3.5 KiB
shipment
This document is auto-generated from the JSDoc comments in src/store by running npm run api-doc.
shipment.create
Source: src/store/shipment/create.js
Creates a new shipment manifest for an order. Validates that all article positions belong to the order and do not exceed remaining ordered quantities.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
import('../../providers/provider.js').DatabaseProvider |
shipment.delete
Source: src/store/shipment/delete.js
Deletes or cancels a shipment manifest of the selected company. - If no ledger rows exist: physically deletes the shipment manifest. - If ledger rows exist: reverses the ledger entries (storno document entry + warehouse stock adjustment), marks the shipment as 'cancelled' in shipmentsummary, and updates the parent order's summary. - Shipped shipments (with packages in 'shipped' state) cannot be deleted.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
import('../../providers/provider.js').DatabaseProvider |
shipment.getById
Source: src/store/shipment/getById.js
Retrieves a shipment manifest by ID for the selected company, including lines and packages.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
import('../../providers/provider.js').DatabaseProvider |
shipment.list
Source: src/store/shipment/list.js
Lists the shipments of the user's selected company.
Parameters
| Name | Type | Description |
|---|---|---|
googleAuthId |
number |
The id of the Google auth user. |
[opts] |
object |
Optional pagination and filter options. |
[opts.offset=0] |
number |
Number of shipments to skip. |
[opts.limit=50] |
number |
Number of shipments to return. |
[opts.search] |
string |
Free-text search matching shipment number, order number, external number, tracking code, or customer name. |
[opts.state] |
`'new' | 'delivered' |
[opts.includeCancelled=false] |
boolean |
Whether to include cancelled shipments when state is not set. |
[opts.seekMonths] |
number |
Negative integer for cutoff months ago (e.g. -1). |
[opts.orderId] |
number |
Optional filter for parent order manifest id. |
[tx] |
object |
Optional transaction. |
Returns
Promise<{shipments: Array<object>, total: number, unfilteredTotal: number, offset: number, limit: number}|Array<object>>
shipment.listByOrderId
Source: src/store/shipment/listByOrderId.js
Lists all shipment manifests belonging to an order.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
import('../../providers/provider.js').DatabaseProvider |
shipment.rebuildSummaries
Source: src/store/shipment/rebuildSummaries.js
Rebuilds the shipmentsummary table for the user's selected company.
Parameters
| Name | Type | Description |
|---|---|---|
googleAuthId |
number |
The id of the Google auth user. |
[tx] |
object |
Optional transaction. |
Returns
Promise<void>
shipment.syncSummary
Source: src/store/shipment/syncSummary.js
Centralized sync and rebuild logic for the materialized shipmentsummary table.
shipment.update
Source: src/store/shipment/update.js
Updates a shipment's state or metadata.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
import('../../providers/provider.js').DatabaseProvider |