diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index a28c4490c7c9..10eee66428e8 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -165,7 +165,7 @@ type GPSPoint = { long: number; }; -type RequestMoneyTransactionData = { +type RequestMoneyTransactionParams = { attendees: Attendee[] | undefined; amount: number; currency: string; @@ -202,7 +202,7 @@ type RequestMoneyInformation = { gpsPoints?: GPSPoint; action?: IOUAction; reimbursible?: boolean; - transactionData: RequestMoneyTransactionData; + transactionParams: RequestMoneyTransactionParams; }; let allPersonalDetails: OnyxTypes.PersonalDetailsList = {}; @@ -3565,7 +3565,7 @@ function shareTrackedExpense( * Submit expense to another user */ function requestMoney(requestMoneyInformation: RequestMoneyInformation) { - const {report, participantParams, policyParams = {}, transactionData, gpsPoints, action, reimbursible} = requestMoneyInformation; + const {report, participantParams, policyParams = {}, transactionParams, gpsPoints, action, reimbursible} = requestMoneyInformation; const {participant, payeeAccountID, payeeEmail} = participantParams; const {policy, policyCategories, policyTagList} = policyParams; const { @@ -3584,7 +3584,7 @@ function requestMoney(requestMoneyInformation: RequestMoneyInformation) { actionableWhisperReportActionID, linkedTrackedExpenseReportAction, linkedTrackedExpenseReportID, - } = transactionData; + } = transactionParams; // If the report is iou or expense report, we should get the linked chat report to be passed to the getMoneyRequestInformation function const isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report); diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index 5a9fa9358355..72a931bf359c 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -217,7 +217,7 @@ function IOURequestStepAmount({ payeeEmail: currentUserPersonalDetails.login, payeeAccountID: currentUserPersonalDetails.accountID, }, - transactionData: { + transactionParams: { amount: backendAmount, currency, created: transaction?.created ?? '', diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index 1c3a34bfff42..d8c48dc3d587 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -252,7 +252,7 @@ function IOURequestStepConfirmation({ }, gpsPoints, action, - transactionData: { + transactionParams: { amount: transaction.amount, attendees: transaction.attendees, currency: transaction.currency, diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx index 29dccaa0f9f1..d491c196e9c2 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx @@ -262,7 +262,7 @@ function IOURequestStepScan({ payeeAccountID: currentUserPersonalDetails.accountID, participant, }, - transactionData: { + transactionParams: { amount: 0, attendees: transaction?.attendees, currency: transaction?.currency ?? 'USD', @@ -369,7 +369,7 @@ function IOURequestStepScan({ lat: successData.coords.latitude, long: successData.coords.longitude, }, - transactionData: { + transactionParams: { amount: 0, attendees: transaction?.attendees, currency: transaction?.currency ?? 'USD', diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.tsx index eb40fba34ddf..bc8622072226 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.tsx @@ -291,7 +291,7 @@ function IOURequestStepScan({ payeeAccountID: currentUserPersonalDetails.accountID, participant, }, - transactionData: { + transactionParams: { amount: 0, attendees: transaction?.attendees, currency: transaction?.currency ?? 'USD', @@ -399,7 +399,7 @@ function IOURequestStepScan({ lat: successData.coords.latitude, long: successData.coords.longitude, }, - transactionData: { + transactionParams: { amount: 0, attendees: transaction?.attendees, currency: transaction?.currency ?? 'USD', diff --git a/tests/actions/IOUTest.ts b/tests/actions/IOUTest.ts index 1928ed694228..4430ec0ce052 100644 --- a/tests/actions/IOUTest.ts +++ b/tests/actions/IOUTest.ts @@ -87,7 +87,7 @@ describe('actions/IOU', () => { payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD, @@ -301,7 +301,7 @@ describe('actions/IOU', () => { payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD, @@ -520,7 +520,7 @@ describe('actions/IOU', () => { payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD, @@ -675,7 +675,7 @@ describe('actions/IOU', () => { payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD, @@ -1491,7 +1491,7 @@ describe('actions/IOU', () => { payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD, @@ -1727,7 +1727,7 @@ describe('actions/IOU', () => { payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD, @@ -1855,7 +1855,7 @@ describe('actions/IOU', () => { payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD, @@ -1956,7 +1956,7 @@ describe('actions/IOU', () => { payeeAccountID: TEST_USER_ACCOUNT_ID, participant: {login: RORY_EMAIL, accountID: RORY_ACCOUNT_ID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD, @@ -2705,7 +2705,7 @@ describe('actions/IOU', () => { payeeAccountID: TEST_USER_ACCOUNT_ID, participant: {login: RORY_EMAIL, accountID: RORY_ACCOUNT_ID}, }, - transactionData: { + transactionParams: { amount: amount2, attendees: [], currency: CONST.CURRENCY.USD, @@ -2923,7 +2923,7 @@ describe('actions/IOU', () => { payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID, isPolicyExpenseChat: true, reportID: chatReport.reportID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD, @@ -3030,7 +3030,7 @@ describe('actions/IOU', () => { payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID, isPolicyExpenseChat: true, reportID: chatReport.reportID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD, @@ -3138,7 +3138,7 @@ describe('actions/IOU', () => { payeeAccountID: RORY_ACCOUNT_ID, participant: {login: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID, isPolicyExpenseChat: true, reportID: chatReport.reportID}, }, - transactionData: { + transactionParams: { amount, attendees: [], currency: CONST.CURRENCY.USD,