Skip to content

Commit

Permalink
Merge branch 'main' into roshan_86cw1fby7
Browse files Browse the repository at this point in the history
  • Loading branch information
RoshanMhatre committed Sep 1, 2024
2 parents 39abb03 + 37fb1cf commit 6453c7e
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 25 deletions.
11 changes: 4 additions & 7 deletions reference/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1748,16 +1748,14 @@ components:
description: |
Full name of the delegatee.
start_at:
type: string
format: date-time
example: '2020-06-11T13:14:55.201598+00:00'
allOf:
- $ref: '#/components/schemas/timestamptz_utc'
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'
allOf:
- $ref: '#/components/schemas/timestamptz_utc'
description: |
Date and time till which the delegation is active. If null, delegation is active indefinitely.
nullable: true
Expand Down Expand Up @@ -1994,7 +1992,6 @@ components:
delegatees:
type: array
nullable: true
maxItems: 1
items:
$ref: '#/components/schemas/delegatees'
description: |
Expand Down
132 changes: 124 additions & 8 deletions reference/spender.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5926,16 +5926,14 @@ components:
description: |
Full name of the delegatee.
start_at:
type: string
format: date-time
example: '2020-06-11T13:14:55.201598+00:00'
allOf:
- $ref: '#/components/schemas/timestamptz_utc'
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'
allOf:
- $ref: '#/components/schemas/timestamptz_utc'
description: |
Date and time till which the delegation is active. If null, delegation is active indefinitely.
nullable: true
Expand Down Expand Up @@ -5986,7 +5984,6 @@ components:
delegatees:
type: array
nullable: true
maxItems: 1
items:
$ref: '#/components/schemas/delegatees'
description: |
Expand Down Expand Up @@ -6100,7 +6097,75 @@ components:
delegatees:
type: array
nullable: true
maxItems: 1
items:
$ref: '#/components/schemas/delegatees'
description: |
List of users who are delegatees for this employee.
spender_delegatees_post_in:
type: object
additionalProperties: false
properties:
delegatee_user_id:
$ref: '#/components/schemas/fk_string'
start_at:
allOf:
- $ref: '#/components/schemas/timestamptz_utc'
description: |
Date and time from which the delegation is active.
nullable: false
end_at:
allOf:
- $ref: '#/components/schemas/timestamptz_utc'
description: |
Date and time till which the delegation is active. If null, delegation is active indefinitely.
nullable: true
spender_delegatees_post_out:
type: object
additionalProperties: false
properties:
user_id:
$ref: '#/components/schemas/fk_string'
email:
$ref: '#/components/schemas/email'
full_name:
type: string
maxLength: 255
description: |
Represents the full name of the Employee.
example: John Doe
commute_details:
$ref: '#/components/schemas/commute_details'
mobile:
type: string
nullable: true
example: '+12131234567'
items:
$ref: '#/components/schemas/phone_number'
description: |
Mobile number of the employee
is_mobile_verified:
type: boolean
nullable: true
description: |
Flag which indicates if mobile is verified or not.
example: false
sms_opt_out_source:
type: string
nullable: true
maxLength: 255
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
items:
$ref: '#/components/schemas/delegatees'
description: |
Expand Down Expand Up @@ -11029,6 +11094,57 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/404'
/spender/employees/delegatees:
post:
tags:
- Employees
summary: Assign delegatees
operationId: employees_delegatees_post
description: |
Assign delegatees to employee
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- data
properties:
data:
$ref: '#/components/schemas/spender_delegatees_post_in'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- data
properties:
data:
$ref: '#/components/schemas/spender_delegatees_post_out'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/400'
'401':
description: Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/401'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/403'
/spender/employees/delegators:
get:
tags:
Expand Down
76 changes: 72 additions & 4 deletions src/components/schemas/employee.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ employee_out:
delegatees:
type: array
nullable: True
maxItems: 1
items:
$ref: ./fields.yaml#/delegatees
description: |
Expand Down Expand Up @@ -579,7 +578,6 @@ spender_employee_out:
delegatees:
type: array
nullable: True
maxItems: 1
items:
$ref: ./fields.yaml#/delegatees
description: |
Expand Down Expand Up @@ -711,7 +709,6 @@ spender_commute_details_out:
delegatees:
type: array
nullable: True
maxItems: 1
items:
$ref: ./fields.yaml#/delegatees
description: |
Expand All @@ -732,7 +729,6 @@ spender_delegators_out:
Represents the full name of the Employee.
example: John Doe


spender_delegatees_delete_out:
type: object
additionalProperties: False
Expand All @@ -757,3 +753,75 @@ spender_delegatees_delete_out:
$ref: './fields.yaml#/timestamptz_utc'
end_date:
$ref: './fields.yaml#/timestamptz_utc'


spender_delegatees_post_in:
type: object
additionalProperties: False
properties:
delegatee_user_id:
$ref: ./fields.yaml#/fk_string
start_at:
allOf:
- $ref: ./fields.yaml#/timestamptz_utc
description: |
Date and time from which the delegation is active.
nullable: False
end_at:
allOf:
- $ref: ./fields.yaml#/timestamptz_utc
description: |
Date and time till which the delegation is active. If null, delegation is active indefinitely.
nullable: True

spender_delegatees_post_out:
type: object
additionalProperties: False
properties:
user_id:
$ref: ./fields.yaml#/fk_string
email:
$ref: './fields.yaml#/email'
full_name:
type: string
maxLength: 255
description: |
Represents the full name of the Employee.
example: John Doe
commute_details:
$ref: './fields.yaml#/commute_details'
mobile:
type: string
nullable: true
example: '+12131234567'
items:
$ref: '#/components/schemas/phone_number'
description: |
Mobile number of the employee
is_mobile_verified:
type: boolean
nullable: true
description: |
Flag which indicates if mobile is verified or not.
example: false
sms_opt_out_source:
type: string
nullable: true
maxLength: 255
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
items:
$ref: ./fields.yaml#/delegatees
description: |
List of users who are delegatees for this employee.
10 changes: 4 additions & 6 deletions src/components/schemas/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1369,16 +1369,14 @@ delegatees:
description: |
Full name of the delegatee.
start_at:
type: string
format: date-time
example: '2020-06-11T13:14:55.201598+00:00'
allOf:
- $ref: './fields.yaml#/timestamptz_utc'
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'
allOf:
- $ref: './fields.yaml#/timestamptz_utc'
description: |
Date and time till which the delegation is active. If null, delegation is active indefinitely.
nullable: True
Expand Down
2 changes: 2 additions & 0 deletions src/spender/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ paths:
$ref: paths/spender@employees@commute_details.yaml
/spender/employees/commute_details/delete:
$ref: paths/spender@employees@[email protected]
/spender/employees/delegatees:
$ref: paths/spender@[email protected]
/spender/employees/delegators:
$ref: paths/spender@[email protected]
/spender/employees/delegatees/delete:
Expand Down
50 changes: 50 additions & 0 deletions src/spender/paths/spender@[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
post:
tags:
- Employees
summary: Assign delegatees
operationId: employees_delegatees_post
description: |
Assign delegatees to employee
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: False
required:
- data
properties:
data:
$ref: '../../components/schemas/employee.yaml#/spender_delegatees_post_in'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
additionalProperties: False
required:
- data
properties:
data:
$ref: '../../components/schemas/employee.yaml#/spender_delegatees_post_out'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '../../components/schemas/400.yaml'
'401':
description: Unauthorized request
content:
application/json:
schema:
$ref: '../../components/schemas/401.yaml'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '../../components/schemas/403.yaml'

0 comments on commit 6453c7e

Please sign in to comment.