From 460843582e120cf3144706e8b985a560afa9c055 Mon Sep 17 00:00:00 2001 From: Krupa Hebbar Date: Thu, 19 Feb 2026 12:30:42 +0530 Subject: [PATCH 1/4] add scopes to employee_rot delegatees --- src/components/schemas/fields.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/schemas/fields.yaml b/src/components/schemas/fields.yaml index bdd21ec78..c006f69b4 100644 --- a/src/components/schemas/fields.yaml +++ b/src/components/schemas/fields.yaml @@ -1982,6 +1982,16 @@ delegatee: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: True + scopes: + type: array + nullable: True + items: + type: string + enum: + - ALL + - SUBMIT + - APPROVE + example: ["SUBMIT", "APPROVE"] subscribed_resources: type: array From 4f9eb6781acfc8fe1426b346942148924b21d696 Mon Sep 17 00:00:00 2001 From: Krupa Hebbar Date: Thu, 19 Feb 2026 07:48:06 +0000 Subject: [PATCH 2/4] Auto generate API docs --- reference/admin.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/reference/admin.yaml b/reference/admin.yaml index 8a4e58748..6dab867da 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -15736,6 +15736,18 @@ components: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true + scopes: + type: array + nullable: true + items: + type: string + enum: + - ALL + - SUBMIT + - APPROVE + example: + - SUBMIT + - APPROVE invitation_in: type: object additionalProperties: false From ce9d23df376e9cf90ee895754f22f2408ad3f06c Mon Sep 17 00:00:00 2001 From: Krupa Hebbar Date: Thu, 19 Feb 2026 16:52:21 +0530 Subject: [PATCH 3/4] use common scopes component --- src/components/schemas/employee.yaml | 4 ++++ src/components/schemas/fields.yaml | 30 +++++++++++++--------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/components/schemas/employee.yaml b/src/components/schemas/employee.yaml index a8f54b335..b80725aed 100644 --- a/src/components/schemas/employee.yaml +++ b/src/components/schemas/employee.yaml @@ -801,6 +801,10 @@ spender_delegatees_post_in: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: True + scopes: + allOf: + - $ref: './fields.yaml#/delegation_access_scope' + nullable: True spender_delegatees_post_out: type: object diff --git a/src/components/schemas/fields.yaml b/src/components/schemas/fields.yaml index c006f69b4..8d97403fb 100644 --- a/src/components/schemas/fields.yaml +++ b/src/components/schemas/fields.yaml @@ -346,6 +346,15 @@ contains_operator: Value signifying the operator for the field example: IN +delegation_access_scope: + type: array + description: | + List of scopes for the delegate. + items: + type: string + enum: [ALL, SUBMIT, APPROVE] + example: ["SUBMIT", "APPROVE"] + expense_policy_rule_embed: type: object additionalProperties: false @@ -1646,15 +1655,9 @@ delegatees: Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: True scopes: - type: array + allOf: + - $ref: './fields.yaml#/delegation_access_scope' nullable: True - items: - type: string - enum: - - ALL - - SUBMIT - - APPROVE - example: ["SUBMIT", "APPROVE"] locale: type: object @@ -1983,15 +1986,10 @@ delegatee: Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: True scopes: - type: array + allOf: + - $ref: './fields.yaml#/delegation_access_scope' nullable: True - items: - type: string - enum: - - ALL - - SUBMIT - - APPROVE - example: ["SUBMIT", "APPROVE"] + subscribed_resources: type: array From 039c15d4512f9bfb65822259cff435f7387cbd46 Mon Sep 17 00:00:00 2001 From: Krupa Hebbar Date: Thu, 19 Feb 2026 11:23:21 +0000 Subject: [PATCH 4/4] Auto generate API docs --- reference/admin.yaml | 37 +++++++++++++++++-------------------- reference/approver.yaml | 25 +++++++++++++++---------- reference/manager.yaml | 25 +++++++++++++++---------- reference/spender.yaml | 29 +++++++++++++++++++---------- 4 files changed, 66 insertions(+), 50 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index 6dab867da..be398c495 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -15153,6 +15153,19 @@ components: description: | String denoting the full name of an employee. example: Jon Snow + delegation_access_scope: + type: array + description: | + List of scopes for the delegate. + items: + type: string + enum: + - ALL + - SUBMIT + - APPROVE + example: + - SUBMIT + - APPROVE delegatees: type: object additionalProperties: false @@ -15196,17 +15209,9 @@ components: Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true scopes: - type: array + allOf: + - $ref: '#/components/schemas/delegation_access_scope' nullable: true - items: - type: string - enum: - - ALL - - SUBMIT - - APPROVE - example: - - SUBMIT - - APPROVE category_out_embed: type: object nullable: true @@ -15737,17 +15742,9 @@ components: Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true scopes: - type: array + allOf: + - $ref: '#/components/schemas/delegation_access_scope' nullable: true - items: - type: string - enum: - - ALL - - SUBMIT - - APPROVE - example: - - SUBMIT - - APPROVE invitation_in: type: object additionalProperties: false diff --git a/reference/approver.yaml b/reference/approver.yaml index d68ad9315..72d10921d 100644 --- a/reference/approver.yaml +++ b/reference/approver.yaml @@ -9411,6 +9411,19 @@ components: description: | String denoting the full name of an employee. example: Jon Snow + delegation_access_scope: + type: array + description: | + List of scopes for the delegate. + items: + type: string + enum: + - ALL + - SUBMIT + - APPROVE + example: + - SUBMIT + - APPROVE delegatees: type: object additionalProperties: false @@ -9454,17 +9467,9 @@ components: Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true scopes: - type: array + allOf: + - $ref: '#/components/schemas/delegation_access_scope' nullable: true - items: - type: string - enum: - - ALL - - SUBMIT - - APPROVE - example: - - SUBMIT - - APPROVE employee_out: type: object additionalProperties: false diff --git a/reference/manager.yaml b/reference/manager.yaml index 3a6b9e41b..d0dc25f41 100644 --- a/reference/manager.yaml +++ b/reference/manager.yaml @@ -1590,6 +1590,19 @@ components: description: | String denoting the full name of an employee. example: Jon Snow + delegation_access_scope: + type: array + description: | + List of scopes for the delegate. + items: + type: string + enum: + - ALL + - SUBMIT + - APPROVE + example: + - SUBMIT + - APPROVE delegatees: type: object additionalProperties: false @@ -1633,17 +1646,9 @@ components: Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true scopes: - type: array + allOf: + - $ref: '#/components/schemas/delegation_access_scope' nullable: true - items: - type: string - enum: - - ALL - - SUBMIT - - APPROVE - example: - - SUBMIT - - APPROVE category_out_embed: type: object nullable: true diff --git a/reference/spender.yaml b/reference/spender.yaml index 3df1b9274..56bf201f4 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -14620,6 +14620,19 @@ components: description: | String denoting the full name of an employee. example: Jon Snow + delegation_access_scope: + type: array + description: | + List of scopes for the delegate. + items: + type: string + enum: + - ALL + - SUBMIT + - APPROVE + example: + - SUBMIT + - APPROVE delegatees: type: object additionalProperties: false @@ -14663,17 +14676,9 @@ components: Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true scopes: - type: array + allOf: + - $ref: '#/components/schemas/delegation_access_scope' nullable: true - items: - type: string - enum: - - ALL - - SUBMIT - - APPROVE - example: - - SUBMIT - - APPROVE spender_employee_out: type: object additionalProperties: false @@ -15088,6 +15093,10 @@ components: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true + scopes: + allOf: + - $ref: '#/components/schemas/delegation_access_scope' + nullable: true spender_delegatees_post_out: type: object additionalProperties: false