Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO QA] feat: Step 4 logic #54280

Draft
wants to merge 47 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9e0e6aa
feat: step 3 logic
MrMuzyk Nov 15, 2024
5669047
feat: break
MrMuzyk Nov 18, 2024
e81d66e
feat: break
MrMuzyk Nov 18, 2024
8ea2550
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Nov 19, 2024
c895304
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Nov 20, 2024
979401b
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Nov 21, 2024
2da4876
feat: proper params
MrMuzyk Nov 22, 2024
8a99d20
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Nov 22, 2024
93396c0
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Nov 25, 2024
dbb6f2a
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Nov 26, 2024
2331ba8
Merge remote-tracking branch 'refs/remotes/origin/feature/GR-step-two…
MrMuzyk Nov 26, 2024
52c6562
testing
MrMuzyk Nov 28, 2024
d135e65
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Nov 28, 2024
356bcae
feat: Step 4 logic
MrMuzyk Dec 5, 2024
90f0695
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Dec 5, 2024
0bdbce8
Merge remote-tracking branch 'refs/remotes/origin/feature/GR-step-two…
MrMuzyk Dec 5, 2024
b63de9b
feat: picklists
MrMuzyk Dec 9, 2024
94c131d
Merge branch 'feat/step-3-logic' of github.com:callstack-internal/Exp…
MrMuzyk Dec 9, 2024
39b8cf5
fix: small fix
MrMuzyk Dec 9, 2024
0721321
Merge branch 'feat/step-3-logic' of github.com:callstack-internal/Exp…
MrMuzyk Dec 9, 2024
0918b98
feat: skipping steps
MrMuzyk Dec 11, 2024
e19cecd
feat: waiting
MrMuzyk Dec 12, 2024
19285e0
Merge branch 'feature/GR-step-two-api-integration' of github.com:call…
MrMuzyk Dec 13, 2024
c6c8d7c
Merge branch 'feat/step-3-logic' of github.com:callstack-internal/Exp…
MrMuzyk Dec 13, 2024
720299e
Merge branch 'feature/GR-step-two-api-integration' of github.com:call…
MrMuzyk Dec 13, 2024
a308516
Merge branch 'feature/GR-step-two-api-integration' of github.com:call…
MrMuzyk Dec 13, 2024
5a2671f
Merge branch 'feature/GR-step-two-api-integration' of github.com:call…
MrMuzyk Dec 16, 2024
3f76d59
feat: hold
MrMuzyk Dec 16, 2024
0dd6b81
Merge branch 'feature/GR-step-two-api-integration' of github.com:call…
MrMuzyk Dec 17, 2024
dc47fe2
feat: average reimbursement
MrMuzyk Dec 18, 2024
63b2979
Merge branch 'feature/GR-step-two-api-integration' of github.com:call…
MrMuzyk Dec 18, 2024
8e0a5c9
Merge branch 'feat/step-3-logic' of github.com:callstack-internal/Exp…
MrMuzyk Dec 18, 2024
f107ff2
fix: keys
MrMuzyk Dec 18, 2024
9f3fba1
Merge branch 'feature/GR-step-two-api-integration' of github.com:call…
MrMuzyk Dec 18, 2024
7974bd6
feat: API error
MrMuzyk Dec 19, 2024
285a000
Merge branch 'feature/GR-step-two-api-integration' of github.com:call…
MrMuzyk Dec 19, 2024
81a07f5
fix: revert default nonusd step
MrMuzyk Dec 19, 2024
a37a0f6
Merge branch 'feature/GR-step-two-api-integration' of github.com:call…
MrMuzyk Dec 20, 2024
866eacf
Merge branch 'feat/step-3-logic' of github.com:callstack-internal/Exp…
MrMuzyk Dec 20, 2024
856ed3b
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
MrMuzyk Jan 7, 2025
5bab709
fix: country field rename
MrMuzyk Jan 7, 2025
531f434
fix: linter
MrMuzyk Jan 7, 2025
b1b0e65
Merge branch 'feat/step-3-logic' of github.com:callstack-internal/Exp…
MrMuzyk Jan 7, 2025
b7122ac
fix: rebase changes
MrMuzyk Jan 7, 2025
798d01d
fix: ts
MrMuzyk Jan 7, 2025
85be385
fix: one more type fix
MrMuzyk Jan 7, 2025
c165104
linter
MrMuzyk Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ const CONST = {
ALLOWED_FILE_TYPES: ['pdf', 'jpg', 'jpeg', 'png'],
FILE_LIMIT: 10,
TOTAL_FILES_SIZE_LIMIT: 5242880,
PURPOSE_OF_TRANSACTION_ID: 8,
STEP: {
COUNTRY: 'CountryStep',
BANK_INFO: 'BankInfoStep',
Expand All @@ -630,14 +631,22 @@ const CONST = {
AGREEMENTS: 'AgreementsStep',
FINISH: 'FinishStep',
},
BUSINESS_INFO_STEP: {
PICKLIST: {
ANNUAL_VOLUME_RANGE: 'AnnualVolumeRange',
APPLICANT_TYPE: 'ApplicantType',
NATURE_OF_BUSINESS: 'NatureOfBusiness',
PURPOSE_OF_TRANSACTION: 'PurposeOfTransaction',
TRADE_VOLUME_RANGE: 'TradeVolumeRange',
},
},
BENEFICIAL_OWNER_INFO_STEP: {
SUBSTEP: {
IS_USER_BENEFICIAL_OWNER: 1,
IS_ANYONE_ELSE_BENEFICIAL_OWNER: 2,
BENEFICIAL_OWNER_DETAILS_FORM: 3,
ARE_THERE_MORE_BENEFICIAL_OWNERS: 4,
OWNERSHIP_CHART: 5,
BENEFICIAL_OWNERS_LIST: 6,
BENEFICIAL_OWNERS_LIST: 5,
},
BENEFICIAL_OWNER_DATA: {
BENEFICIAL_OWNER_KEYS: 'beneficialOwnerKeys',
Expand All @@ -652,6 +661,10 @@ const CONST = {
STATE: 'state',
ZIP_CODE: 'zipCode',
COUNTRY: 'country',
PROOF_OF_OWNERSHIP: 'proofOfOwnership',
COPY_OF_ID: 'copyOfID',
ADDRESS_PROOF: 'addressProof',
CODICE_FISCALE: 'codiceFisacle',
},
CURRENT_USER_KEY: 'currentUser',
},
Expand Down Expand Up @@ -705,6 +718,7 @@ const CONST = {
AU: 'AU',
CA: 'CA',
GB: 'GB',
IT: 'IT',
},
DESKTOP_DEEPLINK_APP_STATE: {
CHECKING: 'checking',
Expand Down
6 changes: 5 additions & 1 deletion src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,15 @@ const ONYXKEYS = {
/** The user's Concierge reportID */
CONCIERGE_REPORT_ID: 'conciergeReportID',

/* Corpay fieds to be used in the bank account creation setup */
/** Corpay fieds to be used in the bank account creation setup */
CORPAY_FIELDS: 'corpayFields',

/** The user's session that will be preserved when using imported state */
PRESERVED_USER_SESSION: 'preservedUserSession',

/** Corpay onboarding fields used in steps 3-5 in the global reimbursements */
CORPAY_ONBOARDING_FIELDS: 'corpayOnboardingFields',

/** Collection Keys */
COLLECTION: {
DOWNLOAD: 'download_',
Expand Down Expand Up @@ -1041,6 +1044,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.CORPAY_FIELDS]: OnyxTypes.CorpayFields;
[ONYXKEYS.PRESERVED_USER_SESSION]: OnyxTypes.Session;
[ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING]: OnyxTypes.DismissedProductTraining;
[ONYXKEYS.CORPAY_ONBOARDING_FIELDS]: OnyxTypes.CorpayOnboardingFields;
};
type OnyxValues = OnyxValuesMapping & OnyxCollectionValuesMapping & OnyxFormValuesMapping & OnyxFormDraftValuesMapping;

Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useSubStep/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export default function useSubStep<TProps extends SubStepProps>({bodyContent, on
[screenIndex, bodyContent.length, onFinished, onNextSubStep],
);

const moveTo = useCallback((step: number) => {
isEditing.current = true;
const moveTo = useCallback((step: number, turnOnEditMode?: boolean) => {
isEditing.current = !(turnOnEditMode !== undefined && !turnOnEditMode);
setScreenIndex(step);
}, []);

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useSubStep/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type SubStepProps = {
onNext: (data?: unknown) => void;

/** moves user to passed sub step */
onMove: (step: number) => void;
onMove: (step: number, turnOnEditMode?: boolean) => void;

/** index of currently displayed sub step */
screenIndex?: number;
Expand Down
20 changes: 20 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2239,11 +2239,14 @@ const translations = {
whatsTheBusinessAddress: "What's the business address?",
whatsTheBusinessContactInformation: "What's the business contact information?",
whatsTheBusinessRegistrationNumber: "What's the business registration number?",
whatsTheBusinessTaxIDEIN: "What's the business tax ID/EIN/VAT/GST Registration number?",
whatsThisNumber: "What's this number?",
whereWasTheBusinessIncorporated: 'Where was the business incorporated?',
whatTypeOfBusinessIsIt: 'What type of business is it?',
whatsTheBusinessAnnualPayment: "What's the business's annual payment volume?",
whatsYourExpectedAverageReimbursements: "What's your expected average reimbursement amount?",
registrationNumber: 'Registration number',
taxIDEIN: 'Tax ID/EIN number',
businessAddress: 'Business address',
businessType: 'Business type',
incorporation: 'Incorporation',
Expand All @@ -2252,15 +2255,22 @@ const translations = {
businessCategory: 'Business category',
annualPaymentVolume: 'Annual payment volume',
annualPaymentVolumeInCurrency: ({currencyCode}: CurrencyCodeParams) => `Annual payment volume in ${currencyCode}`,
averageReimbursementAmount: 'Average Reimbursement amount',
averageReimbursementAmountInCurrency: ({currencyCode}: CurrencyCodeParams) => `Average Reimbursement amount in ${currencyCode}`,
selectIncorporationType: 'Select incorporation type',
selectBusinessCategory: 'Select business category',
selectAnnualPaymentVolume: 'Select annual payment volume',
selectIncorporationCountry: 'Select incorporation country',
selectIncorporationState: 'Select incorporation state',
selectAverageReimbursement: 'Select average reimbursement amount',
findIncorporationType: 'Find incorporation type',
findBusinessCategory: 'Find business category',
findAnnualPaymentVolume: 'Find annual payment volume',
findIncorporationState: 'Find incorporation state',
findAverageReimbursement: 'Find average reimbursement amount',
error: {
registrationNumber: 'Please provide a valid registration number.',
},
},
beneficialOwnerInfoStep: {
doYouOwn25percent: 'Do you own 25% or more of',
Expand Down Expand Up @@ -2318,6 +2328,16 @@ const translations = {
selectCountry: 'Select country',
findCountry: 'Find country',
address: 'Address',
chooseFile: 'Choose file',
uploadDocuments: 'Upload additional documentation',
proofOfBeneficialOwner: 'Proof of beneficial owner',
proofOfBeneficialOwnerDescription: 'Lorem ipsum',
copyOfID: 'Copy of ID',
copyOfIDDescription: 'Lorem ipsum',
proofOfAddress: 'Proof of address',
proofOfAddressDescription: 'Lorem ipsum',
codiceFiscale: 'Codice fiscale/Tax ID',
codiceFiscaleDescription: 'Lorem ipsum',
},
validationStep: {
headerTitle: 'Validate bank account',
Expand Down
20 changes: 20 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2263,11 +2263,14 @@ const translations = {
whatsTheBusinessAddress: '¿Cuál es la dirección de la empresa?',
whatsTheBusinessContactInformation: '¿Cuál es la información de contacto de la empresa?',
whatsTheBusinessRegistrationNumber: '¿Cuál es el número de registro de la empresa?',
whatsTheBusinessTaxIDEIN: '¿Cuál es el número de identificación fiscal/EIN/IVA/GST de la empresa?',
whatsThisNumber: '¿Qué es este número?',
whereWasTheBusinessIncorporated: '¿Dónde se constituyó la empresa?',
whatTypeOfBusinessIsIt: '¿Qué tipo de empresa es?',
whatsTheBusinessAnnualPayment: '¿Cuál es el volumen anual de pagos de la empresa?',
whatsYourExpectedAverageReimbursements: "What's your expected average reimbursement amount?",
registrationNumber: 'Número de registro',
taxIDEIN: 'Número de identificación fiscal/EIN',
businessAddress: 'Dirección de la empresa',
businessType: 'Tipo de empresa',
incorporation: 'Constitución',
Expand All @@ -2276,15 +2279,22 @@ const translations = {
businessCategory: 'Categoría de la empresa',
annualPaymentVolume: 'Volumen anual de pagos',
annualPaymentVolumeInCurrency: ({currencyCode}: CurrencyCodeParams) => `Volumen anual de pagos en ${currencyCode}`,
averageReimbursementAmount: 'Average Reimbursement amount',
averageReimbursementAmountInCurrency: ({currencyCode}: CurrencyCodeParams) => `Average Reimbursement amount in ${currencyCode}`,
selectIncorporationType: 'Seleccione tipo de constitución',
selectBusinessCategory: 'Seleccione categoría de la empresa',
selectAnnualPaymentVolume: 'Seleccione volumen anual de pagos',
selectIncorporationCountry: 'Seleccione país de constitución',
selectIncorporationState: 'Seleccione estado de constitución',
selectAverageReimbursement: 'Select average reimbursement amount',
findIncorporationType: 'Buscar tipo de constitución',
findBusinessCategory: 'Buscar categoría de la empresa',
findAnnualPaymentVolume: 'Buscar volumen anual de pagos',
findIncorporationState: 'Buscar estado de constitución',
findAverageReimbursement: 'Find average reimbursement amount',
error: {
registrationNumber: 'Por favor, proporcione un número de registro válido.',
},
},
beneficialOwnerInfoStep: {
doYouOwn25percent: '¿Posees el 25% o más de',
Expand Down Expand Up @@ -2342,6 +2352,16 @@ const translations = {
selectCountry: 'Seleccionar país',
findCountry: 'Buscar país',
address: 'Dirección',
chooseFile: 'Choose file',
uploadDocuments: 'Upload additional documentation',
proofOfBeneficialOwner: 'Proof of beneficial owner',
proofOfBeneficialOwnerDescription: 'Lorem ipsum',
copyOfID: 'Copy of ID',
copyOfIDDescription: 'Lorem ipsum',
proofOfAddress: 'Proof of address',
proofOfAddressDescription: 'Lorem ipsum',
codiceFiscale: 'Codice fiscale/Tax ID',
codiceFiscaleDescription: 'Lorem ipsum',
},
validationStep: {
headerTitle: 'Validar cuenta bancaria',
Expand Down
7 changes: 7 additions & 0 deletions src/libs/API/parameters/GetCorpayOnboardingFieldsParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type {Country} from '@src/CONST';

type GetCorpayOnboardingFieldsParams = {
countryISO: Country | '';
};

export default GetCorpayOnboardingFieldsParams;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type SaveCorpayOnboardingBeneficialOwnerParams = {
inputs: string;
isUserBeneficialOwner: boolean;
beneficialOwners: string[];
bankAccountID: number;
};

export default SaveCorpayOnboardingBeneficialOwnerParams;
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type CONST from '@src/CONST';

type SaveCorpayOnboardingCompanyDetails = {
annualVolume: string;
applicantTypeId: string;
companyName: string;
companyStreetAddress: string;
companyCity: string;
companyState?: string;
companyPostalCode: string;
companyCountryCode: string;
currencyNeeded: string;
businessContactNumber: string;
businessConfirmationEmail: string;
businessRegistrationIncorporationNumber: string;
formationIncorporationCountryCode: string;
formationIncorporationState?: string;
fundDestinationCountries: string;
fundSourceCountries: string;
natureOfBusiness: string;
purposeOfTransactionId: typeof CONST.NON_USD_BANK_ACCOUNT.PURPOSE_OF_TRANSACTION_ID;
tradeVolume: string;
taxIDEINNumber: string;
};

type SaveCorpayOnboardingCompanyDetailsParams = {
inputs: string;
bankAccountID: number;
};

export type {SaveCorpayOnboardingCompanyDetails, SaveCorpayOnboardingCompanyDetailsParams};
3 changes: 3 additions & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,6 @@ export type {default as ExportPerDiemCSVParams} from './ExportPerDiemCSVParams';
export type {default as UpdateWorkspaceCustomUnitParams} from './UpdateWorkspaceCustomUnitParams';
export type {default as DismissProductTrainingParams} from './DismissProductTraining';
export type {default as OpenWorkspacePlanPageParams} from './OpenWorkspacePlanPage';
export type {default as GetCorpayOnboardingFieldsParams} from './GetCorpayOnboardingFieldsParams';
export type {SaveCorpayOnboardingCompanyDetailsParams} from './SaveCorpayOnboardingCompanyDetailsParams';
export type {default as SaveCorpayOnboardingBeneficialOwnerParams} from './SaveCorpayOnboardingBeneficialOwnerParams';
6 changes: 6 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ const WRITE_COMMANDS = {
UPDATE_WORKSPACE_CUSTOM_UNIT: 'UpdateWorkspaceCustomUnit',
VALIDATE_USER_AND_GET_ACCESSIBLE_POLICIES: 'ValidateUserAndGetAccessiblePolicies',
DISMISS_PRODUCT_TRAINING: 'DismissProductTraining',
SAVE_CORPAY_ONBOARDING_COMPANY_DETAILS: 'SaveCorpayOnboardingCompanyDetails',
SAVE_CORPAY_ONBOARDING_BENEFICIAL_OWNER: 'SaveCorpayOnboardingBeneficialOwner',
} as const;

type WriteCommand = ValueOf<typeof WRITE_COMMANDS>;
Expand Down Expand Up @@ -770,6 +772,8 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.UPDATE_SUBSCRIPTION_SIZE]: Parameters.UpdateSubscriptionSizeParams;
[WRITE_COMMANDS.REQUEST_TAX_EXEMPTION]: null;
[WRITE_COMMANDS.UPDATE_WORKSPACE_CUSTOM_UNIT]: Parameters.UpdateWorkspaceCustomUnitParams;
[WRITE_COMMANDS.SAVE_CORPAY_ONBOARDING_COMPANY_DETAILS]: Parameters.SaveCorpayOnboardingCompanyDetailsParams;
[WRITE_COMMANDS.SAVE_CORPAY_ONBOARDING_BENEFICIAL_OWNER]: Parameters.SaveCorpayOnboardingBeneficialOwnerParams;

[WRITE_COMMANDS.DELETE_MONEY_REQUEST_ON_SEARCH]: Parameters.DeleteMoneyRequestOnSearchParams;
[WRITE_COMMANDS.HOLD_MONEY_REQUEST_ON_SEARCH]: Parameters.HoldMoneyRequestOnSearchParams;
Expand Down Expand Up @@ -964,6 +968,7 @@ const READ_COMMANDS = {
OPEN_CARD_DETAILS_PAGE: 'OpenCardDetailsPage',
GET_ASSIGNED_SUPPORT_DATA: 'GetAssignedSupportData',
OPEN_WORKSPACE_PLAN_PAGE: 'OpenWorkspacePlanPage',
GET_CORPAY_ONBOARDING_FIELDS: 'GetCorpayOnboardingFields',
} as const;

type ReadCommand = ValueOf<typeof READ_COMMANDS>;
Expand Down Expand Up @@ -1029,6 +1034,7 @@ type ReadCommandParameters = {
[READ_COMMANDS.OPEN_CARD_DETAILS_PAGE]: Parameters.OpenCardDetailsPageParams;
[READ_COMMANDS.GET_ASSIGNED_SUPPORT_DATA]: Parameters.GetAssignedSupportDataParams;
[READ_COMMANDS.OPEN_WORKSPACE_PLAN_PAGE]: Parameters.OpenWorkspacePlanPageParams;
[READ_COMMANDS.GET_CORPAY_ONBOARDING_FIELDS]: Parameters.GetCorpayOnboardingFieldsParams;
};

const SIDE_EFFECT_REQUEST_COMMANDS = {
Expand Down
Loading
Loading