2.0 KiB
shipping
This document is auto-generated from the JSDoc comments in src/store by running npm run api-doc.
shipping.create
Source: src/store/shipping/create.js
Creates a shipping for a manifest (order). The number is allocated from the shipping numbers sequence (own prefix + counter).
Parameters
| Name | Type | Description |
|---|---|---|
googleAuthId |
number |
The id of the Google auth user. |
input |
object |
Shipping input. |
input.manifestId |
number |
The manifest (order) id. |
input.type |
string |
Shipping type. |
input.state |
string |
Shipping state. |
[tx] |
object |
Optional transaction to run within. |
Returns
Promise<{id: number, manifestId: number, number: string, type: string, state: string}>
Throws
Error — If manifest is not found or input is invalid.
Example
await store.shipping.create(googleAuthId, { manifestId: 42, type: 'parcel', state: 'open' });
shipping.delete
Source: src/store/shipping/delete.js
Deletes a shipping of the user's selected company. Its packages are removed by cascade.
Parameters
| Name | Type | Description |
|---|---|---|
googleAuthId |
number |
The id of the Google auth user. |
id |
number |
The shipping id. |
[tx] |
object |
Optional transaction to run within. |
Returns
Promise<void>
Example
await store.shipping.delete(googleAuthId, 9);
shipping.listByManifestId
Source: src/store/shipping/listByManifestId.js
Lists shippings of a manifest (order) in the user's selected company.
Parameters
| Name | Type | Description |
|---|---|---|
googleAuthId |
number |
The id of the Google auth user. |
manifestId |
number |
The manifest id. |
[tx] |
object |
Optional transaction to run within. |
Returns
Promise<Array<{id: number, manifestId: number, number: string, type: string, state: string}>>
Example
const shippings = await store.shipping.listByManifestId(googleAuthId, 42);