This commit is contained in:
seb
2026-10-12 13:11:28 +02:00
parent 4429294d8b
commit 1f09e620e3
8 changed files with 233 additions and 9 deletions

View File

@@ -206,7 +206,8 @@ 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.delete.md`](routes/shipping/_id.delete.md) | `DELETE /shipping/{id}` |
| [`routes/shipping/_id.patch.md`](routes/shipping/_id.patch.md) | `PATCH /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/smallthumb/get.md`](routes/smallthumb/get.md) | `GET /smallthumb/{fullHash}` |

View File

@@ -1,6 +1,6 @@
# Dash API Routes Overview (All)
Overview of all 209 API endpoints across all modules.
Overview of all 210 API endpoints across all modules.
### Notation
@@ -563,7 +563,7 @@ _none_
- Params: `id: int`
- Returns: `200 { shippings: T39[] }`
#### Create shipping for an order — `POST /order/{id}/shipping`
- Params: `id: int, body: { type: str, state: str }`
- Params: `id: int, body: { type: str, state: str, warehouseId?: int }`
- Returns: `201 { shipping: T39 }`
### Section: /package
@@ -700,6 +700,9 @@ _none_
#### Delete shipping — `DELETE /shipping/{id}`
- Params: `id: int`
- Returns: `204 void`
#### Update shipping — `PATCH /shipping/{id}`
- Params: `id: int, body: { type?: str, state?: str, warehouseId?: int }`
- Returns: `200 { shipping: T39 }`
#### 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 }[] }`

View File

@@ -1,6 +1,6 @@
# Dash API Routes Overview
Overview of all 162 API endpoints across all modules.
Overview of all 163 API endpoints across all modules.
### Notation
@@ -464,7 +464,7 @@ _none_
- Params: `id: int`
- Returns: `200 { shippings: T35[] }`
#### Create shipping for an order — `POST /order/{id}/shipping`
- Params: `id: int, body: { type: str, state: str }`
- Params: `id: int, body: { type: str, state: str, warehouseId?: int }`
- Returns: `201 { shipping: T35 }`
### Section: /package
@@ -544,6 +544,9 @@ _none_
#### Delete shipping — `DELETE /shipping/{id}`
- Params: `id: int`
- Returns: `204 void`
#### Update shipping — `PATCH /shipping/{id}`
- Params: `id: int, body: { type?: str, state?: str, warehouseId?: int }`
- Returns: `200 { shipping: T35 }`
#### 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 }[] }`

View File

@@ -6,6 +6,7 @@ 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).
If `state` is `shipped`, stock is adjusted via the ledger and article history is written.
## Path parameters
@@ -20,11 +21,13 @@ Creates a shipping for the order. The shipping number is allocated from the
|-------|----------|------|-------------|
| `type` | yes | string | |
| `state` | yes | string | |
| `warehouseId` | no | integer | Optional warehouse ID for stock deduction when state is shipped |
```json
{
"type": "…",
"state": "…"
"state": "…",
"warehouseId": 1
}
```
@@ -51,7 +54,8 @@ Created shipping
| 400 | Validation error or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Order not found — `{"error":"…"}` |
| 404 | Order or warehouse not found — `{"error":"…"}` |
| 409 | Order already shipped — `{"error":"…"}` |
---

View File

@@ -5,6 +5,8 @@ Protected. Requires a valid session cookie (`credentials: 'include'`).
Delete shipping
Deletes a shipping of the selected company. Its packages are removed as well.
Shipped shippings cannot be deleted because stock movements have been ledgered.
## Path parameters
@@ -25,6 +27,8 @@ _No content_
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Shipping not found — `{"error":"…"}` |
| 409 | Shipped shipping cannot be deleted — `{"error":"…"}` |
---

View File

@@ -0,0 +1,61 @@
# `PATCH /shipping/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Update shipping
Updates a shipping record. If transitioned to `shipped`, stock is adjusted
via ledger and article history is written. Once shipped, it cannot be undone.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Shipping ID |
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `type` | no | string | |
| `state` | no | string | |
| `warehouseId` | no | integer | Warehouse ID for stock deduction when transitioning to shipped |
```json
{
"type": "…",
"state": "…",
"warehouseId": 1
}
```
## Response `200`
Updated 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 | Shipping or warehouse not found — `{"error":"…"}` |
| 409 | Shipped shipping cannot be undone, or order already shipped — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._