This commit is contained in:
seb
2026-10-26 19:22:01 +01:00
parent a5a9e51898
commit 69388c789f
23 changed files with 1307 additions and 28 deletions

View File

@@ -0,0 +1,36 @@
# `GET /retoure`
Protected. Requires a valid session cookie (`credentials: 'include'`).
List retoures
Lists customer return manifests (`manifest` rows with `type = 'retoure'`)
for the authenticated user's selected company.
## Query parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `offset` | no | integer | |
| `limit` | no | integer | |
| `search` | no | string | |
| `onlyUnpaid` | no | boolean | |
| `onlyUndelivered` | no | boolean | |
| `entityId` | no | integer | |
| `seekMonths` | no | integer | |
## Response `200`
List of retoures
## Errors
| Status | Description |
|--------|-------------|
| 400 | Validation error |
| 403 | Not authorized |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,33 @@
# `POST /retoure`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Create retoure
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `number` | no | string | |
| `date` | yes | string | |
| `entityId` | no | integer | |
| `externalNumber` | no | string | |
| `lines` | no | any[] | |
```json
{
"number": "…",
"date": "…",
"entityId": 1,
"externalNumber": "…",
"lines": []
}
```
## Response `201`
Retoure created
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,21 @@
# `DELETE /retoure/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Delete retoure
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | |
## Response `204`
Retoure deleted
_No content_
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,25 @@
# `GET /retoure/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Get retoure by ID
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | |
## Response `200`
Retoure details
## Errors
| Status | Description |
|--------|-------------|
| 404 | Retoure not found |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,25 @@
# `PUT /retoure/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Update retoure
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | |
## Body (JSON)
```json
{}
```
## Response `200`
Retoure updated
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,19 @@
# `POST /retoure/{id}/shipment`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Create shipment for retoure
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | |
## Response `201`
Shipment created
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,13 @@
# `POST /retoure/rebuild-summaries`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Rebuild retoure summaries
## Response `200`
Summaries rebuilt
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,23 @@
# `GET /return`
Protected. Requires a valid session cookie (`credentials: 'include'`).
List returns
## Query parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `offset` | no | integer | |
| `limit` | no | integer | |
| `search` | no | string | |
| `onlyUnbooked` | no | boolean | |
| `supplierId` | no | integer | |
## Response `200`
List of returns
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,19 @@
# `POST /return`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Create return
## Body (JSON)
```json
{}
```
## Response `201`
Return created
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,21 @@
# `DELETE /return/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Delete return
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | |
## Response `204`
Return deleted
_No content_
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,19 @@
# `GET /return/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Get return by ID
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | |
## Response `200`
Return details
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,19 @@
# `PUT /return/{id}`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Update return
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | |
## Response `200`
Return updated
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,19 @@
# `POST /return/{id}/book`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Book return to ledger
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | |
## Response `200`
Return booked
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,13 @@
# `POST /return/rebuild-summaries`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Rebuild return summaries
## Response `200`
Summaries rebuilt
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._