Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECard Transactions] Update Transactions and Report TS Types #28246

Merged
merged 5 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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