From 03b389bdaaf83fc496c7b8e6b6b676046f80b7a9 Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Thu, 21 May 2026 23:44:32 +0530 Subject: [PATCH 1/3] Updated openapi docs for policy violation reason --- reference/spender.yaml | 14 ++++++++++++++ src/components/schemas/expense.yaml | 3 +++ src/components/schemas/expense_policies.yaml | 14 ++++++++++++++ src/components/schemas/fields.yaml | 5 +++++ 4 files changed, 36 insertions(+) diff --git a/reference/spender.yaml b/reference/spender.yaml index 9a8aee0ad..3f790aad4 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -8719,6 +8719,9 @@ components: example: epc1a2f3farmk comment_type: type: string + enum: + - LOST_RECEIPT_REASON + - POLICY_VIOLATION_REASON description: Type of the policy comment comment_text: type: string @@ -16484,6 +16487,12 @@ components: If it is set to true, then a warning is shown to the employee, whenever he attempts to create an expense that violates this policy rule. default: false example: true + policy_violation_reason_required: + type: boolean + description: | + If it is set to true, then entering a policy violation reason becomes mandatory for expenses violating this policy rule. + default: false + example: false action_make_unreportable: type: boolean description: | @@ -16572,6 +16581,11 @@ components: description: | A true value here means that policy calculation suggests showing a warning when the user attempts to create an expense that violates this expense policy rule. example: true + policy_violation_reason_required: + type: boolean + description: | + A true value here means that entering a policy violation reason is mandatory for this policy rule. + example: false action_make_unreportable: type: boolean nullable: false diff --git a/src/components/schemas/expense.yaml b/src/components/schemas/expense.yaml index 1878901b9..3ad47de57 100644 --- a/src/components/schemas/expense.yaml +++ b/src/components/schemas/expense.yaml @@ -2970,6 +2970,9 @@ expense_policy_comment_out_embed: example: epc1a2f3farmk comment_type: type: string + enum: + - LOST_RECEIPT_REASON + - POLICY_VIOLATION_REASON description: Type of the policy comment comment_text: type: string diff --git a/src/components/schemas/expense_policies.yaml b/src/components/schemas/expense_policies.yaml index 15b79ad9c..08a6d88a5 100644 --- a/src/components/schemas/expense_policies.yaml +++ b/src/components/schemas/expense_policies.yaml @@ -45,6 +45,7 @@ expense_policy_in: - employee_titles_op - action_flag - action_show_warning + - policy_violation_reason_required - action_make_unreportable - description default: True @@ -374,6 +375,13 @@ expense_policy_in: If it is set to true, then a warning is shown to the employee, whenever he attempts to create an expense that violates this policy rule. default: False example: True + policy_violation_reason_required: + type: boolean + description: | + If it is set to true, then entering a policy violation reason becomes mandatory for expenses violating this policy rule.
+ _Note: This can be true only when `action_show_warning` is true._ + default: False + example: False action_make_unreportable: type: boolean description: | @@ -789,6 +797,12 @@ expense_policy_out: If it is set to true, then a warning is shown to the employee, whenever he attempts to create an expense that violates this policy rule. default: False example: True + policy_violation_reason_required: + type: boolean + description: | + If it is set to true, then entering a policy violation reason becomes mandatory for expenses violating this policy rule. + default: False + example: False action_make_unreportable: type: boolean description: | diff --git a/src/components/schemas/fields.yaml b/src/components/schemas/fields.yaml index 8d97403fb..5d4520429 100644 --- a/src/components/schemas/fields.yaml +++ b/src/components/schemas/fields.yaml @@ -374,6 +374,11 @@ expense_policy_rule_embed: description: | A true value here means that policy calculation suggests showing a warning when the user attempts to create an expense that violates this expense policy rule. example: True + policy_violation_reason_required: + type: boolean + description: | + A true value here means that entering a policy violation reason is mandatory for this policy rule. + example: false action_make_unreportable: type: boolean nullable: false From 1f1934995b990255e1da3358f110ed7446cde3c2 Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Fri, 22 May 2026 16:04:49 +0530 Subject: [PATCH 2/3] Made updates to support mandatory policy violation reason --- reference/admin.yaml | 5 +++++ reference/approver.yaml | 5 +++++ reference/spender.yaml | 2 ++ 3 files changed, 12 insertions(+) diff --git a/reference/admin.yaml b/reference/admin.yaml index 01a77f663..85983c2c7 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -28733,6 +28733,11 @@ components: description: | A true value here means that policy calculation suggests showing a warning when the user attempts to create an expense that violates this expense policy rule. example: true + policy_violation_reason_required: + type: boolean + description: | + A true value here means that entering a policy violation reason is mandatory for this policy rule. + example: false action_make_unreportable: type: boolean nullable: false diff --git a/reference/approver.yaml b/reference/approver.yaml index cd59e5745..68ac63fa2 100644 --- a/reference/approver.yaml +++ b/reference/approver.yaml @@ -8371,6 +8371,11 @@ components: description: | A true value here means that policy calculation suggests showing a warning when the user attempts to create an expense that violates this expense policy rule. example: true + policy_violation_reason_required: + type: boolean + description: | + A true value here means that entering a policy violation reason is mandatory for this policy rule. + example: false action_make_unreportable: type: boolean nullable: false diff --git a/reference/spender.yaml b/reference/spender.yaml index 3f790aad4..2088a69a7 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -16828,6 +16828,8 @@ components: _Note: This field is mandatory when you are creating an expense and want to check it against the policy rules before saving the expense._ source: $ref: '#/components/schemas/source' + currency: + $ref: '#/components/schemas/currency' merchant: $ref: '#/components/schemas/merchant' foreign_currency: From 0e49e17aed2c5dfd5df508533a93c139ea15db98 Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Fri, 22 May 2026 11:37:18 +0000 Subject: [PATCH 3/3] Auto generate API docs --- reference/admin.yaml | 17 +++++++++++++++++ reference/approver.yaml | 3 +++ reference/manager.yaml | 8 ++++++++ reference/spender.yaml | 2 -- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index 85983c2c7..f1f58611a 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -17975,6 +17975,9 @@ components: example: epc1a2f3farmk comment_type: type: string + enum: + - LOST_RECEIPT_REASON + - POLICY_VIOLATION_REASON description: Type of the policy comment comment_text: type: string @@ -28179,6 +28182,12 @@ components: If it is set to true, then a warning is shown to the employee, whenever he attempts to create an expense that violates this policy rule. default: false example: true + policy_violation_reason_required: + type: boolean + description: | + If it is set to true, then entering a policy violation reason becomes mandatory for expenses violating this policy rule. + default: false + example: false action_make_unreportable: type: boolean description: | @@ -28295,6 +28304,7 @@ components: - employee_titles_op - action_flag - action_show_warning + - policy_violation_reason_required - action_make_unreportable - description default: true @@ -28638,6 +28648,13 @@ components: If it is set to true, then a warning is shown to the employee, whenever he attempts to create an expense that violates this policy rule. default: false example: true + policy_violation_reason_required: + type: boolean + description: | + If it is set to true, then entering a policy violation reason becomes mandatory for expenses violating this policy rule.
+ _Note: This can be true only when `action_show_warning` is true._ + default: false + example: false action_make_unreportable: type: boolean description: | diff --git a/reference/approver.yaml b/reference/approver.yaml index 68ac63fa2..c227d6aa8 100644 --- a/reference/approver.yaml +++ b/reference/approver.yaml @@ -5521,6 +5521,9 @@ components: example: epc1a2f3farmk comment_type: type: string + enum: + - LOST_RECEIPT_REASON + - POLICY_VIOLATION_REASON description: Type of the policy comment comment_text: type: string diff --git a/reference/manager.yaml b/reference/manager.yaml index 4fdb18873..0ef7b6f0b 100644 --- a/reference/manager.yaml +++ b/reference/manager.yaml @@ -843,6 +843,11 @@ components: description: | A true value here means that policy calculation suggests showing a warning when the user attempts to create an expense that violates this expense policy rule. example: true + policy_violation_reason_required: + type: boolean + description: | + A true value here means that entering a policy violation reason is mandatory for this policy rule. + example: false action_make_unreportable: type: boolean nullable: false @@ -2209,6 +2214,9 @@ components: example: epc1a2f3farmk comment_type: type: string + enum: + - LOST_RECEIPT_REASON + - POLICY_VIOLATION_REASON description: Type of the policy comment comment_text: type: string diff --git a/reference/spender.yaml b/reference/spender.yaml index 2088a69a7..3f790aad4 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -16828,8 +16828,6 @@ components: _Note: This field is mandatory when you are creating an expense and want to check it against the policy rules before saving the expense._ source: $ref: '#/components/schemas/source' - currency: - $ref: '#/components/schemas/currency' merchant: $ref: '#/components/schemas/merchant' foreign_currency: