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

feat: POST /<admin/approver>/expenses/bulk #554

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions reference/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4281,6 +4281,29 @@ components:
List of file ids to attach to the expense. <br>
To add new files to the expense, send the list of file ids to be attached. <br>
To remove files from the expense, send the list of all file ids except which you want to remove. <br>
expenses_in:
type: array
additionalProperties: false
items:
type: object
required:
- id
properties:
id:
allOf:
- $ref: '#/components/schemas/id_string'
description: |
This id is provided by Fyle to identify an object
admin_amount:
type: number
nullable: false
description: |
The expense amount which is added or modified by admin or approver.
example: 1900
foreign_currency:
$ref: '#/components/schemas/foreign_currency'
foreign_amount:
$ref: '#/components/schemas/foreign_amount'
attach_files_to_expense_in:
type: object
required:
Expand Down Expand Up @@ -16863,6 +16886,59 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/404'
/admin/expenses/bulk:
post:
tags:
- Expenses
summary: Update expenses in bulk
description: |
Update expenses in bulk.
operationId: expenses_post_bulk
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/expenses_in'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/expense_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'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/404'
/admin/expenses/attach_files/bulk:
post:
tags:
Expand Down
76 changes: 76 additions & 0 deletions reference/approver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2499,6 +2499,29 @@ components:
$ref: '#/components/schemas/locations'
custom_fields:
$ref: '#/components/schemas/custom_fields'
expenses_in:
type: array
additionalProperties: false
items:
type: object
required:
- id
properties:
id:
allOf:
- $ref: '#/components/schemas/id_string'
description: |
This id is provided by Fyle to identify an object
admin_amount:
type: number
nullable: false
description: |
The expense amount which is added or modified by admin or approver.
example: 1900
foreign_currency:
$ref: '#/components/schemas/foreign_currency'
foreign_amount:
$ref: '#/components/schemas/foreign_amount'
attach_files_to_expense_in:
type: object
required:
Expand Down Expand Up @@ -4517,6 +4540,59 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/404'
/approver/expenses/bulk:
post:
tags:
- Expenses
summary: Update expenses in bulk
description: |
Update expenses in bulk.
operationId: expenses_post_bulk
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/expenses_in'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/expense_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'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/404'
/approver/expenses/attach_files/bulk:
post:
tags:
Expand Down
2 changes: 2 additions & 0 deletions src/admin/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ paths:
$ref: paths/admin@accounting_export_lineitems@bulk.yaml
/admin/expenses:
$ref: paths/admin@expenses.yaml
/admin/expenses/bulk:
$ref: paths/admin@expenses@bulk.yaml
/admin/expenses/attach_files/bulk :
$ref: paths/admin@expenses@attach_files@bulk.yaml
/admin/expenses/accounting_export_summary/bulk:
Expand Down
52 changes: 52 additions & 0 deletions src/admin/paths/admin@expenses@bulk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
post:
tags:
- Expenses
summary: Update expenses in bulk
description: |
Update expenses in bulk.
operationId: expenses_post_bulk
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
data:
$ref: '../../components/schemas/expense.yaml#/expenses_in'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '../../components/schemas/expense.yaml#/expense_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'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '../../components/schemas/404.yaml'
2 changes: 2 additions & 0 deletions src/approver/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ paths:
$ref: paths/approver@reports@exports.yaml
/approver/expenses:
$ref: 'paths/approver@expenses.yaml'
/approver/expenses/bulk:
$ref: 'paths/approver@expenses@bulk.yaml'
/approver/expenses/attach_files/bulk :
$ref: paths/approver@expenses@attach_files@bulk.yaml
/approver/reports/eject_expenses:
Expand Down
52 changes: 52 additions & 0 deletions src/approver/paths/approver@expenses@bulk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
post:
tags:
- Expenses
summary: Update expenses in bulk
description: |
Update expenses in bulk.
operationId: expenses_post_bulk
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
data:
$ref: '../../components/schemas/expense.yaml#/expenses_in'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '../../components/schemas/expense.yaml#/expense_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'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '../../components/schemas/404.yaml'
24 changes: 24 additions & 0 deletions src/components/schemas/expense.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,30 @@ spender_expense_in:
To add new files to the expense, send the list of file ids to be attached. <br>
To remove files from the expense, send the list of all file ids except which you want to remove. <br>

expenses_in:
type: array
additionalProperties: false
items:
type: object
required:
- id
properties:
id:
allOf:
- $ref: './fields.yaml#/id_string'
description: |
This id is provided by Fyle to identify an object
admin_amount:
type: number
nullable: false
description: |
The expense amount which is added or modified by admin or approver.
example: 1900
foreign_currency:
$ref: './fields.yaml#/foreign_currency'
foreign_amount:
$ref: './fields.yaml#/foreign_amount'

admin_expense_in:
type: object
additionalProperties: false
Expand Down