Skip to content
Draft
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/libs/actions/IOU/Duplicate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@
hasViolations: false,
customUnitPolicyID,
isTrackIntentUser,
formatPhoneNumber,

Check failure on line 718 in src/libs/actions/IOU/Duplicate.ts

View workflow job for this annotation

GitHub Actions / typecheck

No value exists in scope for the shorthand property 'formatPhoneNumber'. Either declare one or provide an initializer.

Check failure on line 718 in src/libs/actions/IOU/Duplicate.ts

View workflow job for this annotation

GitHub Actions / ESLint check

Unsafe assignment of an error typed value
};
return submitPerDiemExpense(perDiemParams);
}
Expand Down
8 changes: 7 additions & 1 deletion src/libs/actions/IOU/PerDiem.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type {LocaleContextProps} from '@components/LocaleContextProvider';

import * as API from '@libs/API';
import type {CreatePerDiemRequestParams} from '@libs/API/parameters';
import {WRITE_COMMANDS} from '@libs/API/types';
Expand All @@ -6,7 +8,6 @@ import DateUtils from '@libs/DateUtils';
import {deferOrExecuteWrite} from '@libs/deferredLayoutWrite';
import {getMicroSecondOnyxErrorWithTranslationKey} from '@libs/ErrorUtils';
import {updateIOUOwnerAndTotal} from '@libs/IOUUtils';
import {formatPhoneNumber} from '@libs/LocalePhoneNumber';
import {validateAmount} from '@libs/MoneyRequestUtils';
import Navigation from '@libs/Navigation/Navigation';
import TransitionTracker from '@libs/Navigation/TransitionTracker';
Expand Down Expand Up @@ -240,6 +241,7 @@ type PerDiemExpenseInformation = {
shouldDeferAutoSubmit?: boolean;
optimisticChatReportID?: string;
optimisticTransactionID?: string;
formatPhoneNumber: LocaleContextProps['formatPhoneNumber'];
// TODO: delegateAccountID will be made required in PR 13 when all callers pass the value (https://github.com/Expensify/App/issues/66425)
delegateAccountID?: number | undefined;
isTrackIntentUser: boolean | undefined;
Expand All @@ -264,6 +266,7 @@ type PerDiemExpenseInformationParams = {
personalDetails: OnyxEntry<OnyxTypes.PersonalDetailsList>;
optimisticChatReportID?: string;
optimisticTransactionID?: string;
formatPhoneNumber: LocaleContextProps['formatPhoneNumber'];
// TODO: delegateAccountID will be made required in PR 13 when all callers pass the value (https://github.com/Expensify/App/issues/66425)
delegateAccountID?: number | undefined;
isTrackIntentUser: boolean | undefined;
Expand Down Expand Up @@ -322,6 +325,7 @@ function getPerDiemExpenseInformation(perDiemExpenseInformation: PerDiemExpenseI
personalDetails,
optimisticChatReportID,
optimisticTransactionID: uiProvidedOptimisticTransactionID,
formatPhoneNumber,
delegateAccountID,
isTrackIntentUser,
} = perDiemExpenseInformation;
Expand Down Expand Up @@ -931,6 +935,7 @@ function submitPerDiemExpense(submitPerDiemExpenseInformation: PerDiemExpenseInf
shouldDeferAutoSubmit,
optimisticChatReportID,
optimisticTransactionID,
formatPhoneNumber,
delegateAccountID,
isTrackIntentUser,
} = submitPerDiemExpenseInformation;
Expand Down Expand Up @@ -984,6 +989,7 @@ function submitPerDiemExpense(submitPerDiemExpenseInformation: PerDiemExpenseInf
personalDetails,
optimisticChatReportID,
optimisticTransactionID,
formatPhoneNumber,
delegateAccountID,
isTrackIntentUser,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@
betas,
personalDetails,
optimisticChatReportID,
formatPhoneNumber,

Check failure on line 641 in src/pages/iou/request/step/confirmation/useExpenseSubmission.ts

View workflow job for this annotation

GitHub Actions / typecheck

No value exists in scope for the shorthand property 'formatPhoneNumber'. Either declare one or provide an initializer.

Check failure on line 641 in src/pages/iou/request/step/confirmation/useExpenseSubmission.ts

View workflow job for this annotation

GitHub Actions / ESLint check

Unsafe assignment of an error typed value
isTrackIntentUser,
});
const targetReportID = backToReport ?? activeReportID;
Expand Down
10 changes: 9 additions & 1 deletion tests/actions/IOU/PerDiemTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import createRandomPolicyCategories from '../../utils/collections/policyCategory
import createRandomPolicyTags from '../../utils/collections/policyTags';
import createRandomTransaction from '../../utils/collections/transaction';
import getOnyxValue from '../../utils/getOnyxValue';
import {getGlobalFetchMock} from '../../utils/TestHelper';
import {formatPhoneNumber, getGlobalFetchMock} from '../../utils/TestHelper';
import waitForBatchedUpdates from '../../utils/waitForBatchedUpdates';

jest.mock('@src/libs/Navigation/Navigation', () => ({
Expand Down Expand Up @@ -326,6 +326,7 @@ describe('PerDiem', () => {
quickAction: undefined,
betas: [CONST.BETAS.ALL],
personalDetails: {[mockParticipantParams.payeeAccountID]: {accountID: mockParticipantParams.payeeAccountID, login: 'payee@example.com'}},
formatPhoneNumber,
isTrackIntentUser: false,
});

Expand Down Expand Up @@ -417,6 +418,7 @@ describe('PerDiem', () => {
quickAction: undefined,
betas: [CONST.BETAS.ALL],
personalDetails: {[mockParticipant.accountID]: {accountID: mockParticipant.accountID, login: 'existing@example.com'}},
formatPhoneNumber,
isTrackIntentUser: false,
});

Expand Down Expand Up @@ -552,6 +554,7 @@ describe('PerDiem', () => {
quickAction: undefined,
betas: [CONST.BETAS.ALL],
personalDetails: {[mockParticipant.accountID]: {accountID: mockParticipant.accountID, login: 'existing@example.com'}},
formatPhoneNumber,
isTrackIntentUser: false,
});

Expand Down Expand Up @@ -641,6 +644,7 @@ describe('PerDiem', () => {
quickAction: undefined,
betas: [CONST.BETAS.ALL],
personalDetails: {[mockParticipant.accountID]: {accountID: mockParticipant.accountID, login: 'existing@example.com'}},
formatPhoneNumber,
isTrackIntentUser: false,
});

Expand Down Expand Up @@ -717,6 +721,7 @@ describe('PerDiem', () => {
quickAction: undefined,
betas: [CONST.BETAS.ALL],
personalDetails: {[RORY_ACCOUNT_ID]: {accountID: RORY_ACCOUNT_ID, login: RORY_EMAIL}},
formatPhoneNumber,
isTrackIntentUser: false,
});

Expand Down Expand Up @@ -786,6 +791,7 @@ describe('PerDiem', () => {
betas: [CONST.BETAS.ALL],
personalDetails: {[RORY_ACCOUNT_ID]: {accountID: RORY_ACCOUNT_ID, login: RORY_EMAIL}},
optimisticTransactionID,
formatPhoneNumber,
isTrackIntentUser: false,
});

Expand Down Expand Up @@ -860,6 +866,7 @@ describe('PerDiem', () => {
quickAction: undefined,
betas: [CONST.BETAS.ALL],
personalDetails: personalDetailsList,
formatPhoneNumber,
isTrackIntentUser: false,
});

Expand Down Expand Up @@ -925,6 +932,7 @@ describe('PerDiem', () => {
quickAction: undefined,
betas: [CONST.BETAS.ALL],
personalDetails: personalDetailsList,
formatPhoneNumber,
isTrackIntentUser: false,
});

Expand Down
Loading