From e83116c83dee9bfff9bb5fe75b6a7b8af9847d05 Mon Sep 17 00:00:00 2001 From: seb Date: Fri, 23 Oct 2026 20:31:38 +0200 Subject: [PATCH] u --- docs/api/routes/shipment/_id.patch.md | 2 +- docs/api/routes/stock/ship.md | 1 - src/api/openapi.js | 4 ++-- src/api/routes/shipment.js | 10 +++++----- src/api/routes/stock.js | 1 - 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/api/routes/shipment/_id.patch.md b/docs/api/routes/shipment/_id.patch.md index 2d9d063..aa4f43d 100644 --- a/docs/api/routes/shipment/_id.patch.md +++ b/docs/api/routes/shipment/_id.patch.md @@ -4,7 +4,7 @@ Protected. Requires a valid session cookie (`credentials: 'include'`). Update shipment state or metadata -Updates delivery state (`new`, `delivered`, `returned`) for the shipment. +Updates delivery state (`new`, `delivered`) for the shipment. Emits SSE events (`shipment`, `order`) so connected clients rerender in real time. diff --git a/docs/api/routes/stock/ship.md b/docs/api/routes/stock/ship.md index 6aa111b..94ecd3e 100644 --- a/docs/api/routes/stock/ship.md +++ b/docs/api/routes/stock/ship.md @@ -7,7 +7,6 @@ Ship shipment manifest item(s) Books shipment for a shipment manifest item on the ledger (warehouse_id = null). If the connected article has stock tracking enabled, an adjustment entry is also booked to deduct physical stock from the target warehouse. -If line amount is negative, books as a customer retoure (incoming). ## Body (JSON) diff --git a/src/api/openapi.js b/src/api/openapi.js index 91cda59..713e177 100644 --- a/src/api/openapi.js +++ b/src/api/openapi.js @@ -1461,7 +1461,7 @@ * $ref: '#/components/schemas/DeliveryFile' * state: * type: string - * enum: [new, delivered, returned] + * enum: [new, delivered] * description: Delivery state * ShipmentSummary: * type: object @@ -1508,7 +1508,7 @@ * nullable: true * state: * type: string - * enum: [new, delivered, returned] + * enum: [new, delivered, cancelled] * Package: * type: object * required: [id, shippingId, entityaddressId, number, type, state] diff --git a/src/api/routes/shipment.js b/src/api/routes/shipment.js index eee1292..0ce8de7 100644 --- a/src/api/routes/shipment.js +++ b/src/api/routes/shipment.js @@ -321,7 +321,7 @@ export function register(app, basePath = '') { * name: state * schema: * type: string - * enum: [new, delivered, returned, cancelled, all] + * enum: [new, delivered, cancelled, all] * description: Optional filter by delivery state (cancelled shipments hidden by default) * - in: query * name: seekMonths @@ -403,7 +403,7 @@ export function register(app, basePath = '') { let state = undefined; if (typeof req.query.state === 'string' && req.query.state.trim() !== '') { const trimmedState = req.query.state.trim().toLowerCase(); - if (!['new', 'delivered', 'returned', 'cancelled', 'all'].includes(trimmedState)) { + if (!['new', 'delivered', 'cancelled', 'all'].includes(trimmedState)) { return res.status(400).json({ error: 'Invalid state' }); } state = trimmedState; @@ -513,7 +513,7 @@ export function register(app, basePath = '') { * tags: [Shipment] * summary: Update shipment state or metadata * description: | - * Updates delivery state (`new`, `delivered`, `returned`) for the shipment. + * Updates delivery state (`new`, `delivered`) for the shipment. * Emits SSE events (`shipment`, `order`) so connected clients rerender in real time. * security: * - cookieAuth: [] @@ -534,7 +534,7 @@ export function register(app, basePath = '') { * properties: * state: * type: string - * enum: [new, delivered, returned, cancelled] + * enum: [new, delivered, cancelled] * description: Delivery state * example: * state: delivered @@ -582,7 +582,7 @@ export function register(app, basePath = '') { const { state } = req.body ?? {}; if (state !== undefined) { - if (typeof state !== 'string' || !['new', 'delivered', 'returned'].includes(state.trim().toLowerCase())) { + if (typeof state !== 'string' || !['new', 'delivered'].includes(state.trim().toLowerCase())) { return res.status(400).json({ error: 'Invalid state' }); } } diff --git a/src/api/routes/stock.js b/src/api/routes/stock.js index 1417c89..e8cad48 100644 --- a/src/api/routes/stock.js +++ b/src/api/routes/stock.js @@ -261,7 +261,6 @@ export function register(app, basePath = '') { * Books shipment for a shipment manifest item on the ledger (warehouse_id = null). * If the connected article has stock tracking enabled, an adjustment entry is also * booked to deduct physical stock from the target warehouse. - * If line amount is negative, books as a customer retoure (incoming). * security: * - cookieAuth: [] * x-signals: [stock, ledger, articles, shipping]