This commit is contained in:
seb
2026-10-09 10:41:21 +02:00
parent 969c064f3a
commit 011d84c3c1
31 changed files with 1845 additions and 4 deletions

View File

@@ -32,6 +32,9 @@ Generated from `@openapi` annotations in [`src/api/routes/`](../../src/api/route
| File | Endpoint |
|------|----------|
| [`routes/account.get.md`](routes/account.get.md) | `GET /account` |
| [`routes/account.post.md`](routes/account.post.md) | `POST /account` |
| [`routes/account/_id.md`](routes/account/_id.md) | `DELETE /account/{id}` |
| [`routes/article/create.md`](routes/article/create.md) | `POST /article` |
| [`routes/article/export.zip.md`](routes/article/export.zip.md) | `GET /article/export.zip` |
| [`routes/article/delete.md`](routes/article/delete.md) | `DELETE /article/{sku}` |
@@ -163,6 +166,12 @@ Generated from `@openapi` annotations in [`src/api/routes/`](../../src/api/route
| [`routes/order/delete.md`](routes/order/delete.md) | `DELETE /order/{id}` |
| [`routes/order/get.md`](routes/order/get.md) | `GET /order/{id}` |
| [`routes/order/update.md`](routes/order/update.md) | `PATCH /order/{id}` |
| [`routes/order/_id/payment.get.md`](routes/order/_id/payment.get.md) | `GET /order/{id}/payment` |
| [`routes/order/_id/payment.post.md`](routes/order/_id/payment.post.md) | `POST /order/{id}/payment` |
| [`routes/order/_id/shipping.get.md`](routes/order/_id/shipping.get.md) | `GET /order/{id}/shipping` |
| [`routes/order/_id/shipping.post.md`](routes/order/_id/shipping.post.md) | `POST /order/{id}/shipping` |
| [`routes/package/_id.md`](routes/package/_id.md) | `DELETE /package/{id}` |
| [`routes/payment/_id.md`](routes/payment/_id.md) | `DELETE /payment/{id}` |
| [`routes/posterminal/list.md`](routes/posterminal/list.md) | `GET /posterminal` |
| [`routes/posterminal/upsert.md`](routes/posterminal/upsert.md) | `PUT /posterminal` |
| [`routes/posterminal/delete.md`](routes/posterminal/delete.md) | `DELETE /posterminal/{id}` |
@@ -194,6 +203,9 @@ Generated from `@openapi` annotations in [`src/api/routes/`](../../src/api/route
| [`routes/quote/update.md`](routes/quote/update.md) | `PATCH /quote/{id}` |
| [`routes/serper/image.md`](routes/serper/image.md) | `POST /serper/image` |
| [`routes/serper/images.md`](routes/serper/images.md) | `POST /serper/images` |
| [`routes/shipping/_id.md`](routes/shipping/_id.md) | `DELETE /shipping/{id}` |
| [`routes/shipping/_id/package.get.md`](routes/shipping/_id/package.get.md) | `GET /shipping/{id}/package` |
| [`routes/shipping/_id/package.post.md`](routes/shipping/_id/package.post.md) | `POST /shipping/{id}/package` |
| [`routes/stock/adjust.md`](routes/stock/adjust.md) | `POST /stock/adjust` |
| [`routes/supplier/list.md`](routes/supplier/list.md) | `GET /supplier` |
| [`routes/supplier/create.md`](routes/supplier/create.md) | `POST /supplier` |

View File

@@ -1,6 +1,6 @@
# Dash API Routes Overview (All)
Overview of all 192 API endpoints across all modules.
Overview of all 204 API endpoints across all modules.
### Notation
@@ -57,6 +57,15 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
### Routes
#### List accounts — `GET /account`
_none_
- Returns: `200 { accounts: { id: int, companyId: int, type: str, name: str }[] }`
#### Create account — `POST /account`
- Params: `body: { type: str, name: str }`
- Returns: `201 { account: { id: int, companyId: int, type: str, name: str } }`
#### Delete account — `DELETE /account/{id}`
- Params: `id: int`
- Returns: `204 void`
#### Create article in category — `POST /article`
- Params: `body: { categoryId: int, name: str, desc?: str, seo?: str, track_stock?: bool }`
- Returns: `201 T31`
@@ -450,6 +459,24 @@ _none_
#### Update order — `PATCH /order/{id}`
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T25[] }`
- Returns: `200 T7`
#### List payments of an order — `GET /order/{id}/payment`
- Params: `id: int`
- Returns: `200 { payments: { id: int, accountId: int, manifestId: int, type: str, amount: num }[] }`
#### Add payment to an order — `POST /order/{id}/payment`
- Params: `id: int, body: { accountId: int, type: str, amount: num }`
- Returns: `201 { payment: { id: int, accountId: int, manifestId: int, type: str, amount: num } }`
#### List shippings of an order — `GET /order/{id}/shipping`
- Params: `id: int`
- Returns: `200 { shippings: { id: int, manifestId: int, number: str, type: str, state: str }[] }`
#### Create shipping for an order — `POST /order/{id}/shipping`
- Params: `id: int, body: { type: str, state: str }`
- Returns: `201 { shipping: { id: int, manifestId: int, number: str, type: str, state: str } }`
#### Delete package — `DELETE /package/{id}`
- Params: `id: int`
- Returns: `204 void`
#### Delete payment — `DELETE /payment/{id}`
- Params: `id: int`
- Returns: `204 void`
#### List POS terminals — `GET /posterminal`
_none_
- Returns: `200 { posterminals: T10[] }`
@@ -543,6 +570,15 @@ _none_
#### Search images via Serper.dev and stream WebP thumbnails (SSE) — `POST /serper/images`
- Params: `body: { q: str, gl?: str, hl?: str, num?: int, preferSource?: bool }`
- Returns: `200 SSE`
#### Delete shipping — `DELETE /shipping/{id}`
- Params: `id: int`
- Returns: `204 void`
#### List packages of a shipping — `GET /shipping/{id}/package`
- Params: `id: int`
- Returns: `200 { packages: { id: int, shippingId: int, entityaddressId: int, number: str, type: str, state: str, details?: str|null }[] }`
#### Create package for a shipping — `POST /shipping/{id}/package`
- Params: `id: int, body: { entityaddressId: int, type: str, state: str, details?: str }`
- Returns: `201 { package: { id: int, shippingId: int, entityaddressId: int, number: str, type: str, state: str, details?: str|null } }`
#### Adjust stock manually — `POST /stock/adjust`
- Params: `body: { sku?: str, warehouseId?: int, amount?: num, text?: str|null, lines?: { sku: str, amount: num, warehouseId?: int, text?: str }[] }`
- Returns: `201 { manifest: { id: int, number: str, type: str, date: str, createdAt: str }, lines: { manifestarticle_id: int, sku: str, name: str, warehouse_id: int, amount: num, text: str }[], ledger: T15[] }`

View File

@@ -1,6 +1,6 @@
# Dash API Routes Overview
Overview of all 146 API endpoints across all modules.
Overview of all 158 API endpoints across all modules.
### Notation
@@ -52,6 +52,15 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
### Routes
#### List accounts — `GET /account`
_none_
- Returns: `200 { accounts: { id: int, companyId: int, type: str, name: str }[] }`
#### Create account — `POST /account`
- Params: `body: { type: str, name: str }`
- Returns: `201 { account: { id: int, companyId: int, type: str, name: str } }`
#### Delete account — `DELETE /account/{id}`
- Params: `id: int`
- Returns: `204 void`
#### Create article in category — `POST /article`
- Params: `body: { categoryId: int, name: str, desc?: str, seo?: str, track_stock?: bool }`
- Returns: `201 T29`
@@ -388,6 +397,24 @@ _none_
#### Update order — `PATCH /order/{id}`
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T24[] }`
- Returns: `200 T7`
#### List payments of an order — `GET /order/{id}/payment`
- Params: `id: int`
- Returns: `200 { payments: { id: int, accountId: int, manifestId: int, type: str, amount: num }[] }`
#### Add payment to an order — `POST /order/{id}/payment`
- Params: `id: int, body: { accountId: int, type: str, amount: num }`
- Returns: `201 { payment: { id: int, accountId: int, manifestId: int, type: str, amount: num } }`
#### List shippings of an order — `GET /order/{id}/shipping`
- Params: `id: int`
- Returns: `200 { shippings: { id: int, manifestId: int, number: str, type: str, state: str }[] }`
#### Create shipping for an order — `POST /order/{id}/shipping`
- Params: `id: int, body: { type: str, state: str }`
- Returns: `201 { shipping: { id: int, manifestId: int, number: str, type: str, state: str } }`
#### Delete package — `DELETE /package/{id}`
- Params: `id: int`
- Returns: `204 void`
#### Delete payment — `DELETE /payment/{id}`
- Params: `id: int`
- Returns: `204 void`
#### List printers — `GET /printer`
_none_
- Returns: `200 { printers: T22[] }`
@@ -439,6 +466,15 @@ _none_
#### Update quote — `PATCH /quote/{id}`
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T24[] }`
- Returns: `200 T8`
#### Delete shipping — `DELETE /shipping/{id}`
- Params: `id: int`
- Returns: `204 void`
#### List packages of a shipping — `GET /shipping/{id}/package`
- Params: `id: int`
- Returns: `200 { packages: { id: int, shippingId: int, entityaddressId: int, number: str, type: str, state: str, details?: str|null }[] }`
#### Create package for a shipping — `POST /shipping/{id}/package`
- Params: `id: int, body: { entityaddressId: int, type: str, state: str, details?: str }`
- Returns: `201 { package: { id: int, shippingId: int, entityaddressId: int, number: str, type: str, state: str, details?: str|null } }`
#### Adjust stock manually — `POST /stock/adjust`
- Params: `body: { sku?: str, warehouseId?: int, amount?: num, text?: str|null, lines?: { sku: str, amount: num, warehouseId?: int, text?: str }[] }`
- Returns: `201 { manifest: { id: int, number: str, type: str, date: str, createdAt: str }, lines: { manifestarticle_id: int, sku: str, name: str, warehouse_id: int, amount: num, text: str }[], ledger: T14[] }`

View File

@@ -0,0 +1,35 @@
# `GET /account`
Protected. Requires a valid session cookie (`credentials: 'include'`).
List accounts
Lists payment accounts for the selected company.
## Response `200`
List of accounts
```json
{
"accounts": [
{
"id": 1,
"companyId": 1,
"type": "…",
"name": "…"
}
]
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | No company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,48 @@
# `POST /account`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Create account
Creates a payment account for the selected company.
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `type` | yes | string | |
| `name` | yes | string | |
```json
{
"type": "…",
"name": "…"
}
```
## Response `201`
Created account
```json
{
"account": {
"id": 1,
"companyId": 1,
"type": "…",
"name": "…"
}
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Validation error or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,32 @@
# `DELETE /account/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Delete account
Deletes an account of the selected company. Its payments are removed as well.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Account ID |
## Response `204`
Account deleted
_No content_
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Account not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,43 @@
# `GET /order/{id}/payment`
Protected. Requires a valid session cookie (`credentials: 'include'`).
List payments of an order
Lists payments of the order (manifest) for the selected company.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Order ID |
## Response `200`
List of payments
```json
{
"payments": [
{
"id": 1,
"accountId": 1,
"manifestId": 1,
"type": "…",
"amount": 1
}
]
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 404 | Order not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,58 @@
# `POST /order/{id}/payment`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Add payment to an order
Adds a payment to the order using an account of the selected company.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Order ID |
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `accountId` | yes | integer | |
| `type` | yes | string | |
| `amount` | yes | number | |
```json
{
"accountId": 1,
"type": "…",
"amount": 1
}
```
## Response `201`
Created payment
```json
{
"payment": {
"id": 1,
"accountId": 1,
"manifestId": 1,
"type": "…",
"amount": 1
}
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Validation error or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Order or account not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,43 @@
# `GET /order/{id}/shipping`
Protected. Requires a valid session cookie (`credentials: 'include'`).
List shippings of an order
Lists shippings of the order (manifest) for the selected company.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Order ID |
## Response `200`
List of shippings
```json
{
"shippings": [
{
"id": 1,
"manifestId": 1,
"number": "…",
"type": "…",
"state": "…"
}
]
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 404 | Order not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,58 @@
# `POST /order/{id}/shipping`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Create shipping for an order
Creates a shipping for the order. The shipping number is allocated from the
`shipping` number sequence (prefix and counter from the numbers API).
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Order ID |
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `type` | yes | string | |
| `state` | yes | string | |
```json
{
"type": "…",
"state": "…"
}
```
## Response `201`
Created shipping
```json
{
"shipping": {
"id": 1,
"manifestId": 1,
"number": "…",
"type": "…",
"state": "…"
}
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Validation error or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Order not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,31 @@
# `DELETE /package/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Delete package
Deletes a package of the selected company.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Package ID |
## Response `204`
Package deleted
_No content_
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,31 @@
# `DELETE /payment/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Delete payment
Deletes a payment of an order in the selected company.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Payment ID |
## Response `204`
Payment deleted
_No content_
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,31 @@
# `DELETE /shipping/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Delete shipping
Deletes a shipping of the selected company. Its packages are removed as well.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Shipping ID |
## Response `204`
Shipping deleted
_No content_
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,45 @@
# `GET /shipping/{id}/package`
Protected. Requires a valid session cookie (`credentials: 'include'`).
List packages of a shipping
Lists packages of the shipping for the selected company.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Shipping ID |
## Response `200`
List of packages
```json
{
"packages": [
{
"id": 1,
"shippingId": 1,
"entityaddressId": 1,
"number": "…",
"type": "…",
"state": "…",
"details": "…"
}
]
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 404 | Shipping not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,64 @@
# `POST /shipping/{id}/package`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Create package for a shipping
Creates a package for the shipping. The package number is allocated from the
`package` number sequence. `entityaddressId` is required (target address).
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Shipping ID |
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `entityaddressId` | yes | integer | |
| `type` | yes | string | |
| `state` | yes | string | |
| `details` | no | string | |
```json
{
"entityaddressId": 1,
"type": "…",
"state": "…",
"details": "…"
}
```
## Response `201`
Created package
```json
{
"package": {
"id": 1,
"shippingId": 1,
"entityaddressId": 1,
"number": "…",
"type": "…",
"state": "…",
"details": "…"
}
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Validation error or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Shipping or entity address not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._