Skip to content

Commit

Permalink
make merchant and comment as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
mkzie2 committed Feb 5, 2025
1 parent ff4079a commit fb818ef
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,8 @@ type TrackExpenseTransactionParams = {
amount: number;
currency: string;
created: string | undefined;
merchant: string;
comment: string;
merchant?: string;
comment?: string;
receipt?: Receipt;
category?: string;
tag?: string;
Expand Down Expand Up @@ -4688,8 +4688,8 @@ function trackExpense(params: CreateTrackExpenseParams) {
amount,
currency,
created = '',
merchant,
comment,
merchant = '',
comment = '',
receipt,
category,
tag,
Expand Down
1 change: 0 additions & 1 deletion src/pages/iou/request/step/IOURequestStepAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ function IOURequestStepAmount({
currency: currency ?? 'USD',
created: transaction?.created,
merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT,
comment: '',
},
});
return;
Expand Down
1 change: 0 additions & 1 deletion src/pages/iou/request/step/IOURequestStepDistance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ function IOURequestStepDistance({
currency: transaction?.currency ?? 'USD',
created: transaction?.created ?? '',
merchant: translate('iou.fieldPending'),
comment: '',
receipt: {},
billable: false,
validWaypoints: getValidWaypoints(waypoints, true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,6 @@ function IOURequestStepScan({
amount: 0,
currency: transaction?.currency ?? 'USD',
created: transaction?.created,
merchant: '',
comment: '',
receipt,
},
});
Expand Down Expand Up @@ -358,8 +356,6 @@ function IOURequestStepScan({
amount: 0,
currency: transaction?.currency ?? 'USD',
created: transaction?.created,
merchant: '',
comment: '',
receipt,
billable: false,
gpsPoints: {
Expand Down
4 changes: 0 additions & 4 deletions src/pages/iou/request/step/IOURequestStepScan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,6 @@ function IOURequestStepScan({
amount: 0,
currency: transaction?.currency ?? 'USD',
created: transaction?.created,
merchant: '',
comment: '',
receipt,
},
});
Expand Down Expand Up @@ -384,8 +382,6 @@ function IOURequestStepScan({
amount: 0,
currency: transaction?.currency ?? 'USD',
created: transaction?.created,
merchant: '',
comment: '',
receipt,
billable: false,
gpsPoints: {
Expand Down
3 changes: 0 additions & 3 deletions tests/actions/IOUTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ describe('actions/IOU', () => {
currency: fakeTransaction.currency,
created: format(new Date(), CONST.DATE.FNS_FORMAT_STRING),
merchant: fakeTransaction.merchant,
comment: '',
billable: false,
validWaypoints: fakeWayPoints,
actionableWhisperReportActionID: fakeTransaction?.actionableWhisperReportActionID,
Expand Down Expand Up @@ -296,7 +295,6 @@ describe('actions/IOU', () => {
currency: transactionDraft?.currency ?? fakeTransaction.currency,
created: format(new Date(), CONST.DATE.FNS_FORMAT_STRING),
merchant: transactionDraft?.merchant ?? fakeTransaction.merchant,
comment: '',
category: Object.keys(fakeCategories).at(0) ?? '',
validWaypoints: Object.keys(transactionDraft?.comment?.waypoints ?? {}).length ? getValidWaypoints(transactionDraft?.comment?.waypoints, true) : undefined,
actionableWhisperReportActionID: transactionDraft?.actionableWhisperReportActionID,
Expand Down Expand Up @@ -4449,7 +4447,6 @@ describe('actions/IOU', () => {
currency: CONST.CURRENCY.USD,
created: '2024-10-30',
merchant: 'KFC',
comment: '',
receipt: {},
actionableWhisperReportActionID: '1',
linkedTrackedExpenseReportAction: {
Expand Down

0 comments on commit fb818ef

Please sign in to comment.