@@ -81,6 +81,129 @@ describe("Create Application", () => {
8181 const res = await unit . applications . get ( createRes . data . id )
8282 expect ( res . data . type ) . toBe ( "businessApplication" )
8383 } )
84+
85+ test ( "Create Business Application with requestedProducts" , async ( ) => {
86+ const req : CreateBusinessApplicationRequest = {
87+ "type" : "businessApplication" ,
88+ "attributes" : {
89+ "name" : "Pied Piper" ,
90+ "address" : {
91+ "street" : "5230 Newell Rd" ,
92+ "city" : "Palo Alto" ,
93+ "state" : "CA" ,
94+ "postalCode" : "94303" ,
95+ "country" : "US"
96+ } ,
97+ "phone" : {
98+ "countryCode" : "1" ,
99+ "number" : "5555555555"
100+ } ,
101+ "stateOfIncorporation" : "DE" ,
102+ "ein" : "123456789" ,
103+ "entityType" : "Corporation" ,
104+ "contact" : {
105+ "fullName" : {
106+ "first" : "Richard" ,
107+ "last" : "Hendricks"
108+ } ,
109+ 110+ "phone" : {
111+ "countryCode" : "1" ,
112+ "number" : "5555555555"
113+ }
114+ } ,
115+ "officer" : {
116+ "fullName" : {
117+ "first" : "Richard" ,
118+ "last" : "Hendricks"
119+ } ,
120+ "dateOfBirth" : "2001-08-10" ,
121+ "title" : "CEO" ,
122+ "ssn" : "721074426" ,
123+ 124+ "phone" : {
125+ "countryCode" : "1" ,
126+ "number" : "5555555555"
127+ } ,
128+ "address" : {
129+ "street" : "5230 Newell Rd" ,
130+ "city" : "Palo Alto" ,
131+ "state" : "CA" ,
132+ "postalCode" : "94303" ,
133+ "country" : "US"
134+ }
135+ } ,
136+ "beneficialOwners" : [
137+ {
138+ "fullName" : {
139+ "first" : "Richard" ,
140+ "last" : "Hendricks"
141+ } ,
142+ "dateOfBirth" : "2001-08-10" ,
143+ "ssn" : "123456789" ,
144+ 145+ "percentage" : 75 ,
146+ "phone" : {
147+ "countryCode" : "1" ,
148+ "number" : "5555555555"
149+ } ,
150+ "address" : {
151+ "street" : "5230 Newell Rd" ,
152+ "city" : "Palo Alto" ,
153+ "state" : "CA" ,
154+ "postalCode" : "94303" ,
155+ "country" : "US"
156+ }
157+ }
158+ ] ,
159+ "requestedProducts" : [ "Banking" , "BillPay" ]
160+ }
161+ }
162+
163+ const res = await unit . applications . create ( req )
164+ expect ( res . data . type ) . toBe ( "businessApplication" )
165+ } )
166+
167+ test ( "Create Sole Proprietor Application with requestedProducts" , async ( ) => {
168+ const req : CreateSoleProprietorApplicationRequest = {
169+ "type" : "individualApplication" ,
170+ "attributes" : {
171+ "ssn" : "721074426" ,
172+ "fullName" : {
173+ "first" : "Peter" ,
174+ "last" : "Parker"
175+ } ,
176+ "dateOfBirth" : "2001-08-10" ,
177+ "address" : {
178+ "street" : "20 Ingram St" ,
179+ "city" : "Forest Hills" ,
180+ "state" : "NY" ,
181+ "postalCode" : "11375" ,
182+ "country" : "US"
183+ } ,
184+ 185+ "phone" : {
186+ "countryCode" : "1" ,
187+ "number" : "5555555555"
188+ } ,
189+ "ip" : "127.0.0.2" ,
190+ "occupation" : "ArchitectOrEngineer" ,
191+ "annualIncome" : "Between50kAnd100k" ,
192+ "sourceOfIncome" : "EmploymentOrPayrollIncome" ,
193+ "annualRevenue" : "Between100kAnd200k" ,
194+ "soleProprietorship" : true ,
195+ "ein" : "123456789" ,
196+ "dba" : "Piedpiper Inc" ,
197+ "numberOfEmployees" : "Between5And10" ,
198+ "businessVertical" : "TechnologyMediaOrTelecom" ,
199+ "website" : "https://www.piedpiper.com" ,
200+ "requestedProducts" : [ "Banking" , "Capital" ]
201+ }
202+ }
203+
204+ const res = await unit . applications . create ( req )
205+ expect ( res . data . type ) . toBe ( "individualApplication" )
206+ } )
84207} )
85208
86209describe ( "Applications" , ( ) => {
@@ -533,6 +656,121 @@ describe("Business Applications", () => {
533656 expect ( req . type ) . toBe ( "businessApplication" )
534657 } )
535658
659+ test ( "Simulation CreateBusinessApplicationRequest with requestedProducts - test structure" , ( ) => {
660+ const req : CreateBusinessApplicationRequest = {
661+ "type" : "businessApplication" ,
662+ "attributes" : {
663+ "name" : "Pied Piper" ,
664+ "address" : {
665+ "street" : "5230 Newell Rd" ,
666+ "city" : "Palo Alto" ,
667+ "state" : "CA" ,
668+ "postalCode" : "94303" ,
669+ "country" : "US"
670+ } ,
671+ "phone" : {
672+ "countryCode" : "1" ,
673+ "number" : "5555555555"
674+ } ,
675+ "stateOfIncorporation" : "DE" ,
676+ "ein" : "123456789" ,
677+ "entityType" : "Corporation" ,
678+ "contact" : {
679+ "fullName" : {
680+ "first" : "Richard" ,
681+ "last" : "Hendricks"
682+ } ,
683+ 684+ "phone" : {
685+ "countryCode" : "1" ,
686+ "number" : "5555555555"
687+ }
688+ } ,
689+ "officer" : {
690+ "fullName" : {
691+ "first" : "Richard" ,
692+ "last" : "Hendricks"
693+ } ,
694+ "dateOfBirth" : "2001-08-10" ,
695+ "title" : "CEO" ,
696+ "ssn" : "721074426" ,
697+ 698+ "phone" : {
699+ "countryCode" : "1" ,
700+ "number" : "5555555555"
701+ } ,
702+ "address" : {
703+ "street" : "5230 Newell Rd" ,
704+ "city" : "Palo Alto" ,
705+ "state" : "CA" ,
706+ "postalCode" : "94303" ,
707+ "country" : "US"
708+ }
709+ } ,
710+ "beneficialOwners" : [
711+ {
712+ "fullName" : {
713+ "first" : "Richard" ,
714+ "last" : "Hendricks"
715+ } ,
716+ "dateOfBirth" : "2001-08-10" ,
717+ "ssn" : "123456789" ,
718+ 719+ "percentage" : 75 ,
720+ "phone" : {
721+ "countryCode" : "1" ,
722+ "number" : "5555555555"
723+ } ,
724+ "address" : {
725+ "street" : "5230 Newell Rd" ,
726+ "city" : "Palo Alto" ,
727+ "state" : "CA" ,
728+ "postalCode" : "94303" ,
729+ "country" : "US"
730+ }
731+ }
732+ ] ,
733+ "requestedProducts" : [ "Banking" , "BillPay" , "Capital" ]
734+ }
735+ }
736+
737+ expect ( req . type ) . toBe ( "businessApplication" )
738+ expect ( req . attributes . requestedProducts ) . toEqual ( [ "Banking" , "BillPay" , "Capital" ] )
739+ } )
740+
741+ test ( "Simulation CreateSoleProprietorApplicationRequest with requestedProducts - test structure" , ( ) => {
742+ const req : CreateSoleProprietorApplicationRequest = {
743+ "type" : "individualApplication" ,
744+ "attributes" : {
745+ "ssn" : "721074426" ,
746+ "fullName" : {
747+ "first" : "Peter" ,
748+ "last" : "Parker"
749+ } ,
750+ "dateOfBirth" : "2001-08-10" ,
751+ "address" : {
752+ "street" : "20 Ingram St" ,
753+ "city" : "Forest Hills" ,
754+ "state" : "NY" ,
755+ "postalCode" : "11375" ,
756+ "country" : "US"
757+ } ,
758+ 759+ "phone" : {
760+ "countryCode" : "1" ,
761+ "number" : "5555555555"
762+ } ,
763+ "soleProprietorship" : true ,
764+ "ein" : "123456789" ,
765+ "dba" : "Piedpiper Inc" ,
766+ "requestedProducts" : [ "Banking" ]
767+ }
768+ }
769+
770+ expect ( req . type ) . toBe ( "individualApplication" )
771+ expect ( req . attributes . requestedProducts ) . toEqual ( [ "Banking" ] )
772+ } )
773+
536774 test ( "Simulation UpdateBusinessApplicationRequest - test structure" , async ( ) => {
537775 const res = await createBusinessApplication ( unit )
538776
0 commit comments