import { CuringData, CuringFormState, ReasonableExplanationType } from './types'; /** * Curing-specific shape builder for `POST /account-owner-documents`. * Two-stage by design: * * `buildClientCuringSubmission` — builds the **camelCase canonical** shape * (`ClientCuringSubmission`) that's exposed to host callbacks (the * demo-mode `onSubmit`, plus production `onSuccess` / `onSettled`). * `buildCuringRequestData` — wraps the canonical builder + `snakeCaseKeys` * to produce the **snake_case wire body** that goes into the multipart * `data` part (matches the public-api `createAccountOwnerDocumentDtoSchema`). * * Mirrors the questionnaire's `transformForSignedClient` → `snakeCaseKeys` * split: hosts see a friendly, documented camelCase shape; the wire format * stays an implementation detail of the POST. * * Owns: * - signature pair "both or neither" rule * - SPT vs Closer-Connection branch selection * - NaN guard on day-count parses */ export type BuildCuringRequestDataInput = { state: CuringFormState; derived: { sptWeightedTotal: number; }; serverData: CuringData; }; /** * camelCase canonical shape of `reasonable_explanation_data`. Public — this * is what surfaces on host callbacks. */ export type ClientReasonableExplanationData = { explanationType: ReasonableExplanationType; signatureName?: string; signatureDate?: string; daysInCurrentYear?: number; daysInFirstPrecedingYear?: number; daysInSecondPrecedingYear?: number; weightedTotal?: number; usPresentDaysCertified?: boolean; closerConnectionCountryCode?: string; closerConnectionReason?: string; }; /** * camelCase canonical shape of the curing submission. The single public * type for host callbacks (demo `onSubmit`, production `onSuccess` / * `onSettled`). `snakeCaseKeys` converts this to the wire body just before * the POST. */ export type ClientCuringSubmission = { fileName?: string; fileMimeType?: string; reasonableExplanationData?: ClientReasonableExplanationData; }; /** * Build the camelCase canonical curing submission. Public — exposed to host * callbacks (demo `onSubmit`, production `onSuccess` / `onSettled`). */ export declare const buildClientCuringSubmission: (inputs: BuildCuringRequestDataInput) => ClientCuringSubmission; /** * Internal snake_case wire shape of the multipart `data` part. Internal — * only the POST helper sees this; hosts see `ClientCuringSubmission` on * callbacks instead. */ export type AccountOwnerDocumentData = { file_name?: string; file_mime_type?: string; reasonable_explanation_data?: { explanation_type: ReasonableExplanationType; signature_name?: string; signature_date?: string; days_in_current_year?: number; days_in_first_preceding_year?: number; days_in_second_preceding_year?: number; weighted_total?: number; us_present_days_certified?: boolean; closer_connection_country_code?: string; closer_connection_reason?: string; }; }; /** * Build the snake_case wire body for the multipart `data` part. Thin * wrapper around `buildClientCuringSubmission` + `snakeCaseKeys`; preserves * the same wire output the BE schema expects. */ export declare const buildCuringRequestData: (inputs: BuildCuringRequestDataInput) => AccountOwnerDocumentData;