Skip to content

Commit fb818ef

Browse files
committed
make merchant and comment as optional
1 parent ff4079a commit fb818ef

File tree

6 files changed

+4
-17
lines changed

6 files changed

+4
-17
lines changed

src/libs/actions/IOU.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,8 @@ type TrackExpenseTransactionParams = {
452452
amount: number;
453453
currency: string;
454454
created: string | undefined;
455-
merchant: string;
456-
comment: string;
455+
merchant?: string;
456+
comment?: string;
457457
receipt?: Receipt;
458458
category?: string;
459459
tag?: string;
@@ -4688,8 +4688,8 @@ function trackExpense(params: CreateTrackExpenseParams) {
46884688
amount,
46894689
currency,
46904690
created = '',
4691-
merchant,
4692-
comment,
4691+
merchant = '',
4692+
comment = '',
46934693
receipt,
46944694
category,
46954695
tag,

src/pages/iou/request/step/IOURequestStepAmount.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ function IOURequestStepAmount({
232232
currency: currency ?? 'USD',
233233
created: transaction?.created,
234234
merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT,
235-
comment: '',
236235
},
237236
});
238237
return;

src/pages/iou/request/step/IOURequestStepDistance.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ function IOURequestStepDistance({
336336
currency: transaction?.currency ?? 'USD',
337337
created: transaction?.created ?? '',
338338
merchant: translate('iou.fieldPending'),
339-
comment: '',
340339
receipt: {},
341340
billable: false,
342341
validWaypoints: getValidWaypoints(waypoints, true),

src/pages/iou/request/step/IOURequestStepScan/index.native.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@ function IOURequestStepScan({
263263
amount: 0,
264264
currency: transaction?.currency ?? 'USD',
265265
created: transaction?.created,
266-
merchant: '',
267-
comment: '',
268266
receipt,
269267
},
270268
});
@@ -358,8 +356,6 @@ function IOURequestStepScan({
358356
amount: 0,
359357
currency: transaction?.currency ?? 'USD',
360358
created: transaction?.created,
361-
merchant: '',
362-
comment: '',
363359
receipt,
364360
billable: false,
365361
gpsPoints: {

src/pages/iou/request/step/IOURequestStepScan/index.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,6 @@ function IOURequestStepScan({
288288
amount: 0,
289289
currency: transaction?.currency ?? 'USD',
290290
created: transaction?.created,
291-
merchant: '',
292-
comment: '',
293291
receipt,
294292
},
295293
});
@@ -384,8 +382,6 @@ function IOURequestStepScan({
384382
amount: 0,
385383
currency: transaction?.currency ?? 'USD',
386384
created: transaction?.created,
387-
merchant: '',
388-
comment: '',
389385
receipt,
390386
billable: false,
391387
gpsPoints: {

tests/actions/IOUTest.ts

-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ describe('actions/IOU', () => {
204204
currency: fakeTransaction.currency,
205205
created: format(new Date(), CONST.DATE.FNS_FORMAT_STRING),
206206
merchant: fakeTransaction.merchant,
207-
comment: '',
208207
billable: false,
209208
validWaypoints: fakeWayPoints,
210209
actionableWhisperReportActionID: fakeTransaction?.actionableWhisperReportActionID,
@@ -296,7 +295,6 @@ describe('actions/IOU', () => {
296295
currency: transactionDraft?.currency ?? fakeTransaction.currency,
297296
created: format(new Date(), CONST.DATE.FNS_FORMAT_STRING),
298297
merchant: transactionDraft?.merchant ?? fakeTransaction.merchant,
299-
comment: '',
300298
category: Object.keys(fakeCategories).at(0) ?? '',
301299
validWaypoints: Object.keys(transactionDraft?.comment?.waypoints ?? {}).length ? getValidWaypoints(transactionDraft?.comment?.waypoints, true) : undefined,
302300
actionableWhisperReportActionID: transactionDraft?.actionableWhisperReportActionID,
@@ -4449,7 +4447,6 @@ describe('actions/IOU', () => {
44494447
currency: CONST.CURRENCY.USD,
44504448
created: '2024-10-30',
44514449
merchant: 'KFC',
4452-
comment: '',
44534450
receipt: {},
44544451
actionableWhisperReportActionID: '1',
44554452
linkedTrackedExpenseReportAction: {

0 commit comments

Comments
 (0)