Skip to content

Commit ea87b4f

Browse files
feat: API specs for spender/expenses/check_mandatory_fields/bulk (#592)
* 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]>
1 parent f7a2a62 commit ea87b4f

File tree

4 files changed

+222
-0
lines changed

4 files changed

+222
-0
lines changed

reference/spender.yaml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8106,6 +8106,57 @@ components:
81068106
- 12423
81078107
description: |
81088108
List of IDs of expense fields which are mandatory but are missing.
8109+
spender_expense_check_mandatory_fields_bulk_in:
8110+
type: array
8111+
additionalProperties: false
8112+
description: |
8113+
Array of expenses to be checked for missing mandatory fields in one request..
8114+
items:
8115+
$ref: '#/components/schemas/items'
8116+
expense_check_mandatory_fields_bulk_out:
8117+
type: array
8118+
additionalProperties: false
8119+
items:
8120+
type: object
8121+
required:
8122+
- id
8123+
- missing_amount
8124+
- missing_currency
8125+
- missing_receipt
8126+
- missing_expense_field_ids
8127+
properties:
8128+
id:
8129+
$ref: '#/components/schemas/id_string'
8130+
example: tx0agOdICdbV
8131+
missing_amount:
8132+
type: boolean
8133+
description: |
8134+
If this is set to true, then you need to send amount field with expense object.
8135+
example: false
8136+
missing_currency:
8137+
type: boolean
8138+
description: |
8139+
If this is set to true, then you need to send currency field with expense object.
8140+
example: false
8141+
missing_receipt:
8142+
type: boolean
8143+
description: |
8144+
If this is set to true, then you need to attach receipt to the expense.
8145+
example: false
8146+
missing_expense_field_ids:
8147+
type: array
8148+
nullable: false
8149+
items:
8150+
type: integer
8151+
nullable: true
8152+
description: |
8153+
This id provided by Fyle to identify an expense field.
8154+
example: 123
8155+
example:
8156+
- 123
8157+
- 12423
8158+
description: |
8159+
List of IDs of expense fields which are mandatory but are missing.
81098160
expense_dismiss_duplicates_in:
81108161
type: object
81118162
required:
@@ -12834,6 +12885,65 @@ paths:
1283412885
application/json:
1283512886
schema:
1283612887
$ref: '#/components/schemas/404'
12888+
/spender/expenses/check_mandatory_fields/bulk:
12889+
post:
12890+
tags:
12891+
- Expenses
12892+
summary: Check multiple expense for missing mandatory fields in bulk.
12893+
description: |
12894+
Before updating multiple [expense objects](https://docs.fylehq.com/docs/fyle-platform-docs/b5ec89140e06b-create-or-update-expense)
12895+
into Fyle, based on the business requirements, you might want to check if all the mandatory fields set up by your organization are added.
12896+
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.
12897+
operationId: check_mandatory_fields_bulk_post
12898+
requestBody:
12899+
required: true
12900+
content:
12901+
application/json:
12902+
schema:
12903+
type: object
12904+
additionalProperties: false
12905+
required:
12906+
- data
12907+
properties:
12908+
data:
12909+
$ref: '#/components/schemas/spender_expense_check_mandatory_fields_bulk_in'
12910+
responses:
12911+
'200':
12912+
description: OK
12913+
content:
12914+
application/json:
12915+
schema:
12916+
type: object
12917+
additionalProperties: false
12918+
required:
12919+
- data
12920+
properties:
12921+
data:
12922+
$ref: '#/components/schemas/expense_check_mandatory_fields_bulk_out'
12923+
'400':
12924+
description: Unauthorised request
12925+
content:
12926+
application/json:
12927+
schema:
12928+
$ref: '#/components/schemas/400'
12929+
'401':
12930+
description: Unauthorised request
12931+
content:
12932+
application/json:
12933+
schema:
12934+
$ref: '#/components/schemas/401'
12935+
'403':
12936+
description: Forbidden
12937+
content:
12938+
application/json:
12939+
schema:
12940+
$ref: '#/components/schemas/403'
12941+
'404':
12942+
description: Not Found
12943+
content:
12944+
application/json:
12945+
schema:
12946+
$ref: '#/components/schemas/404'
1283712947
/spender/expenses/dismiss_duplicates/bulk:
1283812948
post:
1283912949
tags:

src/components/schemas/expense.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,6 +2045,14 @@ spender_expense_check_mandatory_fields_in:
20452045
Invoice number of the expense.
20462046
example: 123456
20472047

2048+
spender_expense_check_mandatory_fields_bulk_in:
2049+
type: array
2050+
additionalProperties: false
2051+
description: |
2052+
Array of expenses to be checked for missing mandatory fields in one request..
2053+
items:
2054+
$ref: '#/spender_expenses_bulk_in/items'
2055+
20482056
expense_check_mandatory_fields_out:
20492057
type: object
20502058
additionalProperties: False
@@ -2082,6 +2090,50 @@ expense_check_mandatory_fields_out:
20822090
description: |
20832091
List of IDs of expense fields which are mandatory but are missing.
20842092
2093+
expense_check_mandatory_fields_bulk_out:
2094+
type: array
2095+
additionalProperties: false
2096+
items:
2097+
type: object
2098+
required:
2099+
- id
2100+
- missing_amount
2101+
- missing_currency
2102+
- missing_receipt
2103+
- missing_expense_field_ids
2104+
properties:
2105+
id:
2106+
$ref: ./fields.yaml#/id_string
2107+
example: tx0agOdICdbV
2108+
missing_amount:
2109+
type: boolean
2110+
description: |
2111+
If this is set to true, then you need to send amount field with expense object.
2112+
example: false
2113+
missing_currency:
2114+
type: boolean
2115+
description: |
2116+
If this is set to true, then you need to send currency field with expense object.
2117+
example: false
2118+
missing_receipt:
2119+
type: boolean
2120+
description: |
2121+
If this is set to true, then you need to attach receipt to the expense.
2122+
example: false
2123+
missing_expense_field_ids:
2124+
type: array
2125+
nullable: false
2126+
items:
2127+
type: integer
2128+
nullable: true
2129+
description: |
2130+
This id provided by Fyle to identify an expense field.
2131+
example: 123
2132+
example:
2133+
- 123
2134+
- 12423
2135+
description: |
2136+
List of IDs of expense fields which are mandatory but are missing.
20852137
expense_check_mandatory_fields_in:
20862138
required:
20872139
- id

src/spender/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ paths:
256256
$ref: paths/spender@automations@report_submissions@next_at.yaml
257257
/spender/expenses/check_mandatory_fields:
258258
$ref: paths/spender@expenses@check_mandatory_fields.yaml
259+
/spender/expenses/check_mandatory_fields/bulk:
260+
$ref: paths/spender@expenses@check_mandatory_fields_bulk.yaml
259261
/spender/expenses/dismiss_duplicates/bulk:
260262
$ref: paths/spender@expenses@[email protected]
261263
/spender/expenses/duplicate_sets:
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
post:
2+
tags:
3+
- Expenses
4+
summary: Check multiple expense for missing mandatory fields in bulk.
5+
description: |
6+
Before updating multiple [expense objects](https://docs.fylehq.com/docs/fyle-platform-docs/b5ec89140e06b-create-or-update-expense)
7+
into Fyle, based on the business requirements, you might want to check if all the mandatory fields set up by your organization are added.
8+
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.
9+
operationId: check_mandatory_fields_bulk_post
10+
requestBody:
11+
required: true
12+
content:
13+
application/json:
14+
schema:
15+
type: object
16+
additionalProperties: False
17+
required:
18+
- data
19+
properties:
20+
data:
21+
$ref: '../../components/schemas/expense.yaml#/spender_expense_check_mandatory_fields_bulk_in'
22+
responses:
23+
'200':
24+
description: OK
25+
content:
26+
application/json:
27+
schema:
28+
type: object
29+
additionalProperties: False
30+
required:
31+
- data
32+
properties:
33+
data:
34+
$ref: ../../components/schemas/expense.yaml#/expense_check_mandatory_fields_bulk_out
35+
'401':
36+
description: Unauthorised request
37+
content:
38+
application/json:
39+
schema:
40+
$ref: '../../components/schemas/401.yaml'
41+
'400':
42+
description: Unauthorised request
43+
content:
44+
application/json:
45+
schema:
46+
$ref: '../../components/schemas/400.yaml'
47+
'403':
48+
description: Forbidden
49+
content:
50+
application/json:
51+
schema:
52+
$ref: '../../components/schemas/403.yaml'
53+
'404':
54+
description: Not Found
55+
content:
56+
application/json:
57+
schema:
58+
$ref: '../../components/schemas/404.yaml'

0 commit comments

Comments
 (0)