u
This commit is contained in:
@@ -4,7 +4,7 @@ Protected. Requires a valid session cookie (`credentials: 'include'`).
|
|||||||
|
|
||||||
Update shipment state or metadata
|
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.
|
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).
|
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
|
If the connected article has stock tracking enabled, an adjustment entry is also
|
||||||
booked to deduct physical stock from the target warehouse.
|
booked to deduct physical stock from the target warehouse.
|
||||||
If line amount is negative, books as a customer retoure (incoming).
|
|
||||||
|
|
||||||
|
|
||||||
## Body (JSON)
|
## Body (JSON)
|
||||||
|
|||||||
@@ -1461,7 +1461,7 @@
|
|||||||
* $ref: '#/components/schemas/DeliveryFile'
|
* $ref: '#/components/schemas/DeliveryFile'
|
||||||
* state:
|
* state:
|
||||||
* type: string
|
* type: string
|
||||||
* enum: [new, delivered, returned]
|
* enum: [new, delivered]
|
||||||
* description: Delivery state
|
* description: Delivery state
|
||||||
* ShipmentSummary:
|
* ShipmentSummary:
|
||||||
* type: object
|
* type: object
|
||||||
@@ -1508,7 +1508,7 @@
|
|||||||
* nullable: true
|
* nullable: true
|
||||||
* state:
|
* state:
|
||||||
* type: string
|
* type: string
|
||||||
* enum: [new, delivered, returned]
|
* enum: [new, delivered, cancelled]
|
||||||
* Package:
|
* Package:
|
||||||
* type: object
|
* type: object
|
||||||
* required: [id, shippingId, entityaddressId, number, type, state]
|
* required: [id, shippingId, entityaddressId, number, type, state]
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ export function register(app, basePath = '') {
|
|||||||
* name: state
|
* name: state
|
||||||
* schema:
|
* schema:
|
||||||
* type: string
|
* type: string
|
||||||
* enum: [new, delivered, returned, cancelled, all]
|
* enum: [new, delivered, cancelled, all]
|
||||||
* description: Optional filter by delivery state (cancelled shipments hidden by default)
|
* description: Optional filter by delivery state (cancelled shipments hidden by default)
|
||||||
* - in: query
|
* - in: query
|
||||||
* name: seekMonths
|
* name: seekMonths
|
||||||
@@ -403,7 +403,7 @@ export function register(app, basePath = '') {
|
|||||||
let state = undefined;
|
let state = undefined;
|
||||||
if (typeof req.query.state === 'string' && req.query.state.trim() !== '') {
|
if (typeof req.query.state === 'string' && req.query.state.trim() !== '') {
|
||||||
const trimmedState = req.query.state.trim().toLowerCase();
|
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' });
|
return res.status(400).json({ error: 'Invalid state' });
|
||||||
}
|
}
|
||||||
state = trimmedState;
|
state = trimmedState;
|
||||||
@@ -513,7 +513,7 @@ export function register(app, basePath = '') {
|
|||||||
* tags: [Shipment]
|
* tags: [Shipment]
|
||||||
* summary: Update shipment state or metadata
|
* summary: Update shipment state or metadata
|
||||||
* description: |
|
* 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.
|
* Emits SSE events (`shipment`, `order`) so connected clients rerender in real time.
|
||||||
* security:
|
* security:
|
||||||
* - cookieAuth: []
|
* - cookieAuth: []
|
||||||
@@ -534,7 +534,7 @@ export function register(app, basePath = '') {
|
|||||||
* properties:
|
* properties:
|
||||||
* state:
|
* state:
|
||||||
* type: string
|
* type: string
|
||||||
* enum: [new, delivered, returned, cancelled]
|
* enum: [new, delivered, cancelled]
|
||||||
* description: Delivery state
|
* description: Delivery state
|
||||||
* example:
|
* example:
|
||||||
* state: delivered
|
* state: delivered
|
||||||
@@ -582,7 +582,7 @@ export function register(app, basePath = '') {
|
|||||||
|
|
||||||
const { state } = req.body ?? {};
|
const { state } = req.body ?? {};
|
||||||
if (state !== undefined) {
|
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' });
|
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).
|
* 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
|
* If the connected article has stock tracking enabled, an adjustment entry is also
|
||||||
* booked to deduct physical stock from the target warehouse.
|
* booked to deduct physical stock from the target warehouse.
|
||||||
* If line amount is negative, books as a customer retoure (incoming).
|
|
||||||
* security:
|
* security:
|
||||||
* - cookieAuth: []
|
* - cookieAuth: []
|
||||||
* x-signals: [stock, ledger, articles, shipping]
|
* x-signals: [stock, ledger, articles, shipping]
|
||||||
|
|||||||
Reference in New Issue
Block a user