Skip to content

Commit

Permalink
Merge pull request #28246 from Expensify/georgia-cardTransactionsTS
Browse files Browse the repository at this point in the history
[ECard Transactions] Update `Transactions` and `Report` TS Types
  • Loading branch information
grgia authored Oct 6, 2023
2 parents 4b0752a + 38f8f58 commit 5208383
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,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,
Expand Down
2 changes: 2 additions & 0 deletions src/types/onyx/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ type Report = {
total?: number;
currency?: string;
preexistingReportID?: string;
/** If the report contains nonreimbursable expenses, send the nonreimbursable total */
nonReimbursableTotal?: number;
};

export default Report;
17 changes: 17 additions & 0 deletions src/types/onyx/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ type Transaction = {
transactionID: string;
tag: string;
pendingFields?: Partial<{[K in keyof Transaction]: ValueOf<typeof CONST.RED_BRICK_ROAD_PENDING_ACTION>}>;

/** Card Transactions */

parentTransactionID?: string;
reimbursable?: boolean;
/** The CC for this transaction */
cardID?: string;
/** If the transaction is pending or posted */
status?: ValueOf<typeof CONST.TRANSACTION.STATUS>;
/** If an EReceipt should be generated for this transaction */
hasEReceipt?: boolean;
/** The MCC Group for this transaction */
mccGroup?: ValueOf<typeof CONST.MCC_GROUPS>;
modifiedMCCGroup?: ValueOf<typeof CONST.MCC_GROUPS>;
/** If the transaction was made in a foreign currency, we send the original amount and currency */
originalAmount?: number;
originalCurrency?: string;
};

export default Transaction;
Expand Down

0 comments on commit 5208383

Please sign in to comment.