From ce9de27554b3a16666f70945a3a29b717cf63cd6 Mon Sep 17 00:00:00 2001 From: Kirti Gautam Date: Tue, 1 Oct 2024 13:50:33 +0530 Subject: [PATCH 1/3] feat: Additional fields POST //expenses --- src/components/schemas/expense.yaml | 90 +++++++++++++++++++++++++++++ src/components/schemas/fields.yaml | 31 +++++++++- 2 files changed, 120 insertions(+), 1 deletion(-) diff --git a/src/components/schemas/expense.yaml b/src/components/schemas/expense.yaml index 8b1d13970..2e5ce24f3 100644 --- a/src/components/schemas/expense.yaml +++ b/src/components/schemas/expense.yaml @@ -750,6 +750,8 @@ spender_expense_in: This field is not required for creating Per Diem Expenses source: $ref: './fields.yaml#/source' + code: + $ref: './fields.yaml#/code' merchant: $ref: './fields.yaml#/merchant' foreign_currency: @@ -860,6 +862,31 @@ spender_expense_in: 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.
+ hotel_is_breakfast_provided: + type: boolean + nullable: true + description: | + This field is applicable for only `Hotel` category. + mileage_rate_id: + allOf: + - $ref: './fields.yaml#/fk_integer' + description: | + Specific to mileage expense. This represents the Mileage's rate id given by Fyle + during creation of mileage rate for which this expense is created. + nullable: true + example: 9080 + mileage_is_round_trip: + type: boolean + nullable: true + description: Flag stating whether this was a round trip or not. + commute_details_id: + type: integer + nullable: true + description: | + Commute details id of the expense. This id is provided by Fyle to identify a commute details. + example: 1234 + commute_details: + $ref: './fields.yaml#/commute_details' admin_expense_in: type: object @@ -912,6 +939,8 @@ admin_expense_in: - Admins can't assign the expense to self. source: $ref: './fields.yaml#/source' + code: + $ref: './fields.yaml#/code' merchant: $ref: './fields.yaml#/merchant' foreign_currency: @@ -983,6 +1012,31 @@ admin_expense_in: 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.
+ hotel_is_breakfast_provided: + type: boolean + nullable: true + description: | + This field is applicable for only `Hotel` category. + mileage_rate_id: + allOf: + - $ref: './fields.yaml#/fk_integer' + description: | + Specific to mileage expense. This represents the Mileage's rate id given by Fyle + during creation of mileage rate for which this expense is created. + nullable: true + example: 9080 + mileage_is_round_trip: + type: boolean + nullable: true + description: Flag stating whether this was a round trip or not. + commute_details_id: + type: integer + nullable: true + description: | + Commute details id of the expense. This id is provided by Fyle to identify a commute details. + example: 1234 + commute_details: + $ref: './fields.yaml#/commute_details' approver_expense_in: type: object @@ -1015,6 +1069,8 @@ approver_expense_in: example: '2020-06-01T01:18:19.292-08:00' source: $ref: './fields.yaml#/source' + code: + $ref: './fields.yaml#/code' merchant: $ref: './fields.yaml#/merchant' foreign_currency: @@ -1077,6 +1133,40 @@ approver_expense_in: $ref: './fields.yaml#/locations' custom_fields: $ref: './fields.yaml#/custom_fields' + file_ids: + type: array + items: + allOf: + - $ref: './fields.yaml#/fk_string' + description: | + 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.
+ hotel_is_breakfast_provided: + type: boolean + nullable: true + description: | + This field is applicable for only `Hotel` category. + mileage_rate_id: + allOf: + - $ref: './fields.yaml#/fk_integer' + description: | + Specific to mileage expense. This represents the Mileage's rate id given by Fyle + during creation of mileage rate for which this expense is created. + nullable: true + example: 9080 + mileage_is_round_trip: + type: boolean + nullable: true + description: Flag stating whether this was a round trip or not. + commute_details_id: + type: integer + nullable: true + description: | + Commute details id of the expense. This id is provided by Fyle to identify a commute details. + example: 1234 + commute_details: + $ref: './fields.yaml#/commute_details' expense_out_embed: type: object diff --git a/src/components/schemas/fields.yaml b/src/components/schemas/fields.yaml index 20c781ffa..9c57a2e05 100644 --- a/src/components/schemas/fields.yaml +++ b/src/components/schemas/fields.yaml @@ -198,7 +198,36 @@ locations: minItems: 0 maxItems: 10 items: - $ref: './fields.yaml#/location' + type: object + nullable: true + properties: + city: + type: string + nullable: true + example: London + state: + type: string + nullable: true + example: London + display: + type: string + nullable: true + country: + type: string + nullable: true + example: United Kingdom + formatted_address: + type: string + nullable: true + example: '221 Baker St, Marylebone, London, United Kingdom' + latitude: + type: number + nullable: true + example: 12.971599 + longitude: + type: number + nullable: true + example: 77.594566 travel_classes: description: | From 077ba4e710dc2499e5a4ee5ebbef5b4e7c1be382 Mon Sep 17 00:00:00 2001 From: Kirti Gautam Date: Tue, 1 Oct 2024 14:01:05 +0530 Subject: [PATCH 2/3] Minor fix --- src/components/schemas/expense.yaml | 42 ++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/components/schemas/expense.yaml b/src/components/schemas/expense.yaml index 2e5ce24f3..4fab89063 100644 --- a/src/components/schemas/expense.yaml +++ b/src/components/schemas/expense.yaml @@ -885,8 +885,18 @@ spender_expense_in: description: | Commute details id of the expense. This id is provided by Fyle to identify a commute details. example: 1234 - commute_details: - $ref: './fields.yaml#/commute_details' + commute_deduction: + type: string + nullable: true + maxLength: 12 + description: | + Commute deduction type of the expense. + example: ONE_WAY + enum: + - ONE_WAY + - ROUND_TRIP + - NO_DEDUCTION + - null admin_expense_in: type: object @@ -1035,8 +1045,18 @@ admin_expense_in: description: | Commute details id of the expense. This id is provided by Fyle to identify a commute details. example: 1234 - commute_details: - $ref: './fields.yaml#/commute_details' + commute_deduction: + type: string + nullable: true + maxLength: 12 + description: | + Commute deduction type of the expense. + example: ONE_WAY + enum: + - ONE_WAY + - ROUND_TRIP + - NO_DEDUCTION + - null approver_expense_in: type: object @@ -1165,8 +1185,18 @@ approver_expense_in: description: | Commute details id of the expense. This id is provided by Fyle to identify a commute details. example: 1234 - commute_details: - $ref: './fields.yaml#/commute_details' + commute_deduction: + type: string + nullable: true + maxLength: 12 + description: | + Commute deduction type of the expense. + example: ONE_WAY + enum: + - ONE_WAY + - ROUND_TRIP + - NO_DEDUCTION + - null expense_out_embed: type: object From d54c5ce7a309d044050a1b15bca9d809e3ccac8d Mon Sep 17 00:00:00 2001 From: Siva Date: Tue, 1 Oct 2024 08:35:12 +0000 Subject: [PATCH 3/3] Auto generate API docs --- reference/admin.yaml | 68 +++++++++++++++++++++++++++++++++++- reference/approver.yaml | 77 ++++++++++++++++++++++++++++++++++++++++- reference/spender.yaml | 68 +++++++++++++++++++++++++++++++++++- 3 files changed, 210 insertions(+), 3 deletions(-) diff --git a/reference/admin.yaml b/reference/admin.yaml index 238248102..5186e028b 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -4158,7 +4158,36 @@ components: minItems: 0 maxItems: 10 items: - $ref: '#/components/schemas/location' + type: object + nullable: true + properties: + city: + type: string + nullable: true + example: London + state: + type: string + nullable: true + example: London + display: + type: string + nullable: true + country: + type: string + nullable: true + example: United Kingdom + formatted_address: + type: string + nullable: true + example: 221 Baker St, Marylebone, London, United Kingdom + latitude: + type: number + nullable: true + example: 12.971599 + longitude: + type: number + nullable: true + example: 77.594566 admin_expense_in: type: object additionalProperties: false @@ -4210,6 +4239,8 @@ components: - Admins can't assign the expense to self. source: $ref: '#/components/schemas/source' + code: + $ref: '#/components/schemas/code' merchant: $ref: '#/components/schemas/merchant' foreign_currency: @@ -4281,6 +4312,41 @@ 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.
+ hotel_is_breakfast_provided: + type: boolean + nullable: true + description: | + This field is applicable for only `Hotel` category. + mileage_rate_id: + allOf: + - $ref: '#/components/schemas/fk_integer' + description: | + Specific to mileage expense. This represents the Mileage's rate id given by Fyle + during creation of mileage rate for which this expense is created. + nullable: true + example: 9080 + mileage_is_round_trip: + type: boolean + nullable: true + description: Flag stating whether this was a round trip or not. + commute_details_id: + type: integer + nullable: true + description: | + Commute details id of the expense. This id is provided by Fyle to identify a commute details. + example: 1234 + commute_deduction: + type: string + nullable: true + maxLength: 12 + description: | + Commute deduction type of the expense. + example: ONE_WAY + enum: + - ONE_WAY + - ROUND_TRIP + - NO_DEDUCTION + - null attach_files_to_expense_in: type: object required: diff --git a/reference/approver.yaml b/reference/approver.yaml index 134d63b61..0a80dd27a 100644 --- a/reference/approver.yaml +++ b/reference/approver.yaml @@ -2399,7 +2399,36 @@ components: minItems: 0 maxItems: 10 items: - $ref: '#/components/schemas/location' + type: object + nullable: true + properties: + city: + type: string + nullable: true + example: London + state: + type: string + nullable: true + example: London + display: + type: string + nullable: true + country: + type: string + nullable: true + example: United Kingdom + formatted_address: + type: string + nullable: true + example: 221 Baker St, Marylebone, London, United Kingdom + latitude: + type: number + nullable: true + example: 12.971599 + longitude: + type: number + nullable: true + example: 77.594566 custom_fields: type: array description: | @@ -2437,6 +2466,8 @@ components: example: '2020-06-01T01:18:19.292-08:00' source: $ref: '#/components/schemas/source' + code: + $ref: '#/components/schemas/code' merchant: $ref: '#/components/schemas/merchant' foreign_currency: @@ -2499,6 +2530,50 @@ components: $ref: '#/components/schemas/locations' custom_fields: $ref: '#/components/schemas/custom_fields' + file_ids: + type: array + items: + allOf: + - $ref: '#/components/schemas/fk_string' + description: | + 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.
+ hotel_is_breakfast_provided: + type: boolean + nullable: true + description: | + This field is applicable for only `Hotel` category. + mileage_rate_id: + allOf: + - $ref: '#/components/schemas/fk_integer' + description: | + Specific to mileage expense. This represents the Mileage's rate id given by Fyle + during creation of mileage rate for which this expense is created. + nullable: true + example: 9080 + mileage_is_round_trip: + type: boolean + nullable: true + description: Flag stating whether this was a round trip or not. + commute_details_id: + type: integer + nullable: true + description: | + Commute details id of the expense. This id is provided by Fyle to identify a commute details. + example: 1234 + commute_deduction: + type: string + nullable: true + maxLength: 12 + description: | + Commute deduction type of the expense. + example: ONE_WAY + enum: + - ONE_WAY + - ROUND_TRIP + - NO_DEDUCTION + - null attach_files_to_expense_in: type: object required: diff --git a/reference/spender.yaml b/reference/spender.yaml index 7865e1967..66c614f64 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -2244,7 +2244,36 @@ components: minItems: 0 maxItems: 10 items: - $ref: '#/components/schemas/location' + type: object + nullable: true + properties: + city: + type: string + nullable: true + example: London + state: + type: string + nullable: true + example: London + display: + type: string + nullable: true + country: + type: string + nullable: true + example: United Kingdom + formatted_address: + type: string + nullable: true + example: 221 Baker St, Marylebone, London, United Kingdom + latitude: + type: number + nullable: true + example: 12.971599 + longitude: + type: number + nullable: true + example: 77.594566 custom_fields: type: array description: | @@ -2269,6 +2298,8 @@ components: This field is not required for creating Per Diem Expenses source: $ref: '#/components/schemas/source' + code: + $ref: '#/components/schemas/code' merchant: $ref: '#/components/schemas/merchant' foreign_currency: @@ -2379,6 +2410,41 @@ 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.
+ hotel_is_breakfast_provided: + type: boolean + nullable: true + description: | + This field is applicable for only `Hotel` category. + mileage_rate_id: + allOf: + - $ref: '#/components/schemas/fk_integer' + description: | + Specific to mileage expense. This represents the Mileage's rate id given by Fyle + during creation of mileage rate for which this expense is created. + nullable: true + example: 9080 + mileage_is_round_trip: + type: boolean + nullable: true + description: Flag stating whether this was a round trip or not. + commute_details_id: + type: integer + nullable: true + description: | + Commute details id of the expense. This id is provided by Fyle to identify a commute details. + example: 1234 + commute_deduction: + type: string + nullable: true + maxLength: 12 + description: | + Commute deduction type of the expense. + example: ONE_WAY + enum: + - ONE_WAY + - ROUND_TRIP + - NO_DEDUCTION + - null expense_add_comment_action_in: type: object required: