From 5421a2d66820c423cc26d2e1643e6b5cb2036da3 Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 09:47:21 -0300 Subject: [PATCH 01/14] Edit ROUTES.ts and remove MONEY_REQUEST_* routes --- src/ROUTES.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 809f0778c3e4..aaff4dcf44e9 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -310,14 +310,6 @@ const ROUTES = { getRoute: (type: ValueOf, transactionID: string, reportID: string, backTo: string) => `${type}/edit/reason/${transactionID}?backTo=${backTo}&reportID=${reportID}` as const, }, - MONEY_REQUEST_MERCHANT: { - route: ':iouType/new/merchant/:reportID?', - getRoute: (iouType: IOUType, reportID = '') => `${iouType}/new/merchant/${reportID}` as const, - }, - MONEY_REQUEST_RECEIPT: { - route: ':iouType/new/receipt/:reportID?', - getRoute: (iouType: IOUType, reportID = '') => `${iouType}/new/receipt/${reportID}` as const, - }, MONEY_REQUEST_CREATE: { route: ':action/:iouType/start/:transactionID/:reportID', getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID: string) => `${action as string}/${iouType as string}/start/${transactionID}/${reportID}` as const, From ca99afa25b9c6a6f9b987dd7e23fa950e24f467e Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 09:48:29 -0300 Subject: [PATCH 02/14] Edit linkgingConfig.js and remove Money_Request* screens --- src/libs/Navigation/linkingConfig/config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index f309b19563e1..439fba4dbf42 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -600,7 +600,6 @@ const config: LinkingOptions['config'] = { [SCREENS.MONEY_REQUEST.STEP_WAYPOINT]: ROUTES.MONEY_REQUEST_STEP_WAYPOINT.route, [SCREENS.MONEY_REQUEST.STEP_TAX_AMOUNT]: ROUTES.MONEY_REQUEST_STEP_TAX_AMOUNT.route, [SCREENS.MONEY_REQUEST.STEP_TAX_RATE]: ROUTES.MONEY_REQUEST_STEP_TAX_RATE.route, - [SCREENS.MONEY_REQUEST.RECEIPT]: ROUTES.MONEY_REQUEST_RECEIPT.route, [SCREENS.MONEY_REQUEST.STATE_SELECTOR]: {path: ROUTES.MONEY_REQUEST_STATE_SELECTOR.route, exact: true}, [SCREENS.IOU_SEND.ENABLE_PAYMENTS]: ROUTES.IOU_SEND_ENABLE_PAYMENTS, [SCREENS.IOU_SEND.ADD_BANK_ACCOUNT]: ROUTES.IOU_SEND_ADD_BANK_ACCOUNT, From e816dd569badc3de0831ac4ea9a23a088458dd97 Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 09:49:21 -0300 Subject: [PATCH 03/14] Edit ModalStackNavigators.js remove old Money_Request* components --- src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index c1ead29096b2..2188941c96d2 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -91,7 +91,6 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator require('../../../../pages/settings/Wallet/AddDebitCardPage').default as React.ComponentType, [SCREENS.IOU_SEND.ENABLE_PAYMENTS]: () => require('../../../../pages/EnablePayments/EnablePaymentsPage').default as React.ComponentType, [SCREENS.MONEY_REQUEST.WAYPOINT]: () => require('../../../../pages/iou/MoneyRequestWaypointPage').default as React.ComponentType, - [SCREENS.MONEY_REQUEST.RECEIPT]: () => require('../../../../pages/EditRequestReceiptPage').default as React.ComponentType, [SCREENS.MONEY_REQUEST.STATE_SELECTOR]: () => require('../../../../pages/settings/Profile/PersonalDetails/StateSelectionPage').default as React.ComponentType, }); From c1d8cbc254290049bf62af54d8b69f17ba569090 Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 09:58:32 -0300 Subject: [PATCH 04/14] Edit IOU.js and remove _temporaryForRefactor from the name of any methods --- src/libs/actions/IOU.ts | 21 +++---------------- .../step/IOURequestStepConfirmation.tsx | 6 +++--- .../request/step/IOURequestStepCurrency.tsx | 2 +- .../step/IOURequestStepParticipants.tsx | 2 +- .../step/IOURequestStepTaxAmountPage.tsx | 2 +- 5 files changed, 9 insertions(+), 24 deletions(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index ed83267e11e7..1539e88b1328 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -357,7 +357,7 @@ function setMoneyRequestCreated(transactionID: string, created: string, isDraft: } // eslint-disable-next-line @typescript-eslint/naming-convention -function setMoneyRequestCurrency_temporaryForRefactor(transactionID: string, currency: string, isEditing = false) { +function setMoneyRequestCurrency(transactionID: string, currency: string, isEditing = false) { const fieldToUpdate = isEditing ? 'modifiedCurrency' : 'currency'; Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {[fieldToUpdate]: currency}); } @@ -383,12 +383,12 @@ function setMoneyRequestTag(transactionID: string, tag: string) { } // eslint-disable-next-line @typescript-eslint/naming-convention -function setMoneyRequestBillable_temporaryForRefactor(transactionID: string, billable: boolean) { +function setMoneyRequestBillable(transactionID: string, billable: boolean) { Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {billable}); } // eslint-disable-next-line @typescript-eslint/naming-convention -function setMoneyRequestParticipants_temporaryForRefactor(transactionID: string, participants: Participant[] = []) { +function setMoneyRequestParticipants(transactionID: string, participants: Participant[] = []) { Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {participants}); } @@ -5829,10 +5829,6 @@ function setMoneyRequestId(id: string) { Onyx.merge(ONYXKEYS.IOU, {id}); } -function setMoneyRequestCurrency(currency: string) { - Onyx.merge(ONYXKEYS.IOU, {currency}); -} - function setMoneyRequestTaxRate(transactionID: string, taxRate: TaxRatesOption) { Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {taxRate}); } @@ -5841,14 +5837,6 @@ function setMoneyRequestTaxAmount(transactionID: string, taxAmount: number, isDr Onyx.merge(`${isDraft ? ONYXKEYS.COLLECTION.TRANSACTION_DRAFT : ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {taxAmount}); } -function setMoneyRequestBillable(billable: boolean) { - Onyx.merge(ONYXKEYS.IOU, {billable}); -} - -function setMoneyRequestParticipants(participants: Participant[], isSplitRequest?: boolean) { - Onyx.merge(ONYXKEYS.IOU, {participants, isSplitRequest}); -} - function setShownHoldUseExplanation() { Onyx.set(ONYXKEYS.NVP_HOLD_USE_EXPLAINED, true); } @@ -6033,17 +6021,14 @@ export { setDraftSplitTransaction, setMoneyRequestAmount, setMoneyRequestBillable, - setMoneyRequestBillable_temporaryForRefactor, setMoneyRequestCategory, setMoneyRequestCreated, setMoneyRequestCurrency, - setMoneyRequestCurrency_temporaryForRefactor, setMoneyRequestDescription, setMoneyRequestId, setMoneyRequestMerchant, setMoneyRequestParticipants, setMoneyRequestParticipantsFromReport, - setMoneyRequestParticipants_temporaryForRefactor, setMoneyRequestPendingFields, setMoneyRequestReceipt, setMoneyRequestTag, diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index 0abc5ab06116..7a580b07b292 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -123,7 +123,7 @@ function IOURequestStepConfirmation({ const defaultBillable = !!policy?.defaultBillable; useEffect(() => { - IOU.setMoneyRequestBillable_temporaryForRefactor(transactionID, defaultBillable); + IOU.setMoneyRequestBillable(transactionID, defaultBillable); }, [transactionID, defaultBillable]); useEffect(() => { @@ -478,11 +478,11 @@ function IOURequestStepConfirmation({ } return participant; }); - IOU.setMoneyRequestParticipants_temporaryForRefactor(transactionID, newParticipants); + IOU.setMoneyRequestParticipants(transactionID, newParticipants); }; const setBillable = (billable: boolean) => { - IOU.setMoneyRequestBillable_temporaryForRefactor(transactionID, billable); + IOU.setMoneyRequestBillable(transactionID, billable); }; return ( diff --git a/src/pages/iou/request/step/IOURequestStepCurrency.tsx b/src/pages/iou/request/step/IOURequestStepCurrency.tsx index c7c596d27a67..d03136063b61 100644 --- a/src/pages/iou/request/step/IOURequestStepCurrency.tsx +++ b/src/pages/iou/request/step/IOURequestStepCurrency.tsx @@ -71,7 +71,7 @@ function IOURequestStepCurrency({ const confirmCurrencySelection = (option: CurrencyListItem) => { Keyboard.dismiss(); if (pageIndex !== 'confirm') { - IOU.setMoneyRequestCurrency_temporaryForRefactor(transactionID, option.currencyCode, action === CONST.IOU.ACTION.EDIT); + IOU.setMoneyRequestCurrency(transactionID, option.currencyCode, action === CONST.IOU.ACTION.EDIT); } navigateBack(option.currencyCode); }; diff --git a/src/pages/iou/request/step/IOURequestStepParticipants.tsx b/src/pages/iou/request/step/IOURequestStepParticipants.tsx index c071bacca44b..374d4e9777cf 100644 --- a/src/pages/iou/request/step/IOURequestStepParticipants.tsx +++ b/src/pages/iou/request/step/IOURequestStepParticipants.tsx @@ -75,7 +75,7 @@ function IOURequestStepParticipants({ const addParticipant = useCallback( (val: Participant[]) => { - IOU.setMoneyRequestParticipants_temporaryForRefactor(transactionID, val); + IOU.setMoneyRequestParticipants(transactionID, val); const rateID = DistanceRequestUtils.getCustomUnitRateID(val[0]?.reportID ?? ''); IOU.setCustomUnitRateID(transactionID, rateID); diff --git a/src/pages/iou/request/step/IOURequestStepTaxAmountPage.tsx b/src/pages/iou/request/step/IOURequestStepTaxAmountPage.tsx index 8021282cf098..dfb5ec1ad81a 100644 --- a/src/pages/iou/request/step/IOURequestStepTaxAmountPage.tsx +++ b/src/pages/iou/request/step/IOURequestStepTaxAmountPage.tsx @@ -116,7 +116,7 @@ function IOURequestStepTaxAmountPage({ IOU.setMoneyRequestTaxAmount(transactionID, amountInSmallestCurrencyUnits, true); // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - IOU.setMoneyRequestCurrency_temporaryForRefactor(transactionID, currency || CONST.CURRENCY.USD); + IOU.setMoneyRequestCurrency(transactionID, currency || CONST.CURRENCY.USD); if (backTo) { Navigation.goBack(backTo); From d69b9f172dc1c44b15b14384e0ace220dfb9e58d Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 09:59:55 -0300 Subject: [PATCH 05/14] remove EditRequestReceiptPage, EditSplitBillPage and EditRequestTagPage --- src/pages/EditRequestReceiptPage.js | 56 ----------------- src/pages/EditRequestTagPage.js | 67 --------------------- src/pages/EditSplitBillPage.tsx | 93 ----------------------------- 3 files changed, 216 deletions(-) delete mode 100644 src/pages/EditRequestReceiptPage.js delete mode 100644 src/pages/EditRequestTagPage.js delete mode 100644 src/pages/EditSplitBillPage.tsx diff --git a/src/pages/EditRequestReceiptPage.js b/src/pages/EditRequestReceiptPage.js deleted file mode 100644 index 40fe64da7eed..000000000000 --- a/src/pages/EditRequestReceiptPage.js +++ /dev/null @@ -1,56 +0,0 @@ -import PropTypes from 'prop-types'; -import React, {useState} from 'react'; -import {View} from 'react-native'; -import DragAndDropProvider from '@components/DragAndDrop/Provider'; -import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import ScreenWrapper from '@components/ScreenWrapper'; -import useLocalize from '@hooks/useLocalize'; -import useThemeStyles from '@hooks/useThemeStyles'; -import Navigation from '@libs/Navigation/Navigation'; -import IOURequestStepScan from './iou/request/step/IOURequestStepScan'; - -const propTypes = { - /** React Navigation route */ - route: PropTypes.shape({ - /** Params from the route */ - params: PropTypes.shape({ - /** The type of IOU report, i.e. bill, request, send */ - iouType: PropTypes.string, - - /** The report ID of the IOU */ - reportID: PropTypes.string, - }), - }).isRequired, -}; - -function EditRequestReceiptPage({route}) { - const styles = useThemeStyles(); - const {translate} = useLocalize(); - const [isDraggingOver, setIsDraggingOver] = useState(false); - - return ( - - {({safeAreaPaddingBottomStyle}) => ( - - - - - - - )} - - ); -} - -EditRequestReceiptPage.propTypes = propTypes; -EditRequestReceiptPage.displayName = 'EditRequestReceiptPage'; - -export default EditRequestReceiptPage; diff --git a/src/pages/EditRequestTagPage.js b/src/pages/EditRequestTagPage.js deleted file mode 100644 index fd9064f8b6fc..000000000000 --- a/src/pages/EditRequestTagPage.js +++ /dev/null @@ -1,67 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import ScreenWrapper from '@components/ScreenWrapper'; -import TagPicker from '@components/TagPicker'; -import Text from '@components/Text'; -import useLocalize from '@hooks/useLocalize'; -import useThemeStyles from '@hooks/useThemeStyles'; -import Navigation from '@libs/Navigation/Navigation'; - -const propTypes = { - /** Transaction default tag value */ - defaultTag: PropTypes.string.isRequired, - - /** The policyID we are getting tags for */ - policyID: PropTypes.string.isRequired, - - /** The tag list name to which the default tag belongs to */ - tagListName: PropTypes.string, - - /** Indicates which tag list index was selected */ - tagListIndex: PropTypes.number.isRequired, - - /** Callback to fire when the Save button is pressed */ - onSubmit: PropTypes.func.isRequired, -}; - -const defaultProps = { - tagListName: '', -}; - -function EditRequestTagPage({defaultTag, policyID, tagListName, tagListIndex, onSubmit}) { - const styles = useThemeStyles(); - const {translate} = useLocalize(); - - const selectTag = (tag) => { - onSubmit({tag: tag.searchText}); - }; - - return ( - - - {translate('iou.tagSelection')} - - - ); -} - -EditRequestTagPage.propTypes = propTypes; -EditRequestTagPage.defaultProps = defaultProps; -EditRequestTagPage.displayName = 'EditRequestTagPage'; - -export default EditRequestTagPage; diff --git a/src/pages/EditSplitBillPage.tsx b/src/pages/EditSplitBillPage.tsx deleted file mode 100644 index 26e08d8347f7..000000000000 --- a/src/pages/EditSplitBillPage.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import type {StackScreenProps} from '@react-navigation/stack'; -import React from 'react'; -import type {OnyxEntry} from 'react-native-onyx'; -import {withOnyx} from 'react-native-onyx'; -import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; -import Navigation from '@libs/Navigation/Navigation'; -import type {SplitDetailsNavigatorParamList} from '@libs/Navigation/types'; -import * as ReportUtils from '@libs/ReportUtils'; -import type {TransactionChanges} from '@libs/TransactionUtils'; -import * as IOU from '@userActions/IOU'; -import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; -import type SCREENS from '@src/SCREENS'; -import type {Report, ReportActions, Transaction} from '@src/types/onyx'; -import type {OriginalMessageIOU} from '@src/types/onyx/OriginalMessage'; -import EditRequestTagPage from './EditRequestTagPage'; - -type EditSplitBillOnyxProps = { - /** The report currently being used */ - report: OnyxEntry; - - /** The report action for currently used report */ - // Used in withOnyx - // eslint-disable-next-line react/no-unused-prop-types - reportActions: OnyxEntry; - - /** The current transaction */ - transaction: OnyxEntry; - - /** The draft transaction that holds data to be persisted on the current transaction */ - draftTransaction: OnyxEntry; -}; - -type EditSplitBillProps = EditSplitBillOnyxProps & StackScreenProps; - -function EditSplitBillPage({route, transaction, draftTransaction, report}: EditSplitBillProps) { - const {field: fieldToEdit, reportID, reportActionID, tagIndex} = route.params; - - const {tag: transactionTag} = ReportUtils.getTransactionDetails(draftTransaction ?? transaction) ?? {}; - - function navigateBackToSplitDetails() { - Navigation.navigate(ROUTES.SPLIT_BILL_DETAILS.getRoute(reportID, reportActionID)); - } - - const setDraftSplitTransaction = (transactionChanges: TransactionChanges) => { - if (transaction) { - IOU.setDraftSplitTransaction(transaction.transactionID, transactionChanges); - } - navigateBackToSplitDetails(); - }; - - if (fieldToEdit === CONST.EDIT_REQUEST_FIELD.TAG) { - return ( - { - setDraftSplitTransaction({tag: transactionChanges.tag.trim()}); - }} - /> - ); - } - - return ; -} - -EditSplitBillPage.displayName = 'EditSplitBillPage'; - -export default withOnyx({ - report: { - key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`, - }, - reportActions: { - key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${route.params.reportID}`, - canEvict: false, - }, - transaction: { - key: ({route, reportActions}: Partial) => { - const reportAction = reportActions?.[`${route?.params.reportActionID.toString()}`]; - const transactionID = (reportAction as OriginalMessageIOU)?.originalMessage.IOUTransactionID ? (reportAction as OriginalMessageIOU).originalMessage.IOUTransactionID : 0; - return `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`; - }, - }, - draftTransaction: { - key: ({route, reportActions}: Partial) => { - const reportAction = reportActions?.[`${route?.params.reportActionID.toString()}`]; - const transactionID = (reportAction as OriginalMessageIOU)?.originalMessage.IOUTransactionID ? (reportAction as OriginalMessageIOU).originalMessage.IOUTransactionID : 0; - return `${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`; - }, - }, -})(EditSplitBillPage); From 90135a1dee292e65967e5a76858e8080656859fc Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 10:12:31 -0300 Subject: [PATCH 06/14] remove EditSplitBillPage related route and navigation --- src/ROUTES.ts | 5 ----- .../Navigation/AppNavigator/ModalStackNavigators/index.tsx | 1 - src/libs/Navigation/linkingConfig/config.ts | 1 - 3 files changed, 7 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index aaff4dcf44e9..b9dad98e27af 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -272,11 +272,6 @@ const ROUTES = { route: 'r/:reportID/split/:reportActionID', getRoute: (reportID: string, reportActionID: string) => `r/${reportID}/split/${reportActionID}` as const, }, - EDIT_SPLIT_BILL: { - route: `r/:reportID/split/:reportActionID/edit/:field/:tagIndex?`, - getRoute: (reportID: string, reportActionID: string, field: ValueOf, tagIndex?: number) => - `r/${reportID}/split/${reportActionID}/edit/${field as string}${typeof tagIndex === 'number' ? `/${tagIndex}` : ''}` as const, - }, TASK_TITLE: { route: 'r/:reportID/title', getRoute: (reportID: string) => `r/${reportID}/title` as const, diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index 2188941c96d2..7b7b5480267a 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -96,7 +96,6 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator({ [SCREENS.SPLIT_DETAILS.ROOT]: () => require('../../../../pages/iou/SplitBillDetailsPage').default as React.ComponentType, - [SCREENS.SPLIT_DETAILS.EDIT_REQUEST]: () => require('../../../../pages/EditSplitBillPage').default as React.ComponentType, }); const DetailsModalStackNavigator = createModalStackNavigator({ diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 439fba4dbf42..beca960d8e23 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -609,7 +609,6 @@ const config: LinkingOptions['config'] = { [SCREENS.RIGHT_MODAL.SPLIT_DETAILS]: { screens: { [SCREENS.SPLIT_DETAILS.ROOT]: ROUTES.SPLIT_BILL_DETAILS.route, - [SCREENS.SPLIT_DETAILS.EDIT_REQUEST]: ROUTES.EDIT_SPLIT_BILL.route, }, }, [SCREENS.RIGHT_MODAL.TASK_DETAILS]: { From 7177a0a560b5d0644660b5accdadd0caf60ab391 Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 10:32:44 -0300 Subject: [PATCH 07/14] remove MoneyRequestWaypointPage and related route and navigation --- .../ModalStackNavigators/index.tsx | 1 - src/libs/Navigation/types.ts | 6 ---- src/pages/iou/MoneyRequestWaypointPage.tsx | 36 ------------------- 3 files changed, 43 deletions(-) delete mode 100644 src/pages/iou/MoneyRequestWaypointPage.tsx diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx index 7b7b5480267a..7c908ba7cfec 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx @@ -90,7 +90,6 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator require('../../../../pages/AddPersonalBankAccountPage').default as React.ComponentType, [SCREENS.IOU_SEND.ADD_DEBIT_CARD]: () => require('../../../../pages/settings/Wallet/AddDebitCardPage').default as React.ComponentType, [SCREENS.IOU_SEND.ENABLE_PAYMENTS]: () => require('../../../../pages/EnablePayments/EnablePaymentsPage').default as React.ComponentType, - [SCREENS.MONEY_REQUEST.WAYPOINT]: () => require('../../../../pages/iou/MoneyRequestWaypointPage').default as React.ComponentType, [SCREENS.MONEY_REQUEST.STATE_SELECTOR]: () => require('../../../../pages/settings/Profile/PersonalDetails/StateSelectionPage').default as React.ComponentType, }); diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 87fad1064e75..2f17645a3451 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -465,12 +465,6 @@ type MoneyRequestNavigatorParamList = { [SCREENS.IOU_SEND.ENABLE_PAYMENTS]: undefined; [SCREENS.IOU_SEND.ADD_BANK_ACCOUNT]: undefined; [SCREENS.IOU_SEND.ADD_DEBIT_CARD]: undefined; - [SCREENS.MONEY_REQUEST.WAYPOINT]: { - iouType: string; - transactionID: string; - waypointIndex: string; - threadReportID: number; - }; [SCREENS.MONEY_REQUEST.STEP_DISTANCE]: { action: IOUAction; iouType: IOUType; diff --git a/src/pages/iou/MoneyRequestWaypointPage.tsx b/src/pages/iou/MoneyRequestWaypointPage.tsx deleted file mode 100644 index 35778f37a9ef..000000000000 --- a/src/pages/iou/MoneyRequestWaypointPage.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import type {StackScreenProps} from '@react-navigation/stack'; -import React from 'react'; -import {withOnyx} from 'react-native-onyx'; -import type {MoneyRequestNavigatorParamList} from '@libs/Navigation/types'; -import ONYXKEYS from '@src/ONYXKEYS'; -import type SCREENS from '@src/SCREENS'; -import IOURequestStepWaypoint from './request/step/IOURequestStepWaypoint'; - -type MoneyRequestWaypointPageOnyxProps = { - transactionID: string | undefined; -}; -type MoneyRequestWaypointPageProps = StackScreenProps & MoneyRequestWaypointPageOnyxProps; - -// This component is responsible for grabbing the transactionID from the IOU key -// You can't use Onyx props in the withOnyx mapping, so we need to set up and access the transactionID here, and then pass it down so that WaypointEditor can subscribe to the transaction. -function MoneyRequestWaypointPage({transactionID = '', route}: MoneyRequestWaypointPageProps) { - return ( - - ); -} - -MoneyRequestWaypointPage.displayName = 'MoneyRequestWaypointPage'; - -export default withOnyx({ - transactionID: {key: ONYXKEYS.IOU, selector: (iou) => iou?.transactionID}, -})(MoneyRequestWaypointPage); From d8848d6adbd5b2479b416dd0138cca4d31fffb0c Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 10:35:10 -0300 Subject: [PATCH 08/14] move src/pages/iou/steps/MoneyRequestAmountForm.tsx to src/pages/iou/ --- src/pages/iou/{steps => }/MoneyRequestAmountForm.tsx | 0 src/pages/iou/request/step/IOURequestStepAmount.tsx | 2 +- src/pages/iou/request/step/IOURequestStepTaxAmountPage.tsx | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/pages/iou/{steps => }/MoneyRequestAmountForm.tsx (100%) diff --git a/src/pages/iou/steps/MoneyRequestAmountForm.tsx b/src/pages/iou/MoneyRequestAmountForm.tsx similarity index 100% rename from src/pages/iou/steps/MoneyRequestAmountForm.tsx rename to src/pages/iou/MoneyRequestAmountForm.tsx diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index 79b7b13e4fde..64112afecd3d 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -13,7 +13,7 @@ import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as ReportUtils from '@libs/ReportUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; import {getRequestType} from '@libs/TransactionUtils'; -import MoneyRequestAmountForm from '@pages/iou/steps/MoneyRequestAmountForm'; +import MoneyRequestAmountForm from '@pages/iou/MoneyRequestAmountForm'; import * as IOU from '@userActions/IOU'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; diff --git a/src/pages/iou/request/step/IOURequestStepTaxAmountPage.tsx b/src/pages/iou/request/step/IOURequestStepTaxAmountPage.tsx index dfb5ec1ad81a..22a00591b4fc 100644 --- a/src/pages/iou/request/step/IOURequestStepTaxAmountPage.tsx +++ b/src/pages/iou/request/step/IOURequestStepTaxAmountPage.tsx @@ -8,8 +8,8 @@ import * as CurrencyUtils from '@libs/CurrencyUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; -import type {CurrentMoney} from '@pages/iou/steps/MoneyRequestAmountForm'; -import MoneyRequestAmountForm from '@pages/iou/steps/MoneyRequestAmountForm'; +import type {CurrentMoney} from '@pages/iou/MoneyRequestAmountForm'; +import MoneyRequestAmountForm from '@pages/iou/MoneyRequestAmountForm'; import * as IOU from '@userActions/IOU'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; From bb6719ea34ff85cdbc57925a5bdb0f42f2232781 Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 11:07:31 -0300 Subject: [PATCH 09/14] Remove ONYXKEYS.IOU (also need to remove some files that relate to IOU like src/pages/iou/propTypes/index.js) --- src/ONYXKEYS.ts | 4 --- src/libs/actions/IOU.ts | 5 --- src/pages/iou/propTypes/index.js | 54 -------------------------------- 3 files changed, 63 deletions(-) delete mode 100644 src/pages/iou/propTypes/index.js diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 45c2d152542d..5a765c93ca03 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -39,9 +39,6 @@ const ONYXKEYS = { CREDENTIALS: 'credentials', STASHED_CREDENTIALS: 'stashedCredentials', - // Contains loading data for the IOU feature (MoneyRequestModal, IOUDetail, & MoneyRequestPreview Components) - IOU: 'iou', - /** Keeps track if there is modal currently visible or not */ MODAL: 'modal', @@ -577,7 +574,6 @@ type OnyxValuesMapping = { [ONYXKEYS.CURRENT_DATE]: string; [ONYXKEYS.CREDENTIALS]: OnyxTypes.Credentials; [ONYXKEYS.STASHED_CREDENTIALS]: OnyxTypes.Credentials; - [ONYXKEYS.IOU]: OnyxTypes.IOU; [ONYXKEYS.MODAL]: OnyxTypes.Modal; [ONYXKEYS.NETWORK]: OnyxTypes.Network; [ONYXKEYS.NEW_GROUP_CHAT_DRAFT]: OnyxTypes.NewGroupChatDraft; diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 1539e88b1328..5208720210e8 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -5825,10 +5825,6 @@ function setMoneyRequestParticipantsFromReport(transactionID: string, report: On return participants; } -function setMoneyRequestId(id: string) { - Onyx.merge(ONYXKEYS.IOU, {id}); -} - function setMoneyRequestTaxRate(transactionID: string, taxRate: TaxRatesOption) { Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {taxRate}); } @@ -6025,7 +6021,6 @@ export { setMoneyRequestCreated, setMoneyRequestCurrency, setMoneyRequestDescription, - setMoneyRequestId, setMoneyRequestMerchant, setMoneyRequestParticipants, setMoneyRequestParticipantsFromReport, diff --git a/src/pages/iou/propTypes/index.js b/src/pages/iou/propTypes/index.js deleted file mode 100644 index 46abafac23e4..000000000000 --- a/src/pages/iou/propTypes/index.js +++ /dev/null @@ -1,54 +0,0 @@ -import PropTypes from 'prop-types'; -import participantPropTypes from '@components/participantPropTypes'; -import CONST from '@src/CONST'; - -const iouPropTypes = PropTypes.shape({ - /** ID (iouType + reportID) of the expense */ - id: PropTypes.string, - - /** Amount of the expense */ - amount: PropTypes.number, - - /** Currency of the expense */ - currency: PropTypes.string, - - /** Description of the expense */ - comment: PropTypes.string, - - /** The merchant name */ - merchant: PropTypes.string, - - /** The category name */ - category: PropTypes.string, - - /** Whether the expense is billable */ - billable: PropTypes.bool, - - /** The tag */ - tag: PropTypes.string, - - /** Date that the expense was created */ - created: PropTypes.string, - - /** The path to an image of the receipt attached to the expense */ - receiptPath: PropTypes.string, - - /** List of the participants */ - participants: PropTypes.arrayOf(participantPropTypes), -}); - -const iouDefaultProps = { - id: '', - amount: 0, - currency: CONST.CURRENCY.USD, - comment: '', - merchant: '', - category: '', - tag: '', - billable: false, - created: '', - participants: [], - receiptPath: '', -}; - -export {iouPropTypes, iouDefaultProps}; From a3f56621d44bb73bd0cc8959a1dac8ffef80f37d Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 11:21:40 -0300 Subject: [PATCH 10/14] revert 'remove ONYXKEYS.IOU' --- src/ONYXKEYS.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 5a765c93ca03..45c2d152542d 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -39,6 +39,9 @@ const ONYXKEYS = { CREDENTIALS: 'credentials', STASHED_CREDENTIALS: 'stashedCredentials', + // Contains loading data for the IOU feature (MoneyRequestModal, IOUDetail, & MoneyRequestPreview Components) + IOU: 'iou', + /** Keeps track if there is modal currently visible or not */ MODAL: 'modal', @@ -574,6 +577,7 @@ type OnyxValuesMapping = { [ONYXKEYS.CURRENT_DATE]: string; [ONYXKEYS.CREDENTIALS]: OnyxTypes.Credentials; [ONYXKEYS.STASHED_CREDENTIALS]: OnyxTypes.Credentials; + [ONYXKEYS.IOU]: OnyxTypes.IOU; [ONYXKEYS.MODAL]: OnyxTypes.Modal; [ONYXKEYS.NETWORK]: OnyxTypes.Network; [ONYXKEYS.NEW_GROUP_CHAT_DRAFT]: OnyxTypes.NewGroupChatDraft; From 33558a04369c2ec9e94c1874b68bd20182be0c1e Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 11:24:21 -0300 Subject: [PATCH 11/14] cleanup missing 'SCREENS.MONEY_REQUEST.RECEIPT' --- src/libs/Navigation/types.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 2f17645a3451..f9541cb674a3 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -472,10 +472,6 @@ type MoneyRequestNavigatorParamList = { reportID: string; backTo: Routes; }; - [SCREENS.MONEY_REQUEST.RECEIPT]: { - iouType: string; - reportID: string; - }; [SCREENS.MONEY_REQUEST.CREATE]: { iouType: IOUType; reportID: string; From 66d906e4cf96cc9b203284ffb0a600df5f4d2db4 Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 13:47:59 -0300 Subject: [PATCH 12/14] remove 'resetMoneyRequestInfo' and remaining 'ONYXKEYS.IOU' --- src/ONYXKEYS.ts | 4 ---- src/libs/actions/IOU.ts | 38 +++++++------------------------------- 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index c17c911d18b3..d64e85aa9ea1 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -39,9 +39,6 @@ const ONYXKEYS = { CREDENTIALS: 'credentials', STASHED_CREDENTIALS: 'stashedCredentials', - // Contains loading data for the IOU feature (MoneyRequestModal, IOUDetail, & MoneyRequestPreview Components) - IOU: 'iou', - /** Keeps track if there is modal currently visible or not */ MODAL: 'modal', @@ -580,7 +577,6 @@ type OnyxValuesMapping = { [ONYXKEYS.CURRENT_DATE]: string; [ONYXKEYS.CREDENTIALS]: OnyxTypes.Credentials; [ONYXKEYS.STASHED_CREDENTIALS]: OnyxTypes.Credentials; - [ONYXKEYS.IOU]: OnyxTypes.IOU; [ONYXKEYS.MODAL]: OnyxTypes.Modal; [ONYXKEYS.NETWORK]: OnyxTypes.Network; [ONYXKEYS.NEW_GROUP_CHAT_DRAFT]: OnyxTypes.NewGroupChatDraft; diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index dc12dfe238d3..c63a837cb671 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -411,29 +411,6 @@ function updateDistanceRequestRate(transactionID: string, rateID: string, policy Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {comment: {customUnit: {customUnitRateID: rateID}}}); } -/** Reset expense info from the store with its initial value */ -function resetMoneyRequestInfo(id = '') { - // Disabling this line since currentDate can be an empty string - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - const created = currentDate || format(new Date(), CONST.DATE.FNS_FORMAT_STRING); - Onyx.merge(ONYXKEYS.IOU, { - id, - amount: 0, - currency: currentUserPersonalDetails.localCurrencyCode ?? CONST.CURRENCY.USD, - comment: '', - participants: [], - merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, - category: '', - tag: '', - created, - receiptPath: '', - receiptFilename: '', - transactionID: '', - billable: null, - isSplitRequest: false, - }); -} - /** Helper function to get the receipt error for expenses, or the generic error if there's no receipt */ function getReceiptError(receipt?: Receipt, filename?: string, isScanRequest = true, errorKey?: number): Errors | ErrorFields { return isEmptyObject(receipt) || !isScanRequest @@ -2899,7 +2876,7 @@ function requestMoney( // eslint-disable-next-line rulesdir/no-multiple-api-calls API.write(WRITE_COMMANDS.REQUEST_MONEY, parameters, onyxData); - resetMoneyRequestInfo(); + } } @@ -3068,7 +3045,7 @@ function trackExpense( }; API.write(WRITE_COMMANDS.TRACK_EXPENSE, parameters, onyxData); - resetMoneyRequestInfo(); + } } if (action === CONST.IOU.ACTION.SHARE) { @@ -3571,7 +3548,7 @@ function splitBill({ API.write(WRITE_COMMANDS.SPLIT_BILL, parameters, onyxData); - resetMoneyRequestInfo(); + Navigation.dismissModal(existingSplitChatReportID); Report.notifyNewAction(splitData.chatReportID, currentUserAccountID); } @@ -3630,7 +3607,7 @@ function splitBillAndOpenReport({ API.write(WRITE_COMMANDS.SPLIT_BILL_AND_OPEN_REPORT, parameters, onyxData); - resetMoneyRequestInfo(); + Navigation.dismissModal(splitData.chatReportID); Report.notifyNewAction(splitData.chatReportID, currentUserAccountID); } @@ -3930,7 +3907,7 @@ function startSplitBill({ API.write(WRITE_COMMANDS.START_SPLIT_BILL, parameters, {optimisticData, successData, failureData}); - resetMoneyRequestInfo(); + Navigation.dismissModalWithReport(splitChatReport); Report.notifyNewAction(splitChatReport.chatReportID ?? '', currentUserAccountID); } @@ -5274,7 +5251,7 @@ function sendMoneyElsewhere(report: OnyxEntry, amount: number, API.write(WRITE_COMMANDS.SEND_MONEY_ELSEWHERE, params, {optimisticData, successData, failureData}); - resetMoneyRequestInfo(); + Navigation.dismissModal(params.chatReportID); Report.notifyNewAction(params.chatReportID, managerID); } @@ -5288,7 +5265,7 @@ function sendMoneyWithWallet(report: OnyxEntry, amount: number API.write(WRITE_COMMANDS.SEND_MONEY_WITH_WALLET, params, {optimisticData, successData, failureData}); - resetMoneyRequestInfo(); + Navigation.dismissModal(params.chatReportID); Report.notifyNewAction(params.chatReportID, managerID); } @@ -6004,7 +5981,6 @@ export { putOnHold, replaceReceipt, requestMoney, - resetMoneyRequestInfo, savePreferredPaymentMethod, sendMoneyElsewhere, sendMoneyWithWallet, From b3c9cf606bdae910d6f3446fa08afb3dabcf261c Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 13:51:40 -0300 Subject: [PATCH 13/14] run prettier --- src/libs/actions/IOU.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index c63a837cb671..4a05bbca4b11 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -2876,7 +2876,6 @@ function requestMoney( // eslint-disable-next-line rulesdir/no-multiple-api-calls API.write(WRITE_COMMANDS.REQUEST_MONEY, parameters, onyxData); - } } @@ -3045,7 +3044,6 @@ function trackExpense( }; API.write(WRITE_COMMANDS.TRACK_EXPENSE, parameters, onyxData); - } } if (action === CONST.IOU.ACTION.SHARE) { @@ -3548,7 +3546,6 @@ function splitBill({ API.write(WRITE_COMMANDS.SPLIT_BILL, parameters, onyxData); - Navigation.dismissModal(existingSplitChatReportID); Report.notifyNewAction(splitData.chatReportID, currentUserAccountID); } @@ -3607,7 +3604,6 @@ function splitBillAndOpenReport({ API.write(WRITE_COMMANDS.SPLIT_BILL_AND_OPEN_REPORT, parameters, onyxData); - Navigation.dismissModal(splitData.chatReportID); Report.notifyNewAction(splitData.chatReportID, currentUserAccountID); } @@ -3907,7 +3903,6 @@ function startSplitBill({ API.write(WRITE_COMMANDS.START_SPLIT_BILL, parameters, {optimisticData, successData, failureData}); - Navigation.dismissModalWithReport(splitChatReport); Report.notifyNewAction(splitChatReport.chatReportID ?? '', currentUserAccountID); } @@ -5251,7 +5246,6 @@ function sendMoneyElsewhere(report: OnyxEntry, amount: number, API.write(WRITE_COMMANDS.SEND_MONEY_ELSEWHERE, params, {optimisticData, successData, failureData}); - Navigation.dismissModal(params.chatReportID); Report.notifyNewAction(params.chatReportID, managerID); } @@ -5265,7 +5259,6 @@ function sendMoneyWithWallet(report: OnyxEntry, amount: number API.write(WRITE_COMMANDS.SEND_MONEY_WITH_WALLET, params, {optimisticData, successData, failureData}); - Navigation.dismissModal(params.chatReportID); Report.notifyNewAction(params.chatReportID, managerID); } From 2b0b12ca324a47eabce6b1563985b196d7ebe210 Mon Sep 17 00:00:00 2001 From: brunovjk Date: Wed, 24 Apr 2024 14:25:46 -0300 Subject: [PATCH 14/14] remove unnecessary 'eslint/naming-convention' --- src/libs/actions/IOU.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 4a05bbca4b11..e1c57ba01892 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -327,7 +327,6 @@ function clearMoneyRequest(transactionID: string, skipConfirmation = false) { Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, null); } -// eslint-disable-next-line @typescript-eslint/naming-convention function startMoneyRequest(iouType: ValueOf, reportID: string, requestType?: IOURequestType, skipConfirmation = false) { clearMoneyRequest(CONST.IOU.OPTIMISTIC_TRANSACTION_ID, skipConfirmation); switch (requestType) { @@ -345,17 +344,14 @@ function startMoneyRequest(iouType: ValueOf, reportID: st } } -// eslint-disable-next-line @typescript-eslint/naming-convention function setMoneyRequestAmount(transactionID: string, amount: number, currency: string) { Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {amount, currency}); } -// eslint-disable-next-line @typescript-eslint/naming-convention function setMoneyRequestCreated(transactionID: string, created: string, isDraft: boolean) { Onyx.merge(`${isDraft ? ONYXKEYS.COLLECTION.TRANSACTION_DRAFT : ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {created}); } -// eslint-disable-next-line @typescript-eslint/naming-convention function setMoneyRequestCurrency(transactionID: string, currency: string, isEditing = false) { const fieldToUpdate = isEditing ? 'modifiedCurrency' : 'currency'; Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {[fieldToUpdate]: currency}); @@ -381,12 +377,10 @@ function setMoneyRequestTag(transactionID: string, tag: string) { Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {tag}); } -// eslint-disable-next-line @typescript-eslint/naming-convention function setMoneyRequestBillable(transactionID: string, billable: boolean) { Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {billable}); } -// eslint-disable-next-line @typescript-eslint/naming-convention function setMoneyRequestParticipants(transactionID: string, participants: Participant[] = []) { Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {participants}); }