feat(api): implement articlesupplier endpoints, sort reordering, and openapi docs

This commit is contained in:
seb
2026-09-17 12:38:16 +02:00
parent 49efd5f8a1
commit fe8fa55fbb
9 changed files with 336 additions and 4 deletions

View File

@@ -0,0 +1,56 @@
# `PUT /article/{sku}/supplier/order`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Reorder article suppliers
Sets the display sort order of supplier assignments for an article.
Expects an array of all assigned `articlesupplier` IDs in the desired order.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `sku` | yes | string | Article SKU |
## Body (JSON)
```json
{
"ids": [
12,
10,
15
]
}
```
## Signals
On success, emits SSE signal: `article-<sku>` (see [`GET /events`](../events.md)).
## Response `200`
New order applied
```json
{
"ids": [
1
]
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid supplier order, ids is required, or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Article or company not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._