Skip to content
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
18 changes: 5 additions & 13 deletions src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

let allPolicies: OnyxCollection<Policy>;

Onyx.connect({

Check warning on line 76 in src/libs/PolicyUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => (allPolicies = value),
Expand Down Expand Up @@ -321,20 +321,10 @@
return undefined;
}

const getUnitWithoutPendingDeleteRates = (customUnit: CustomUnit | undefined) => {
if (!customUnit) {
return undefined;
}
return {
...customUnit,
rates: Object.fromEntries(Object.entries(customUnit.rates).filter(([, rate]) => rate.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)),
};
};

const distanceCustomUnit = getUnitWithoutPendingDeleteRates(Object.values(customUnits).find((customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE));
const perDiemUnit = getUnitWithoutPendingDeleteRates(Object.values(customUnits).find((customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_PER_DIEM_INTERNATIONAL));

if (isDistanceRatesOptionSelected && isPerDiemOptionSelected) {
const distanceCustomUnit = Object.values(customUnits).find((customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE);
const perDiemUnit = Object.values(customUnits).find((customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_PER_DIEM_INTERNATIONAL);

if (!perDiemUnit || !distanceCustomUnit || !perDiemCustomUnitID || !distanceCustomUnitID) {
return undefined;
}
Expand All @@ -343,12 +333,14 @@
}

if (isDistanceRatesOptionSelected && distanceCustomUnitID) {
const distanceCustomUnit = Object.values(customUnits).find((customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE);
if (!distanceCustomUnit) {
return undefined;
}
return {[distanceCustomUnitID]: distanceCustomUnit};
}

const perDiemUnit = Object.values(customUnits).find((customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_PER_DIEM_INTERNATIONAL);
if (!perDiemUnit || !perDiemCustomUnitID) {
return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@
};

let conciergeReportIDOnyxConnect: OnyxEntry<string>;
Onyx.connect({

Check warning on line 1048 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.CONCIERGE_REPORT_ID,
callback: (value) => {
conciergeReportIDOnyxConnect = value;
Expand All @@ -1053,7 +1053,7 @@
});

const defaultAvatarBuildingIconTestID = 'SvgDefaultAvatarBuilding Icon';
Onyx.connect({

Check warning on line 1056 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val is undefined
Expand All @@ -1071,7 +1071,7 @@
let allPersonalDetails: OnyxEntry<PersonalDetailsList>;
let allPersonalDetailLogins: string[];
let currentUserPersonalDetails: OnyxEntry<PersonalDetails>;
Onyx.connect({

Check warning on line 1074 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
if (deprecatedCurrentUserAccountID) {
Expand All @@ -1083,7 +1083,7 @@
});

let allReportsDraft: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 1086 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_DRAFT,
waitForCollectionCallback: true,
callback: (value) => (allReportsDraft = value),
Expand All @@ -1091,7 +1091,7 @@

let allPolicies: OnyxCollection<Policy>;
let policiesArray: Policy[] = [];
Onyx.connect({

Check warning on line 1094 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -1101,7 +1101,7 @@
});

let allPolicyDrafts: OnyxCollection<Policy>;
Onyx.connect({

Check warning on line 1104 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY_DRAFTS,
waitForCollectionCallback: true,
callback: (value) => (allPolicyDrafts = value),
Expand All @@ -1109,7 +1109,7 @@

let deprecatedAllReports: OnyxCollection<Report>;
let deprecatedReportsByPolicyID: ReportByPolicyMap;
Onyx.connect({

Check warning on line 1112 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -1145,14 +1145,14 @@
});

let betaConfiguration: OnyxEntry<BetaConfiguration> = {};
Onyx.connect({

Check warning on line 1148 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.BETA_CONFIGURATION,
callback: (value) => (betaConfiguration = value ?? {}),
});

let deprecatedAllTransactions: OnyxCollection<Transaction> = {};
let deprecatedReportsTransactions: Record<string, Transaction[]> = {};
Onyx.connect({

Check warning on line 1155 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -4572,7 +4572,7 @@
/**
* Get the report fields attached to the policy given policyID
*/
function getReportFieldsByPolicyID(policyID: string | undefined): Policy['fieldList'] {
function getReportFieldsByPolicyID(policyID: string | undefined): Record<string, PolicyReportField> {
if (!policyID) {
return {};
}
Expand Down
3 changes: 0 additions & 3 deletions src/libs/actions/Policy/Category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ function appendSetupCategoriesOnboardingData(
function buildOptimisticPolicyWithExistingCategories(policyID: string, categories: PolicyCategories) {
const categoriesValues = Object.values(categories);
const optimisticCategoryMap = categoriesValues.reduce<Record<string, Partial<PolicyCategory>>>((acc, category) => {
if (category.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
return acc;
}
acc[category.name] = {
...category,
errors: null,
Comment on lines 106 to 109

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Skip deleted categories when building duplicate category map

buildOptimisticPolicyWithExistingCategories now processes every category and forces pendingAction: ADD, including categories that were already marked for deletion. In offline flows, duplicating a workspace after deleting categories will recreate those deleted categories in the target workspace instead of excluding them. The reducer should continue skipping categories with pendingAction: DELETE.

Useful? React with 👍 / 👎.

Expand Down
144 changes: 51 additions & 93 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3097,98 +3097,6 @@ function createDraftWorkspace(
return params;
}

function buildOptimisticDuplicatePolicy(sourcePolicy: Policy, policyOptions: DuplicatePolicyDataOptions) {
const {
policyName: duplicatedPolicyName = '',
targetPolicyID: duplicatedPolicyID,
file: duplicatedPolicyFile,
parts: duplicatedParts,
localCurrency: duplicatedLocalCurrency,
} = policyOptions;

const isMemberFeatureSelected = duplicatedParts?.people;
const isReportsFeatureSelected = duplicatedParts?.reports;
const isConnectionsFeatureSelected = duplicatedParts?.connections;
const isTaxesFeatureSelected = duplicatedParts?.taxes;
const isTagsFeatureSelected = duplicatedParts?.tags;
const isInvoicesFeatureSelected = duplicatedParts?.invoices;
const isDistanceRatesFeatureSelected = duplicatedParts?.distance;
const isRulesFeatureSelected = duplicatedParts?.expenses;
const isWorkflowsFeatureSelected = duplicatedParts?.exportLayouts;
const isPerDiemFeatureSelected = duplicatedParts?.perDiem;
const isOverviewFeatureSelected = duplicatedParts?.overview;
const isTravelFeatureSelected = duplicatedParts?.travel;
const isCodingRulesFeatureSelected = duplicatedParts?.codingRules;
const duplicatedOutputCurrency = isOverviewFeatureSelected ? sourcePolicy?.outputCurrency : duplicatedLocalCurrency;
const {customUnitID: duplicatedDistanceCustomUnitID} = buildOptimisticDistanceRateCustomUnits(duplicatedOutputCurrency);
const duplicatedPerDiemCustomUnitID = generateCustomUnitID();

const filterPendingDeleteData = <T>(data?: Record<string, T>): Record<string, T> | undefined =>
data
? (Object.fromEntries(
Object.entries(data).filter(([, value]) => {
if (!value || typeof value !== 'object' || !('pendingAction' in value)) {
return true;
}
return value.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;
}),
) as Record<string, T>)
: undefined;

const codingRulesWithoutPendingDelete = filterPendingDeleteData(sourcePolicy?.rules?.codingRules);
const employeeListWithoutPendingDelete = filterPendingDeleteData(sourcePolicy?.employeeList);
const fieldListWithoutPendingDelete = filterPendingDeleteData(sourcePolicy?.fieldList);
const connectionsWithoutPendingDelete = filterPendingDeleteData(sourcePolicy?.connections);
const taxRatesWithoutPendingDelete = {
...sourcePolicy?.taxRates,
taxes: filterPendingDeleteData(sourcePolicy?.taxRates?.taxes),
};

return {
...sourcePolicy,
areCategoriesEnabled: true,
areTagsEnabled: isTagsFeatureSelected,
areDistanceRatesEnabled: isDistanceRatesFeatureSelected,
areInvoicesEnabled: isInvoicesFeatureSelected,
areRulesEnabled: isRulesFeatureSelected,
areWorkflowsEnabled: isWorkflowsFeatureSelected,
areReportFieldsEnabled: isReportsFeatureSelected,
areConnectionsEnabled: isConnectionsFeatureSelected,
arePerDiemRatesEnabled: isPerDiemFeatureSelected,
isTravelEnabled: isTravelFeatureSelected ? sourcePolicy?.isTravelEnabled : undefined,
travelSettings: undefined,
workspaceAccountID: undefined,
tax: isTaxesFeatureSelected ? sourcePolicy?.tax : undefined,
employeeList: isMemberFeatureSelected ? employeeListWithoutPendingDelete : {[sourcePolicy.owner]: sourcePolicy?.employeeList?.[sourcePolicy.owner]},
id: duplicatedPolicyID,
name: duplicatedPolicyName,
fieldList: isReportsFeatureSelected ? fieldListWithoutPendingDelete : undefined,
connections: isConnectionsFeatureSelected ? connectionsWithoutPendingDelete : undefined,
customUnits: getCustomUnitsForDuplication(sourcePolicy, isDistanceRatesFeatureSelected, isPerDiemFeatureSelected, {
distanceCustomUnitID: duplicatedDistanceCustomUnitID,
perDiemCustomUnitID: duplicatedPerDiemCustomUnitID,
}),
taxRates: isTaxesFeatureSelected ? taxRatesWithoutPendingDelete : undefined,
rules: isCodingRulesFeatureSelected ? {codingRules: codingRulesWithoutPendingDelete} : undefined,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
pendingFields: {
autoReporting: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
approvalMode: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
reimbursementChoice: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
name: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
outputCurrency: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
address: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
description: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
type: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
areReportFieldsEnabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
},
avatarURL: duplicatedPolicyFile?.uri,
originalFileName: duplicatedPolicyFile?.name,
outputCurrency: duplicatedOutputCurrency,
address: isOverviewFeatureSelected ? sourcePolicy?.address : undefined,
};
}

function buildDuplicatePolicyData(policy: Policy, options: DuplicatePolicyDataOptions) {
const {policyName = '', policyID = generatePolicyID(), file, welcomeNote, parts, targetPolicyID = generatePolicyID(), policyCategories, localCurrency} = options;

Expand All @@ -3204,8 +3112,19 @@ function buildDuplicatePolicyData(policy: Policy, options: DuplicatePolicyDataOp
pendingChatMembers,
} = ReportUtils.buildOptimisticWorkspaceChats(targetPolicyID, policyName);
const isMemberOptionSelected = parts?.people;
const isReportsOptionSelected = parts?.reports;
const isConnectionsOptionSelected = parts?.connections;
const isCategoriesOptionSelected = parts?.categories;
const isTaxesOptionSelected = parts?.taxes;
const isTagsOptionSelected = parts?.tags;
const isInvoicesOptionSelected = parts?.invoices;
const isDistanceRatesOptionSelected = parts?.distance;
const isRulesOptionSelected = parts?.expenses;
const isWorkflowsOptionSelected = parts?.exportLayouts;
const isPerDiemOptionSelected = parts?.perDiem;
const isOverviewOptionSelected = parts?.overview;
const isTravelOptionSelected = parts?.travel;
const isCodingRulesOptionSelected = parts?.codingRules;

const outputCurrency = isOverviewOptionSelected ? policy?.outputCurrency : localCurrency;

Expand Down Expand Up @@ -3238,7 +3157,46 @@ function buildDuplicatePolicyData(policy: Policy, options: DuplicatePolicyDataOp
{
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.POLICY}${targetPolicyID}`,
value: buildOptimisticDuplicatePolicy(policy, {...options, targetPolicyID}),
value: {
...policy,
areCategoriesEnabled: true,
areTagsEnabled: isTagsOptionSelected,
areDistanceRatesEnabled: isDistanceRatesOptionSelected,
areInvoicesEnabled: isInvoicesOptionSelected,
areRulesEnabled: isRulesOptionSelected,
areWorkflowsEnabled: isWorkflowsOptionSelected,
areReportFieldsEnabled: isReportsOptionSelected,
areConnectionsEnabled: isConnectionsOptionSelected,
arePerDiemRatesEnabled: isPerDiemOptionSelected,
isTravelEnabled: isTravelOptionSelected ? policy?.isTravelEnabled : undefined,
travelSettings: undefined,
workspaceAccountID: undefined,
tax: isTaxesOptionSelected ? policy?.tax : undefined,
employeeList: isMemberOptionSelected ? policy.employeeList : {[policy.owner]: policy?.employeeList?.[policy.owner]},
id: targetPolicyID,
name: policyName,
fieldList: isReportsOptionSelected ? policy?.fieldList : undefined,
connections: isConnectionsOptionSelected ? policy?.connections : undefined,
Comment on lines +3175 to +3179

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Filter pending-delete entries before cloning workspace data

In buildDuplicatePolicyData, the duplicate policy now copies employeeList, fieldList, and connections directly from the source policy, so entries still marked with pendingAction: DELETE are carried into the new workspace. If a user deletes members/report fields/connections while offline and duplicates before sync completes, those removed items are reintroduced in the optimistic duplicate state and can persist until a full refresh. Please filter out pending-delete children before assigning these maps.

Useful? React with 👍 / 👎.

customUnits: getCustomUnitsForDuplication(policy, isDistanceRatesOptionSelected, isPerDiemOptionSelected, {distanceCustomUnitID, perDiemCustomUnitID}),
taxRates: isTaxesOptionSelected ? policy?.taxRates : undefined,
rules: isCodingRulesOptionSelected ? {codingRules: policy?.rules?.codingRules} : undefined,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
pendingFields: {
autoReporting: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
approvalMode: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
reimbursementChoice: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
name: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
outputCurrency: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
address: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
description: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
type: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
areReportFieldsEnabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
},
avatarURL: file?.uri,
originalFileName: file?.name,
outputCurrency,
address: isOverviewOptionSelected ? policy?.address : undefined,
},
},
{
onyxMethod: Onyx.METHOD.MERGE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@ function WorkspaceDuplicateSelectFeaturesForm({policyID}: WorkspaceDuplicateForm
const [duplicateWorkspace] = useOnyx(ONYXKEYS.DUPLICATE_WORKSPACE);
const [duplicatedWorkspaceAvatar, setDuplicatedWorkspaceAvatar] = useState<File | undefined>();
const [isDuplicateModalOpen, setIsDuplicateModalOpen] = useState(false);
const allIds = getMemberAccountIDsForWorkspace(policy?.employeeList, false, false);
const allIds = getMemberAccountIDsForWorkspace(policy?.employeeList);
const totalMembers = Object.keys(allIds).length;
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`);
const taxesLength = Object.values(policy?.taxRates?.taxes ?? {}).filter((tax) => tax.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length ?? 0;
const taxesLength = Object.keys(policy?.taxRates?.taxes ?? {}).length ?? 0;
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`);
const categoriesCount = Object.values(policyCategories ?? {}).filter((category) => category.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length;
const codingRulesCount = Object.values(policy?.rules?.codingRules ?? {}).filter((rule) => rule.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length;
const categoriesCount = Object.keys(policyCategories ?? {}).length;
const codingRulesCount = Object.keys(policy?.rules?.codingRules ?? {}).length;
const [selectedItems, setSelectedItems] = useState<string[]>([]);
const reportFields = Object.values(getReportFieldsByPolicyID(policyID) ?? {}).filter((field) => field.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length ?? 0;
const reportFields = Object.keys(getReportFieldsByPolicyID(policyID)).length ?? 0;
const customUnits = getPerDiemCustomUnit(policy);
const customUnitRates: Record<string, Rate> = customUnits?.rates ?? {};
const allRates = Object.values(customUnitRates)?.filter((rate) => rate.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length ?? 0;
const allRates = Object.values(customUnitRates)?.length;
const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST);
const currentUserPersonalDetails = useCurrentUserPersonalDetails();

const accountingIntegrations = Object.values(CONST.POLICY.CONNECTIONS.NAME);
const connectedIntegration = getAllValidConnectedIntegration(policy, accountingIntegrations);

const customUnit = getDistanceRateCustomUnit(policy);
const ratesCount = Object.values(customUnit?.rates ?? {}).filter((rate) => rate.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length;
const ratesCount = Object.keys(customUnit?.rates ?? {}).length;
const invoiceCompany =
policy?.invoice?.companyName && policy?.invoice?.companyWebsite
? `${policy?.invoice?.companyName}, ${policy?.invoice?.companyWebsite}`
Expand All @@ -67,10 +67,7 @@ function WorkspaceDuplicateSelectFeaturesForm({policyID}: WorkspaceDuplicateForm
if (!policyTags) {
return 0;
}
return Object.values(policyTags).reduce(
(sum, tagGroup) => sum + Number(Object.values(tagGroup.tags)?.filter((tag) => tag.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length ?? 0),
0,
);
return Object.values(policyTags).reduce((sum, tagGroup) => sum + Number(Object.values(tagGroup.tags)?.length ?? 0), 0);
}, [policyTags]);

const formattedAddress = !isEmptyObject(policy) && !isEmptyObject(policy.address) ? formatAddressToString(policy.address) : '';
Expand Down
5 changes: 1 addition & 4 deletions tests/actions/PolicyTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,7 @@ describe('actions/Policy', () => {
it('duplicate workspace', async () => {
(fetch as MockFetch)?.pause?.();
await Onyx.set(ONYXKEYS.SESSION, {email: ESH_EMAIL, accountID: ESH_ACCOUNT_ID});
const fakePolicy = {
...createRandomPolicy(10, CONST.POLICY.TYPE.PERSONAL),
employeeList: {},
};
const fakePolicy = createRandomPolicy(10, CONST.POLICY.TYPE.PERSONAL);
await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${fakePolicy.id}`, fakePolicy);
await Onyx.set(`${ONYXKEYS.NVP_ACTIVE_POLICY_ID}`, fakePolicy.id);
await Onyx.set(`${ONYXKEYS.NVP_INTRO_SELECTED}`, {choice: CONST.ONBOARDING_CHOICES.MANAGE_TEAM});
Expand Down
Loading