Files
dashlibstorage/API.order.md
seb 29099b2a16 feat(manifest): add externalNumber reference to quote/order/delivery
- Add `external_number NVARCHAR(100)` column to the `manifest` table.
- Thread `externalNumber` through manifestDoc and delivery SQL (list,
  header, create, update).
- Include `externalNumber` in shapeSummary and quote/order/delivery
  create/update/list/getById handlers (optional, clearable on update).
- Update README type definitions and regenerate API/schema docs.
2026-08-08 09:13:20 +02:00

3.8 KiB

order

This document is auto-generated from the JSDoc comments in src/store by running npm run api-doc.

order.create

Source: src/store/order/create.js

Creates a new order for the user's selected company with its lines.

Parameters

Name Type Description
googleAuthId number The id of the Google auth user.
body object The order input.
body.number string The order number.
body.date string The order date.
[body.entityId] number The id of the customer entity.
[body.externalNumber] string An external (customer) reference number.
[body.lines] Array<object> The order lines.

Returns

Promise<{id: number, number: string, type: string, entityId: number|null, externalNumber: string|null, date: string, lines: Array<object>}> — The created order.

Throws

Error — If the order is invalid.

Example

const order = await store.order.create(42, { number: 'B-2026-001', date: '2026-09-15', entityId: 12, lines: [...] });
// => { id, number, type, entityId, externalNumber, date, lines: [...] }

order.delete

Source: src/store/order/delete.js

Deletes an order by its id within the user's selected company.

Parameters

Name Type Description
googleAuthId number The id of the Google auth user.
id number The id of the order to delete.

Returns

Promise<void>

Throws

Error — If the order is not found.

Example

await store.order.delete(42, 5);

order.getById

Source: src/store/order/getById.js

Returns a single order by its id within the user's selected company.

Parameters

Name Type Description
googleAuthId number The id of the Google auth user.
id number The id of the order.

Returns

Promise<{id: number, number: string, type: string, entityId: number|null, externalNumber: string|null, date: string, lines: Array<object>}> — The order with its lines.

Throws

Error — If the order is not found.

Example

const order = await store.order.getById(42, 5);
// => { id, number, type, entityId, externalNumber, date, lines: [...] }

order.list

Source: src/store/order/list.js

Lists the orders of the user's selected company.

Parameters

Name Type Description
googleAuthId number The id of the Google auth user.

Returns

Promise<Array<{id: number, number: string, type: string, entityId: number|null, externalNumber: string|null, date: string}>> — The orders.

Example

const orders = await store.order.list(42);
// => [{ id, number, type, entityId, externalNumber, date }]

order.update

Source: src/store/order/update.js

Updates an order's header and/or lines.

Parameters

Name Type Description
googleAuthId number The id of the Google auth user.
id number The id of the order to update.
patch object The update patch.
[patch.number] string The new order number.
[patch.date] string The new order date.
[patch.entityId] number The new customer entity id.
[patch.externalNumber] string The new external (customer) reference number.
[patch.lines] Array<object> The new order lines.

Returns

Promise<{id: number, number: string, type: string, entityId: number|null, externalNumber: string|null, date: string, lines: Array<object>}> — The updated order.

Throws

Error — If the order is not found.

Example

const order = await store.order.update(42, 5, { number: 'B-2026-002', lines: [...] });
// => { id, number, type, entityId, date, lines: [...] }