Expand openapi.yaml with endpoints for orders, vehicles, departments, and economic statistics.

This commit is contained in:
Jeppe Bundgaard
2026-01-05 12:12:00 +01:00
parent c8b83c63d3
commit 7705fc8a09
+246
View File
@@ -762,6 +762,23 @@ paths:
$ref: '#/components/responses/Unauthorized' $ref: '#/components/responses/Unauthorized'
'404': '404':
$ref: '#/components/responses/NotFound' $ref: '#/components/responses/NotFound'
put:
tags:
- Orders
summary: Update order (alias)
description: Update an existing order
operationId: updateOrders
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OrderUpdate'
responses:
'200':
description: Order updated successfully
'400':
$ref: '#/components/responses/BadRequest'
/order: /order:
get: get:
@@ -1066,6 +1083,36 @@ paths:
responses: responses:
'201': '201':
description: Category added to department successfully description: Category added to department successfully
delete:
tags:
- Departments
summary: Remove category from department
operationId: removeDepartmentCategory
parameters:
- name: department_id
in: query
required: true
schema: {type: integer}
- name: category_id
in: query
required: true
schema: {type: integer}
responses:
'200': {description: Success}
/departments/order/recommended:
get:
tags:
- Departments
summary: Get recommended order for department
operationId: getDepartmentRecommendedOrder
parameters:
- name: department_id
in: query
required: true
schema: {type: integer}
responses:
'200': {description: Success}
/department/lanes: /department/lanes:
get: get:
@@ -1198,6 +1245,11 @@ paths:
schema: schema:
type: integer type: integer
description: Get specific product by ID description: Get specific product by ID
- name: final_price
in: query
schema:
type: boolean
description: Whether to return final prices including discounts
- $ref: '#/components/parameters/PageParam' - $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam' - $ref: '#/components/parameters/PerPageParam'
responses: responses:
@@ -1503,6 +1555,15 @@ paths:
parameters: parameters:
- $ref: '#/components/parameters/PageParam' - $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/PerPageParam' - $ref: '#/components/parameters/PerPageParam'
- name: id
in: query
schema: {type: integer}
- name: reg
in: query
schema: {type: string}
- name: customer_id
in: query
schema: {type: integer}
responses: responses:
'200': '200':
description: Vehicles retrieved successfully description: Vehicles retrieved successfully
@@ -1512,6 +1573,57 @@ paths:
type: array type: array
items: items:
$ref: '#/components/schemas/Vehicle' $ref: '#/components/schemas/Vehicle'
post:
tags:
- Vehicles
summary: Add vehicle
operationId: addVehicle
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [reg, customer_id]
properties:
reg: {type: string}
customer_id: {type: integer}
type: {type: integer}
reference: {type: string}
responses:
'200': {description: Success}
put:
tags:
- Vehicles
summary: Edit vehicle
operationId: editVehicle
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [id]
properties:
id: {type: integer}
reg: {type: string}
customer_id: {type: integer}
type: {type: integer}
reference: {type: string}
responses:
'200': {description: Success}
delete:
tags:
- Vehicles
summary: Delete vehicle
operationId: deleteVehicle
parameters:
- name: id
in: query
required: true
schema: {type: integer}
responses:
'200': {description: Success}
/vehicles/addons/available: /vehicles/addons/available:
get: get:
@@ -1553,6 +1665,104 @@ paths:
'200': '200':
description: Vehicle addon toggled successfully description: Vehicle addon toggled successfully
/department/vehicles/unknown-customer:
get:
tags:
- Vehicles
summary: Get unknown customer vehicles in department
operationId: getUnknownCustomerVehicles
responses:
'200': {description: Success}
/department/vehicle/customer-suggestions:
get:
tags:
- Vehicles
summary: Get vehicle customer suggestions
operationId: getVehicleCustomerSuggestions
parameters:
- name: reg
in: query
required: true
schema: {type: string}
responses:
'200': {description: Success}
/vehicles/set-auto-start-on-lpr:
post:
tags:
- Vehicles
summary: Set auto start on LPR
operationId: setVehicleAutoStartOnLpr
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [reg, auto_start_on_lpr]
properties:
reg: {type: string}
auto_start_on_lpr: {type: boolean}
responses:
'200': {description: Success}
/vehicles/set-vehicle-type-id:
post:
tags:
- Vehicles
summary: Set vehicle type ID
operationId: setVehicleTypeId
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [reg, vehicle_type_id]
properties:
reg: {type: string}
vehicle_type_id: {type: integer}
responses:
'200': {description: Success}
/superuser/users-with-vehicle-subscriptions:
get:
tags:
- Vehicles
summary: Get users with vehicle subscriptions
operationId: getUsersWithVehicleSubscriptions
responses:
'200': {description: Success}
/vehicles/status:
get:
tags:
- Vehicles
summary: Get vehicle status
operationId: getVehicleStatus
parameters:
- name: reg
in: query
required: true
schema: {type: string}
responses:
'200': {description: Success}
/vehicles/search:
get:
tags:
- Vehicles
summary: Search vehicles
operationId: searchVehicles
parameters:
- name: search
in: query
required: true
schema: {type: string}
responses:
'200': {description: Success}
# Notifications Endpoints # Notifications Endpoints
/notifications: /notifications:
get: get:
@@ -1682,6 +1892,42 @@ paths:
'200': '200':
description: This year's income statistics retrieved successfully description: This year's income statistics retrieved successfully
/statistics/income/departments:
get:
tags:
- Statistics
summary: Get total income today by departments
operationId: getTotalIncomeTodayByDepartments
responses:
'200': {description: Success}
/statistics/economic/totals:
get:
tags:
- Statistics
summary: Get total economic statistics
operationId: getEconomicTotals
responses:
'200': {description: Success}
/statistics/economic/totals/department_sent_invoice_totals:
get:
tags:
- Statistics
summary: Get department sent invoice totals
operationId: getDepartmentSentInvoiceTotals
responses:
'200': {description: Success}
/statistics/economic/totals/department_draft_invoice_totals:
get:
tags:
- Statistics
summary: Get department draft invoice totals
operationId: getDepartmentDraftInvoiceTotals
responses:
'200': {description: Success}
# Worker Endpoints # Worker Endpoints
/worker/version: /worker/version:
get: get: