From 236ac0465db9fccccbb3331e9ba53201410cb733 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Tue, 26 Sep 2023 17:58:14 +0800 Subject: [PATCH 1/3] update TS with optional params for expensify card transactions (not live) --- src/CONST.ts | 18 ++++++++++++++++++ src/types/onyx/Report.ts | 2 ++ src/types/onyx/Transaction.ts | 16 ++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index 4d216285bc50..935f054c61c4 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -676,6 +676,24 @@ const CONST = { TYPE: { CUSTOM_UNIT: 'customUnit', }, + STATUS: { + PENDING: 'Pending', + POSTED: 'Posted', + }, + }, + MCC_GROUPS: { + COMMUTER: 'Commuter', + GAS: 'Gas', + GOODS: 'Goods', + GROCERIES: 'Groceries', + HOTEL: 'Hotel', + MAIL: 'Mail', + MEALS: 'Meals', + RENTAL: 'Rental', + SERVICES: 'Services', + TAXI: 'Taxi', + MISCELLANEOUS: 'Miscellaneous', + UTILITIES: 'Utilities', }, JSON_CODE: { SUCCESS: 200, diff --git a/src/types/onyx/Report.ts b/src/types/onyx/Report.ts index 88caa683305d..a5647ed23e71 100644 --- a/src/types/onyx/Report.ts +++ b/src/types/onyx/Report.ts @@ -83,6 +83,8 @@ type Report = { participantAccountIDs?: number[]; total?: number; currency?: string; + /** If the report contains nonreimbursable expenses, send the nonreimbursable total */ + nonReimbursableTotal?: number; }; export default Report; diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index 8327c866df0f..ba8848509dd6 100644 --- a/src/types/onyx/Transaction.ts +++ b/src/types/onyx/Transaction.ts @@ -47,6 +47,22 @@ type Transaction = { routes?: Routes; transactionID: string; tag: string; + + /** Card Transactions */ + + reimbursable?: boolean; + /** The CC for this transaction */ + cardID?: string; + /** If the transaction is pending or posted */ + status?: ValueOf; + /** If an EReceipt should be generated for this transaction */ + hasEReceipt?: boolean; + /** The MCC Group for this transaction */ + mccGroup?: ValueOf; + modifiedMCCGroup?: ValueOf; + /** If the transaction was made in a foreign currency, we send the original amount and currency */ + originalAmount?: number; + originalCurrency?: string; }; export default Transaction; From 3cae3c250ca381da41fb843d51139cf828d14936 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 4 Oct 2023 12:52:24 +0100 Subject: [PATCH 2/3] add optional parentTransactionID --- src/types/onyx/Transaction.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index 580a47eb66ba..c44b99979b7f 100644 --- a/src/types/onyx/Transaction.ts +++ b/src/types/onyx/Transaction.ts @@ -55,6 +55,7 @@ type Transaction = { reportID: string; routes?: Routes; transactionID: string; + parentTransactionID?: string; tag: string; pendingFields?: Partial<{[K in keyof Transaction]: ValueOf}>; From f827aa6452d53cbcefeb456e24b10fa6dc9e6878 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Thu, 5 Oct 2023 12:59:33 +0100 Subject: [PATCH 3/3] move down --- src/types/onyx/Transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index c44b99979b7f..95561d5b5311 100644 --- a/src/types/onyx/Transaction.ts +++ b/src/types/onyx/Transaction.ts @@ -55,12 +55,12 @@ type Transaction = { reportID: string; routes?: Routes; transactionID: string; - parentTransactionID?: string; tag: string; pendingFields?: Partial<{[K in keyof Transaction]: ValueOf}>; /** Card Transactions */ + parentTransactionID?: string; reimbursable?: boolean; /** The CC for this transaction */ cardID?: string;