Skip to content

Commit

Permalink
save director information api call temp
Browse files Browse the repository at this point in the history
  • Loading branch information
burczu committed Dec 6, 2024
1 parent a1f0be5 commit 8c0dff5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
type SaveCorpayOnboardingDirectorInformation = {
import type {FileObject} from '@components/AttachmentModal';

// secondSignerFullName?: string;
// secondSignerDateOfBirth?: string;
// secondSignerJobTitle?: string;
// secondSignerEmail?: string;
// secondSignerCompleteResidentialAddress?: string;

type SaveCorpayOnboardingCompanyDirector = {
signerFullName: string;
signerDateOfBirth: string;
signerJobTitle: string;
signerEmail: string;
signerCompleteResidentialAddress: string;
secondSignerFullName?: string;
secondSignerDateOfBirth?: string;
secondSignerJobTitle?: string;
secondSignerEmail?: string;
secondSignerCompleteResidentialAddress?: string;
};

type SaveCorpayOnboardingDirectorInformation = {
companyDirectors: SaveCorpayOnboardingCompanyDirector[];
proofOfDirectors?: FileObject | string;
copyOfID?: FileObject | string;
addressProof?: FileObject | string;
codiceProof?: FileObject | string;
pdsAndFSG?: FileObject | string;
};

type SaveCorpayOnboardingDirectorInformationParams = {
inputs: string;
bankAccountID: number;
proofOfDirectors?: File;
copyOfID?: File;
addressProof?: File;
codiceProof?: File;
pdsAndFSG?: File;
proofOfDirectors?: FileObject | string;
copyOfID?: FileObject | string;
addressProof?: FileObject | string;
codiceProof?: FileObject | string;
pdsAndFSG?: FileObject | string;
};

export type {SaveCorpayOnboardingDirectorInformation, SaveCorpayOnboardingDirectorInformationParams};
22 changes: 12 additions & 10 deletions src/pages/ReimbursementAccount/NonUSD/SignerInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ const INPUT_KEYS = {
SECOND_SIGNER_JOB_TITLE: INPUT_IDS.ADDITIONAL_DATA.CORPAY.SECOND_SIGNER_JOB_TITLE,
SECOND_SIGNER_EMAIL: INPUT_IDS.ADDITIONAL_DATA.CORPAY.SECOND_SIGNER_EMAIL,
SECOND_SIGNER_COMPLETE_RESIDENTIAL_ADDRESS: INPUT_IDS.ADDITIONAL_DATA.CORPAY.SECOND_SIGNER_COMPLETE_RESIDENTIAL_ADDRESS,
SIGNER_COPY_OF_ID: INPUT_IDS.ADDITIONAL_DATA.CORPAY.SIGNER_COPY_OF_ID,
};

function SignerInfo({onBackButtonPress, onSubmit}: SignerInfoProps) {
const {translate} = useLocalize();

const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT);
const [reimbursementAccountDraft] = useOnyx(ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT);
const [account] = useOnyx(ONYXKEYS.ACCOUNT);
const policyID = reimbursementAccount?.achData?.policyID ?? '-1';
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);
const currency = policy?.outputCurrency ?? '';
Expand Down Expand Up @@ -85,16 +87,16 @@ function SignerInfo({onBackButtonPress, onSubmit}: SignerInfoProps) {
} else {
BankAccounts.saveCorpayOnboardingDirectorInformation(
{
signerFullName: onyxValues[INPUT_KEYS.SIGNER_FULL_NAME],
signerDateOfBirth: onyxValues[INPUT_KEYS.SIGNER_DATE_OF_BIRTH],
signerJobTitle: onyxValues[INPUT_KEYS.SIGNER_JOB_TITLE],
signerEmail: onyxValues[INPUT_KEYS.SIGNER_EMAIL],
signerCompleteResidentialAddress: onyxValues[INPUT_KEYS.SIGNER_COMPLETE_RESIDENTIAL_ADDRESS],
secondSignerFullName: onyxValues[INPUT_KEYS.SECOND_SIGNER_FULL_NAME],
secondSignerDateOfBirth: onyxValues[INPUT_KEYS.SECOND_SIGNER_DATE_OF_BIRTH],
secondSignerJobTitle: onyxValues[INPUT_KEYS.SECOND_SIGNER_JOB_TITLE],
secondSignerEmail: onyxValues[INPUT_KEYS.SECOND_SIGNER_EMAIL],
secondSignerCompleteResidentialAddress: onyxValues[INPUT_KEYS.SECOND_SIGNER_COMPLETE_RESIDENTIAL_ADDRESS],
companyDirectors: [
{
signerFullName: onyxValues[INPUT_KEYS.SIGNER_FULL_NAME],
signerDateOfBirth: onyxValues[INPUT_KEYS.SIGNER_DATE_OF_BIRTH],
signerJobTitle: onyxValues[INPUT_KEYS.SIGNER_JOB_TITLE],
signerEmail: account?.primaryLogin ?? '',
signerCompleteResidentialAddress: onyxValues[INPUT_KEYS.SIGNER_COMPLETE_RESIDENTIAL_ADDRESS],
},
],
copyOfID: onyxValues[INPUT_KEYS.SIGNER_COPY_OF_ID],

Check failure on line 99 in src/pages/ReimbursementAccount/NonUSD/SignerInfo/index.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Type 'FileObject[]' is not assignable to type 'string | FileObject | undefined'.
},
bankAccountID,
);
Expand Down

0 comments on commit 8c0dff5

Please sign in to comment.