@@ -13,7 +13,6 @@ import type {IOUAction, IOURequestType, IOUType, OdometerImageType} from './CONS
1313import type { ReplacementReason } from './libs/actions/Card' ;
1414import Log from './libs/Log' ;
1515import type { RootNavigatorParamList } from './libs/Navigation/types' ;
16- import type { ReimbursementAccountStepToOpen } from './libs/ReimbursementAccountUtils' ;
1716import StringUtils from './libs/StringUtils' ;
1817import { getUrlWithParams } from './libs/Url' ;
1918import SCREENS from './SCREENS' ;
@@ -864,34 +863,20 @@ const ROUTES = {
864863
865864 getRoute : ( policyID ?: string , backTo ?: string ) => getUrlWithBackToParam ( `bank-account/${ VERIFY_ACCOUNT } ?policyID=${ policyID } ` , backTo ) ,
866865 } ,
867- BANK_ACCOUNT_NEW : 'bank-account/new' ,
868866 BANK_ACCOUNT_PERSONAL : 'bank-account/personal' ,
867+ // TODO: rename the route as no longer accepts step
869868 BANK_ACCOUNT_WITH_STEP_TO_OPEN : {
870- route : 'bank-account/:stepToOpen?' ,
871- getRoute : ( {
872- policyID,
873- stepToOpen = '' ,
874- bankAccountID,
875- backTo,
876- subStepToOpen,
877- } : {
878- policyID : string | undefined ;
879- stepToOpen ?: ReimbursementAccountStepToOpen ;
880- bankAccountID ?: number ;
881- backTo ?: string ;
882- subStepToOpen ?: typeof CONST . BANK_ACCOUNT . STEP . COUNTRY ;
883- } ) => {
884- if ( ! policyID && ! bankAccountID ) {
885- return getUrlWithBackToParam ( `bank-account/${ stepToOpen } ` , backTo ) ;
886- }
887-
869+ route : 'bank-account/new' ,
870+ getRoute : ( { policyID, bankAccountID, backTo} : { policyID : string | undefined ; bankAccountID ?: number ; backTo ?: string } ) => {
871+ let queryString = '' ;
888872 if ( bankAccountID ) {
889- return getUrlWithBackToParam ( `bank-account/${ stepToOpen } ?bankAccountID=${ bankAccountID } ` , backTo ) ;
873+ queryString = `?bankAccountID=${ bankAccountID } ` ;
874+ } else if ( policyID ) {
875+ queryString = `?policyID=${ policyID } ` ;
890876 }
891877 // TODO this backTo comes from drilling it through bank account form screens
892878 // should be removed once https://github.com/Expensify/App/pull/72219 is resolved
893-
894- return getUrlWithBackToParam ( `bank-account/${ stepToOpen } ?policyID=${ policyID } ${ subStepToOpen ? `&subStep=${ subStepToOpen } ` : '' } ` , backTo ) ;
879+ return getUrlWithBackToParam ( `bank-account/new${ queryString } ` , backTo ) ;
895880 } ,
896881 } ,
897882 BANK_ACCOUNT_ENTER_SIGNER_INFO : {
@@ -921,6 +906,18 @@ const ROUTES = {
921906 return getUrlWithBackToParam ( `${ base } ${ pagePart } ${ subPagePart } ${ actionPart } ${ queryString } ` , backTo ) ;
922907 } ,
923908 } ,
909+ BANK_ACCOUNT_USD_SETUP : {
910+ route : 'bank-account/new/us/:page?/:subPage?/:action?' ,
911+ getRoute : ( { policyID, page, subPage, action, backTo} : { policyID ?: string ; page ?: string ; subPage ?: string ; action ?: 'edit' ; backTo ?: string } ) => {
912+ const base = 'bank-account/new/us' ;
913+ const pagePart = page ? `/${ page } ` : '' ;
914+ const subPagePart = subPage ? `/${ subPage } ` : '' ;
915+ const actionPart = action ? `/${ action } ` : '' ;
916+ const queryString = policyID ? `?policyID=${ policyID } ` : '' ;
917+
918+ return getUrlWithBackToParam ( `${ base } ${ pagePart } ${ subPagePart } ${ actionPart } ${ queryString } ` , backTo ) ;
919+ } ,
920+ } ,
924921 SETTINGS : 'settings' ,
925922 SETTINGS_PROFILE : {
926923 route : 'settings/profile' ,
0 commit comments