Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
81e594c
step 3 implementation applied
burczu Nov 25, 2024
5f213c7
getting corpay onboarding fields call added to signer info page
burczu Nov 25, 2024
aadaf97
unnecessary api call prevented
burczu Nov 26, 2024
8aaecc4
save corpay onboarding director information endpoint handling
burczu Nov 27, 2024
a1f0be5
prettier fixes
burczu Dec 2, 2024
8c0dff5
save director information api call temp
burczu Dec 6, 2024
fa24353
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Dec 10, 2024
5801d10
Merge branch 'feat/step-3-logic' into feat/50907-GR-Phase3-Step5-nav-…
burczu Dec 10, 2024
cb68762
duplicated import removed
burczu Dec 10, 2024
4d18148
switched to destination country
burczu Dec 10, 2024
68de54a
Merge branch 'feat/step-4-logic' into feat/50907-GR-Phase3-Step5-nav-…
burczu Dec 11, 2024
50a07f6
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Dec 11, 2024
5172a67
Merge branch 'feat/step-4-logic' into feat/50907-GR-Phase3-Step5-nav-…
burczu Dec 13, 2024
df189c0
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Jan 7, 2025
e9d25fe
Merge branch 'feat/step-4-logic' into feat/50907-GR-Phase3-Step5-nav-…
burczu Jan 7, 2025
dcdbe8f
sending documents added
burczu Jan 8, 2025
62e531a
onyx data handling added to the save director information action
burczu Jan 8, 2025
eb9681b
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Jan 8, 2025
531be87
body content usage fixed
burczu Jan 9, 2025
e65b3c3
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Jan 9, 2025
93444f5
use callback wrapper utilized
burczu Jan 9, 2025
993afee
Merge branch 'feat/step-4-logic' into feat/50907-GR-Phase3-Step5-nav-…
burczu Jan 17, 2025
517f4af
removing files fixed
burczu Jan 20, 2025
3f4a312
error utils usage fixed
burczu Jan 20, 2025
7e8bb10
uploading documents improved
burczu Jan 20, 2025
9498a17
temporary files
burczu Jan 21, 2025
4f9903b
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 3, 2025
68908c4
Merge branch 'feat/step-4-logic' into feat/50907-GR-Phase3-Step5-nav-…
burczu Feb 3, 2025
0ffd2f0
address page added
burczu Feb 3, 2025
adbe1db
temporary skipping step 4
burczu Feb 4, 2025
ac45216
address added to the confirmation substep
burczu Feb 4, 2025
10f36d8
wip: merging signer address from onyx and draft
burczu Feb 4, 2025
3cd18dc
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 4, 2025
f306b4a
Merge branch 'feat/step-4-logic' into feat/50907-GR-Phase3-Step5-nav-…
burczu Feb 4, 2025
fbe81a2
get signer address value extracted to separate utils and wrapped up
burczu Feb 5, 2025
ef0969f
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 5, 2025
c4ce465
get signer details and files utility method scaffolded
burczu Feb 5, 2025
8231d04
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 5, 2025
3a43bc7
step 4 enabled back
burczu Feb 7, 2025
1defa28
address prefixes adjusted to new reqs
burczu Feb 7, 2025
6adcb61
signer data shape adjusted
burczu Feb 7, 2025
d92f373
signer details helper created
burczu Feb 7, 2025
670bbb2
new version of signer params
burczu Feb 7, 2025
6e2bb38
signer info helper refactored
burczu Feb 7, 2025
84accc3
save signer info API call adjusted to the new shape of payload
burczu Feb 7, 2025
cd985d8
calling API call with data prepared with new helper
burczu Feb 7, 2025
901dabe
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 7, 2025
5d45d74
address component adjusted to the new Onyx keys shape
burczu Feb 10, 2025
45c65cb
getting address values fixed
burczu Feb 10, 2025
976e41d
getting signer details for signer info fixed
burczu Feb 10, 2025
023aaa9
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 10, 2025
080492b
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 11, 2025
73a9bdf
unnecessary address helper removed
burczu Feb 11, 2025
27ed2ec
collecting signer email as account primary login added
burczu Feb 11, 2025
0f92358
occupation step added
burczu Feb 12, 2025
7dd79a0
reimbursement account form signer info type adjusted
burczu Feb 12, 2025
b4e4cce
collecting additional data of current user handled
burczu Feb 12, 2025
0bb82d2
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 12, 2025
b56ec2c
proof of directors collecting added
burczu Feb 12, 2025
4bc87bb
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 13, 2025
692ed1d
upload signer info files depending on country (WIP)
burczu Feb 13, 2025
00ecd67
missing file uploaders added
burczu Feb 13, 2025
b60d7ac
confirmation step cleanup
burczu Feb 13, 2025
5b29968
confirmation page addjusted to the new payload shape
burczu Feb 14, 2025
03164a2
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 14, 2025
ca6e1fe
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 17, 2025
4301087
director details flow added [WIP]
burczu Feb 18, 2025
c332975
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 18, 2025
d2ec22b
prettier changes
burczu Feb 18, 2025
9d5cb3d
collecting additional directors details substeps
burczu Feb 18, 2025
387f52a
directors details substeps cleanup
burczu Feb 18, 2025
47ee7d6
enter email component fixed
burczu Feb 20, 2025
de3d4b2
missing second signer corpay field added
burczu Feb 20, 2025
eb2d71c
multiple directors list confirmation page added (WIP)
burczu Feb 20, 2025
732321a
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 20, 2025
0f94f41
filtering current user from additional directors list
burczu Feb 20, 2025
7a6c3e2
additional directors handling when it comes to the API call
burczu Feb 21, 2025
6aecc0e
unnecessary comment removed
burczu Feb 21, 2025
2682f12
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 21, 2025
650ae0a
flow changed to handle only one additional director
burczu Feb 21, 2025
62a3629
prettier fixes
burczu Feb 24, 2025
5082896
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 24, 2025
c8e3288
additional fixes after merge
burczu Feb 24, 2025
92b9c38
linter fixes
burczu Feb 24, 2025
caf125a
unnecessary console.logs removed
burczu Feb 24, 2025
ed1041f
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Feb 25, 2025
6b9c338
linting error fixed
burczu Feb 25, 2025
3b5f0ea
typescript fixes
burczu Feb 25, 2025
6809597
editing additional director fix
burczu Feb 25, 2025
d17d902
resetting director details form on entering edit mode added
burczu Feb 25, 2025
6495bb2
is loading handling while saving signer info added (wip)
burczu Feb 26, 2025
078dafe
upload documents fixed
burczu Feb 26, 2025
829dc2d
typings fix
burczu Feb 26, 2025
4dc7c26
showing loading indicator while saving
burczu Feb 26, 2025
a9c709d
signer and director prefixes added to consts
burczu Feb 27, 2025
3189471
upload files step polished
burczu Feb 27, 2025
4a113f8
document uploading styling fixed
burczu Feb 27, 2025
4c05d58
missing director prefix usage fixed
burczu Feb 28, 2025
79a1bba
additional prefix fix
burczu Feb 28, 2025
2f3d7c8
get values for signer info director key obtaining fixed
burczu Mar 3, 2025
1b08715
typo fixed
burczu Mar 4, 2025
6548b70
typecheck issues fixed
burczu Mar 4, 2025
4569320
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 4, 2025
c7115da
typings fix after merge
burczu Mar 4, 2025
72fb766
linting errors fixed
burczu Mar 4, 2025
8f01114
prettier fixed
burczu Mar 4, 2025
0bef699
error handling on documents uploading page added
burczu Mar 5, 2025
7ad6814
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 5, 2025
bfd2518
using beneficial owner data for signer when applicable
burczu Mar 5, 2025
97a4de7
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 5, 2025
784c114
linter errors fixed
burczu Mar 5, 2025
a643b50
prettier errors fixed
burczu Mar 5, 2025
013c51f
upload documents slightly fixed
burczu Mar 6, 2025
48ee7a2
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 6, 2025
37dd2d5
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 7, 2025
d6b4c91
occupation field at confirmation page fixed
burczu Mar 7, 2025
8172a4c
typing fix
burczu Mar 10, 2025
716fd1b
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 10, 2025
6d5e1fc
beneficial owner data collecting fixed
burczu Mar 10, 2025
7ef3fa6
back button handling fixed
burczu Mar 10, 2025
e93bd14
different copy for sub-steps when collecting director details
burczu Mar 11, 2025
20d1d81
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 11, 2025
2feed69
paddings fixed on upload page separators
burczu Mar 11, 2025
3600887
separator padding fixed on document upload on step 4
burczu Mar 11, 2025
68f4e8e
useCallback deps list updated
burczu Mar 12, 2025
2f1d6dc
prettier fix
burczu Mar 12, 2025
c897ef7
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 12, 2025
aa3ee62
missing optional properties added to API params
burczu Mar 12, 2025
da82bec
unnecessary comment removed
burczu Mar 12, 2025
92145f2
director list translation props added (WIP)
burczu Mar 12, 2025
f518db8
sub-steps director's flow translations (WIP)
burczu Mar 12, 2025
b584f06
missing comma
burczu Mar 12, 2025
1f214d1
add additional director translations added (WIP)
burczu Mar 12, 2025
07641ef
unnecessary comment removed
burczu Mar 12, 2025
9dfd2a7
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 14, 2025
04a9374
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 17, 2025
0b14888
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 20, 2025
97780f2
country step country value fixed on upload file
burczu Mar 21, 2025
7974137
occupation error message fixed (WIP)
burczu Mar 21, 2025
463f7da
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 21, 2025
1c628f5
merge from main
burczu Mar 21, 2025
15e8041
Merge remote-tracking branch 'origin/main' into feat/50907-GR-Phase3-…
burczu Mar 25, 2025
5e7be4f
prd and fsg needed check fixed
burczu Mar 25, 2025
669e260
FSDandPDS typo fixed
burczu Mar 25, 2025
8948c3b
proof of directors copy
burczu Mar 26, 2025
6c0dbbb
copy of ID copy
burczu Mar 26, 2025
f56315f
codice fiscale copy
burczu Mar 26, 2025
85e0900
pds and fsg copy
burczu Mar 26, 2025
7090355
switched to download button (WIP)
burczu Mar 26, 2025
4917ffc
Merge remote-tracking branch 'origin/main' into feat/50907-GR-Phase3-…
burczu Mar 26, 2025
c75c10b
download button alignment fixed
burczu Mar 27, 2025
88fd779
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 27, 2025
10a7d86
collecting PRD & FSG removed for now
burczu Mar 27, 2025
2bfec19
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 28, 2025
144faaf
prettier fixes
burczu Mar 28, 2025
d2a1001
tscheck fix
burczu Mar 28, 2025
12cab81
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Mar 31, 2025
7bd4687
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Apr 1, 2025
f59e949
switch to file uploads per director - first step
burczu Apr 1, 2025
8d1850f
showing upload file page for other director
burczu Apr 1, 2025
d1b3db0
passing files correctly
burczu Apr 2, 2025
e41a0da
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Apr 2, 2025
f559b8c
file limit introduced
burczu Apr 2, 2025
a5aaf92
name step component simplified
burczu Apr 3, 2025
e72bc26
job title step component simplified
burczu Apr 3, 2025
8f2ea26
occupation step component removed
burczu Apr 3, 2025
5fdf868
additional director flow removed from index
burczu Apr 3, 2025
becfd1d
payload creating adjusted to simplified version
burczu Apr 4, 2025
1274de0
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Apr 7, 2025
cf6dc67
step 5 for Australia handling fixed
burczu Apr 7, 2025
f3b20a3
correctly redirecting to the provide email page for AUD
burczu Apr 8, 2025
699db44
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Apr 8, 2025
5cb0164
prettier fixes
burczu Apr 8, 2025
9082b05
liting fixes
burczu Apr 8, 2025
490b5f8
unnecessary translations removed
burczu Apr 8, 2025
3bcfadb
eslint error fixed
burczu Apr 8, 2025
669f800
items order on confirmation page fixed
burczu Apr 8, 2025
893b59b
JamieGPT translations added
burczu Apr 8, 2025
1dd5ac9
prettier fix
burczu Apr 9, 2025
0e373e1
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Apr 9, 2025
6222833
loading and errors handling inside the confirmation page added
burczu Apr 9, 2025
983a496
error handling fixed
burczu Apr 9, 2025
738da05
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Apr 11, 2025
9d31c9f
CAD case fixed
burczu Apr 11, 2025
cc49908
Merge branch 'main' into feat/50907-GR-Phase3-Step5-nav-api-call
burczu Apr 14, 2025
8c5309b
unnecessary skip of file uploads removed
burczu Apr 14, 2025
6082db3
allow multiple issue fixed
burczu Apr 14, 2025
2f8bc03
spanish translations updated
burczu Apr 15, 2025
14a3028
unnecessary directorIDs property removed from payload
burczu Apr 15, 2025
52f961a
hook deps fixed
burczu Apr 15, 2025
60d7a02
unnecessary code removed
burczu Apr 15, 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
23 changes: 21 additions & 2 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ const CONST = {
FILE_LIMIT: 10,
TOTAL_FILES_SIZE_LIMIT: 5242880,
PURPOSE_OF_TRANSACTION_ID: 'Intercompany_Payment',
CURRENT_USER_KEY: 'currentUser',
STEP: {
COUNTRY: 'CountryStep',
BANK_INFO: 'BankInfoStep',
Expand Down Expand Up @@ -734,7 +735,6 @@ const CONST = {
FULL_NAME: 'fullName',
RESIDENTIAL_ADDRESS: 'residentialAddress',
},
CURRENT_USER_KEY: 'currentUser',
},
STEP_NAMES: ['1', '2', '3', '4', '5', '6'],
STEP_HEADER_HEIGHT: 40,
Expand All @@ -743,7 +743,26 @@ const CONST = {
IS_DIRECTOR: 1,
ENTER_EMAIL: 2,
SIGNER_DETAILS_FORM: 3,
HANG_TIGHT: 4,
DIRECTOR_DETAILS_FORM: 4,
HANG_TIGHT: 5,
},
SIGNER_INFO_DATA: {
SIGNER_PREFIX: 'signer',
FULL_NAME: 'signerFullName',
DATE_OF_BIRTH: 'signerDateOfBirth',
JOB_TITLE: 'signerJobTitle',
EMAIL: 'signerEmail',
ADDRESS: 'signerCompleteResidentialAddress',
STREET: 'signer_street',
CITY: 'signer_city',
STATE: 'signer_state',
ZIP_CODE: 'signer_zipCode',
COUNTRY: 'signer_nationality',
PROOF_OF_DIRECTORS: 'proofOfDirectors',
COPY_OF_ID: 'signerCopyOfID',
ADDRESS_PROOF: 'signerAddressProof',
CODICE_FISCALE: 'signerCodiceFiscale',
DOWNLOADED_PDS_AND_FSG: 'downloadedPDSandFSG',
},
},
BANK_INFO_STEP_ACCOUNT_HOLDER_KEY_PREFIX: 'accountHolder',
Expand Down
6 changes: 3 additions & 3 deletions src/components/UploadFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {ValueOf} from 'type-fest';
import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import * as FileUtils from '@libs/fileDownload/FileUtils';
import {splitExtensionFromFileName} from '@libs/fileDownload/FileUtils';
import CONST from '@src/CONST';
import type {FileObject} from './AttachmentModal';
import AttachmentPicker from './AttachmentPicker';
Expand Down Expand Up @@ -86,7 +86,7 @@ function UploadFile({
}

if (acceptedFileTypes.length > 0) {
const filesExtensions = files.map((file) => FileUtils.splitExtensionFromFileName(file?.name ?? '').fileExtension.toLowerCase());
const filesExtensions = files.map((file) => splitExtensionFromFileName(file?.name ?? '').fileExtension.toLowerCase());

if (acceptedFileTypes.every((element) => !filesExtensions.includes(element as string))) {
setError(translate('attachmentPicker.notAllowedExtension'));
Expand All @@ -108,7 +108,7 @@ function UploadFile({
<AttachmentPicker
acceptedFileTypes={acceptedFileTypes}
fileLimit={fileLimit}
allowMultiple={!!fileLimit}
allowMultiple={fileLimit > 1}
>
{({openPicker}) => (
<Button
Expand Down
12 changes: 10 additions & 2 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2675,18 +2675,26 @@ const translations = {
jobTitle: 'Job title',
whatsYourDOB: "What's your date of birth?",
uploadID: 'Upload ID and proof of address',
id: "ID (driver's license or passport)",
personalAddress: 'Proof of personal address (e.g. utility bill)',
letsDoubleCheck: 'Let’s double check that everything looks right.',
legalName: 'Legal name',
proofOf: 'Proof of personal address',
enterOneEmail: 'Enter the email of director or senior officer at',
regulationRequiresOneMoreDirector: 'Regulation requires one more director or senior officer as a signer.',
regulationRequiresOneMoreDirector: 'Regulation requires at least more director or senior officer as a signer.',
hangTight: 'Hang tight...',
enterTwoEmails: 'Enter the emails of two directors or senior officers at',
sendReminder: 'Send a reminder',
chooseFile: 'Choose file',
weAreWaiting: "We're waiting for others to verify their identities as directors or senior officers of the business.",
id: 'Copy of ID',
proofOfDirectors: 'Proof of director(s)',
proofOfDirectorsDescription: 'Examples: Oncorp Corporate Profile or Business Registration.',
codiceFiscale: 'Codice Fiscale',
codiceFiscaleDescription: 'Codice Fiscale for Signatories, Authorized Users and Beneficial Owners.',
PDSandFSG: 'PDS + FSG disclosure paperwork',
PDSandFSGDescription:
"Our partnership with Corpay utilizes an API connection to take advantage of their vast network of international banking partners to power Global Reimbursements in Expensify. As per Australian regulation we are providing you with Corpay's Financial Services Guide (FSG) and Product Disclosure Statement (PDS).\n\nPlease read the FSG and PDS documents carefully as they contain full details and important information on the products and services Corpay offers. Retain these documents for future reference.",
pleaseUpload: 'Please upload additional documentation below to help us verify your identity as a director or senior officer of the business entity.',
},
agreementsStep: {
agreements: 'Agreements',
Expand Down
10 changes: 9 additions & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2698,7 +2698,6 @@ const translations = {
jobTitle: 'Título profesional',
whatsYourDOB: '¿Cual es tu fecha de nacimiento?',
uploadID: 'Subir documento de identidad y prueba de domicilio',
id: 'Identificación (licencia de conducir o pasaporte)',
personalAddress: 'Prueba de domicilio personal (por ejemplo, factura de servicios públicos)',
letsDoubleCheck: 'Vamos a verificar que todo esté correcto.',
legalName: 'Nombre legal',
Expand All @@ -2710,6 +2709,15 @@ const translations = {
sendReminder: 'Enviar un recordatorio',
chooseFile: 'Seleccionar archivo',
weAreWaiting: 'Estamos esperando que otros verifiquen sus identidades como directores o altos funcionarios de la empresa.',
id: 'Copia de identificación',
proofOfDirectors: 'Prueba de director(es)',
proofOfDirectorsDescription: 'Ejemplos: Perfil Corporativo de Oncorp o Registro Comercial.',
codiceFiscale: 'Codice Fiscale',
codiceFiscaleDescription: 'Codice Fiscale para firmantes, usuarios autorizados y beneficiarios finales.',
PDSandFSG: 'Documentación de divulgación PDS + FSG',
PDSandFSGDescription:
'Nuestra colaboración con Corpay utiliza una conexión API para aprovechar su amplia red de socios bancarios internacionales y facilitar los reembolsos globales en Expensify. Según la normativa australiana, te proporcionamos la Guía de Servicios Financieros (FSG) y el Documento de Divulgación del Producto (PDS) de Corpay.\n\nPor favor, lee detenidamente los documentos FSG y PDS, ya que contienen información completa e importante sobre los productos y servicios que ofrece Corpay. Conserva estos documentos para futuras consultas.',
pleaseUpload: 'Sube documentación adicional a continuación para ayudarnos a verificar tu identidad como director o alto ejecutivo de la entidad comercial.',
},
agreementsStep: {
agreements: 'Acuerdos',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type {FileObject} from '@components/AttachmentModal';

type SaveCorpayOnboardingDirectorInformationParams = {
inputs: string;
proofOfDirectors?: FileObject;
addressProof?: FileObject;
copyOfID?: FileObject;
codiceFiscaleTaxID?: FileObject;
bankAccountID: number;
};

export default SaveCorpayOnboardingDirectorInformationParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ export type {default as GetCorpayOnboardingFieldsParams} from './GetCorpayOnboar
export type {SaveCorpayOnboardingCompanyDetailsParams} from './SaveCorpayOnboardingCompanyDetailsParams';
export type {default as AcceptSpotnanaTermsParams} from './AcceptSpotnanaTermsParams';
export type {default as SaveCorpayOnboardingBeneficialOwnerParams} from './SaveCorpayOnboardingBeneficialOwnerParams';
export type {default as SaveCorpayOnboardingDirectorInformationParams} from './SaveCorpayOnboardingDirectorInformationParams';
export type {default as MoveIOUReportToPolicyAndInviteSubmitterParams} from './MoveIOUReportToPolicyAndInviteSubmitterParams';
export type {default as MoveIOUReportToExistingPolicyParams} from './MoveIOUReportToExistingPolicyParams';
export type {default as ChangeReportPolicyParams} from './ChangeReportPolicyParams';
Expand Down
7 changes: 5 additions & 2 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ const WRITE_COMMANDS = {
RESET_SMS_DELIVERY_FAILURE_STATUS: 'ResetSMSDeliveryFailureStatus',
SAVE_CORPAY_ONBOARDING_COMPANY_DETAILS: 'SaveCorpayOnboardingCompanyDetails',
SAVE_CORPAY_ONBOARDING_BENEFICIAL_OWNER: 'SaveCorpayOnboardingBeneficialOwner',
SAVE_CORPAY_ONBOARDING_DIRECTOR_INFORMATION: 'SaveCorpayOnboardingDirectorInformation',
CHANGE_REPORT_POLICY: 'ChangeReportPolicy',
SEND_RECAP_IN_ADMINS_ROOM: 'SendRecapInAdminsRoom',
COMPLETE_CONCIERGE_CALL: 'CompleteConciergeCall',
Expand Down Expand Up @@ -797,6 +798,8 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.UPDATE_SUBSCRIPTION_SIZE]: Parameters.UpdateSubscriptionSizeParams;
[WRITE_COMMANDS.REQUEST_TAX_EXEMPTION]: null;
[WRITE_COMMANDS.GET_CORPAY_BANK_ACCOUNT_FIELDS]: Parameters.GetCorpayBankAccountFieldsParams;
[WRITE_COMMANDS.SAVE_CORPAY_ONBOARDING_BENEFICIAL_OWNER]: Parameters.SaveCorpayOnboardingBeneficialOwnerParams;
[WRITE_COMMANDS.SAVE_CORPAY_ONBOARDING_DIRECTOR_INFORMATION]: Parameters.SaveCorpayOnboardingDirectorInformationParams;
[WRITE_COMMANDS.UPDATE_WORKSPACE_CUSTOM_UNIT]: Parameters.UpdateWorkspaceCustomUnitParams;
[WRITE_COMMANDS.RESET_SMS_DELIVERY_FAILURE_STATUS]: Parameters.ResetSMSDeliveryFailureStatusParams;
[WRITE_COMMANDS.SAVE_CORPAY_ONBOARDING_COMPANY_DETAILS]: Parameters.SaveCorpayOnboardingCompanyDetailsParams;
Expand Down Expand Up @@ -1008,8 +1011,8 @@ const READ_COMMANDS = {
START_ISSUE_NEW_CARD_FLOW: 'StartIssueNewCardFlow',
OPEN_CARD_DETAILS_PAGE: 'OpenCardDetailsPage',
GET_ASSIGNED_SUPPORT_DATA: 'GetAssignedSupportData',
OPEN_WORKSPACE_PLAN_PAGE: 'OpenWorkspacePlanPage',
GET_CORPAY_ONBOARDING_FIELDS: 'GetCorpayOnboardingFields',
OPEN_WORKSPACE_PLAN_PAGE: 'OpenWorkspacePlanPage',
OPEN_SECURITY_SETTINGS_PAGE: 'OpenSecuritySettingsPage',
} as const;

Expand Down Expand Up @@ -1079,8 +1082,8 @@ type ReadCommandParameters = {
[READ_COMMANDS.START_ISSUE_NEW_CARD_FLOW]: Parameters.StartIssueNewCardFlowParams;
[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;
[READ_COMMANDS.OPEN_WORKSPACE_PLAN_PAGE]: Parameters.OpenWorkspacePlanPageParams;
[READ_COMMANDS.OPEN_SECURITY_SETTINGS_PAGE]: null;
};

Expand Down
45 changes: 45 additions & 0 deletions src/libs/actions/BankAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {
VerifyIdentityForBankAccountParams,
} from '@libs/API/parameters';
import type {SaveCorpayOnboardingCompanyDetails} from '@libs/API/parameters/SaveCorpayOnboardingCompanyDetailsParams';
import type SaveCorpayOnboardingDirectorInformationParams from '@libs/API/parameters/SaveCorpayOnboardingDirectorInformationParams';
import {READ_COMMANDS, SIDE_EFFECT_REQUEST_COMMANDS, WRITE_COMMANDS} from '@libs/API/types';
import {getMicroSecondOnyxErrorWithTranslationKey} from '@libs/ErrorUtils';
import {translateLocal} from '@libs/Localize';
Expand Down Expand Up @@ -546,6 +547,44 @@ function saveCorpayOnboardingBeneficialOwners(parameters: SaveCorpayOnboardingBe
return API.write(WRITE_COMMANDS.SAVE_CORPAY_ONBOARDING_BENEFICIAL_OWNER, parameters, onyxData);
}

function saveCorpayOnboardingDirectorInformation(parameters: SaveCorpayOnboardingDirectorInformationParams) {
const onyxData: OnyxData = {
optimisticData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
value: {
isSavingCorpayOnboardingDirectorInformation: true,
errors: null,
},
},
],
successData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
value: {
isSavingCorpayOnboardingDirectorInformation: false,
isSuccess: true,
},
},
],
failureData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
value: {
isSavingCorpayOnboardingDirectorInformation: false,
isSuccess: false,
errors: getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'),
},
},
],
};

return API.write(WRITE_COMMANDS.SAVE_CORPAY_ONBOARDING_DIRECTOR_INFORMATION, parameters, onyxData);
}

function clearReimbursementAccount() {
Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, null);
}
Expand All @@ -566,6 +605,10 @@ function clearReimbursementAccountSaveCorpayOnboardingBeneficialOwners() {
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {isSuccess: null, isSavingCorpayOnboardingBeneficialOwnersFields: null});
}

function clearReimbursementAccoungSaveCorplayOnboardingDirectorInformation() {
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {isSuccess: null, isSavingCorpayOnboardingDirectorInformation: null});
}

/**
* Function to display and fetch data for Reimbursement Account step
* @param stepToOpen - current step to open
Expand Down Expand Up @@ -850,7 +893,9 @@ export {
saveCorpayOnboardingCompanyDetails,
clearReimbursementAccountSaveCorpayOnboardingCompanyDetails,
saveCorpayOnboardingBeneficialOwners,
saveCorpayOnboardingDirectorInformation,
clearReimbursementAccountSaveCorpayOnboardingBeneficialOwners,
clearReimbursementAccoungSaveCorplayOnboardingDirectorInformation,
clearCorpayBankAccountFields,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function Documents({onNext, isEditing, ownerBeingModifiedID}: DocumentsProps) {
/>
<Text style={[styles.mutedTextLabel, styles.mt6]}>{translate('ownershipInfoStep.proofOfBeneficialOwnerDescription')}</Text>
{(isDocumentNeededStatus.isCopyOfIDNeeded || isDocumentNeededStatus.isProofOfAddressNeeded || isDocumentNeededStatus.isCodiceFiscaleNeeded) && (
<View style={[styles.sectionDividerLine, styles.mh0]} />
<View style={[styles.sectionDividerLine, styles.mt6, styles.mb6]} />
)}
</View>
)}
Expand All @@ -158,7 +158,7 @@ function Documents({onNext, isEditing, ownerBeingModifiedID}: DocumentsProps) {
inputID={copyOfIDInputID}
/>
<Text style={[styles.mutedTextLabel, styles.mt6]}>{translate('ownershipInfoStep.copyOfIDDescription')}</Text>
{(isDocumentNeededStatus.isProofOfAddressNeeded || isDocumentNeededStatus.isCodiceFiscaleNeeded) && <View style={[styles.sectionDividerLine, styles.mh0]} />}
{(isDocumentNeededStatus.isProofOfAddressNeeded || isDocumentNeededStatus.isCodiceFiscaleNeeded) && <View style={[styles.sectionDividerLine, styles.mt6, styles.mb6]} />}
</View>
)}

Expand All @@ -184,7 +184,7 @@ function Documents({onNext, isEditing, ownerBeingModifiedID}: DocumentsProps) {
inputID={addressProofInputID}
/>
<Text style={[styles.mutedTextLabel, styles.mt6]}>{translate('ownershipInfoStep.proofOfAddressDescription')}</Text>
{isDocumentNeededStatus.isCodiceFiscaleNeeded && <View style={[styles.sectionDividerLine, styles.mh0]} />}
{isDocumentNeededStatus.isCodiceFiscaleNeeded && <View style={[styles.sectionDividerLine, styles.mt6, styles.mb6]} />}
</View>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function BeneficialOwnerInfo({onBackButtonPress, onSubmit}: BeneficialOwnerInfoP
const [reimbursementAccountDraft] = useOnyx(ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT);

const [ownerKeys, setOwnerKeys] = useState<string[]>([]);
const [ownerBeingModifiedID, setOwnerBeingModifiedID] = useState<string>(CONST.NON_USD_BANK_ACCOUNT.BENEFICIAL_OWNER_INFO_STEP.CURRENT_USER_KEY);
const [ownerBeingModifiedID, setOwnerBeingModifiedID] = useState<string>(CONST.NON_USD_BANK_ACCOUNT.CURRENT_USER_KEY);
const [isEditingCreatedOwner, setIsEditingCreatedOwner] = useState(false);
const [isUserEnteringHisOwnData, setIsUserEnteringHisOwnData] = useState(false);
const [isUserOwner, setIsUserOwner] = useState(false);
Expand Down Expand Up @@ -199,7 +199,7 @@ function BeneficialOwnerInfo({onBackButtonPress, onSubmit}: BeneficialOwnerInfoP

setIsUserOwner(value);
setIsUserEnteringHisOwnData(value);
setOwnerKeys((currentOwnersKeys) => currentOwnersKeys.filter((key) => key !== CONST.NON_USD_BANK_ACCOUNT.BENEFICIAL_OWNER_INFO_STEP.CURRENT_USER_KEY));
setOwnerKeys((currentOwnersKeys) => currentOwnersKeys.filter((key) => key !== CONST.NON_USD_BANK_ACCOUNT.CURRENT_USER_KEY));

// User is an owner but there are 4 other owners already added, so we remove last one
if (value && ownerKeys.length === 4) {
Expand Down Expand Up @@ -235,7 +235,7 @@ function BeneficialOwnerInfo({onBackButtonPress, onSubmit}: BeneficialOwnerInfoP

// User is an owner and no one else is an owner
if (isUserOwner && !value) {
setOwnerKeys([CONST.NON_USD_BANK_ACCOUNT.BENEFICIAL_OWNER_INFO_STEP.CURRENT_USER_KEY]);
setOwnerKeys([CONST.NON_USD_BANK_ACCOUNT.CURRENT_USER_KEY]);
setCurrentSubStep(SUBSTEP.BENEFICIAL_OWNERS_LIST);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function EnterEmail({onSubmit, isUserDirector}: EnterEmailProps) {
errors[SIGNER_EMAIL] = translate('bankAccount.error.email');
}

if (shouldGatherBothEmails && values[SECOND_SIGNER_EMAIL] && !Str.isValidEmail(values[SECOND_SIGNER_EMAIL])) {
if (shouldGatherBothEmails && values[SECOND_SIGNER_EMAIL] && !Str.isValidEmail(String(values[SECOND_SIGNER_EMAIL]))) {
errors[SECOND_SIGNER_EMAIL] = translate('bankAccount.error.email');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function HangTight({tempSubmit}: {tempSubmit: () => void}) {
const {paddingBottom: safeAreaInsetPaddingBottom} = useSafeAreaPaddings();

const handleSendReminder = () => {
// TODO remove that
// TODO this should send a message to the email provided in the previous step

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was this for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a handler for the button on the last screen below, on the right:

Screenshot 2025-04-15 at 10 15 22

I presumed I will call the AskForCorpaySignerInformation endpoint, is it correct? And this is part of another issue, will be done in separate PR after we merge this one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok yeah, sounds good

tempSubmit();
};

Expand Down
Loading