diff --git a/reference/admin.yaml b/reference/admin.yaml index 238248102..e06f252b8 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -4281,6 +4281,25 @@ components: List of file ids to attach to the expense.
To add new files to the expense, send the list of file ids to be attached.
To remove files from the expense, send the list of all file ids except which you want to remove.
+ 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 attach_files_to_expense_in: type: object required: @@ -16863,6 +16882,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: diff --git a/reference/approver.yaml b/reference/approver.yaml index 134d63b61..c33fbb91d 100644 --- a/reference/approver.yaml +++ b/reference/approver.yaml @@ -2499,6 +2499,25 @@ 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 attach_files_to_expense_in: type: object required: @@ -4517,6 +4536,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: diff --git a/src/admin/openapi.yaml b/src/admin/openapi.yaml index 2c705beca..6cd7b4b70 100644 --- a/src/admin/openapi.yaml +++ b/src/admin/openapi.yaml @@ -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: diff --git a/src/admin/paths/admin@expenses@bulk.yaml b/src/admin/paths/admin@expenses@bulk.yaml new file mode 100644 index 000000000..7cb88a59a --- /dev/null +++ b/src/admin/paths/admin@expenses@bulk.yaml @@ -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' diff --git a/src/approver/openapi.yaml b/src/approver/openapi.yaml index 3d9a877a3..b65584f54 100644 --- a/src/approver/openapi.yaml +++ b/src/approver/openapi.yaml @@ -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: diff --git a/src/approver/paths/approver@expenses@bulk.yaml b/src/approver/paths/approver@expenses@bulk.yaml new file mode 100644 index 000000000..7cb88a59a --- /dev/null +++ b/src/approver/paths/approver@expenses@bulk.yaml @@ -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' diff --git a/src/components/schemas/expense.yaml b/src/components/schemas/expense.yaml index 8b1d13970..ae503058e 100644 --- a/src/components/schemas/expense.yaml +++ b/src/components/schemas/expense.yaml @@ -861,6 +861,26 @@ spender_expense_in: To add new files to the expense, send the list of file ids to be attached.
To remove files from the expense, send the list of all file ids except which you want to remove.
+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 + admin_expense_in: type: object additionalProperties: false