Skip to content

Commit

Permalink
feat: cut bank statement from step 2
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMuzyk committed Feb 12, 2025
1 parent 74d1ec1 commit 29ec0ec
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 150 deletions.
4 changes: 1 addition & 3 deletions src/pages/ReimbursementAccount/NonUSD/BankInfo/BankInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import INPUT_IDS from '@src/types/form/ReimbursementAccountForm';
import AccountHolderDetails from './subSteps/AccountHolderDetails';
import BankAccountDetails from './subSteps/BankAccountDetails';
import Confirmation from './subSteps/Confirmation';
import UploadStatement from './subSteps/UploadStatement';
import type {BankInfoSubStepProps} from './types';

const {COUNTRY} = INPUT_IDS.ADDITIONAL_DATA;
Expand Down Expand Up @@ -67,8 +66,7 @@ function BankInfo({onBackButtonPress, onSubmit}: BankInfoProps) {
getCorpayBankAccountFields(country, currency);
}, [country, currency]);

const bodyContent: Array<ComponentType<BankInfoSubStepProps>> =
currency !== CONST.CURRENCY.AUD ? [BankAccountDetails, AccountHolderDetails, Confirmation] : [BankAccountDetails, AccountHolderDetails, UploadStatement, Confirmation];
const bodyContent: Array<ComponentType<BankInfoSubStepProps>> = [BankAccountDetails, AccountHolderDetails, Confirmation];

const {
componentToRender: SubStep,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,31 @@ function Confirmation({onNext, onMove, corpayFields}: BankInfoSubStepProps) {
const values = useMemo(() => getBankInfoStepValues(inputKeys, reimbursementAccountDraft, reimbursementAccount), [inputKeys, reimbursementAccount, reimbursementAccountDraft]);

const items = useMemo(
() => (
<>
{corpayFields?.formFields?.map((field) => {
let title = values[field.id as keyof typeof values] ? String(values[field.id as keyof typeof values]) : '';
() =>
corpayFields?.formFields?.map((field) => {
let title = values[field.id as keyof typeof values] ? String(values[field.id as keyof typeof values]) : '';

if (field.id === ACCOUNT_HOLDER_COUNTRY) {
title = CONST.ALL_COUNTRIES[title as keyof typeof CONST.ALL_COUNTRIES];
}
if (field.id === ACCOUNT_HOLDER_COUNTRY) {
title = CONST.ALL_COUNTRIES[title as keyof typeof CONST.ALL_COUNTRIES];
}

return (
<MenuItemWithTopDescription
description={field.label}
title={title}
shouldShowRightIcon
onPress={() => {
if (!field.id.includes(CONST.NON_USD_BANK_ACCOUNT.BANK_INFO_STEP_ACCOUNT_HOLDER_KEY_PREFIX)) {
onMove(0);
} else {
onMove(1);
}
}}
key={field.id}
/>
);
})}
{!!reimbursementAccountDraft?.[INPUT_IDS.ADDITIONAL_DATA.CORPAY.BANK_STATEMENT] && (
return (
<MenuItemWithTopDescription
description={translate('bankInfoStep.bankStatement')}
title={reimbursementAccountDraft[INPUT_IDS.ADDITIONAL_DATA.CORPAY.BANK_STATEMENT].map((file) => file.name).join(', ')}
description={field.label}
title={title}
shouldShowRightIcon
onPress={() => onMove(2)}
onPress={() => {
if (!field.id.includes(CONST.NON_USD_BANK_ACCOUNT.BANK_INFO_STEP_ACCOUNT_HOLDER_KEY_PREFIX)) {
onMove(0);
} else {
onMove(1);
}
}}
key={field.id}
/>
)}
</>
),
[corpayFields, onMove, reimbursementAccountDraft, translate, values],
);
}),
[corpayFields, onMove, values],
);

return (
Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions src/types/form/ReimbursementAccountForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const INPUT_IDS = {
BANK_ADDRESS_LINE_1: 'bankAddressLine1',
BANK_COUNTRY: 'bankCountry',
BANK_CURRENCY: 'bankCurrency',
BANK_STATEMENT: 'bankStatement',
COMPANY_NAME: 'companyName',
COMPANY_STREET: 'companyStreetAddress',
COMPANY_CITY: 'companyCity',
Expand Down Expand Up @@ -274,9 +273,6 @@ type NonUSDReimbursementAccountAdditionalProps = {
/** Bank address line 1 */
[INPUT_IDS.ADDITIONAL_DATA.CORPAY.BANK_ADDRESS_LINE_1]: string;

/** Bank statement file */
[INPUT_IDS.ADDITIONAL_DATA.CORPAY.BANK_STATEMENT]: FileObject[];

/** Company name */
[INPUT_IDS.ADDITIONAL_DATA.CORPAY.COMPANY_NAME]: string;

Expand Down
2 changes: 0 additions & 2 deletions src/types/onyx/ReimbursementAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ type Corpay = {
[INPUT_IDS.ADDITIONAL_DATA.CORPAY.CONSENT_TO_PRIVACY_NOTICE]: boolean;
/** Checkbox - authorized to bind to client to agreement */
[INPUT_IDS.ADDITIONAL_DATA.CORPAY.AUTHORIZED_TO_BIND_CLIENT_TO_AGREEMENT]: boolean;
/** Bank statement */
[INPUT_IDS.ADDITIONAL_DATA.CORPAY.BANK_STATEMENT]: FileObject[];
/** Is user also an owner */
[INPUT_IDS.ADDITIONAL_DATA.CORPAY.OWNS_MORE_THAN_25_PERCENT]: boolean;
/** Are the more owners */
Expand Down

0 comments on commit 29ec0ec

Please sign in to comment.