Skip to content

Commit

Permalink
feat: API specs for spender/expenses/check_mandatory_fields/bulk (#592)
Browse files Browse the repository at this point in the history
* feat: API specs for spender/expenses/check_mandatory_fields/bulk

* Auto generate API docs

* fixed output type to object

* Auto generate API docs

---------

Co-authored-by: Siva <[email protected]>
  • Loading branch information
prabs222 and snarayanank2 authored Feb 4, 2025
1 parent f7a2a62 commit ea87b4f
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 0 deletions.
110 changes: 110 additions & 0 deletions reference/spender.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8106,6 +8106,57 @@ components:
- 12423
description: |
List of IDs of expense fields which are mandatory but are missing.
spender_expense_check_mandatory_fields_bulk_in:
type: array
additionalProperties: false
description: |
Array of expenses to be checked for missing mandatory fields in one request..
items:
$ref: '#/components/schemas/items'
expense_check_mandatory_fields_bulk_out:
type: array
additionalProperties: false
items:
type: object
required:
- id
- missing_amount
- missing_currency
- missing_receipt
- missing_expense_field_ids
properties:
id:
$ref: '#/components/schemas/id_string'
example: tx0agOdICdbV
missing_amount:
type: boolean
description: |
If this is set to true, then you need to send amount field with expense object.
example: false
missing_currency:
type: boolean
description: |
If this is set to true, then you need to send currency field with expense object.
example: false
missing_receipt:
type: boolean
description: |
If this is set to true, then you need to attach receipt to the expense.
example: false
missing_expense_field_ids:
type: array
nullable: false
items:
type: integer
nullable: true
description: |
This id provided by Fyle to identify an expense field.
example: 123
example:
- 123
- 12423
description: |
List of IDs of expense fields which are mandatory but are missing.
expense_dismiss_duplicates_in:
type: object
required:
Expand Down Expand Up @@ -12834,6 +12885,65 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/404'
/spender/expenses/check_mandatory_fields/bulk:
post:
tags:
- Expenses
summary: Check multiple expense for missing mandatory fields in bulk.
description: |
Before updating multiple [expense objects](https://docs.fylehq.com/docs/fyle-platform-docs/b5ec89140e06b-create-or-update-expense)
into Fyle, based on the business requirements, you might want to check if all the mandatory fields set up by your organization are added.
This endpoint allows you to validate multiple expense objects in a single request by passing an array of expense objects along with some extra optional fields documented below.
operationId: check_mandatory_fields_bulk_post
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- data
properties:
data:
$ref: '#/components/schemas/spender_expense_check_mandatory_fields_bulk_in'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- data
properties:
data:
$ref: '#/components/schemas/expense_check_mandatory_fields_bulk_out'
'400':
description: Unauthorised request
content:
application/json:
schema:
$ref: '#/components/schemas/400'
'401':
description: Unauthorised 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'
/spender/expenses/dismiss_duplicates/bulk:
post:
tags:
Expand Down
52 changes: 52 additions & 0 deletions src/components/schemas/expense.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2045,6 +2045,14 @@ spender_expense_check_mandatory_fields_in:
Invoice number of the expense.
example: 123456

spender_expense_check_mandatory_fields_bulk_in:
type: array
additionalProperties: false
description: |
Array of expenses to be checked for missing mandatory fields in one request..
items:
$ref: '#/spender_expenses_bulk_in/items'

expense_check_mandatory_fields_out:
type: object
additionalProperties: False
Expand Down Expand Up @@ -2082,6 +2090,50 @@ expense_check_mandatory_fields_out:
description: |
List of IDs of expense fields which are mandatory but are missing.
expense_check_mandatory_fields_bulk_out:
type: array
additionalProperties: false
items:
type: object
required:
- id
- missing_amount
- missing_currency
- missing_receipt
- missing_expense_field_ids
properties:
id:
$ref: ./fields.yaml#/id_string
example: tx0agOdICdbV
missing_amount:
type: boolean
description: |
If this is set to true, then you need to send amount field with expense object.
example: false
missing_currency:
type: boolean
description: |
If this is set to true, then you need to send currency field with expense object.
example: false
missing_receipt:
type: boolean
description: |
If this is set to true, then you need to attach receipt to the expense.
example: false
missing_expense_field_ids:
type: array
nullable: false
items:
type: integer
nullable: true
description: |
This id provided by Fyle to identify an expense field.
example: 123
example:
- 123
- 12423
description: |
List of IDs of expense fields which are mandatory but are missing.
expense_check_mandatory_fields_in:
required:
- id
Expand Down
2 changes: 2 additions & 0 deletions src/spender/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ paths:
$ref: paths/spender@automations@report_submissions@next_at.yaml
/spender/expenses/check_mandatory_fields:
$ref: paths/spender@expenses@check_mandatory_fields.yaml
/spender/expenses/check_mandatory_fields/bulk:
$ref: paths/spender@expenses@check_mandatory_fields_bulk.yaml
/spender/expenses/dismiss_duplicates/bulk:
$ref: paths/spender@expenses@[email protected]
/spender/expenses/duplicate_sets:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
post:
tags:
- Expenses
summary: Check multiple expense for missing mandatory fields in bulk.
description: |
Before updating multiple [expense objects](https://docs.fylehq.com/docs/fyle-platform-docs/b5ec89140e06b-create-or-update-expense)
into Fyle, based on the business requirements, you might want to check if all the mandatory fields set up by your organization are added.
This endpoint allows you to validate multiple expense objects in a single request by passing an array of expense objects along with some extra optional fields documented below.
operationId: check_mandatory_fields_bulk_post
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: False
required:
- data
properties:
data:
$ref: '../../components/schemas/expense.yaml#/spender_expense_check_mandatory_fields_bulk_in'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
additionalProperties: False
required:
- data
properties:
data:
$ref: ../../components/schemas/expense.yaml#/expense_check_mandatory_fields_bulk_out
'401':
description: Unauthorised request
content:
application/json:
schema:
$ref: '../../components/schemas/401.yaml'
'400':
description: Unauthorised request
content:
application/json:
schema:
$ref: '../../components/schemas/400.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'

0 comments on commit ea87b4f

Please sign in to comment.