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

[Wave 6] Bank Account Flow Refactor #34498

Merged
merged 338 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
338 commits
Select commit Hold shift + click to select a range
ab237f5
Merge main and resolve merge conflicts
mountiny Nov 16, 2023
3ae88d7
Merge branch 'vit-tieredBankAccountFlow' of https://github.com/Expens…
MrMuzyk Nov 17, 2023
42ae28e
fix: prettier fix
MrMuzyk Nov 17, 2023
57da62e
Merge pull request #31121 from MrMuzyk/michal/bank-info-screen
mountiny Nov 17, 2023
d84e933
Merge main
mountiny Nov 20, 2023
b1ada29
Merge branch 'vit-tieredBankAccountFlow' of github.com:Expensify/App …
mountiny Nov 20, 2023
6beb491
Merge branch 'main' of https://github.com/Expensify/App into michal/o…
MrMuzyk Nov 22, 2023
88e7b0a
feat: verify identity
MrMuzyk Nov 24, 2023
2137c0f
draft: bank owner verification page commit
Swor71 Nov 24, 2023
a27d4b2
Merge main
mountiny Nov 24, 2023
4c15a86
Merge branch 'vit-tieredBankAccountFlow' of https://github.com/Expens…
MrMuzyk Nov 24, 2023
affc306
fix: small polishing fies
MrMuzyk Nov 24, 2023
14cd02f
fix: removed unused ref
MrMuzyk Nov 24, 2023
f43a36a
fix: lint fixes
MrMuzyk Nov 24, 2023
187dc92
fix: cr fixes
MrMuzyk Nov 27, 2023
8cde23a
fix: typo and form wrapper change
MrMuzyk Nov 27, 2023
a06e1d4
Merge pull request #31812 from MrMuzyk/michal/onfido-step
mountiny Nov 27, 2023
cef2e8c
Merge branch 'marcin/bank-owner-verification-page' of github.com:Swor…
MrMuzyk Nov 27, 2023
97ed396
feat: UBO step
MrMuzyk Nov 29, 2023
26adf3b
feat: break
MrMuzyk Dec 6, 2023
e0dedb6
Merge main
mountiny Dec 7, 2023
dcd1e98
before rebase
MrMuzyk Dec 7, 2023
b0f8813
Merge branch 'vit-tieredBankAccountFlow' of https://github.com/Expens…
MrMuzyk Dec 7, 2023
6367197
fix: fixing stuff after rebase
MrMuzyk Dec 7, 2023
10c486d
feat: checking all once more
MrMuzyk Dec 7, 2023
0f74c4b
feat: es translations
MrMuzyk Dec 8, 2023
ba7b7b5
fix: cr fixes
MrMuzyk Dec 11, 2023
21fedad
Merge main and resolve merge conflicts
mountiny Dec 14, 2023
dd49213
Merge branch 'vit-tieredBankAccountFlow' of https://github.com/Expens…
MrMuzyk Dec 14, 2023
b1003e9
fix: styles imports fix
MrMuzyk Dec 14, 2023
aaa1c13
fix: rework forms
MrMuzyk Dec 14, 2023
c7e5489
fix: default value fix
MrMuzyk Dec 14, 2023
701ec37
feat: add one more proptype to formProvider
MrMuzyk Dec 15, 2023
a6ee5a3
Merge pull request #32709 from MrMuzyk/michal/ubo-step
mountiny Dec 15, 2023
a2b4569
Merge main and resolve merge conflicts
mountiny Dec 15, 2023
1b9958b
feat: migrate interactiveStepSubHeader to ts
MrMuzyk Dec 18, 2023
954f5b9
fix: cr fix
MrMuzyk Dec 18, 2023
b234f73
chore: migrate useSubStep hook to ts
Swor71 Dec 18, 2023
b546231
fix: removed corresponding js file
Swor71 Dec 18, 2023
9e69db6
fix: cr fix
MrMuzyk Dec 18, 2023
201f1b6
Merge pull request #33226 from MrMuzyk/feat/interactive-step-sub-head…
arosiclair Dec 18, 2023
7cee9c1
feat: getValuesForBeneficialOwner migrate to ts
MrMuzyk Dec 19, 2023
354a2e3
refactor: migrated getInitialSubstepForBusinessInfo helper
barttom Dec 19, 2023
d4495ec
refactor: migrated getInitialSubstepForPersonalInfo to typescript
barttom Dec 19, 2023
4e120c8
fix: changed typing, added comment
barttom Dec 19, 2023
8c85c12
fix: cr fixes
MrMuzyk Dec 19, 2023
1f8ade1
fix: linter
MrMuzyk Dec 19, 2023
cf0f1a6
Merge pull request #33231 from Swor71/marcin/migrate-useSubstepHook-t…
mountiny Dec 19, 2023
3e7e21e
Merge pull request #33270 from MrMuzyk/feat/get-values-for-beneficial…
mountiny Dec 19, 2023
e075c54
Merge pull request #33271 from barttom/refactor/getInitialSubstepForB…
mountiny Dec 19, 2023
dd91c18
feat: migrate getSubstepValues to ts
Swor71 Dec 19, 2023
a7b2405
Merge pull request #33272 from barttom/refactor/getInitialSubstepForP…
bondydaa Dec 19, 2023
b60de4a
add: return type to the hook
Swor71 Dec 20, 2023
dfcebe9
Merge pull request #33281 from Swor71/marcin/migrate-getSubstepValues-ts
mountiny Dec 20, 2023
973dd49
fix: better narrowing for getSubstepValues return
Swor71 Dec 20, 2023
a8944cf
Merge main
mountiny Dec 21, 2023
eadc97d
Merge pull request #33350 from Swor71/fix-getSubstepValues-util-ts
mountiny Dec 21, 2023
104ee2b
fix: fixed datepicker
barttom Dec 21, 2023
0afb1f2
Merge pull request #33402 from barttom/fix/fixes-after-merge-21122023
mountiny Dec 21, 2023
aadfdbd
fix: fixed component in datepicker
barttom Dec 21, 2023
0bcce1e
Merge pull request #33405 from barttom/fix/fixes-after-merge-21122023…
Julesssss Dec 21, 2023
91858d6
feat: add new verification step page
barttom Dec 1, 2023
3180e92
feat: added submit of stpe, added default valuies and validation for …
barttom Dec 5, 2023
b40dbc7
feat: added ConnectBankAccount component
barttom Dec 7, 2023
9dd74d3
feat: added EnableBankAccount step
barttom Dec 7, 2023
50fa822
fix: rollback import
barttom Dec 7, 2023
c4b58d7
fix: fixed translation
barttom Dec 7, 2023
48d7a8e
feat: handled sending proper data after the last step
barttom Dec 15, 2023
2c6e183
feat: handled sending proper data after the last step
barttom Dec 15, 2023
714cb1a
feat: added new compnents for verification and enable steps
barttom Dec 15, 2023
89a9e81
fix: fixed imports
barttom Dec 15, 2023
4609424
fix: fixed helepr funciton
barttom Dec 15, 2023
d6fcd71
refactor: remove unused components
barttom Dec 15, 2023
4d0ca8b
refactor: fixed prettier
barttom Dec 15, 2023
0df650b
fix: fixed stepper colors
barttom Dec 17, 2023
06d8f09
fix: follow const variable uppercased names, change ubo step value na…
barttom Dec 18, 2023
a3aa0bc
feat: updated translation
barttom Dec 18, 2023
eaeffed
fix: added default values, added close button to the CompleteVerifica…
barttom Dec 18, 2023
7fdab99
fix: added default values and missed comments
barttom Dec 18, 2023
2cfb812
fix: removed unused useMemo
barttom Dec 18, 2023
598740d
feat: BankInfo migration to ts
MrMuzyk Dec 21, 2023
9ba3ec2
Merge branch 'vit-tieredBankAccountFlow' of https://github.com/Expens…
MrMuzyk Dec 21, 2023
2996514
fix: move expect errors
MrMuzyk Dec 21, 2023
a4c0f85
fix: test fix
MrMuzyk Dec 21, 2023
51d14f7
fix: fixed card styles on the bank accont confirmation
barttom Dec 21, 2023
b35b92b
fix: lint
barttom Dec 21, 2023
5467681
fix: fixed card styles on the bank accont confirmation
barttom Dec 21, 2023
3c00ef2
fix: cr fixes
MrMuzyk Dec 22, 2023
9c12a98
feat: small fix
MrMuzyk Dec 22, 2023
85f44ee
fix: more changes
MrMuzyk Dec 22, 2023
d918cd4
Merge pull request #32666 from barttom/refactor/30442/varification-step
mountiny Dec 22, 2023
ec5704e
Merge branch 'vit-tieredBankAccountFlow' of https://github.com/Expens…
MrMuzyk Dec 22, 2023
929933c
feat: migrate BusinessInfo step to TS
Swor71 Dec 22, 2023
5936131
fix: added casting to TranslationPaths
Swor71 Dec 22, 2023
2cfe13d
Merge pull request #33408 from MrMuzyk/feat/bank-info-step-to-ts
mountiny Dec 22, 2023
a78e325
Merge branch 'vit-tieredBankAccountFlow' into marcin/migrate-business…
Swor71 Dec 22, 2023
4064f8c
fix: CR comments
Swor71 Dec 28, 2023
47634ab
fix: CR comments
Swor71 Dec 29, 2023
68b0160
Merge pull request #33495 from Swor71/marcin/migrate-businessInfo-ts
mountiny Dec 29, 2023
06b826b
Merge main to resolve merge conflicts
mountiny Dec 29, 2023
943863d
Sync with upstream
mountiny Dec 29, 2023
6ccb30d
Merge branch 'main' into vit-tieredBankAccountFlow
mountiny Jan 4, 2024
9709323
refactor: migrated BeneficialOwnerInfo
barttom Dec 20, 2023
8f79ac3
refactor: migrated BeneficialOwnerCheckUBO component
barttom Dec 22, 2023
d62eedd
refactor: migrated CompanyOwnersListUBO to ts
barttom Dec 22, 2023
42271f6
refactor: improvements in BeneficialOwnerInfo & BeneficialOwneCHeckUbo
barttom Jan 2, 2024
1e51492
fix: fixes in CompanyOwnersListUBO
barttom Jan 3, 2024
0c77132
fix: fixes in CompanyOwnersListUBO
barttom Jan 3, 2024
0520950
refactor: migrated Address component
barttom Jan 4, 2024
91cdddb
refactor: finished ConfirmationUBO migration
barttom Jan 4, 2024
cf04fa2
refactor: finished ConfirmationUBO migration
barttom Jan 4, 2024
f6e8c1b
refactor: mirgrated DateOfBirthUBO
barttom Jan 4, 2024
862f951
refactor: migrated LegalNameUBO
barttom Jan 4, 2024
31f87c4
refactor: migrated LegalNameUBO
barttom Jan 4, 2024
02d7b6e
refactor: migrated SocialSecurityNumberUbo
barttom Jan 4, 2024
d497f3a
refactor: fixed callback type
barttom Jan 4, 2024
6bdb95a
refactor: fixed PR comments
barttom Jan 6, 2024
7bdf9c5
refactor: adjusted migrated files to changes from main branch
barttom Jan 6, 2024
9498329
fix: added formprovider
barttom Jan 8, 2024
15a820b
fix: fix linter
barttom Jan 8, 2024
72bec45
Merge pull request #33956 from barttom/refactor/ubo-step-ts-migration
mountiny Jan 8, 2024
035c328
refactor: migrated CompleteVerification step
barttom Jan 9, 2024
d74a2df
fix: fixed lint errors
barttom Jan 9, 2024
4c58710
fix: removed unnecessary comment
barttom Jan 10, 2024
9b4e365
Merge pull request #34138 from barttom/refactor/complete-verification…
mountiny Jan 10, 2024
9975297
feat: PersonalInfo ts migration
MrMuzyk Jan 10, 2024
663739b
feat: small fixes
MrMuzyk Jan 10, 2024
a8452f9
fix: change props name for help links
MrMuzyk Jan 10, 2024
2da7382
Merge main to resolve merge conflicts
mountiny Jan 10, 2024
ad0c28c
Merge pull request #34220 from MrMuzyk/feat/personal-info-ts-migration
mountiny Jan 10, 2024
2acfed6
feat: EnableBankAccount ts migration
MrMuzyk Jan 10, 2024
20663ac
fix: rebase errors
MrMuzyk Jan 10, 2024
b470e94
fix: cr fixes
MrMuzyk Jan 11, 2024
bb7abab
fix: cr
MrMuzyk Jan 11, 2024
bccec25
fix: fix comment
MrMuzyk Jan 11, 2024
10f17e6
Merge pull request #34255 from MrMuzyk/feat/enable-account-migrate-to-ts
mountiny Jan 11, 2024
57f6431
refactor: migrated connectbank account step
barttom Jan 11, 2024
6742591
fix: fixed amount validation
barttom Jan 11, 2024
b5cd316
fix: added props descriptions
barttom Jan 11, 2024
4cdc1b6
Merge pull request #34326 from barttom/refactor/conect-bank-account-t…
mountiny Jan 11, 2024
106a602
feat: migrate VerifyIdentity to ts
Swor71 Jan 11, 2024
fad1257
fix: removed reimbursementAccountDefaultProps
Swor71 Jan 11, 2024
6680af4
fix: move to the last step when editing data
barttom Jan 11, 2024
56e32a2
Merge pull request #34338 from Swor71/marcin/migrate-verify-identity-…
mountiny Jan 11, 2024
cc1de27
refactor: remove usage from AddressBusiness
barttom Jan 12, 2024
e851092
refactor: remove usage from IncorporationDateBusiness
barttom Jan 12, 2024
6acd1cb
refactor: remove usage from IncorporationStateBusiness
barttom Jan 12, 2024
ac27526
refactor: remove usage from NameBusiness
barttom Jan 12, 2024
93bf043
refactor: remove usage from PhoneNumberBusiness
barttom Jan 12, 2024
ee450b5
refactor: remove usage from TaxIdBusiness
barttom Jan 12, 2024
d89dcbc
refactor: remove usage from TypeBusiness
barttom Jan 12, 2024
87401a7
refactor: remove usage from WebsiteBusiness
barttom Jan 12, 2024
bfce092
refactor: remove usage from ConfirmAgreements
barttom Jan 12, 2024
297b696
refactor: remove usage from getSubstepValues
barttom Jan 12, 2024
77bb056
refactor: removed helper
barttom Jan 12, 2024
2f82ba0
Merge main
mountiny Jan 12, 2024
a61e206
fix: added default value
barttom Jan 12, 2024
7cee965
Merge pull request #34413 from barttom/refactor/remove-getDefaultValu…
mountiny Jan 12, 2024
d9860ca
Merge pull request #34408 from barttom/fix/back-button-logic
mountiny Jan 12, 2024
2d2c833
Use new vbba 111 commands and swap order of company step and requesto…
nkuoch Jan 2, 2024
d3c3105
Merge branch 'main' of github.com:Expensify/App into vit-tieredBankAc…
barttom Jan 15, 2024
625cd5e
fix: restore space in button
barttom Jan 16, 2024
e729b3d
fix: change typing for useSubStep
barttom Jan 16, 2024
72030ae
fix: fixed PhoneNumber import
barttom Jan 16, 2024
0e87100
fix: prettier file
barttom Jan 16, 2024
e2810e3
fix: removed new js files
barttom Jan 16, 2024
746fdda
fix: removed new js files
barttom Jan 16, 2024
5047fe4
refactor: rewrite Boolean() to double negation
barttom Jan 16, 2024
3d60607
refactor: rewrite Boolean() to double negation
barttom Jan 16, 2024
322ed33
Merge pull request #33838 from Expensify/nat-vbba111
mountiny Jan 16, 2024
41ec6f6
merge upstream vit-tieredBankAccountFlow
barttom Jan 16, 2024
945c338
Merge branch 'main' of github.com:Expensify/App into vit-tieredBankAc…
barttom Jan 16, 2024
2d9c55f
fix: commont ts fixes
barttom Jan 17, 2024
e4e3020
chore: moved OnfidoInitialize into VerifyIdentity (#1)
Swor71 Jan 17, 2024
afdd1d8
Merge branch 'main' of github.com:Expensify/App into vit-tieredBankAc…
barttom Jan 17, 2024
cb12a2d
fix: correct spanish translations (#2)
MrMuzyk Jan 17, 2024
62ea0f9
refactor: rewrite conditional translation for next button
barttom Jan 18, 2024
531d753
chore: apply lint changes
barttom Jan 18, 2024
8f99658
merge upstream vit-tieredBankAccountFlow
barttom Jan 18, 2024
2eed3fe
fix: changed prop typing
barttom Jan 18, 2024
efaa3c8
Merge branch 'vit-tieredBankAccountFlow' of github.com:barttom/App-ex…
barttom Jan 18, 2024
fdc7aed
Merge branch 'main' of github.com:Expensify/App into vit-tieredBankAc…
barttom Jan 19, 2024
eca2209
fix: editing issue after coming back (#3)
MrMuzyk Jan 19, 2024
997149f
Feat/vbba prevent autosaving in editing mode (#6)
barttom Jan 22, 2024
8590e79
merge upstream vit-tieredBankAccountFlow
barttom Jan 22, 2024
418beef
VBBA setup - Plug BE fixes (step order, policyID saving) & remove con…
nkuoch Jan 23, 2024
3f3f590
fix: fixed translation for company type in business info summary
barttom Jan 23, 2024
9bf8205
merge upstream vit-tieredBankAccountFlow
barttom Jan 23, 2024
70d84be
fix: restore needed shouldSaveDraft prop in steps
barttom Jan 23, 2024
bef9dbf
Merge branch 'main' of github.com:Expensify/App into vit-tieredBankAc…
barttom Jan 23, 2024
a48104e
fix: added missed hint prop
barttom Jan 23, 2024
dbc5dd3
feat: final refactor tweaks (#7)
MrMuzyk Jan 24, 2024
72b80c5
Merge branch 'main' of github.com:Expensify/App into vit-tieredBankAc…
barttom Jan 24, 2024
b25007e
fix: changed top space in complete verification step (#9)
barttom Jan 24, 2024
567b6fc
merge upstream vit-tieredBankAccountFlow
barttom Jan 25, 2024
95ba920
fix: Batch of bug fixes (#8)
MrMuzyk Jan 25, 2024
9fc619f
Marcin/fix vbba cr bugs (#10)
Swor71 Jan 25, 2024
1877623
merge upstream vit-tieredBankAccountFlow
barttom Jan 25, 2024
671d363
chore: fixed after merge
barttom Jan 25, 2024
280c5db
feat: removed close button (#11)
MrMuzyk Jan 25, 2024
bc1784d
fix: fixed phone placeholder
barttom Jan 25, 2024
b7ff8e1
merge upstream vit-tieredBankAccountFlow
barttom Jan 26, 2024
fc2be36
chor: resolved common TS errors after merging main
barttom Jan 26, 2024
f4991ba
feat: Change business type selector from dropdown to list (#13)
MrMuzyk Jan 26, 2024
dda162b
feat: migrated interactiveStepSubHeader stroy to ts (#12)
Swor71 Jan 26, 2024
1d3a102
merge upstream vit-tieredBankAccountFlow
barttom Jan 26, 2024
dca6b06
fix: check new types for validation (#14)
barttom Jan 30, 2024
1b26775
merge upstream vit-tieredBankAccountFlow
barttom Jan 30, 2024
3ff7fb7
fix: fixed BankAccounts helpers after merge
barttom Jan 30, 2024
c1ed41f
fix: adjusted to merge chnages
barttom Jan 31, 2024
307ddf7
merge upstream vit-tieredBankAccountFlow
barttom Jan 31, 2024
eb343d2
fix: prettier
barttom Jan 31, 2024
b4b6927
fix: Styling fixes (#15)
MrMuzyk Jan 31, 2024
fbc5e7c
merge upstream vit-tieredBankAccountFlow
barttom Feb 1, 2024
b3c1f62
Merge branch 'main' of github.com:Expensify/App into vit-tieredBankAc…
barttom Feb 1, 2024
e2054e7
Merge branch 'main' of github.com:Expensify/App into vit-tieredBankAc…
barttom Feb 2, 2024
eecc985
Fix/refactor form types (#17)
barttom Feb 2, 2024
b6b7957
fix: removed empty files, added prop description
Swor71 Feb 2, 2024
f6d46be
merge upstream vit-tieredBankAccountFlow
barttom Feb 5, 2024
dc2cad8
fix: prettier
barttom Feb 5, 2024
6144d33
fix: more styling fixes (#16)
MrMuzyk Feb 5, 2024
a55680f
fix: removed unused newAchData param from goToWithdrawalAccountSetupStep
Swor71 Feb 5, 2024
3b606ad
chore: added basic description to useSubStep hook
Swor71 Feb 5, 2024
1f20c90
fix: fixed key name in ubo step
barttom Feb 5, 2024
63a2349
fix: wrap up checkbox
barttom Feb 5, 2024
2d889b6
merge upstream vit-tieredBankAccountFlow
barttom Feb 5, 2024
fa3b5b2
merge upstream vit-tieredBankAccountFlow
barttom Feb 6, 2024
3bf29c2
Merge branch 'main' of https://github.com/Expensify/App into fix/ts-f…
MrMuzyk Feb 6, 2024
9eb21ba
fix: error type check
MrMuzyk Feb 6, 2024
c3d63f9
Merge remote-tracking branch 'upstream/main' into bartek/vit-tieredBa…
Swor71 Feb 6, 2024
5ab9677
Merge branch 'vit-tieredBankAccountFlow' of github.com:barttom/App-ex…
MrMuzyk Feb 6, 2024
398d7ac
Merge pull request #18 from MrMuzyk/fix/ts-fixes
MrMuzyk Feb 6, 2024
12b559d
merge upstream vit-tieredBankAccountFlow
barttom Feb 7, 2024
9f060e6
fix: adjust to change from ValidationStep
barttom Feb 7, 2024
c03a1a2
fix: added minWIdth styels and variables for substep index (#19)
barttom Feb 7, 2024
e629706
fix: allow acc number change after going back from step 2 (#20)
MrMuzyk Feb 7, 2024
eb238f0
Merge branch 'main' of github.com:Expensify/App into vit-tieredBankAc…
barttom Feb 8, 2024
16a790e
fix: added removed icon
barttom Feb 8, 2024
4b01b2c
merge upstream vit-tieredBankAccountFlow
barttom Feb 9, 2024
cfc51cf
fix: removed duplicated icon
barttom Feb 9, 2024
4059b7f
fix: header and form spacing
MrMuzyk Feb 9, 2024
0312396
Merge branch 'vit-tieredBankAccountFlow' of github.com:barttom/App-ex…
MrMuzyk Feb 9, 2024
6da20e2
Merge pull request #21 from MrMuzyk/fix/header-styling
MrMuzyk Feb 9, 2024
2002e4d
fix: batch of submit button fixes and some other minor ones (#22)
MrMuzyk Feb 12, 2024
4145478
Merge branch 'main' of github.com:Expensify/App into vit-tieredBankAc…
barttom Feb 12, 2024
d6be353
Merge branch 'vit-tieredBankAccountFlow' of github.com:barttom/App-ex…
barttom Feb 12, 2024
36ba3b8
fix: added prop fo menu item icon
barttom Feb 12, 2024
c58d868
merge upstream vit-tieredBankAccountFlow
barttom Feb 13, 2024
1880215
fix: fixed types
barttom Feb 13, 2024
8e4a414
Fix/adding docs (#23)
barttom Feb 13, 2024
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
108 changes: 107 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,71 @@ const CONST = {
DOMAIN: '@expensify.sms',
},
BANK_ACCOUNT: {
BANK_INFO_STEP: {
INPUT_KEY: {
ROUTING_NUMBER: 'routingNumber',
ACCOUNT_NUMBER: 'accountNumber',
PLAID_MASK: 'plaidMask',
IS_SAVINGS: 'isSavings',
BANK_NAME: 'bankName',
PLAID_ACCOUNT_ID: 'plaidAccountID',
PLAID_ACCESS_TOKEN: 'plaidAccessToken',
},
},
PERSONAL_INFO_STEP: {
INPUT_KEY: {
FIRST_NAME: 'firstName',
LAST_NAME: 'lastName',
DOB: 'dob',
SSN_LAST_4: 'ssnLast4',
STREET: 'requestorAddressStreet',
CITY: 'requestorAddressCity',
STATE: 'requestorAddressState',
ZIP_CODE: 'requestorAddressZipCode',
},
},
BUSINESS_INFO_STEP: {
INPUT_KEY: {
COMPANY_NAME: 'companyName',
COMPANY_TAX_ID: 'companyTaxID',
COMPANY_WEBSITE: 'website',
COMPANY_PHONE: 'companyPhone',
STREET: 'addressStreet',
CITY: 'addressCity',
STATE: 'addressState',
ZIP_CODE: 'addressZipCode',
INCORPORATION_TYPE: 'incorporationType',
INCORPORATION_DATE: 'incorporationDate',
INCORPORATION_STATE: 'incorporationState',
HAS_NO_CONNECTION_TO_CANNABIS: 'hasNoConnectionToCannabis',
},
},
BENEFICIAL_OWNER_INFO_STEP: {
SUBSTEP: {
IS_USER_UBO: 1,
IS_ANYONE_ELSE_UBO: 2,
UBO_DETAILS_FORM: 3,
ARE_THERE_MORE_UBOS: 4,
UBOS_LIST: 5,
},
INPUT_KEY: {
OWNS_MORE_THAN_25_PERCENT: 'ownsMoreThan25Percent',
HAS_OTHER_BENEFICIAL_OWNERS: 'hasOtherBeneficialOwners',
BENEFICIAL_OWNERS: 'beneficialOwners',
},
BENEFICIAL_OWNER_DATA: {
BENEFICIAL_OWNER_KEYS: 'beneficialOwnerKeys',
PREFIX: 'beneficialOwner',
FIRST_NAME: 'firstName',
LAST_NAME: 'lastName',
DOB: 'dob',
SSN_LAST_4: 'ssnLast4',
STREET: 'street',
CITY: 'city',
STATE: 'state',
ZIP_CODE: 'zipCode',
},
},
PLAID: {
ALLOWED_THROTTLED_COUNT: 2,
ERROR: {
Expand All @@ -205,6 +270,13 @@ const CONST = {
EXIT: 'EXIT',
},
},
COMPLETE_VERIFICATION: {
INPUT_KEY: {
IS_AUTHORIZED_TO_USE_BANK_ACCOUNT: 'isAuthorizedToUseBankAccount',
CERTIFY_TRUE_INFORMATION: 'certifyTrueInformation',
ACCEPT_TERMS_AND_CONDITIONS: 'acceptTermsAndConditions',
},
},
ERROR: {
MISSING_ROUTING_NUMBER: '402 Missing routingNumber',
MAX_ROUTING_NUMBER: '402 Maximum Size Exceeded routingNumber',
Expand All @@ -214,14 +286,18 @@ const CONST = {
STEP: {
// In the order they appear in the VBA flow
BANK_ACCOUNT: 'BankAccountStep',
COMPANY: 'CompanyStep',
REQUESTOR: 'RequestorStep',
COMPANY: 'CompanyStep',
BENEFICIAL_OWNERS: 'BeneficialOwnersStep',
ACH_CONTRACT: 'ACHContractStep',
VALIDATION: 'ValidationStep',
ENABLE: 'EnableStep',
},
STEP_NAMES: ['1', '2', '3', '4', '5'],
STEPS_HEADER_HEIGHT: 40,
SUBSTEP: {
MANUAL: 'manual',
PLAID: 'plaid',
},
VERIFICATIONS: {
ERROR_MESSAGE: 'verifications.errorMessage',
Expand Down Expand Up @@ -493,6 +569,8 @@ const CONST = {
ONFIDO_FACIAL_SCAN_POLICY_URL: 'https://onfido.com/facial-scan-policy-and-release/',
ONFIDO_PRIVACY_POLICY_URL: 'https://onfido.com/privacy/',
ONFIDO_TERMS_OF_SERVICE_URL: 'https://onfido.com/terms-of-service/',
LIST_OF_RESTRICTED_BUSINESSES: 'https://community.expensify.com/discussion/6191/list-of-restricted-businesses',
barttom marked this conversation as resolved.
Show resolved Hide resolved

// Use Environment.getEnvironmentURL to get the complete URL with port number
DEV_NEW_EXPENSIFY_URL: 'https://dev.new.expensify.com:',
OLDDOT_URLS: {
Expand Down Expand Up @@ -3194,6 +3272,34 @@ const CONST = {
},

REPORT_FIELD_TITLE_FIELD_ID: 'text_title',

REIMBURSEMENT_ACCOUNT_SUBSTEP_INDEX: {
BANK_ACCOUNT: {
ACCOUNT_NUMBERS: 0,
},
PERSONAL_INFO: {
LEGAL_NAME: 0,
DATE_OF_BIRTH: 1,
SSN: 2,
ADDRESS: 3,
},
BUSINESS_INFO: {
BUSINESS_NAME: 0,
TAX_ID_NUMBER: 1,
COMPANY_WEBSITE: 2,
PHONE_NUMBER: 3,
COMPANY_ADDRESS: 4,
COMPANY_TYPE: 5,
INCORPORATION_DATE: 6,
INCORPORATION_STATE: 7,
},
UBO: {
LEGAL_NAME: 0,
DATE_OF_BIRTH: 1,
SSN: 2,
ADDRESS: 3,
},
},
} as const;

type Country = keyof typeof CONST.ALL_COUNTRIES;
Expand Down
6 changes: 4 additions & 2 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ const ONYXKEYS = {

/** Token needed to initialize Onfido */
ONFIDO_TOKEN: 'onfidoToken',
ONFIDO_APPLICANT_ID: 'onfidoApplicantID',

/** Indicates which locale should be used */
NVP_PREFERRED_LOCALE: 'preferredLocale',
Expand Down Expand Up @@ -426,6 +427,7 @@ type OnyxValues = {
[ONYXKEYS.IS_PLAID_DISABLED]: boolean;
[ONYXKEYS.PLAID_LINK_TOKEN]: string;
[ONYXKEYS.ONFIDO_TOKEN]: string;
[ONYXKEYS.ONFIDO_APPLICANT_ID]: string;
[ONYXKEYS.NVP_PREFERRED_LOCALE]: OnyxTypes.Locale;
[ONYXKEYS.USER_WALLET]: OnyxTypes.UserWallet;
[ONYXKEYS.WALLET_ONFIDO]: OnyxTypes.WalletOnfido;
Expand Down Expand Up @@ -563,8 +565,8 @@ type OnyxValues = {
[ONYXKEYS.FORMS.REPORT_FIELD_EDIT_FORM]: OnyxTypes.ReportFieldEditForm;
[ONYXKEYS.FORMS.REPORT_FIELD_EDIT_FORM_DRAFT]: OnyxTypes.Form;
// @ts-expect-error Different values are defined under the same key: ReimbursementAccount and ReimbursementAccountForm
[ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM]: OnyxTypes.Form;
[ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT]: OnyxTypes.Form;
[ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM]: OnyxTypes.ReimbursementAccountForm;
[ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT]: OnyxTypes.ReimbursementAccountForm;
[ONYXKEYS.FORMS.PERSONAL_BANK_ACCOUNT]: OnyxTypes.PersonalBankAccount;
[ONYXKEYS.FORMS.PERSONAL_BANK_ACCOUNT_DRAFT]: OnyxTypes.PersonalBankAccount;
};
Expand Down
74 changes: 71 additions & 3 deletions src/components/AddPlaidBankAccount.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React, {useCallback, useEffect, useRef} from 'react';
import React, {useCallback, useEffect, useRef, useState} from 'react';
import {ActivityIndicator, View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
Expand All @@ -16,10 +16,12 @@ import * as BankAccounts from '@userActions/BankAccounts';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import FullPageOfflineBlockingView from './BlockingViews/FullPageOfflineBlockingView';
import FormHelpMessage from './FormHelpMessage';
import Icon from './Icon';
import getBankIcon from './Icon/BankIcons';
import Picker from './Picker';
import PlaidLink from './PlaidLink';
import RadioButtons from './RadioButtons';
import Text from './Text';

const propTypes = {
Expand Down Expand Up @@ -55,6 +57,15 @@ const propTypes = {

/** Are we adding a withdrawal account? */
allowDebit: PropTypes.bool,

/** Is displayed in new VBBA */
isDisplayedInNewVBBA: PropTypes.bool,

/** Text to display on error message */
errorText: PropTypes.string,

/** Function called whenever radio button value changes */
onInputChange: PropTypes.func,
};

const defaultProps = {
Expand All @@ -68,6 +79,9 @@ const defaultProps = {
allowDebit: false,
bankAccountID: 0,
isPlaidDisabled: false,
isDisplayedInNewVBBA: false,
errorText: '',
onInputChange: () => {},
};

function AddPlaidBankAccount({
Expand All @@ -82,11 +96,23 @@ function AddPlaidBankAccount({
bankAccountID,
allowDebit,
isPlaidDisabled,
isDisplayedInNewVBBA,
errorText,
onInputChange,
}) {
const theme = useTheme();
const styles = useThemeStyles();
const plaidBankAccounts = lodashGet(plaidData, 'bankAccounts', []);
const defaultSelectedPlaidAccount = _.find(plaidBankAccounts, (account) => account.plaidAccountID === selectedPlaidAccountID);
const defaultSelectedPlaidAccountID = lodashGet(defaultSelectedPlaidAccount, 'plaidAccountID', '');
const defaultSelectedPlaidAccountMask = lodashGet(
_.find(plaidBankAccounts, (account) => account.plaidAccountID === selectedPlaidAccountID),
'mask',
'',
);
const subscribedKeyboardShortcuts = useRef([]);
const previousNetworkState = useRef();
const [selectedPlaidAccountMask, setSelectedPlaidAccountMask] = useState(defaultSelectedPlaidAccountMask);

const {translate} = useLocalize();
const {isOffline} = useNetwork();
Expand Down Expand Up @@ -162,17 +188,28 @@ function AddPlaidBankAccount({
previousNetworkState.current = isOffline;
}, [allowDebit, bankAccountID, isAuthenticatedWithPlaid, isOffline]);

const plaidBankAccounts = lodashGet(plaidData, 'bankAccounts') || [];
const token = getPlaidLinkToken();
const options = _.map(plaidBankAccounts, (account) => ({
value: account.plaidAccountID,
label: `${account.addressName} ${account.mask}`,
label: account.addressName,
}));
const {icon, iconSize, iconStyles} = getBankIcon({styles});
const plaidErrors = lodashGet(plaidData, 'errors');
const plaidDataErrorMessage = !_.isEmpty(plaidErrors) ? _.chain(plaidErrors).values().first().value() : '';
const bankName = lodashGet(plaidData, 'bankName');

/**
* @param {String} plaidAccountID
*
* When user selects one of plaid accounts we need to set the mask in order to display it on UI
*/
const handleSelectingPlaidAccount = (plaidAccountID) => {
const mask = _.find(plaidBankAccounts, (account) => account.plaidAccountID === plaidAccountID).mask;
setSelectedPlaidAccountMask(mask);
onSelect(plaidAccountID);
onInputChange(plaidAccountID);
};

if (isPlaidDisabled) {
return (
<View>
Expand Down Expand Up @@ -239,6 +276,37 @@ function AddPlaidBankAccount({
return <FullPageOfflineBlockingView>{renderPlaidLink()}</FullPageOfflineBlockingView>;
}

if (isDisplayedInNewVBBA) {
return (
<FullPageOfflineBlockingView>
<Text style={[styles.mb3, styles.textHeadline]}>{translate('bankAccount.chooseAnAccount')}</Text>
{!_.isEmpty(text) && <Text style={[styles.mb6, styles.textSupporting]}>{text}</Text>}
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mb6]}>
<Icon
src={icon}
height={iconSize}
width={iconSize}
additionalStyles={iconStyles}
/>
<View>
<Text style={[styles.ml3, styles.textStrong]}>{bankName}</Text>
{selectedPlaidAccountMask.length > 0 && (
<Text style={[styles.ml3, styles.textLabelSupporting]}>{`${translate('bankAccount.accountEnding')} ${selectedPlaidAccountMask}`}</Text>
)}
</View>
</View>
<Text style={[styles.textLabelSupporting]}>{`${translate('bankAccount.chooseAnAccountBelow')}:`}</Text>
<RadioButtons
items={options}
defaultCheckedValue={defaultSelectedPlaidAccountID}
onPress={handleSelectingPlaidAccount}
radioButtonStyle={[styles.mb6]}
/>
<FormHelpMessage message={errorText} />
</FullPageOfflineBlockingView>
);
}

// Plaid bank accounts view
return (
<FullPageOfflineBlockingView>
Expand Down
43 changes: 41 additions & 2 deletions src/components/DatePicker/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import {setYear} from 'date-fns';
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, {forwardRef, useState} from 'react';
import React, {forwardRef, useEffect, useState} from 'react';
import {View} from 'react-native';
import * as Expensicons from '@components/Icon/Expensicons';
import refPropTypes from '@components/refPropTypes';
import TextInput from '@components/TextInput';
import {propTypes as baseTextInputPropTypes, defaultProps as defaultBaseTextInputPropTypes} from '@components/TextInput/BaseTextInput/baseTextInputPropTypes';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import * as FormActions from '@userActions/FormActions';
import CONST from '@src/CONST';
import CalendarPicker from './CalendarPicker';

Expand Down Expand Up @@ -42,6 +43,12 @@ const propTypes = {
/** A function that is passed by FormWrapper */
onTouched: PropTypes.func.isRequired,

/** Saves a draft of the input value when used in a form */
shouldSaveDraft: PropTypes.bool,

/** ID of the wrapping form */
formID: PropTypes.string,

...baseTextInputPropTypes,
};

Expand All @@ -50,9 +57,28 @@ const datePickerDefaultProps = {
minDate: setYear(new Date(), CONST.CALENDAR_PICKER.MIN_YEAR),
maxDate: setYear(new Date(), CONST.CALENDAR_PICKER.MAX_YEAR),
value: undefined,
shouldSaveDraft: false,
formID: '',
};

function DatePicker({forwardedRef, containerStyles, defaultValue, disabled, errorText, inputID, isSmallScreenWidth, label, maxDate, minDate, onInputChange, onTouched, placeholder, value}) {
function DatePicker({
forwardedRef,
containerStyles,
defaultValue,
disabled,
errorText,
inputID,
isSmallScreenWidth,
label,
maxDate,
minDate,
onInputChange,
onTouched,
placeholder,
value,
shouldSaveDraft,
formID,
}) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const [selectedDate, setSelectedDate] = useState(value || defaultValue || undefined);
Expand All @@ -67,6 +93,19 @@ function DatePicker({forwardedRef, containerStyles, defaultValue, disabled, erro
setSelectedDate(newValue);
};

useEffect(() => {
// Value is provided to input via props and onChange never fires. We have to save draft manually.
if (shouldSaveDraft && formID !== '') {
FormActions.setDraftValues(formID, {[inputID]: selectedDate});
}

if (selectedDate === value || _.isUndefined(value)) {
return;
}

setSelectedDate(value);
}, [formID, inputID, selectedDate, shouldSaveDraft, value]);

return (
<View style={styles.datePickerRoot}>
<View style={[isSmallScreenWidth ? styles.flex2 : {}, styles.pointerEventsNone]}>
Expand Down
Loading
Loading