This commit is contained in:
seb
2026-10-15 20:14:51 +02:00
parent 7c8c24eb4d
commit 2179b2e241
23 changed files with 1242 additions and 105 deletions

View File

@@ -38,6 +38,30 @@ Retrieves a shipment manifest by ID for the selected company, including lines an
| --- | --- | --- |
| `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'|'returned'` | Filter by delivery state. |
| `[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`*
@@ -49,3 +73,38 @@ Lists all shipment manifests belonging to an order.
| 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` | |