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

Add validations for POST /admin/expense_policy_rules #331

Merged
merged 23 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b4b7e35
Add validations for POST /admin/expense_policy_rules
KirtiGautam Aug 8, 2023
aed2d99
Auto generate API docs
snarayanank2 Aug 8, 2023
999d975
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Aug 10, 2023
33a3d38
added
KirtiGautam Aug 10, 2023
dad1044
Auto generate API docs
snarayanank2 Aug 10, 2023
9714e44
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Aug 17, 2023
680e9bd
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Sep 4, 2023
b79db1f
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Sep 7, 2023
ddd94de
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Sep 12, 2023
d38aea5
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Sep 28, 2023
c3fd400
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Oct 6, 2023
890823a
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Oct 6, 2023
08f9b95
added
KirtiGautam Oct 6, 2023
3df4ee6
Auto generate API docs
snarayanank2 Oct 6, 2023
f89fbcf
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Oct 16, 2023
67d49a1
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Oct 17, 2023
bd51d5c
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Oct 18, 2023
9626cc3
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Oct 20, 2023
20195e5
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Oct 30, 2023
876f1dd
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Nov 3, 2023
395175e
Merge branch 'main' of https://github.com/fylein/fyle-platform-docs i…
KirtiGautam Nov 3, 2023
6b744b8
added
KirtiGautam Nov 3, 2023
98d2584
Auto generate API docs
snarayanank2 Nov 3, 2023
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
40 changes: 34 additions & 6 deletions reference/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8880,6 +8880,40 @@ components:
description: |
This represents the description of the expense policy rule.
example: Receipt is mandatory for expense above $50
expense_without_receipt_allowed:
type: boolean
description: |
If this is set to false, then for all such expenses that doesn't have receipt, this policy rule will be violated. <br>
**Note: If this field is set to false i.e. receipts are mandatory, only following conditions & actions are allowed =>**
- expense_category_ids
- expense_category_ids_op
- expense_project_ids
- expense_project_ids_op
- expense_cost_center_ids
- expense_cost_center_ids_op
- expense_limit_type (only `INIDIVIDUAL` type is allowed)
- expense_currency
- expense_amount_max
- employee_department_ids
- employee_department_ids_op
- employee_locations
- employee_user_ids
- employee_user_ids_op
- employee_titles
- employee_titles_op
- action_flag
- action_show_warning
- action_make_unreportable
- action_remove_employee_approver1
- action_add_employee_approver2
- action_add_employee_approver3
- action_add_project_approver1
- action_add_project_approver2
- action_add_department_head_approver
- action_add_approver_user_ids
- description
default: true
example: true
expense_limit_type:
oneOf:
- $ref: '#/components/schemas/expense_policy_limit_type'
Expand Down Expand Up @@ -9053,12 +9087,6 @@ components:
If this is set to false, then for all such expenses that are created on holidays, this policy rule will be violated.
default: true
example: true
expense_without_receipt_allowed:
type: boolean
description: |
If this is set to false, then for all such expenses that doesn't have receipt, this policy rule will be violated.
default: true
example: true
expense_spent_at_max:
allOf:
- $ref: '#/components/schemas/timestamptz_pst'
Expand Down
40 changes: 34 additions & 6 deletions src/components/schemas/expense_policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,40 @@ expense_policy_in:
description: |
This represents the description of the expense policy rule.
example: Receipt is mandatory for expense above $50
expense_without_receipt_allowed:
type: boolean
description: |
If this is set to false, then for all such expenses that doesn't have receipt, this policy rule will be violated. <br>
**Note: If this field is set to false i.e. receipts are mandatory, only following conditions & actions are allowed =>**
- expense_category_ids
- expense_category_ids_op
- expense_project_ids
- expense_project_ids_op
- expense_cost_center_ids
- expense_cost_center_ids_op
- expense_limit_type (only `INIDIVIDUAL` type is allowed)
- expense_currency
- expense_amount_max
- employee_department_ids
- employee_department_ids_op
- employee_locations
- employee_user_ids
- employee_user_ids_op
- employee_titles
- employee_titles_op
- action_flag
- action_show_warning
- action_make_unreportable
- action_remove_employee_approver1
Copy link
Contributor

Choose a reason for hiding this comment

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

remove all the fields which are not required as per the new agreement

- action_add_employee_approver2
- action_add_employee_approver3
- action_add_project_approver1
- action_add_project_approver2
- action_add_department_head_approver
- action_add_approver_user_ids
- description
default: True
example: True
expense_limit_type:
oneOf:
- $ref: ./fields.yaml#/expense_policy_limit_type
Expand Down Expand Up @@ -186,12 +220,6 @@ expense_policy_in:
If this is set to false, then for all such expenses that are created on holidays, this policy rule will be violated.
default: True
example: True
expense_without_receipt_allowed:
type: boolean
description: |
If this is set to false, then for all such expenses that doesn't have receipt, this policy rule will be violated.
default: True
example: True
expense_spent_at_max:
allOf:
- $ref: './fields.yaml#/timestamptz_pst'
Expand Down