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: 13 additions & 5 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,10 +321,20 @@
return undefined;
}

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

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 @@ -4566,7 +4566,7 @@
/**
* Get the report fields attached to the policy given policyID
*/
function getReportFieldsByPolicyID(policyID: string | undefined): Record<string, PolicyReportField> {
function getReportFieldsByPolicyID(policyID: string | undefined): Policy['fieldList'] {
if (!policyID) {
return {};
}
Expand Down
3 changes: 3 additions & 0 deletions src/libs/actions/Policy/Category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ 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,
Expand Down
144 changes: 93 additions & 51 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3095,6 +3095,98 @@ 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 @@ -3110,19 +3202,8 @@ 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 @@ -3155,46 +3236,7 @@ function buildDuplicatePolicyData(policy: Policy, options: DuplicatePolicyDataOp
{
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.POLICY}${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,
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,
},
value: buildOptimisticDuplicatePolicy(policy, {...options, targetPolicyID}),
},
{
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);
const allIds = getMemberAccountIDsForWorkspace(policy?.employeeList, false, false);
const totalMembers = Object.keys(allIds).length;
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`);
const taxesLength = Object.keys(policy?.taxRates?.taxes ?? {}).length ?? 0;
const taxesLength = Object.values(policy?.taxRates?.taxes ?? {}).filter((tax) => tax.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length ?? 0;
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`);
const categoriesCount = Object.keys(policyCategories ?? {}).length;
const codingRulesCount = Object.keys(policy?.rules?.codingRules ?? {}).length;
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;
Comment on lines +46 to +47

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude pending-deleted members from the duplicate feature counts

This change filters pending-deleted categories and merchant rules, but the members count in this form still comes from getMemberAccountIDsForWorkspace(policy?.employeeList) with its default includeMemberWithPendingDelete = true. In the offline flow this PR targets, a removed member is still counted in the “Members” row and confirmation modal even though buildDuplicatePolicyData() now drops that member from the duplicated employeeList, so the UI still overstates how many people will be copied.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@nkdengineer Is this a valid concern?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's correct, I updated.

const [selectedItems, setSelectedItems] = useState<string[]>([]);
const reportFields = Object.keys(getReportFieldsByPolicyID(policyID)).length ?? 0;
const reportFields = Object.values(getReportFieldsByPolicyID(policyID) ?? {}).filter((field) => field.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length ?? 0;
const customUnits = getPerDiemCustomUnit(policy);
const customUnitRates: Record<string, Rate> = customUnits?.rates ?? {};
const allRates = Object.values(customUnitRates)?.length;
const allRates = Object.values(customUnitRates)?.filter((rate) => rate.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length ?? 0;
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.keys(customUnit?.rates ?? {}).length;
const ratesCount = Object.values(customUnit?.rates ?? {}).filter((rate) => rate.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length;
const invoiceCompany =
policy?.invoice?.companyName && policy?.invoice?.companyWebsite
? `${policy?.invoice?.companyName}, ${policy?.invoice?.companyWebsite}`
Expand All @@ -67,7 +67,10 @@ function WorkspaceDuplicateSelectFeaturesForm({policyID}: WorkspaceDuplicateForm
if (!policyTags) {
return 0;
}
return Object.values(policyTags).reduce((sum, tagGroup) => sum + Number(Object.values(tagGroup.tags)?.length ?? 0), 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,
);
}, [policyTags]);

const formattedAddress = !isEmptyObject(policy) && !isEmptyObject(policy.address) ? formatAddressToString(policy.address) : '';
Expand Down
5 changes: 4 additions & 1 deletion tests/actions/PolicyTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ 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);
const fakePolicy = {
...createRandomPolicy(10, CONST.POLICY.TYPE.PERSONAL),
employeeList: {},
};
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