Skip to content

Commit

Permalink
Auto generate API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
snarayanank2 committed Dec 5, 2024
1 parent c0742e2 commit e0c4289
Show file tree
Hide file tree
Showing 3 changed files with 899 additions and 208 deletions.
355 changes: 280 additions & 75 deletions reference/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4478,28 +4478,80 @@ components:
- $ref: '#/components/schemas/id_string'
example: exfilumWHrlPf7K
expenses_stats_in:
type: object
required:
- data
properties:
query_params:
nullable: false
type: string
description: |
This field contains the query param string similar to the query params passed in expenses GET call for displaying expenses in the list view.
example: id=in.('tx1263', 'tx1569')
Query param string similar to expenses GET call. Use group_by_state=eq.true to get state-wise grouping of stats.
example: id=in.('tx1263', 'tx1569')&group_by_state=eq.true
expenses_stats_out:
type: object
properties:
count:
type: integer
nullable: false
description: |
This field represents the total number of expenses that match the criteria specified in the query_params within the body of the request.
example: 1
total_amount:
allOf:
- $ref: '#/components/schemas/amount'
description: |
This field indicates the sum of amount of expenses that match the criteria specified in the query_params within the body of the request.
example: 100
type: array
description: |
Array containing stats objects. When group_by_state is true, contains objects for ALL possible states
(with count and total_amount as 0 for states with no matching expenses). When false or not provided,
contains single object with aggregated stats and null state.
items:
type: object
required:
- count
- total_amount
- state
properties:
count:
type: integer
nullable: false
description: |
Number of expenses that match the specified criteria.
example: 10
total_amount:
type: number
nullable: false
description: |
Sum of amounts for matching expenses.
example: 44545.4
state:
type: string
nullable: true
description: |
Expense state for grouping. null when group_by_state is false or not provided.
When group_by_state is true, response includes all possible states, with count=0
and total_amount=0 for states with no matching expenses.
example: DRAFT
enum:
- COMPLETE
- DRAFT
- PAID
- PAYMENT_PROCESSING
- APPROVER_PENDING
- PAYMENT_PENDING
- APPROVED
- null
example:
- state: COMPLETE
count: 343
total_amount: 1337
- state: DRAFT
count: 10
total_amount: 44545.4
- state: PAID
count: 0
total_amount: 0
- state: PAYMENT_PROCESSING
count: 0
total_amount: 0
- state: APPROVER_PENDING
count: 0
total_amount: 0
- state: PAYMENT_PENDING
count: 0
total_amount: 0
- state: APPROVED
count: 0
total_amount: 0
query_params:
type: string
description: |
Expand Down Expand Up @@ -4868,28 +4920,79 @@ components:
custom_fields:
$ref: '#/components/schemas/custom_fields'
advance_requests_stats_in:
type: object
required:
- data
properties:
query_params:
type: string
description: |
This field contains the query param string similar to the query params passed in advance_requests GET call for displaying advance_requests in the list view.
Query param string similar to advance_requests GET call. Use group_by_state=eq.true to get state-wise grouping of stats.
nullable: false
example: id=in.('adr1263', 'adr1569')
example: id=in.('adr1263','adr1569')&group_by_state=eq.true
advance_requests_stats_out:
type: object
properties:
count:
type: integer
description: |
This field represents the total number of advance_requests that match the criteria specified in the query_params within the body of the request.
nullable: false
example: 1
total_amount:
allOf:
- $ref: '#/components/schemas/amount'
description: |
This field indicates the sum of amount of advance_requests that match the criteria specified in the query_params within the body of the request.
example: 100
type: array
description: |
Array containing stats objects. When group_by_state is true, contains objects for ALL possible states
(with count and total_amount as 0 for states with no matching advance requests). When false or not provided,
contains single object with aggregated stats and null state.
items:
type: object
required:
- count
- total_amount
- state
properties:
count:
type: integer
nullable: false
description: |
Number of advance requests that match the specified criteria.
example: 10
total_amount:
type: number
nullable: false
description: |
Sum of amounts for matching advance requests.
example: 44545.4
state:
type: string
nullable: true
description: |
Advance request state for grouping. null when group_by_state is false or not provided.
When group_by_state is true, response includes all possible states, with count=0
and total_amount=0 for states with no matching advance requests.
example: DRAFT
enum:
- DRAFT
- APPROVAL_PENDING
- APPROVED
- SENT_BACK
- PULLED_BACK
- REJECTED
- PAID
- null
example:
- state: DRAFT
count: 10
total_amount: 44545.4
- state: APPROVAL_PENDING
count: 0
total_amount: 0
- state: APPROVED
count: 343
total_amount: 1337
- state: SENT_BACK
count: 0
total_amount: 0
- state: PULLED_BACK
count: 0
total_amount: 0
- state: REJECTED
count: 0
total_amount: 0
- state: PAID
count: 0
total_amount: 0
advance_request_out_embed:
type: object
nullable: true
Expand Down Expand Up @@ -6209,53 +6312,155 @@ components:
id:
$ref: '#/components/schemas/id_string'
reports_stats_in:
type: object
required:
- data
properties:
query_params:
nullable: false
type: string
description: |
This field contains the query param string similar to the query params passed in reports GET call for displaying reports in the list view.
example: state=eq.PAYMENT_PROCESSING&report_id=in.('rp123', 'rep1234')
reports_stats_out:
type: object
properties:
count:
type: integer
Query param string similar to reports GET call. Use group_by_state=eq.true to get state-wise grouping of stats.
nullable: false
description: |
This field indicates the count of reports.
example: 1
total_amount:
allOf:
- $ref: '#/components/schemas/amount'
description: |
This field indicates the sum of amount of reports.
example: 100
processing_amount:
allOf:
- $ref: '#/components/schemas/amount'
description: |
This field indicates the sum of reimbursable amount of reports in Processing state.
example: 101
processing_count:
type: integer
description: |
This field indicates the count of reports in Processing state.
example: 2
failed_amount:
nullable: true
anyOf:
- $ref: '#/components/schemas/amount'
- $ref: '#/components/schemas/null_field'
description: |
This field indicates the sum of reimbursable amount of reports in Processing state for which ACH has failed
example: 101
failed_count:
type: integer
nullable: true
description: |
This field indicates the count of reports in processing state for which ACH has failed.
example: 1
example: id=in.('rp123','rep1234')&group_by_state=eq.true
reports_stats_out:
type: array
description: |
Array containing stats objects. When group_by_state is true, contains objects for ALL possible states
(with count and amounts as 0 for states with no matching reports). When false or not provided,
contains single object with aggregated stats and null state.
Note: failed_amount, failed_count, processing_amount, and processing_count are only applicable
for PAYMENT_PROCESSING state and will be null for all other states.
items:
type: object
required:
- count
- total_amount
- state
- failed_amount
- failed_count
- processing_amount
- processing_count
- reimbursable_amount
properties:
count:
type: integer
nullable: false
description: |
Number of reports that match the specified criteria.
example: 5
total_amount:
type: number
nullable: false
description: |
Sum of amounts for matching reports.
example: 2200
state:
type: string
nullable: true
description: |
Report state for grouping. null when group_by_state is false or not provided.
When group_by_state is true, response includes all possible states.
example: PAYMENT_PROCESSING
enum:
- DRAFT
- APPROVER_PENDING
- APPROVER_INQUIRY
- PAYMENT_PROCESSING
- APPROVED
- PAYMENT_PENDING
- PAID
- null
failed_amount:
type: number
nullable: true
description: |
Sum of reimbursable amount of reports for which ACH has failed.
Only applicable when state is PAYMENT_PROCESSING, null for all other states.
example: 200
failed_count:
type: integer
nullable: true
description: |
Count of reports for which ACH has failed.
Only applicable when state is PAYMENT_PROCESSING, null for all other states.
example: 1
processing_amount:
type: number
nullable: true
description: |
Sum of reimbursable amount of reports in processing state.
Only applicable when state is PAYMENT_PROCESSING, null for all other states.
example: 1500
processing_count:
type: integer
nullable: true
description: |
Count of reports in processing state.
Only applicable when state is PAYMENT_PROCESSING, null for all other states.
example: 3
reimbursable_amount:
type: number
nullable: false
description: |
Sum of reimbursable amounts for matching reports.
example: 500
example:
- state: DRAFT
count: 3
failed_amount: null
failed_count: null
processing_amount: null
processing_count: null
reimbursable_amount: 200
total_amount: 350
- state: APPROVER_PENDING
count: 5
failed_amount: null
failed_count: null
processing_amount: null
processing_count: null
reimbursable_amount: 500
total_amount: 2200
- state: APPROVER_INQUIRY
count: 2
failed_amount: null
failed_count: null
processing_amount: null
processing_count: null
reimbursable_amount: 0
total_amount: 500
- state: PAYMENT_PROCESSING
count: 5
failed_amount: 200
failed_count: 1
processing_amount: 1500
processing_count: 3
reimbursable_amount: 500
total_amount: 2200
- state: APPROVED
count: 0
failed_amount: null
failed_count: null
processing_amount: null
processing_count: null
reimbursable_amount: 0
total_amount: 0
- state: PAYMENT_PENDING
count: 0
failed_amount: null
failed_count: null
processing_amount: null
processing_count: null
reimbursable_amount: 0
total_amount: 0
- state: PAID
count: 0
failed_amount: null
failed_count: null
processing_amount: null
processing_count: null
reimbursable_amount: 0
total_amount: 0
report_create_and_submit_expenses:
type: object
additionalProperties: false
Expand Down
Loading

0 comments on commit e0c4289

Please sign in to comment.