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

Per diem documentation #374

Merged
merged 18 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion reference/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3517,7 +3517,7 @@ components:
type: integer
nullable: true
description: |
Specific to per diem related expenses, number of days ofr which per diem claim is made.
Specific to per diem related expenses, number of days for which per diem claim is made.
example: 2
started_at:
$ref: '#/components/schemas/timestamptz_utc'
Expand Down
2 changes: 1 addition & 1 deletion reference/approver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ components:
type: integer
nullable: true
description: |
Specific to per diem related expenses, number of days ofr which per diem claim is made.
Specific to per diem related expenses, number of days for which per diem claim is made.
example: 2
started_at:
$ref: '#/components/schemas/timestamptz_utc'
Expand Down
34 changes: 30 additions & 4 deletions reference/spender.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ components:
type: integer
nullable: true
description: |
Specific to per diem related expenses, number of days ofr which per diem claim is made.
Specific to per diem related expenses, number of days for which per diem claim is made.
example: 2
started_at:
$ref: '#/components/schemas/timestamptz_utc'
Expand Down Expand Up @@ -2098,7 +2098,12 @@ components:
id:
$ref: '#/components/schemas/id_string'
spent_at:
$ref: '#/components/schemas/spent_at'
allOf:
- $ref: '#/components/schemas/spent_at'
description: |
Date on which the expense was made.
This date cannot be in future.
This field is not required for creating Per Diem Expenses
source:
$ref: '#/components/schemas/source'
merchant:
Expand All @@ -2108,7 +2113,11 @@ components:
foreign_amount:
$ref: '#/components/schemas/foreign_amount'
claim_amount:
$ref: '#/components/schemas/claim_amount'
allOf:
- $ref: '#/components/schemas/claim_amount'
description: |
The expense amount as claimed by user. <br>
For Per Diem Expenses this amount should be equal to per diem rate rounded to two decimal places multiplied by number of days.
purpose:
type: string
example: Team lunch
Expand Down Expand Up @@ -2160,6 +2169,23 @@ components:
$ref: '#/components/schemas/locations'
custom_fields:
$ref: '#/components/schemas/custom_fields'
per_diem_rate_id:
allOf:
- $ref: '#/components/schemas/fk_integer'
nullable: true
example: 583
description: |
Specific to per diem expense. This represents the per diem's rate id given by Fyle
during creation of per diem rate for which this expense is created. <br>
This field is required for creating Per Diem Expenses.
per_diem_num_days:
allOf:
- $ref: '#/components/schemas/fk_integer'
nullable: true
example: 2
description: |
Specific to per diem related expenses, number of days for which per diem claim is made. <br>
This field is required for creating Per Diem Expenses.
expense_add_comment_action_in:
type: object
required:
Expand Down Expand Up @@ -6857,7 +6883,7 @@ paths:
- Expenses
summary: Create or update expense
description: |
Create or update an expense.
Create or update an expense.<br> To create/edit per diem expenses, please send category id of per diem category, along with some required additional fields mentioned below
operationId: expenses_post
requestBody:
required: true
Expand Down
36 changes: 31 additions & 5 deletions src/components/schemas/expense.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ expense_out:
type: integer
nullable: true
description: |
Specific to per diem related expenses, number of days ofr which per diem claim is made.
Specific to per diem related expenses, number of days for which per diem claim is made.
example: 2
started_at:
$ref: './fields.yaml#/timestamptz_utc'
Expand Down Expand Up @@ -654,7 +654,7 @@ expense_in:
type: integer
nullable: true
description: |
Specific to per diem related expenses, number of days ofr which per diem claim is made.
Specific to per diem related expenses, number of days for which per diem claim is made.
example: 2
started_at:
$ref: './fields.yaml#/timestamptz_pst'
Expand Down Expand Up @@ -704,7 +704,12 @@ spender_expense_in:
id:
$ref: './fields.yaml#/id_string'
spent_at:
$ref: './fields.yaml#/spent_at'
allOf:
- $ref: './fields.yaml#/spent_at'
description: |
Date on which the expense was made.
This date cannot be in future.
This field is not required for creating Per Diem Expenses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we talk about how per diems are created/most probably in the header?

source:
$ref: './fields.yaml#/source'
merchant:
Expand All @@ -714,7 +719,11 @@ spender_expense_in:
foreign_amount:
$ref: './fields.yaml#/foreign_amount'
claim_amount:
$ref: './fields.yaml#/claim_amount'
allOf:
- $ref: './fields.yaml#/claim_amount'
description: |
The expense amount as claimed by user. <br>
For Per Diem Expenses this amount should be equal to per diem rate rounded to two decimal places multiplied by number of days.
purpose:
type: string
example: Team lunch
Expand Down Expand Up @@ -766,6 +775,23 @@ spender_expense_in:
$ref: './fields.yaml#/locations'
custom_fields:
$ref: './fields.yaml#/custom_fields'
per_diem_rate_id:
allOf:
- $ref: './fields.yaml#/fk_integer'
nullable: true
example: 583
description: |
Specific to per diem expense. This represents the per diem's rate id given by Fyle
during creation of per diem rate for which this expense is created. <br>
This field is required for creating Per Diem Expenses.
per_diem_num_days:
allOf:
- $ref: './fields.yaml#/fk_integer'
nullable: true
example: 2
description: |
Specific to per diem related expenses, number of days for which per diem claim is made. <br>
This field is required for creating Per Diem Expenses.

admin_expense_in:
type: object
Expand Down Expand Up @@ -1340,7 +1366,7 @@ accounting_export_summary_in:
url:
type: string
description: URL Endpoint for exported / failed expense
example: https://app.example.com/expense/txwownwrng
example: https://app.example.com/expense/txwownwrng
spender_expense_check_mandatory_fields_in:
type: object
additionalProperties: false
Expand Down
3 changes: 2 additions & 1 deletion src/spender/paths/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ post:
- Expenses
summary: Create or update expense
description: >
Create or update an expense.
Create or update an expense.<br>
To create/edit per diem expenses, please send category id of per diem category, along with some required additional fields mentioned below
operationId: expenses_post
requestBody:
required: true
Expand Down
Loading