export type UndefinedNameOnTitleInput = {first: string, last: string}; export type UndefinedPhoneInputDto = {phoneNumber: string, type: 'HOME' | 'MOBILE'}; export type UndefinedMaritalPartnerContactInputDto = {email: string, primaryPhoneNumber: UndefinedPhoneInputDto, secondaryPhoneNumber?: (UndefinedPhoneInputDto | null) | undefined}; export type UndefinedUpdateMaritalPartnerInput = {firstName: string, lastName: string, contact: UndefinedMaritalPartnerContactInputDto, homeOccupancy?: ('PRIMARY' | 'SECONDARY' | 'INVESTMENT' | 'OTHER') | undefined, nameOnTitle?: (UndefinedNameOnTitleInput | null) | undefined}; export type UndefinedPersonalIdentityInputDto = {type: 'SSN', value: string}; export type UndefinedCurrencyMeasurementInputDto = {type: 'USD', value: number}; export type UndefinedAddress = {line1: string, line2?: string | undefined, city: string, state: string, zip: string, country?: string | undefined}; export type UndefinedUpdateApplicantInput = {type: 'APPLICANT' | 'COAPPLICANT', isOnTitle?: boolean | undefined, nameOnTitle?: (UndefinedNameOnTitleInput | null) | undefined, maritalPartner?: UndefinedUpdateMaritalPartnerInput | undefined, firstName?: string | undefined, lastName?: string | undefined, dateOfBirth?: string | undefined, personalIdentity?: UndefinedPersonalIdentityInputDto | undefined, homeOccupancy?: ('PRIMARY' | 'SECONDARY' | 'INVESTMENT' | 'OTHER') | undefined, homeOwnership?: ('NOT_OWNED' | 'OWNED_WITH_MORTGAGE' | 'OWNED_FREE_AND_CLEAR') | undefined, annualIncome?: UndefinedCurrencyMeasurementInputDto | undefined, email?: string | undefined, primaryPhoneNumber?: UndefinedPhoneInputDto | undefined, secondaryPhoneNumber?: (UndefinedPhoneInputDto | null) | undefined, spokenLanguage?: ('ENGLISH' | 'SPANISH') | undefined, employmentStatus?: ('EMPLOYED' | 'RETIRED' | 'NOT_EMPLOYED' | 'OTHER') | undefined, citizenshipStatus?: ('US_CITIZEN' | 'LAWFUL_PERMANENT_RESIDENT_ALIEN' | 'OTHER') | undefined, address?: UndefinedAddress | undefined, maritalStatus?: ('SINGLE' | 'MARRIED' | 'DIVORCED' | 'SEPARATED' | 'WIDOWED') | undefined}; export type PatchApiPosfinancingRestV2ApplicationsApplicationIdApplicantsArgs = {applicationId: unknown, body: Array}; export type PatchApiPosfinancingRestV2ApplicationsApplicationIdApplicantsOptions = {baseUrl?: string | undefined, jwt?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Applicant on Application * * PATCH /posfinancing/rest/v2/applications/{applicationId}/applicants */ export const patchApiPosfinancingRestV2ApplicationsApplicationIdApplicants = async (args: PatchApiPosfinancingRestV2ApplicationsApplicationIdApplicantsArgs, options?: PatchApiPosfinancingRestV2ApplicationsApplicationIdApplicantsOptions) => { const {baseUrl = "https://devint01-api.goodleap.com", fetch: fetchFn = fetch, jwt} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (jwt !== undefined) headers.set('authorization', `Bearer ${jwt}`) const url = `${baseUrl.replace(/\/+$/, '')}/posfinancing/rest/v2/applications/${encodeURIComponent(String(args.applicationId))}/applicants${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };