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 3 logic #52954

Merged
merged 56 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 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
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
39b8cf5
fix: small fix
MrMuzyk Dec 9, 2024
19285e0
Merge branch 'feature/GR-step-two-api-integration' of github.com:call…
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
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
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
afcca53
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 8, 2025
a6b9bc3
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 9, 2025
d4bb3a6
fix: translations
MrMuzyk Jan 9, 2025
14d23eb
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 9, 2025
4675bb8
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 10, 2025
72715df
fix: cr fixes
MrMuzyk Jan 10, 2025
4b96aac
fix: refactor submit
MrMuzyk Jan 13, 2025
e1c88cc
fix: add links to validation algorithms
MrMuzyk Jan 13, 2025
e3b316b
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 13, 2025
8438839
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 13, 2025
c72b1d7
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 14, 2025
9cf06da
fix: call fix
MrMuzyk Jan 15, 2025
28e17ec
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 15, 2025
e18a8f8
fix: linting
MrMuzyk Jan 15, 2025
139266c
fix: more linter changes
MrMuzyk Jan 15, 2025
790b0bb
fix: final fix
MrMuzyk Jan 15, 2025
c9d1663
fix: missing fields
MrMuzyk Jan 15, 2025
b06196e
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 17, 2025
f0763c2
fix: change purpose value
MrMuzyk Jan 17, 2025
c82f196
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 17, 2025
c8441ca
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 20, 2025
7f4e714
Merge branch 'main' of github.com:Expensify/App into feat/step-3-logic
MrMuzyk Jan 21, 2025
937c8ec
fix: typo
MrMuzyk Jan 22, 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
Prev Previous commit
Next Next commit
feat: hold
  • Loading branch information
MrMuzyk committed Dec 16, 2024
commit 3f76d599341d1bf361342d68ae7f669633709cd7
4 changes: 4 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2216,15 +2216,19 @@ const translations = {
businessCategory: 'Business category',
annualPaymentVolume: 'Annual payment volume',
annualPaymentVolumeInCurrency: ({currencyCode}: CurrencyCodeParams) => `Annual payment volume in ${currencyCode}`,
tradeVolumeRange: 'Trade volume range',
tradeVolumeRangeInCurrency: ({currencyCode}: CurrencyCodeParams) => `Trade volume range in ${currencyCode}`,
selectIncorporationType: 'Select incorporation type',
selectBusinessCategory: 'Select business category',
selectAnnualPaymentVolume: 'Select annual payment volume',
selectIncorporationCountry: 'Select incorporation country',
selectIncorporationState: 'Select incorporation state',
selectTradeVolumeRange: 'Select trade volume range',
findIncorporationType: 'Find incorporation type',
findBusinessCategory: 'Find business category',
findAnnualPaymentVolume: 'Find annual payment volume',
findIncorporationState: 'Find incorporation state',
findTradeVolumeRange: 'Find trade volume range',
error: {
registrationNumber: 'Please provide a valid registration number.',
},
Expand Down
4 changes: 4 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2240,15 +2240,19 @@ const translations = {
businessCategory: 'Categoría de la empresa',
annualPaymentVolume: 'Volumen anual de pagos',
annualPaymentVolumeInCurrency: ({currencyCode}: CurrencyCodeParams) => `Volumen anual de pagos en ${currencyCode}`,
tradeVolumeRange: 'Trade volume range',
tradeVolumeRangeInCurrency: ({currencyCode}: CurrencyCodeParams) => `Trade volume range 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',
selectTradeVolumeRange: 'Select trade volume range',
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',
findTradeVolumeRange: 'Find trade volume range',
error: {
registrationNumber: 'Por favor, proporcione un número de registro válido.',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const {
FORMATION_INCORPORATION_COUNTRY_CODE,
ANNUAL_VOLUME,
APPLICANT_TYPE_ID,
TRADE_VOLUME,
BUSINESS_CATEGORY,
} = INPUT_IDS.ADDITIONAL_DATA.CORPAY;

Expand Down Expand Up @@ -62,6 +63,10 @@ function Confirmation({onNext, onMove}: SubStepProps) {
() => displayStringValue(corpayOnboardingFields?.picklists.ApplicantType ?? [], values[APPLICANT_TYPE_ID]),
[corpayOnboardingFields?.picklists.ApplicantType, values],
);
const tradeVolumeRange = useMemo(
() => displayStringValue(corpayOnboardingFields?.picklists.TradeVolumeRange ?? [], values[TRADE_VOLUME]),
[corpayOnboardingFields?.picklists.TradeVolumeRange, values],
);

return (
<SafeAreaConsumer>
Expand Down Expand Up @@ -151,6 +156,14 @@ function Confirmation({onNext, onMove}: SubStepProps) {
onMove(7);
}}
/>
<MenuItemWithTopDescription
description={translate('businessInfoStep.tradeVolumeRange')}
title={tradeVolumeRange}
shouldShowRightIcon
onPress={() => {
onMove(7);
}}
/>
<View style={[styles.p5, styles.flexGrow1, styles.justifyContentEnd]}>
<Button
success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import INPUT_IDS from '@src/types/form/ReimbursementAccountForm';

type PaymentVolumeProps = SubStepProps;

const {ANNUAL_VOLUME} = INPUT_IDS.ADDITIONAL_DATA.CORPAY;
const {ANNUAL_VOLUME, TRADE_VOLUME} = INPUT_IDS.ADDITIONAL_DATA.CORPAY;
const STEP_FIELDS = [ANNUAL_VOLUME];

function PaymentVolume({onNext, isEditing}: PaymentVolumeProps) {
Expand All @@ -36,8 +36,19 @@ function PaymentVolume({onNext, isEditing}: PaymentVolumeProps) {
return accumulator;
}, {} as Record<string, string>);
}, [corpayOnboardingFields]);
const tradeVolumeRangeListOptions = useMemo(() => {
if (!corpayOnboardingFields?.picklists.TradeVolumeRange) {
return {};
}

return corpayOnboardingFields.picklists.TradeVolumeRange.reduce((accumulator, currentValue) => {
accumulator[currentValue.name] = currentValue.stringValue;
return accumulator;
}, {} as Record<string, string>);
}, [corpayOnboardingFields]);

const annualVolumeDefaultValue = reimbursementAccount?.achData?.additionalData?.corpay?.[ANNUAL_VOLUME] ?? reimbursementAccountDraft?.[ANNUAL_VOLUME] ?? '';
const tradeVolumeDefaultValue = reimbursementAccount?.achData?.additionalData?.corpay?.[TRADE_VOLUME] ?? reimbursementAccountDraft?.[TRADE_VOLUME] ?? '';

const validate = useCallback((values: FormOnyxValues<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM>): FormInputErrors<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM> => {
return ValidationUtils.getFieldRequiredErrors(values, STEP_FIELDS);
Expand Down Expand Up @@ -69,6 +80,16 @@ function PaymentVolume({onNext, isEditing}: PaymentVolumeProps) {
shouldSaveDraft={!isEditing}
value={annualVolumeDefaultValue}
/>
<InputWrapper
InputComponent={PushRowWithModal}
optionsList={tradeVolumeRangeListOptions}
description={translate('businessInfoStep.tradeVolumeRangeInCurrency', {currencyCode: CONST.CURRENCY.USD})}
modalHeaderTitle={translate('businessInfoStep.selectTradeVolumeRange')}
searchInputTitle={translate('businessInfoStep.findTradeVolumeRange')}
inputID={TRADE_VOLUME}
shouldSaveDraft={!isEditing}
value={tradeVolumeDefaultValue}
/>
</FormProvider>
);
}
Expand Down
Loading