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

fix: minor doc changes for POST /admin/expenses #381

Merged
merged 9 commits into from
Nov 6, 2023
37 changes: 30 additions & 7 deletions reference/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3792,10 +3792,13 @@ components:
admin_expense_in:
type: object
additionalProperties: false
required:
- admin_amount
- spent_at
- assignee_user_email
anyOf:
- required:
- admin_amount
- spent_at
- assignee_user_email
- required:
- id
properties:
id:
allOf:
Expand All @@ -3808,18 +3811,32 @@ components:
nullable: false
description: |
The expense amount which is added or modified by admin or approver.
- **Note:**
- This field is required while creating an expense.
- _Not required when updating an expense, but is non-nullable_.
example: 1900
spent_at:
$ref: '#/components/schemas/spent_at'
type: string
format: date-time
nullable: false
description: |
It signifies when this expense was made.
This date cannot be in future.
- **Note:**
- This field is required while creating an expense.
- _Not required when updating an expense, but is non-nullable_.
example: '2020-06-01T01:18:19.292-08:00'
assignee_user_email:
allOf:
- $ref: '#/components/schemas/email'
description: |
An immutable field that represents the email address of the employee.
Must be compliant with <a href='https://www.ietf.org/rfc/rfc822.txt'>RFC
822.</a>
- _Note:_
- The expense will be assigned/re-assigned to this particular `employee`. _Not required when updating an expense, but is non-nullable_.
- **Note:**
- The expense will be assigned/re-assigned to this particular `employee`.
- This field is required while creating an expense.
- _Not required when updating an expense, but is non-nullable_.
- Admins can't assign the expense to self.
source:
$ref: '#/components/schemas/source'
Expand Down Expand Up @@ -14675,6 +14692,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/403'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/404'
/admin/expenses/assign:
post:
tags:
Expand Down
6 changes: 6 additions & 0 deletions src/admin/paths/admin@expenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,9 @@ post:
application/json:
schema:
$ref: '../../components/schemas/403.yaml'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '../../components/schemas/404.yaml'
31 changes: 24 additions & 7 deletions src/components/schemas/expense.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -770,10 +770,13 @@ spender_expense_in:
admin_expense_in:
type: object
additionalProperties: false
required:
- admin_amount
- spent_at
- assignee_user_email
anyOf:
- required:
- admin_amount
- spent_at
- assignee_user_email
- required:
- id
properties:
id:
allOf:
Expand All @@ -786,18 +789,32 @@ admin_expense_in:
nullable: false
description: |
The expense amount which is added or modified by admin or approver.
- **Note:**
- This field is required while creating an expense.
- _Not required when updating an expense, but is non-nullable_.
example: 1900
spent_at:
$ref: './fields.yaml#/spent_at'
type: string
format: date-time
nullable: False
description: |
It signifies when this expense was made.
This date cannot be in future.
- **Note:**
- This field is required while creating an expense.
- _Not required when updating an expense, but is non-nullable_.
example: '2020-06-01T01:18:19.292-08:00'
assignee_user_email:
allOf:
- $ref: './fields.yaml#/email'
description: |
An immutable field that represents the email address of the employee.
Must be compliant with <a href='https://www.ietf.org/rfc/rfc822.txt'>RFC
822.</a>
- _Note:_
- The expense will be assigned/re-assigned to this particular `employee`. _Not required when updating an expense, but is non-nullable_.
- **Note:**
- The expense will be assigned/re-assigned to this particular `employee`.
- This field is required while creating an expense.
- _Not required when updating an expense, but is non-nullable_.
- Admins can't assign the expense to self.
source:
$ref: './fields.yaml#/source'
Expand Down