u
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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' });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user