Skip to content
Open
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
79 changes: 79 additions & 0 deletions reference/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4891,6 +4891,73 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/404'
/admin/expenses/count:
get:
tags:
- Expenses
summary: Get expense count
description: |
Returns the number of expenses in the requested state that belong to enabled employees in the organization.
operationId: expenses_count
parameters:
- in: query
name: state
required: true
description: |
Valid expense state for which the count should be returned.<br>
Supported operators are `eq`.<br>
state=eq.DRAFT
schema:
type: string
example: eq.DRAFT
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- data
properties:
data:
$ref: '#/components/schemas/expenses_count_out'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/400'
'401':
description: Unauthorized request
content:
application/json:
schema:
$ref: '#/components/schemas/401'
'403':
description: Forbidden
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- data
- error
- message
properties:
data:
type: object
nullable: true
example: null
error:
type: string
enum:
- InvalidUsage
message:
type: string
example: You don't have permissions to access this resource
/admin/expenses/exports:
post:
tags:
Expand Down Expand Up @@ -22621,6 +22688,18 @@ components:
- state: UNREPORTABLE
count: 0
total_amount: 0
expenses_count_out:
type: object
additionalProperties: false
required:
- count
properties:
count:
type: integer
minimum: 0
nullable: false
description: Number of expenses matching the requested state and enabled-employee criteria.
example: 33
query_params:
type: string
description: |
Expand Down
2 changes: 2 additions & 0 deletions src/admin/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ paths:
$ref: paths/admin@expenses@verify@bulk.yaml
/admin/expenses/stats:
$ref: paths/admin@expenses@stats.yaml
/admin/expenses/count:
$ref: paths/admin@expenses@count.yaml
/admin/expenses/exports:
$ref: paths/admin@expenses@exports.yaml
/admin/expenses/export_configurations:
Expand Down
66 changes: 66 additions & 0 deletions src/admin/paths/admin@expenses@count.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
get:
tags:
- Expenses
summary: Get expense count
description: |
Returns the number of expenses in the requested state that belong to enabled employees in the organization.
operationId: expenses_count
parameters:
- in: query
name: state
required: true
description: |
Valid expense state for which the count should be returned.<br>
Supported operators are `eq`.<br>
state=eq.DRAFT
schema:
type: string
example: eq.DRAFT
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
additionalProperties: False
required:
- data
properties:
data:
$ref: '../../components/schemas/expense.yaml#/expenses_count_out'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '../../components/schemas/400.yaml'
'401':
description: Unauthorized request
content:
application/json:
schema:
$ref: '../../components/schemas/401.yaml'
'403':
description: Forbidden
content:
application/json:
schema:
type: object
additionalProperties: False
required:
- data
- error
- message
properties:
data:
type: object
nullable: true
example: null
error:
type: string
enum:
- InvalidUsage
message:
type: string
example: You don't have permissions to access this resource
14 changes: 14 additions & 0 deletions src/components/schemas/expense.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2187,6 +2187,20 @@ expense_delete_in:
$ref: './fields.yaml#/id_string'


expenses_count_out:
type: object
additionalProperties: False
required:
- count
properties:
count:
type: integer
minimum: 0
nullable: false
description: Number of expenses matching the requested state and enabled-employee criteria.
example: 33


expenses_stats_in:
required:
- query_params
Expand Down
Loading