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

Add support for MERGED_WITH_CASH_TRANSACTION system message #41477

Merged
merged 7 commits into from
May 3, 2024
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
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ const CONST = {
MANAGER_DETACH_RECEIPT: 'MANAGERDETACHRECEIPT', // OldDot Action
MARKED_REIMBURSED: 'MARKEDREIMBURSED', // OldDot Action
MARK_REIMBURSED_FROM_INTEGRATION: 'MARKREIMBURSEDFROMINTEGRATION', // OldDot Action
MERGED_WITH_CASH_TRANSACTION: 'MERGEDWITHCASHTRANSACTION',
francoisl marked this conversation as resolved.
Show resolved Hide resolved
MODIFIED_EXPENSE: 'MODIFIEDEXPENSE',
MOVED: 'MOVED',
OUTDATED_BANK_ACCOUNT: 'OUTDATEDBANKACCOUNT', // OldDot Action
Expand Down
3 changes: 3 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2959,4 +2959,7 @@ export default {
offline:
"You appear to be offline. Unfortunately, Expensify Classic doesn't work offline, but New Expensify does. If you prefer to use Expensify Classic, try again when you have an internet connection.",
},
systemMessage: {
mergedWithCashTransaction: 'matched a receipt to this transaction.',
},
} satisfies TranslationBase;
3 changes: 3 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3461,4 +3461,7 @@ export default {
offline:
'Parece que estás desconectado. Desafortunadamente, Expensify Classic no funciona sin conexión, pero New Expensify sí. Si prefieres utilizar Expensify Classic, inténtalo de nuevo cuando tengas conexión a internet.',
},
systemMessage: {
mergedWithCashTransaction: 'encontró un recibo para esta transacción.',
},
} satisfies EnglishTranslation;
2 changes: 2 additions & 0 deletions src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@ function ReportActionItem({
children = <ReportActionItemBasicMessage message={action.message?.[0]?.text ?? ''} />;
} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.UNHOLD) {
children = <ReportActionItemBasicMessage message={translate('iou.unheldExpense')} />;
} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.MERGED_WITH_CASH_TRANSACTION) {
children = <ReportActionItemBasicMessage message={translate('systemMessage.mergedWithCashTransaction')} />;
} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.DISMISSED_VIOLATION) {
children = <ReportActionItemBasicMessage message={ReportActionsUtils.getDismissedViolationMessageText(action.originalMessage)} />;
} else {
Expand Down
6 changes: 6 additions & 0 deletions src/types/onyx/OriginalMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ type OriginalMessageMoved = {
};
};

type OriginalMessageMergedWithCashTransaction = {
actionName: typeof CONST.REPORT.ACTIONS.TYPE.MERGED_WITH_CASH_TRANSACTION;
originalMessage: Record<string, never>; // No data is sent with this action
};

type OriginalMessageDismissedViolation = {
actionName: typeof CONST.REPORT.ACTIONS.TYPE.DISMISSED_VIOLATION;
originalMessage: {
Expand Down Expand Up @@ -343,6 +348,7 @@ type OriginalMessage =
| OriginalMessageMoved
| OriginalMessageMarkedReimbursed
| OriginalMessageActionableTrackedExpenseWhisper
| OriginalMessageMergedWithCashTransaction
| OriginalMessageDismissedViolation;

export default OriginalMessage;
Expand Down
Loading