Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] Add approval mode for policies #35047

Merged
merged 3 commits into from
Jan 24, 2024
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
8 changes: 8 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,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)),
};
}
Loading