Skip to content

Commit

Permalink
Merge pull request #37455 from Expensify/vit-37367
Browse files Browse the repository at this point in the history
[NoQA] Add the feature boolean flags to the policy type
  • Loading branch information
luacmartins authored Feb 28, 2024
2 parents a085ce4 + 253366e commit 5fbcbb5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/libs/actions/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,12 @@ function createWorkspace(policyOwnerEmail = '', makeMeAdmin = false, policyName
outputCurrency,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
customUnits,
areCategoriesEnabled: true,
areTagsEnabled: false,
areDistanceRatesEnabled: false,
areWorkflowsEnabled: false,
areReportFieldsEnabled: false,
areConnectionsEnabled: false,
},
},
{
Expand Down Expand Up @@ -1803,6 +1809,12 @@ function createWorkspaceFromIOUPayment(iouReport: Report | EmptyObject): string
outputCurrency: CONST.CURRENCY.USD,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
customUnits,
areCategoriesEnabled: true,
areTagsEnabled: false,
areDistanceRatesEnabled: false,
areWorkflowsEnabled: false,
areReportFieldsEnabled: false,
areConnectionsEnabled: false,
};

const optimisticData: OnyxUpdate[] = [
Expand Down
18 changes: 18 additions & 0 deletions src/types/onyx/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,24 @@ type Policy = OnyxCommon.OnyxValueWithOfflineFeedback<

/** All the integration connections attached to the policy */
connections?: Record<string, Connection>;

/** Whether the Categories feature is enabled */
areCategoriesEnabled?: boolean;

/** Whether the Tags feature is enabled */
areTagsEnabled?: boolean;

/** Whether the Distance Rates feature is enabled */
areDistanceRatesEnabled?: boolean;

/** Whether the workflows feature is enabled */
areWorkflowsEnabled?: boolean;

/** Whether the Report Fields feature is enabled */
areReportFieldsEnabled?: boolean;

/** Whether the Connections feature is enabled */
areConnectionsEnabled?: boolean;
},
'generalSettings' | 'addWorkspaceRoom'
>;
Expand Down

0 comments on commit 5fbcbb5

Please sign in to comment.