export type SUBMISSIONCreateHmdaResponseItemInput = {questionId: string, value: string, collectionMethod: 'SELF' | 'VISUAL_OBSERVATION_OR_SURNAME' | 'ORIGINATOR_INPUT' | 'AUTOFILLED'}; export type SUBMISSIONCreateHmdaApplicantResponsesInput = {applicantRole: 'APPLICANT' | 'COAPPLICANT', responses: Array}; export type SUBMISSIONCreateHmdaResponsesInput = {payload: Array, token: string}; export type PatchApiPosfinancingRestV2ApplicationsApplicationIdHomeMortgageDisclosuresArgs = {applicationId: string, body: SUBMISSIONCreateHmdaResponsesInput}; export type PatchApiPosfinancingRestV2ApplicationsApplicationIdHomeMortgageDisclosuresOptions = {baseUrl?: string | undefined, jwt?: string | undefined, fetch?: typeof fetch | undefined}; /** * Creates home mortgage disclosure responses for an application. * * PATCH /posfinancing/rest/v2/applications/{applicationId}/home-mortgage-disclosures */ export const patchApiPosfinancingRestV2ApplicationsApplicationIdHomeMortgageDisclosures = async (args: PatchApiPosfinancingRestV2ApplicationsApplicationIdHomeMortgageDisclosuresArgs, options?: PatchApiPosfinancingRestV2ApplicationsApplicationIdHomeMortgageDisclosuresOptions) => { 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))}/home-mortgage-disclosures${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 };