u
This commit is contained in:
@@ -51,6 +51,24 @@ Shipment details
|
||||
"type": "…",
|
||||
"state": "…"
|
||||
}
|
||||
],
|
||||
"files": [
|
||||
{
|
||||
"id": 1,
|
||||
"manifestId": 1,
|
||||
"fileId": 1,
|
||||
"sort": 1,
|
||||
"hash": "…",
|
||||
"mimetype": "…",
|
||||
"name": "…",
|
||||
"size": 1,
|
||||
"created": "2026-08-10T00:00:00.000Z",
|
||||
"modified": "2026-08-10T00:00:00.000Z",
|
||||
"thumbavif": "…",
|
||||
"thumbx": 1,
|
||||
"thumby": 1,
|
||||
"meta": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
38
docs/api/routes/shipment/_id/file/_fileId.md
Normal file
38
docs/api/routes/shipment/_id/file/_fileId.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# `GET /shipment/{id}/file/{fileId}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Get shipment attachment file content
|
||||
|
||||
Returns the full binary content of an attached file (e.g. shipment delivery note PDF)
|
||||
for the specified shipment. Supports HTTP caching via ETag (SHA-256 hash) and 304 Not Modified.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Shipment ID |
|
||||
| `fileId` | yes | integer | File ID or attachment ID |
|
||||
|
||||
## Query parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `download` | no | boolean | When true, sets Content-Disposition to attachment instead of inline |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Binary file content
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 304 | Not modified |
|
||||
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
|
||||
| 404 | Shipment or file not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
59
docs/api/routes/shipment/_id/pdf.md
Normal file
59
docs/api/routes/shipment/_id/pdf.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# `POST /shipment/{id}/pdf`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Generate and attach shipment PDF (delivery note)
|
||||
|
||||
Generates an A4 delivery note PDF document for the shipment with line items and package tracking.
|
||||
Shipping slips contain no price information.
|
||||
Attaches the PDF as a `manifestattachment` to the shipment so it can be printed or attached to packages.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Shipment ID |
|
||||
|
||||
## Signals
|
||||
|
||||
On success, emits SSE signal: `shipment` (see [`GET /events`](../events.md)).
|
||||
|
||||
## Response `201`
|
||||
|
||||
PDF generated and attached to shipment
|
||||
|
||||
```json
|
||||
{
|
||||
"attachment": {
|
||||
"id": 1,
|
||||
"manifestId": 1,
|
||||
"fileId": 1,
|
||||
"sort": 1,
|
||||
"hash": "…",
|
||||
"mimetype": "…",
|
||||
"name": "…",
|
||||
"size": 1,
|
||||
"created": "2026-08-10T00:00:00.000Z",
|
||||
"modified": "2026-08-10T00:00:00.000Z",
|
||||
"thumbavif": "…",
|
||||
"thumbx": 1,
|
||||
"thumby": 1,
|
||||
"meta": {}
|
||||
},
|
||||
"fileUrl": "/shipment/1/file/5"
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Shipment not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user