Skip to content

Commit

Permalink
Merge pull request #35047 from Expensify/alberto-policyInfo
Browse files Browse the repository at this point in the history
[No QA] Add approval mode for policies
  • Loading branch information
Hayata Suenaga authored Jan 24, 2024
2 parents bc4de12 + c5ba737 commit 30aa432
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,14 @@ const CONST = {
LAST_BUSINESS_DAY_OF_MONTH: 'lastBusinessDayOfMonth',
LAST_DAY_OF_MONTH: 'lastDayOfMonth',
},
APPROVAL_MODE: {
OPTIONAL: 'OPTIONAL',
BASIC: 'BASIC',
ADVANCED: 'ADVANCED',
DYNAMICEXTERNAL: 'DYNAMIC_EXTERNAL',
SMARTREPORT: 'SMARTREPORT',
BILLCOM: 'BILLCOM',
},
ROOM_PREFIX: '#',
CUSTOM_UNIT_RATE_BASE_OFFSET: 100,
OWNER_EMAIL_FAKE: '_FAKE_',
Expand Down
3 changes: 3 additions & 0 deletions src/types/onyx/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ type Policy = {

/** Informative messages about which policy members were added with primary logins when invited with their secondary login */
primaryLoginsInvited?: Record<string, string>;

/** The approval mode set up on this policy */
approvalMode?: ValueOf<typeof CONST.POLICY.APPROVAL_MODE>;
};

export default Policy;
Expand Down
1 change: 1 addition & 0 deletions tests/utils/LHNTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ function getFakePolicy(id = 1, name = 'Workspace-Test-001') {
submitsTo: 123456,
defaultBillable: false,
disabledFields: {defaultBillable: true, reimbursable: false},
approvalMode: 'BASIC',
};
}

Expand Down
1 change: 1 addition & 0 deletions tests/utils/collections/policies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ export default function createRandomPolicy(index: number): Policy {
errors: {},
customUnits: {},
errorFields: {},
approvalMode: rand(Object.values(CONST.POLICY.APPROVAL_MODE)),
};
}

0 comments on commit 30aa432

Please sign in to comment.