Repository navigation
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| policyParams, | ||
| transactionParams: { | ||
| amount: details.amount, | ||
| currency: details.currency, |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
The transaction-detail extraction, receipt construction, and the entire transactionParams object (amount, currency, created, merchant, comment, category, tag, taxCode, taxAmount, billable, reimbursable, attendees, isFromGlobalCreate, receipt) are duplicated verbatim from buildRetryPayload.ts (lines 102-133), including the identical // Read from the transaction because details widens this to string | Attendee[]. comment. You already extracted the shared predicate/participant helpers into buildRetryPayload.ts and import them here; this block is the remaining DRY gap. If the shape of a tracked expense's transaction params ever changes, both builders have to be edited in lockstep.
Extract the shared block into a helper exported alongside the others, e.g.:
// in buildRetryPayload.ts
function buildRetryTransactionParams(transaction: Transaction, details: TransactionDetails, receipt: Receipt) {
return {
amount: details.amount,
currency: details.currency,
created: details.created,
merchant: getMerchantForRetry(details.merchant),
comment: details.comment,
category: details.category,
tag: details.tag,
taxCode: details.taxCode,
taxAmount: details.taxAmount,
billable: details.billable,
reimbursable: details.reimbursable,
// Read from the transaction because `details` widens this to `string | Attendee[]`.
attendees: transaction.comment?.attendees,
isFromGlobalCreate: getIsFromGlobalCreate(transaction),
receipt,
};
}
export {buildRetryTransactionParams};Then call transactionParams: buildRetryTransactionParams(transaction, details, receipt) in both builders.
Reviewed at: c237890 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
Explanation of Change
Follow-up to #99902 and #102893, which added Try again for failed
RequestMoneyandReplaceReceiptuploads. A scanned receipt tracked in the self-DM goes throughTrackExpense, so when the upload fails - the row showed only Save before.This PR adds Try again for a failed
TrackExpensein the self-DMFixed Issues
$ #102494
PROPOSAL:
Tests
Offline tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
TrackExpense-SelfDM.mp4
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari