Skip to content

Commit 3308d29

Browse files
axshaniilyamerman
andauthored
Add included to create application response (#141)
* - added few fields to create application - added include object to get function - lint-fix * lint-fix Co-authored-by: Ilya Merman <[email protected]>
1 parent 460cee1 commit 3308d29

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

resources/application.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export class Applications extends BaseResource {
2121
return this.httpGet<UnitResponse<Application[]>>("", { params: parameters })
2222
}
2323

24-
public async create(request: CreateApplicationRequest): Promise<UnitResponse<Application>> {
25-
return this.httpPost<UnitResponse<Application>>("", { data: request })
24+
public async create(request: CreateApplicationRequest): Promise<UnitResponse<Application> & Include<ApplicationDocument[]>> {
25+
return this.httpPost<UnitResponse<Application> & Include<ApplicationDocument[]>>("", { data: request })
2626
}
2727

2828
public async upload(request: UploadDocumentRequest) : Promise<UnitResponse<ApplicationDocument>> {

types/application.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Address, BeneficialOwner, BusinessContact, FullName, Officer, Phone, State, Relationship, DeviceFingerprint } from "./common"
1+
import { Address, BeneficialOwner, BusinessContact, FullName, Officer, Phone, State, Relationship, DeviceFingerprint, Agent } from "./common"
22

33
export type ApplicationStatus =
44
"AwaitingDocuments" | //Certain documents are required for the process to continue. You may upload them via Upload Document.
@@ -392,6 +392,16 @@ export interface CreateIndividualApplicationRequest {
392392
* Optional. A list of device fingerprints for fraud and risk prevention [See Device Fingerprints](https://developers.unit.co/applications/#device-fingerprints).
393393
*/
394394
deviceFingerprints?: DeviceFingerprint[]
395+
396+
/**
397+
* Optional. See [this](https://docs.unit.co/customer-api-tokens/#customers-create-customer-bearer-token-jwt) section for more information.
398+
*/
399+
jwtSubject?: string
400+
401+
/**
402+
* Optional. The details of the person that will act as the agent that has power of attorney.
403+
*/
404+
powerOfAttorneyAgent?: Agent
395405
}
396406
}
397407

types/common.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,63 @@ export interface DeviceFingerprint {
358358
value: string
359359
}
360360

361+
/**
362+
* More about [Agent](https://docs.unit.co/types/#agent)
363+
*/
364+
export interface Agent {
365+
/**
366+
* One of Approved, Denied or PendingReview.
367+
*/
368+
status: string
369+
370+
/**
371+
* Agent name.
372+
*/
373+
fullName: FullName
374+
375+
/**
376+
* SSN of the agent (numbers only). One of ssn or passport is required.
377+
*/
378+
ssn?: string
379+
380+
/**
381+
* Passport of the agent. One of ssn or passport is required.
382+
*/
383+
passport?: string
384+
385+
/**
386+
* ISO31661-Alpha2 string Only when Passport is populated. Two letters representing the agent's nationality.
387+
*/
388+
nationality: string
389+
390+
/**
391+
* RFC3339 Date string Date only (e.g. "2001-08-15").
392+
*/
393+
dateOfBirth: string
394+
395+
/**
396+
* Address The agent's address.
397+
*/
398+
address: Address
399+
400+
/**
401+
* Phone number of the agent.
402+
*/
403+
phone: Phone
404+
405+
/**
406+
* Email address of the agent.
407+
*/
408+
email: string
409+
410+
/**
411+
* Optional. See [this](https://docs.unit.co/customer-api-tokens/#customers-create-customer-bearer-token-jwt) section for more information.
412+
*/
413+
jwtSubject?: string
414+
415+
416+
}
417+
361418
export interface UnitResponse<T> {
362419
data: T
363420
}

0 commit comments

Comments
 (0)