11import { createFullName , createAddress , createPhone , createOfficer , createBusinessContact , createBeneficialOwner } from "../helpers"
2- import { CreateBusinessApplicationRequest , CreateDepositAccountRequest , CreateIndividualApplicationRequest , CreateTrustApplicationRequest , Unit } from "../unit"
2+ import { CreateBusinessApplicationRequest , CreateDepositAccountRequest , CreateIndividualApplicationRequest , CreateTrustApplicationRequest , Unit , VerifyDocumentRequest } from "../unit"
33
44export function createIndividualApplication ( unit : Unit ) {
55 const createIndividualApplication : CreateIndividualApplicationRequest = {
66 type : "individualApplication" ,
77 attributes : {
8- ssn : "721074426 " ,
9- fullName : createFullName ( "Richard" , "Hendricks" ) ,
8+ ssn : "123456789 " ,
9+ fullName : createFullName ( "Richard" , "Hendricks" ) ,
1010 dateOfBirth : "2001-08-10" ,
11- address : createAddress ( "20 Ingram St" , null , "Forest Hills" , "CA" , "11375" , "US" ) ,
11+ address : createAddress ( "20 Ingram St" , null , "Forest Hills" , "CA" , "11375" , "US" ) ,
121213- phone : createPhone ( "1" , "5555555555" )
13+ phone : createPhone ( "1" , "5555555555" )
1414 }
1515 }
1616
@@ -22,11 +22,30 @@ export function createIndividualApplicationWithRequiredDocument(unit: Unit) {
2222 type : "individualApplication" ,
2323 attributes : {
2424 ssn : "000000002" ,
25- fullName : createFullName ( "Richard" , "Hendricks" ) ,
25+ fullName : createFullName ( "Richard" , "Hendricks" ) ,
2626 dateOfBirth : "2001-08-10" ,
27- address : createAddress ( "20 Ingram St" , null , "Forest Hills" , "CA" , "11375" , "US" ) ,
27+ address : createAddress ( "20 Ingram St" , null , "Forest Hills" , "CA" , "11375" , "US" ) ,
282829- phone : createPhone ( "1" , "5555555555" )
29+ phone : createPhone ( "1" , "5555555555" )
30+ }
31+ }
32+
33+ return unit . applications . create ( createIndividualApplication )
34+ }
35+
36+ export function createIndividualApplicationWithSelfieVerification ( unit : Unit ) {
37+ const createIndividualApplication : CreateIndividualApplicationRequest = {
38+ type : "individualApplication" ,
39+ attributes : {
40+ ssn : "000000003" ,
41+ fullName : createFullName ( "Richard" , "Hendricks" ) ,
42+ dateOfBirth : "2001-08-10" ,
43+ address : createAddress ( "20 Ingram St" , null , "Forest Hills" , "CA" , "11375" , "US" ) ,
44+ 45+ phone : createPhone ( "1" , "5555555555" ) ,
46+ evaluationParams : {
47+ "useSelfieVerification" : "ReplaceIdentification"
48+ }
3049 }
3150 }
3251
@@ -47,10 +66,10 @@ export function createBusinessApplication(unit: Unit) {
4766 createAddress ( "950 Allerton Street" , null , "Redwood City" , "CA" , "94063" , "US" ) , createPhone ( "1" , "2025550108" ) , "[email protected] " ) , 4867 contact :
createBusinessContact ( createFullName ( "Jone" , "Doe" ) , "[email protected] " , createPhone ( "1" , "2025550108" ) ) , 4968 beneficialOwners : [
50- createBeneficialOwner ( null , createFullName ( "James" , "Smith" ) , "574567625" , null , null , "2012-04-05" ,
51- createAddress ( "650 Allerton Street" , null , "Redwood City" , "CA" , "94063" , "US" ) , createPhone ( "1" , "2025550127" ) , "[email protected] " , null ) , 52- createBeneficialOwner ( null , createFullName ( "Richard" , "Hendricks" ) , "574572795" , null , null , "2012-04-03" ,
53- createAddress ( "470 Allerton Street" , null , "Redwood City" , "CA" , "94063" , "US" ) , createPhone ( "1" , "2025550158" ) , "[email protected] " , null ) 69+ createBeneficialOwner ( null , createFullName ( "James" , "Smith" ) , "574567625" , null , null , "2012-04-05" ,
70+ createAddress ( "650 Allerton Street" , null , "Redwood City" , "CA" , "94063" , "US" ) , createPhone ( "1" , "2025550127" ) , "[email protected] " , null ) , 71+ createBeneficialOwner ( null , createFullName ( "Richard" , "Hendricks" ) , "574572795" , null , null , "2012-04-03" ,
72+ createAddress ( "470 Allerton Street" , null , "Redwood City" , "CA" , "94063" , "US" ) , createPhone ( "1" , "2025550158" ) , "[email protected] " , null ) 5473 ]
5574 }
5675 }
@@ -62,48 +81,48 @@ export function createTrustApplication(unit: Unit) {
6281 const createTrustApplication : CreateTrustApplicationRequest = {
6382 "type" : "trustApplication" ,
6483 "attributes" : {
65- "name" : "Trust me Inc." ,
66- "stateOfIncorporation" : "CA" ,
67- "revocability" : "Revocable" ,
68- "sourceOfFunds" : "Salary" ,
69- "taxId" : "123456789" ,
70- "trustees" : [
71- {
72- "fullName" : createFullName ( "Richard" , "Hendricks" ) ,
73- "dateOfBirth" : "2000-01-01" ,
74- "ssn" : "000000002" ,
75- 76- "phone" : createPhone ( "1" , "2025550108" ) ,
77- "address" : createAddress ( "5230 Newell Rd" , null , "Palo Alto" , "CA" , "94303" , "US" )
78- }
79- ] ,
80- "contact" : {
81- "fullName" : createFullName ( "Jared" , "Dunn" ) ,
82- 83- "phone" : createPhone ( "1" , "2025550108" ) ,
84- "address" : createAddress ( "5230 Newell Rd" , null , "Palo Alto" , "CA" , "94303" , "US" )
85- } ,
86- "grantor" : {
87- "fullName" : createFullName ( "Jared" , "Dunn" ) ,
88- "dateOfBirth" : "2000-01-01" ,
89- "ssn" : "000000003" ,
90- 91- "phone" : createPhone ( "1" , "2025550108" ) ,
92- "address" : createAddress ( "5230 Newell Rd" , null , "Palo Alto" , "CA" , "94303" , "US" )
93- } ,
94- "tags" : {
95- "test" : "test1"
96- } ,
97- "beneficiaries" : [
98- {
99- "fullName" : createFullName ( "Dinesh" , "Chugtai" ) ,
100- "dateOfBirth" : "2000-01-01"
84+ "name" : "Trust me Inc." ,
85+ "stateOfIncorporation" : "CA" ,
86+ "revocability" : "Revocable" ,
87+ "sourceOfFunds" : "Salary" ,
88+ "taxId" : "123456789" ,
89+ "trustees" : [
90+ {
91+ "fullName" : createFullName ( "Richard" , "Hendricks" ) ,
92+ "dateOfBirth" : "2000-01-01" ,
93+ "ssn" : "000000002" ,
94+ 95+ "phone" : createPhone ( "1" , "2025550108" ) ,
96+ "address" : createAddress ( "5230 Newell Rd" , null , "Palo Alto" , "CA" , "94303" , "US" )
97+ }
98+ ] ,
99+ "contact" : {
100+ "fullName" : createFullName ( "Jared" , "Dunn" ) ,
101+ 102+ "phone" : createPhone ( "1" , "2025550108" ) ,
103+ "address" : createAddress ( "5230 Newell Rd" , null , "Palo Alto" , "CA" , "94303" , "US" )
101104 } ,
102- {
103- "fullName" : createFullName ( "Gilfoyle" , "Unknown" ) ,
104- "dateOfBirth" : "2000-01-01"
105- }
106- ]
105+ "grantor" : {
106+ "fullName" : createFullName ( "Jared" , "Dunn" ) ,
107+ "dateOfBirth" : "2000-01-01" ,
108+ "ssn" : "000000003" ,
109+ 110+ "phone" : createPhone ( "1" , "2025550108" ) ,
111+ "address" : createAddress ( "5230 Newell Rd" , null , "Palo Alto" , "CA" , "94303" , "US" )
112+ } ,
113+ "tags" : {
114+ "test" : "test1"
115+ } ,
116+ "beneficiaries" : [
117+ {
118+ "fullName" : createFullName ( "Dinesh" , "Chugtai" ) ,
119+ "dateOfBirth" : "2000-01-01"
120+ } ,
121+ {
122+ "fullName" : createFullName ( "Gilfoyle" , "Unknown" ) ,
123+ "dateOfBirth" : "2000-01-01"
124+ }
125+ ]
107126 }
108127 }
109128
@@ -150,4 +169,8 @@ export async function createIndividualAccount(unit: Unit) {
150169export async function createBussinessAccount ( unit : Unit ) {
151170 const customerId = await createBusinessCustomer ( unit )
152171 return createAccount ( customerId ? customerId : "" , unit )
172+ }
173+
174+ export function createVerifyDocumentRequest ( applicationId : string , documentId : string , jobId : string ) : VerifyDocumentRequest {
175+ return { applicationId, documentId, data : { type : "selfieVerification" , attributes : { jobId } } }
153176}
0 commit comments