From 7ef40e2236ebe67d24a03c9836342a8a26dfc32b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 14:01:43 +0000 Subject: [PATCH 1/8] Initial plan From 00bfaf1759d6337257ee3fe80e39c06cbe3860ad Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 14:08:39 +0000 Subject: [PATCH 2/8] Add requestedProducts support to business and sole proprietor applications Co-authored-by: GermanSmoliar <97832762+GermanSmoliar@users.noreply.github.com> --- tests/applications.spec.ts | 238 +++++++++++++++++++++++++++++++++++++ types/application.ts | 12 ++ 2 files changed, 250 insertions(+) diff --git a/tests/applications.spec.ts b/tests/applications.spec.ts index cebdc439..5bf285a9 100644 --- a/tests/applications.spec.ts +++ b/tests/applications.spec.ts @@ -81,6 +81,129 @@ describe("Create Application", () => { const res = await unit.applications.get(createRes.data.id) expect(res.data.type).toBe("businessApplication") }) + + test("Create Business Application with requestedProducts", async () => { + const req: CreateBusinessApplicationRequest = { + "type": "businessApplication", + "attributes": { + "name": "Pied Piper", + "address": { + "street": "5230 Newell Rd", + "city": "Palo Alto", + "state": "CA", + "postalCode": "94303", + "country": "US" + }, + "phone": { + "countryCode": "1", + "number": "5555555555" + }, + "stateOfIncorporation": "DE", + "ein": "123456789", + "entityType": "Corporation", + "contact": { + "fullName": { + "first": "Richard", + "last": "Hendricks" + }, + "email": "richard@piedpiper.com", + "phone": { + "countryCode": "1", + "number": "5555555555" + } + }, + "officer": { + "fullName": { + "first": "Richard", + "last": "Hendricks" + }, + "dateOfBirth": "2001-08-10", + "title": "CEO", + "ssn": "721074426", + "email": "richard@piedpiper.com", + "phone": { + "countryCode": "1", + "number": "5555555555" + }, + "address": { + "street": "5230 Newell Rd", + "city": "Palo Alto", + "state": "CA", + "postalCode": "94303", + "country": "US" + } + }, + "beneficialOwners": [ + { + "fullName": { + "first": "Richard", + "last": "Hendricks" + }, + "dateOfBirth": "2001-08-10", + "ssn": "123456789", + "email": "richard@piedpiper.com", + "percentage": 75, + "phone": { + "countryCode": "1", + "number": "5555555555" + }, + "address": { + "street": "5230 Newell Rd", + "city": "Palo Alto", + "state": "CA", + "postalCode": "94303", + "country": "US" + } + } + ], + "requestedProducts": ["Banking", "BillPay"] + } + } + + const res = await unit.applications.create(req) + expect(res.data.type).toBe("businessApplication") + }) + + test("Create Sole Proprietor Application with requestedProducts", async () => { + const req: CreateSoleProprietorApplicationRequest = { + "type": "individualApplication", + "attributes": { + "ssn": "721074426", + "fullName": { + "first": "Peter", + "last": "Parker" + }, + "dateOfBirth": "2001-08-10", + "address": { + "street": "20 Ingram St", + "city": "Forest Hills", + "state": "NY", + "postalCode": "11375", + "country": "US" + }, + "email": "peter@oscorp.com", + "phone": { + "countryCode": "1", + "number": "5555555555" + }, + "ip": "127.0.0.2", + "occupation": "ArchitectOrEngineer", + "annualIncome": "Between50kAnd100k", + "sourceOfIncome": "EmploymentOrPayrollIncome", + "annualRevenue": "Between100kAnd200k", + "soleProprietorship": true, + "ein": "123456789", + "dba": "Piedpiper Inc", + "numberOfEmployees": "Between5And10", + "businessVertical": "TechnologyMediaOrTelecom", + "website": "https://www.piedpiper.com", + "requestedProducts": ["Banking", "Capital"] + } + } + + const res = await unit.applications.create(req) + expect(res.data.type).toBe("individualApplication") + }) }) describe("Applications", () => { @@ -533,6 +656,121 @@ describe("Business Applications", () => { expect(req.type).toBe("businessApplication") }) + test("Simulation CreateBusinessApplicationRequest with requestedProducts - test structure", () => { + const req: CreateBusinessApplicationRequest = { + "type": "businessApplication", + "attributes": { + "name": "Pied Piper", + "address": { + "street": "5230 Newell Rd", + "city": "Palo Alto", + "state": "CA", + "postalCode": "94303", + "country": "US" + }, + "phone": { + "countryCode": "1", + "number": "5555555555" + }, + "stateOfIncorporation": "DE", + "ein": "123456789", + "entityType": "Corporation", + "contact": { + "fullName": { + "first": "Richard", + "last": "Hendricks" + }, + "email": "richard@piedpiper.com", + "phone": { + "countryCode": "1", + "number": "5555555555" + } + }, + "officer": { + "fullName": { + "first": "Richard", + "last": "Hendricks" + }, + "dateOfBirth": "2001-08-10", + "title": "CEO", + "ssn": "721074426", + "email": "richard@piedpiper.com", + "phone": { + "countryCode": "1", + "number": "5555555555" + }, + "address": { + "street": "5230 Newell Rd", + "city": "Palo Alto", + "state": "CA", + "postalCode": "94303", + "country": "US" + } + }, + "beneficialOwners": [ + { + "fullName": { + "first": "Richard", + "last": "Hendricks" + }, + "dateOfBirth": "2001-08-10", + "ssn": "123456789", + "email": "richard@piedpiper.com", + "percentage": 75, + "phone": { + "countryCode": "1", + "number": "5555555555" + }, + "address": { + "street": "5230 Newell Rd", + "city": "Palo Alto", + "state": "CA", + "postalCode": "94303", + "country": "US" + } + } + ], + "requestedProducts": ["Banking", "BillPay", "Capital"] + } + } + + expect(req.type).toBe("businessApplication") + expect(req.attributes.requestedProducts).toEqual(["Banking", "BillPay", "Capital"]) + }) + + test("Simulation CreateSoleProprietorApplicationRequest with requestedProducts - test structure", () => { + const req: CreateSoleProprietorApplicationRequest = { + "type": "individualApplication", + "attributes": { + "ssn": "721074426", + "fullName": { + "first": "Peter", + "last": "Parker" + }, + "dateOfBirth": "2001-08-10", + "address": { + "street": "20 Ingram St", + "city": "Forest Hills", + "state": "NY", + "postalCode": "11375", + "country": "US" + }, + "email": "peter@oscorp.com", + "phone": { + "countryCode": "1", + "number": "5555555555" + }, + "soleProprietorship": true, + "ein": "123456789", + "dba": "Piedpiper Inc", + "requestedProducts": ["Banking"] + } + } + + expect(req.type).toBe("individualApplication") + expect(req.attributes.requestedProducts).toEqual(["Banking"]) + }) + test("Simulation UpdateBusinessApplicationRequest - test structure", async () => { const res = await createBusinessApplication(unit) diff --git a/types/application.ts b/types/application.ts index 8a90ed8b..4f17c917 100644 --- a/types/application.ts +++ b/types/application.ts @@ -16,6 +16,8 @@ export type Application = IndividualApplication | BusinessApplication export type ApplicationType = "businessApplication" | "individualApplication" +export type Product = "Banking" | "BillPay" | "Capital" + export type Occupation = "ArchitectOrEngineer" | "BusinessAnalystAccountantOrFinancialAdvisor" | @@ -202,6 +204,11 @@ export interface BaseApplicationAttributes extends UnimplementedFields { * See [Tags](https://developers.unit.co/#tags). */ tags?: object + + /** + * Optional. The product being applied for. One of Banking, BillPay, or Capital. + */ + requestedProducts?: Product[] } export interface BaseApplicationRelationships extends UnimplementedRelationships { @@ -553,6 +560,11 @@ interface BaseCreateApplicationRequestAttributes { * Optional. A list of device fingerprints for fraud and risk prevention [See Device Fingerprints](https://developers.unit.co/applications/#device-fingerprints). */ deviceFingerprints?: DeviceFingerprint[] + + /** + * Optional. The product being applied for. One of Banking, BillPay, or Capital. + */ + requestedProducts?: Product[] } From 4e529697c57bdd3013574aeccec2d9fd99121a34 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 14:15:36 +0000 Subject: [PATCH 3/8] Fix documentation to use plural form for requestedProducts Co-authored-by: GermanSmoliar <97832762+GermanSmoliar@users.noreply.github.com> --- types/application.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/application.ts b/types/application.ts index 4f17c917..263cd3fa 100644 --- a/types/application.ts +++ b/types/application.ts @@ -206,7 +206,7 @@ export interface BaseApplicationAttributes extends UnimplementedFields { tags?: object /** - * Optional. The product being applied for. One of Banking, BillPay, or Capital. + * Optional. The products being applied for. One or more of Banking, BillPay, or Capital. */ requestedProducts?: Product[] } @@ -562,7 +562,7 @@ interface BaseCreateApplicationRequestAttributes { deviceFingerprints?: DeviceFingerprint[] /** - * Optional. The product being applied for. One of Banking, BillPay, or Capital. + * Optional. The products being applied for. One or more of Banking, BillPay, or Capital. */ requestedProducts?: Product[] } From 9f09da0e60592548c75bf69db2b0bd8b3c05c10d Mon Sep 17 00:00:00 2001 From: YegorZh Date: Thu, 11 Dec 2025 16:08:18 +0000 Subject: [PATCH 4/8] feat: application form v2 requested products and related tests --- tests/applicationForms.spec.ts | 229 +++++++++++++++++++++++++++++++++ types/applicationForm.ts | 11 ++ 2 files changed, 240 insertions(+) diff --git a/tests/applicationForms.spec.ts b/tests/applicationForms.spec.ts index 0b7b13e4..0b998a52 100644 --- a/tests/applicationForms.spec.ts +++ b/tests/applicationForms.spec.ts @@ -150,4 +150,233 @@ describe("ApplicationForms", () => { expect(applicationFormPrefill.applicationType).toBe("Business") }) + + test("Create Application Form V2 for Business with requestedProducts", async () => { + const req: CreateApplicationFormV2 = { + type: "applicationForm", + attributes: { + idempotencyKey: Math.random().toString(36).substring(7), + applicantDetails: { + applicationType: "Business", + name: "Pied Piper", + stateOfIncorporation: "DE", + entityType: "Corporation", + contact: { + fullName: { + first: "Richard", + last: "Hendricks" + }, + email: "richard@piedpiper.com", + phone: { + countryCode: "1", + number: "5555555555" + } + }, + officer: { + fullName: { + first: "Richard", + last: "Hendricks" + }, + dateOfBirth: "2001-08-10", + title: "CEO", + ssn: "721074426", + email: "richard@piedpiper.com", + phone: { + countryCode: "1", + number: "5555555555" + }, + address: { + street: "5230 Newell Rd", + city: "Palo Alto", + state: "CA", + postalCode: "94303", + country: "US" + } + }, + beneficialOwners: [ + { + fullName: { + first: "Richard", + last: "Hendricks" + }, + dateOfBirth: "2001-08-10", + ssn: "123456789", + email: "richard@piedpiper.com", + percentage: 75, + phone: { + countryCode: "1", + number: "5555555555" + }, + address: { + street: "5230 Newell Rd", + city: "Palo Alto", + state: "CA", + postalCode: "94303", + country: "US" + } + } + ] + }, + requestedProducts: ["Banking", "BillPay"] + }, + relationships: {} + } + const res = await unitWithVersion.applicationForms.create(req) + expect(res.data.type).toBe("applicationFormV2") + }) + + test("Create Application Form V2 for Sole Proprietor with requestedProducts", async () => { + const req: CreateApplicationFormV2 = { + type: "applicationForm", + attributes: { + idempotencyKey: Math.random().toString(36).substring(7), + applicantDetails: { + applicationType: "SoleProprietorship", + fullName: { + first: "Peter", + last: "Parker" + }, + ssn: "721074426", + dateOfBirth: "2001-08-10", + address: { + street: "20 Ingram St", + city: "Forest Hills", + state: "NY", + postalCode: "11375", + country: "US" + }, + email: "peter@oscorp.com", + phone: { + countryCode: "1", + number: "5555555555" + }, + occupation: "ArchitectOrEngineer", + annualIncome: "Between50kAnd100k", + sourceOfIncome: "EmploymentOrPayrollIncome", + annualRevenue: "Between100kAnd200k", + ein: "123456789", + dba: "Piedpiper Inc", + numberOfEmployees: "Between5And10", + businessVertical: "TechnologyMediaOrTelecom", + website: "https://www.piedpiper.com" + }, + requestedProducts: ["Banking", "Capital"] + }, + relationships: {} + } + const res = await unitWithVersion.applicationForms.create(req) + expect(res.data.type).toBe("applicationFormV2") + }) + + test("Simulation CreateApplicationFormV2 for Business with requestedProducts - test structure", () => { + const req: CreateApplicationFormV2 = { + type: "applicationForm", + attributes: { + idempotencyKey: "3a1a33be-4e12-4603-9ed0-820922389fb8", + applicantDetails: { + applicationType: "Business", + name: "Pied Piper", + stateOfIncorporation: "DE", + entityType: "Corporation", + contact: { + fullName: { + first: "Richard", + last: "Hendricks" + }, + email: "richard@piedpiper.com", + phone: { + countryCode: "1", + number: "5555555555" + } + }, + officer: { + fullName: { + first: "Richard", + last: "Hendricks" + }, + dateOfBirth: "2001-08-10", + title: "CEO", + ssn: "721074426", + email: "richard@piedpiper.com", + phone: { + countryCode: "1", + number: "5555555555" + }, + address: { + street: "5230 Newell Rd", + city: "Palo Alto", + state: "CA", + postalCode: "94303", + country: "US" + } + }, + beneficialOwners: [ + { + fullName: { + first: "Richard", + last: "Hendricks" + }, + dateOfBirth: "2001-08-10", + ssn: "123456789", + email: "richard@piedpiper.com", + percentage: 75, + phone: { + countryCode: "1", + number: "5555555555" + }, + address: { + street: "5230 Newell Rd", + city: "Palo Alto", + state: "CA", + postalCode: "94303", + country: "US" + } + } + ] + }, + requestedProducts: ["Banking", "BillPay", "Capital"] + }, + relationships: {} + } + + expect(req.type).toBe("applicationForm") + expect(req.attributes.requestedProducts).toEqual(["Banking", "BillPay", "Capital"]) + }) + + test("Simulation CreateApplicationFormV2 for Sole Proprietor with requestedProducts - test structure", () => { + const req: CreateApplicationFormV2 = { + type: "applicationForm", + attributes: { + idempotencyKey: "3a1a33be-4e12-4603-9ed0-820922389fb8", + applicantDetails: { + applicationType: "SoleProprietorship", + fullName: { + first: "Peter", + last: "Parker" + }, + ssn: "721074426", + dateOfBirth: "2001-08-10", + address: { + street: "20 Ingram St", + city: "Forest Hills", + state: "NY", + postalCode: "11375", + country: "US" + }, + email: "peter@oscorp.com", + phone: { + countryCode: "1", + number: "5555555555" + }, + ein: "123456789", + dba: "Piedpiper Inc" + }, + requestedProducts: ["Banking"] + }, + relationships: {} + } + + expect(req.type).toBe("applicationForm") + expect(req.attributes.requestedProducts).toEqual(["Banking"]) + }) }) \ No newline at end of file diff --git a/types/applicationForm.ts b/types/applicationForm.ts index 7a6e23c9..e3709e7f 100644 --- a/types/applicationForm.ts +++ b/types/applicationForm.ts @@ -6,6 +6,7 @@ import { CashFlow, NumberOfEmployees, Occupation, + Product, SourceOfIncome } from "./application" import {Address, BusinessContact, EntityType, FullName, Officer, Phone, Relationship, Tags} from "./common" @@ -89,6 +90,11 @@ export interface CreateApplicationFormV2 { */ jwtSubject?: string + + /** + * Optional. The products being applied for. One or more of Banking, BillPay, or Capital. + */ + requestedProducts?: Product[] } relationships?: { /** @@ -160,6 +166,11 @@ export type ApplicationFormV2 = { applicationFormSettings: ApplicationFormSettingsOverride + /** + * Optional. The products being applied for. One or more of Banking, BillPay, or Capital. + */ + requestedProducts?: Product[] + } links: { From c20d5cce99f76172e65a50a11fbe80a804e0eefa Mon Sep 17 00:00:00 2001 From: YegorZh Date: Thu, 11 Dec 2025 16:08:43 +0000 Subject: [PATCH 5/8] version bump to 1.3.10 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9c7e2625..d1cc0dc9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@unit-finance/unit-node-sdk", - "version": "1.3.9", + "version": "1.3.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@unit-finance/unit-node-sdk", - "version": "1.3.9", + "version": "1.3.10", "license": "MPLv2", "dependencies": { "axios": "^1.8.4" diff --git a/package.json b/package.json index 56048ed0..03de74f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@unit-finance/unit-node-sdk", - "version": "1.3.9", + "version": "1.3.10", "description": "", "main": "dist/unit.js", "types": "dist/unit.d.ts", From d64c1a23f4c7330501a61983d120797ee0d98b66 Mon Sep 17 00:00:00 2001 From: YegorZh Date: Thu, 11 Dec 2025 16:32:05 +0000 Subject: [PATCH 6/8] fix: test cleanup --- tests/applicationForms.spec.ts | 2 +- tests/applications.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/applicationForms.spec.ts b/tests/applicationForms.spec.ts index 0b998a52..f7ff0a10 100644 --- a/tests/applicationForms.spec.ts +++ b/tests/applicationForms.spec.ts @@ -260,7 +260,7 @@ describe("ApplicationForms", () => { businessVertical: "TechnologyMediaOrTelecom", website: "https://www.piedpiper.com" }, - requestedProducts: ["Banking", "Capital"] + requestedProducts: ["Capital"] }, relationships: {} } diff --git a/tests/applications.spec.ts b/tests/applications.spec.ts index 5bf285a9..a5d2477b 100644 --- a/tests/applications.spec.ts +++ b/tests/applications.spec.ts @@ -197,7 +197,7 @@ describe("Create Application", () => { "numberOfEmployees": "Between5And10", "businessVertical": "TechnologyMediaOrTelecom", "website": "https://www.piedpiper.com", - "requestedProducts": ["Banking", "Capital"] + "requestedProducts": ["Capital"] } } From 71da08fc896bd2dc1154747146c101b8380d6329 Mon Sep 17 00:00:00 2001 From: YegorZh Date: Thu, 11 Dec 2025 17:37:20 +0000 Subject: [PATCH 7/8] fix: removed usage of capital product in applications --- tests/applicationForms.spec.ts | 26 +++++++++++++++++++++++++- tests/applications.spec.ts | 4 ++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/tests/applicationForms.spec.ts b/tests/applicationForms.spec.ts index f7ff0a10..a06fee29 100644 --- a/tests/applicationForms.spec.ts +++ b/tests/applicationForms.spec.ts @@ -159,7 +159,19 @@ describe("ApplicationForms", () => { applicantDetails: { applicationType: "Business", name: "Pied Piper", + address: { + street: "5230 Newell Rd", + city: "Palo Alto", + state: "CA", + postalCode: "94303", + country: "US" + }, + phone: { + countryCode: "1", + number: "5555555555" + }, stateOfIncorporation: "DE", + ein: "123456789", entityType: "Corporation", contact: { fullName: { @@ -260,7 +272,7 @@ describe("ApplicationForms", () => { businessVertical: "TechnologyMediaOrTelecom", website: "https://www.piedpiper.com" }, - requestedProducts: ["Capital"] + requestedProducts: ["BillPay"] }, relationships: {} } @@ -276,7 +288,19 @@ describe("ApplicationForms", () => { applicantDetails: { applicationType: "Business", name: "Pied Piper", + address: { + street: "5230 Newell Rd", + city: "Palo Alto", + state: "CA", + postalCode: "94303", + country: "US" + }, + phone: { + countryCode: "1", + number: "5555555555" + }, stateOfIncorporation: "DE", + ein: "123456789", entityType: "Corporation", contact: { fullName: { diff --git a/tests/applications.spec.ts b/tests/applications.spec.ts index a5d2477b..bacac0a9 100644 --- a/tests/applications.spec.ts +++ b/tests/applications.spec.ts @@ -8,7 +8,6 @@ import { CreateSoleProprietorApplicationRequest, IndividualApplication, PatchApplicationRequest, - PatchBusinessApplicationAttributes, PatchBusinessApplicationBeneficialOwner, RelationshipsArrayData, Unit, @@ -156,6 +155,7 @@ describe("Create Application", () => { } } ], + "businessVertical": "TechnologyMediaOrTelecom", "requestedProducts": ["Banking", "BillPay"] } } @@ -197,7 +197,7 @@ describe("Create Application", () => { "numberOfEmployees": "Between5And10", "businessVertical": "TechnologyMediaOrTelecom", "website": "https://www.piedpiper.com", - "requestedProducts": ["Capital"] + "requestedProducts": ["BillPay"] } } From 69c6e4d10005a782b1bb713bbefcfc7493cf5a88 Mon Sep 17 00:00:00 2001 From: YegorZh Date: Thu, 11 Dec 2025 18:01:57 +0000 Subject: [PATCH 8/8] fix: requested field fixes --- tests/applicationForms.spec.ts | 10 +++++++--- tests/applications.spec.ts | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/applicationForms.spec.ts b/tests/applicationForms.spec.ts index a06fee29..23846a53 100644 --- a/tests/applicationForms.spec.ts +++ b/tests/applicationForms.spec.ts @@ -157,7 +157,7 @@ describe("ApplicationForms", () => { attributes: { idempotencyKey: Math.random().toString(36).substring(7), applicantDetails: { - applicationType: "Business", + applicationType: "SingleMemberBusiness", name: "Pied Piper", address: { street: "5230 Newell Rd", @@ -227,7 +227,9 @@ describe("ApplicationForms", () => { country: "US" } } - ] + ], + businessVertical: "TechnologyMediaOrTelecom", + yearOfIncorporation: "2014" }, requestedProducts: ["Banking", "BillPay"] }, @@ -356,7 +358,9 @@ describe("ApplicationForms", () => { country: "US" } } - ] + ], + businessVertical: "TechnologyMediaOrTelecom", + yearOfIncorporation: "2014" }, requestedProducts: ["Banking", "BillPay", "Capital"] }, diff --git a/tests/applications.spec.ts b/tests/applications.spec.ts index bacac0a9..8ee2e3cb 100644 --- a/tests/applications.spec.ts +++ b/tests/applications.spec.ts @@ -156,6 +156,7 @@ describe("Create Application", () => { } ], "businessVertical": "TechnologyMediaOrTelecom", + "yearOfIncorporation": "2014", "requestedProducts": ["Banking", "BillPay"] } }