# delivery This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`. ## `delivery.attachments` *Source: `src/store/delivery/attachments.js`* Loads attachment metadata (without binary content) for a manifest. ## `delivery.book` *Source: `src/store/delivery/book.js`* Books all positions of an incoming delivery manifest to the ledger by delegating to store.stock.accept. **Parameters** | Name | Type | Description | | --- | --- | --- | | `provider` | `object` | Storage provider instance. | **Returns** `Function` — `(googleAuthId, input, tx) => Promise` ## `delivery.list` *Source: `src/store/delivery/list.js`* Lists the deliveries 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 deliveries to skip. | | `[opts.limit=50]` | `number` | Number of deliveries to return. | | `[opts.search]` | `string` | Free-text search matching delivery number, external number, or supplier name. | | `[opts.onlyUnbooked=false]` | `boolean` | When true, returns only deliveries with unbooked stock items. | | `[opts.supplierId]` | `number` | Filter by supplier entity id. | | `[opts.seekMonths]` | `number` | Negative integer for cutoff months ago (e.g. -1). | | `[tx]` | `object` | Optional transaction. | **Returns** `Promise<{deliveries: Array, total: number, unfilteredTotal: number, offset: number, limit: number}|Array>` ## `delivery.rebuildSummaries` *Source: `src/store/delivery/rebuildSummaries.js`* Rebuilds the `deliverysummary` table for the user's selected company. **Parameters** | Name | Type | Description | | --- | --- | --- | | `provider` | `import('../../providers/provider.js').DatabaseProvider` | | ## `delivery.syncSummary` *Source: `src/store/delivery/syncSummary.js`* Centralized sync and rebuild logic for the materialized `deliverysummary` table. Keeps `deliverysummary` in sync with manifest (delivery), manifestarticle, article (track_stock), and ledger (DELIVERY transactions).