From 49e5bc0c29c4bb8c5de7155021944a9a3fd25ef6 Mon Sep 17 00:00:00 2001 From: Roshan Mhatre Date: Thu, 8 Aug 2024 00:30:20 +0530 Subject: [PATCH] feat: Update docs for `spender/employees` (#534) * feat: Update docs for spender/employees * Auto generate API docs * feat: Update docs * Auto generate API docs * feat: Update is_enabled description * Auto generate API docs --------- Co-authored-by: Siva --- reference/admin.yaml | 75 ++++++++++++------- reference/approver.yaml | 28 +++---- reference/hod.yaml | 1 - reference/hop.yaml | 1 - reference/spender.yaml | 108 +++++++++++++++++++++++---- src/components/schemas/employee.yaml | 71 +++++++++++++----- src/components/schemas/fields.yaml | 31 +++++++- 7 files changed, 241 insertions(+), 74 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index 058dc8d5f..c5a6c25c3 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -127,7 +127,6 @@ components: type: boolean description: | This indicates if the resource is enabled for use within the organisation. - default: true example: true restricted_spender_user_ids: type: array @@ -1636,6 +1635,11 @@ components: example: Audi code: $ref: '#/components/schemas/code' + has_accepted_invite: + type: boolean + description: | + This boolean field represents whether the employee has accepted the current org's invite by verifying his/her email or not. + example: true bank_ifsc: type: string example: SBIN0007587 @@ -1707,12 +1711,42 @@ components: The unique id of an user to which the object is associated. readOnly: true example: uswjwgnwwgo + user_full_name: + type: string + maxLength: 255 + description: | + String denoting the full name of an employee. + example: Jon Snow delegatees: type: object additionalProperties: false properties: + id: + allOf: + - $ref: '#/components/schemas/id_integer' + description: | + Delegation id. + example: 100 + type: + type: string + enum: + - SHORT_TERM + - PERMANENT + description: | + Type of delegation. + example: SHORT_TERM user_id: $ref: '#/components/schemas/user_id' + email: + allOf: + - $ref: '#/components/schemas/email' + description: | + Email of the delegatee. + full_name: + allOf: + - $ref: '#/components/schemas/user_full_name' + description: | + Full name of the delegatee. start_at: type: string format: date-time @@ -1792,7 +1826,10 @@ components: department: $ref: '#/components/schemas/department_out_embed' is_enabled: - $ref: '#/components/schemas/is_enabled' + allOf: + - $ref: '#/components/schemas/is_enabled' + description: | + This field indicates whether the employee is enabled in the org. joined_at: $ref: '#/components/schemas/joined_at' level_id: @@ -1908,11 +1945,7 @@ components: description: | List of users who are approvers for this employee. has_accepted_invite: - type: boolean - description: | - This boolean field represents whether the employee has accepted the current org's invite by veryfying his/her email or not. - default: true - example: true + $ref: '#/components/schemas/has_accepted_invite' branch_account: type: string nullable: true @@ -3047,13 +3080,12 @@ components: flattened_custom_field: $ref: '#/components/schemas/flattened_custom_field' has_accepted_invite: - type: boolean - description: | - This boolean field represents whether the employee has accepted the current org's invite by veryfying his/her email or not. - default: true - example: true + $ref: '#/components/schemas/has_accepted_invite' is_enabled: - $ref: '#/components/schemas/is_enabled' + allOf: + - $ref: '#/components/schemas/is_enabled' + description: | + This field indicates whether the employee is enabled in the org. mobile: type: string nullable: true @@ -5332,13 +5364,12 @@ components: nullable: true example: Branch Manager has_accepted_invite: - type: boolean - description: | - This boolean field represents whether the employee has accepted the current org's invite by veryfying his/her email or not. - default: true - example: true + $ref: '#/components/schemas/has_accepted_invite' is_enabled: - $ref: '#/components/schemas/is_enabled' + allOf: + - $ref: '#/components/schemas/is_enabled' + description: | + This field indicates whether the employee is enabled in the org. mobile: type: string nullable: true @@ -10169,12 +10200,6 @@ components: $ref: '#/components/schemas/spend_overview_percentage' change_percentage: $ref: '#/components/schemas/spend_overview_change_percentage' - user_full_name: - type: string - maxLength: 255 - description: | - String denoting the full name of an employee. - example: Jon Snow spend_overview_by_user_data_out: type: object nullable: false diff --git a/reference/approver.yaml b/reference/approver.yaml index 7a2e35979..e9e9d7f1f 100644 --- a/reference/approver.yaml +++ b/reference/approver.yaml @@ -229,11 +229,15 @@ components: - id - name - band + has_accepted_invite: + type: boolean + description: | + This boolean field represents whether the employee has accepted the current org's invite by verifying his/her email or not. + example: true is_enabled: type: boolean description: | This indicates if the resource is enabled for use within the organisation. - default: true example: true phone_number: type: string @@ -318,13 +322,12 @@ components: nullable: true example: Branch Manager has_accepted_invite: - type: boolean - description: | - This boolean field represents whether the employee has accepted the current org's invite by veryfying his/her email or not. - default: true - example: true + $ref: '#/components/schemas/has_accepted_invite' is_enabled: - $ref: '#/components/schemas/is_enabled' + allOf: + - $ref: '#/components/schemas/is_enabled' + description: | + This field indicates whether the employee is enabled in the org. mobile: type: string nullable: true @@ -1332,13 +1335,12 @@ components: flattened_custom_field: $ref: '#/components/schemas/flattened_custom_field' has_accepted_invite: - type: boolean - description: | - This boolean field represents whether the employee has accepted the current org's invite by veryfying his/her email or not. - default: true - example: true + $ref: '#/components/schemas/has_accepted_invite' is_enabled: - $ref: '#/components/schemas/is_enabled' + allOf: + - $ref: '#/components/schemas/is_enabled' + description: | + This field indicates whether the employee is enabled in the org. mobile: type: string nullable: true diff --git a/reference/hod.yaml b/reference/hod.yaml index c5893dfc5..2b7d35c85 100644 --- a/reference/hod.yaml +++ b/reference/hod.yaml @@ -106,7 +106,6 @@ components: type: boolean description: | This indicates if the resource is enabled for use within the organisation. - default: true example: true budget_out_embed: type: object diff --git a/reference/hop.yaml b/reference/hop.yaml index 40facdcc0..6d1683e0b 100644 --- a/reference/hop.yaml +++ b/reference/hop.yaml @@ -106,7 +106,6 @@ components: type: boolean description: | This indicates if the resource is enabled for use within the organisation. - default: true example: true budget_out_embed: type: object diff --git a/reference/spender.yaml b/reference/spender.yaml index f63459077..f3c6396b7 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -114,7 +114,6 @@ components: type: boolean description: | This indicates if the resource is enabled for use within the organisation. - default: true example: true project_out: type: object @@ -1101,6 +1100,11 @@ components: example: - v1 - v2 + has_accepted_invite: + type: boolean + description: | + This boolean field represents whether the employee has accepted the current org's invite by verifying his/her email or not. + example: true phone_number: type: string example: '+12131234567' @@ -1171,13 +1175,12 @@ components: flattened_custom_field: $ref: '#/components/schemas/flattened_custom_field' has_accepted_invite: - type: boolean - description: | - This boolean field represents whether the employee has accepted the current org's invite by veryfying his/her email or not. - default: true - example: true + $ref: '#/components/schemas/has_accepted_invite' is_enabled: - $ref: '#/components/schemas/is_enabled' + allOf: + - $ref: '#/components/schemas/is_enabled' + description: | + This field indicates whether the employee is enabled in the org. mobile: type: string nullable: true @@ -2564,13 +2567,12 @@ components: nullable: true example: Branch Manager has_accepted_invite: - type: boolean - description: | - This boolean field represents whether the employee has accepted the current org's invite by veryfying his/her email or not. - default: true - example: true + $ref: '#/components/schemas/has_accepted_invite' is_enabled: - $ref: '#/components/schemas/is_enabled' + allOf: + - $ref: '#/components/schemas/is_enabled' + description: | + This field indicates whether the employee is enabled in the org. mobile: type: string nullable: true @@ -5880,6 +5882,56 @@ components: - matched_expenses - last_user_matched_at - metadata + user_full_name: + type: string + maxLength: 255 + description: | + String denoting the full name of an employee. + example: Jon Snow + delegatees: + type: object + additionalProperties: false + properties: + id: + allOf: + - $ref: '#/components/schemas/id_integer' + description: | + Delegation id. + example: 100 + type: + type: string + enum: + - SHORT_TERM + - PERMANENT + description: | + Type of delegation. + example: SHORT_TERM + user_id: + $ref: '#/components/schemas/user_id' + email: + allOf: + - $ref: '#/components/schemas/email' + description: | + Email of the delegatee. + full_name: + allOf: + - $ref: '#/components/schemas/user_full_name' + description: | + Full name of the delegatee. + start_at: + type: string + format: date-time + example: '2020-06-11T13:14:55.201598+00:00' + description: | + Date and time from which the delegation is active. + nullable: false + end_at: + type: string + format: date-time + example: '2020-07-11T13:14:55.201598+00:00' + description: | + Date and time till which the delegation is active. If null, delegation is active indefinitely. + nullable: true spender_employee_out: type: object additionalProperties: false @@ -5917,6 +5969,21 @@ components: description: | Represents if opt out is done by web app or sms example: WEB_APP + is_enabled: + allOf: + - $ref: '#/components/schemas/is_enabled' + description: | + This field indicates whether the employee is enabled in the org. + has_accepted_invite: + $ref: '#/components/schemas/has_accepted_invite' + delegatees: + type: array + nullable: true + maxItems: 1 + items: + $ref: '#/components/schemas/delegatees' + description: | + List of users who are delegatees for this employee. commute_location_not_nullable: type: object nullable: false @@ -6016,6 +6083,21 @@ components: description: | Represents if opt out is done by web app or sms example: WEB_APP + is_enabled: + allOf: + - $ref: '#/components/schemas/is_enabled' + description: | + This field indicates whether the employee is enabled in the org. + has_accepted_invite: + $ref: '#/components/schemas/has_accepted_invite' + delegatees: + type: array + nullable: true + maxItems: 1 + items: + $ref: '#/components/schemas/delegatees' + description: | + List of users who are delegatees for this employee. virtual_card_out: type: object properties: diff --git a/src/components/schemas/employee.yaml b/src/components/schemas/employee.yaml index 5b912f3e3..1a9faa9c5 100644 --- a/src/components/schemas/employee.yaml +++ b/src/components/schemas/employee.yaml @@ -35,7 +35,10 @@ employee_out: department: $ref: './department.yaml#/department_out_embed' is_enabled: - $ref: ./fields.yaml#/is_enabled + allOf: + - $ref: ./fields.yaml#/is_enabled + description: | + This field indicates whether the employee is enabled in the org. joined_at: $ref: './fields.yaml#/joined_at' level_id: @@ -146,11 +149,7 @@ employee_out: description: | List of users who are approvers for this employee. has_accepted_invite: - type: boolean - description: > - This boolean field represents whether the employee has accepted the current org's invite by veryfying his/her email or not. - default: true - example: true + $ref: ./fields.yaml#/has_accepted_invite branch_account: type: string nullable: True @@ -345,13 +344,12 @@ employee_out_embed_for_expense: flattened_custom_field: $ref: './fields.yaml#/flattened_custom_field' has_accepted_invite: - type: boolean - description: > - This boolean field represents whether the employee has accepted the current org's invite by veryfying his/her email or not. - default: true - example: true + $ref: ./fields.yaml#/has_accepted_invite is_enabled: - $ref: ./fields.yaml#/is_enabled + allOf: + - $ref: ./fields.yaml#/is_enabled + description: | + This field indicates whether the employee is enabled in the org. mobile: type: string nullable: True @@ -429,13 +427,12 @@ employee_out_embed_for_report: nullable: True example: Branch Manager has_accepted_invite: - type: boolean - description: > - This boolean field represents whether the employee has accepted the current org's invite by veryfying his/her email or not. - default: true - example: true + $ref: ./fields.yaml#/has_accepted_invite is_enabled: - $ref: ./fields.yaml#/is_enabled + allOf: + - $ref: ./fields.yaml#/is_enabled + description: | + This field indicates whether the employee is enabled in the org. mobile: type: string nullable: True @@ -477,7 +474,10 @@ employee_in: department_id: $ref: './fields.yaml#/fk_string' is_enabled: - $ref: ./fields.yaml#/is_enabled + allOf: + - $ref: ./fields.yaml#/is_enabled + description: | + This field indicates whether the employee is enabled in the org. joined_at: $ref: './fields.yaml#/joined_at' level_id: @@ -569,6 +569,22 @@ spender_employee_out: description: | Represents if opt out is done by web app or sms example: WEB_APP + is_enabled: + allOf: + - $ref: ./fields.yaml#/is_enabled + description: | + This field indicates whether the employee is enabled in the org. + has_accepted_invite: + $ref: ./fields.yaml#/has_accepted_invite + delegatees: + type: array + nullable: True + maxItems: 1 + items: + $ref: ./fields.yaml#/delegatees + description: | + List of users who are delegatees for this employee. + employees_upload_in: type: object @@ -684,4 +700,19 @@ spender_commute_details_out: maxLength: 255 description: | Represents if opt out is done by web app or sms - example: WEB_APP \ No newline at end of file + example: WEB_APP + is_enabled: + allOf: + - $ref: ./fields.yaml#/is_enabled + description: | + This field indicates whether the employee is enabled in the org. + has_accepted_invite: + $ref: ./fields.yaml#/has_accepted_invite + delegatees: + type: array + nullable: True + maxItems: 1 + items: + $ref: ./fields.yaml#/delegatees + description: | + List of users who are delegatees for this employee. diff --git a/src/components/schemas/fields.yaml b/src/components/schemas/fields.yaml index 9c33779ec..a7e520eaa 100644 --- a/src/components/schemas/fields.yaml +++ b/src/components/schemas/fields.yaml @@ -103,7 +103,6 @@ is_enabled: type: boolean description: | This indicates if the resource is enabled for use within the organisation. - default: true example: true webhook_url: @@ -1343,8 +1342,32 @@ delegatees: type: object additionalProperties: False properties: + id: + allOf: + - $ref: './fields.yaml#/id_integer' + description: | + Delegation id. + example: 100 + type: + type: string + enum: + - SHORT_TERM + - PERMANENT + description: | + Type of delegation. + example: SHORT_TERM user_id: $ref: '#/user_id' + email: + allOf: + - $ref: './fields.yaml#/email' + description: | + Email of the delegatee. + full_name: + allOf: + - $ref: './fields.yaml#/user_full_name' + description: | + Full name of the delegatee. start_at: type: string format: date-time @@ -1658,3 +1681,9 @@ commute_details_in: - KM - MILES example: MILES + +has_accepted_invite: + type: boolean + description: > + This boolean field represents whether the employee has accepted the current org's invite by verifying his/her email or not. + example: true