Auto-allocate delivery number via getnextnumberwithprefixandpadding

This commit is contained in:
seb
2026-08-08 10:09:08 +02:00
parent 91e7c03655
commit fb88cb92a5
3 changed files with 12 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ This document is auto-generated from the JSDoc comments in `src/store` by runnin
*Source: `src/store/delivery/create.js`*
Creates a new delivery for the user's selected company with its lines.
Creates a new delivery for the user's selected company with its lines. The delivery number is allocated internally via `getnextnumberwithprefixandpadding` (`type` `delivery`); supply `externalNumber` for an external (supplier) reference.
**Parameters**
@@ -14,7 +14,6 @@ Creates a new delivery for the user's selected company with its lines.
| --- | --- | --- |
| `googleAuthId` | `number` | The id of the Google auth user. |
| `body` | `object` | The delivery input. |
| `body.number` | `string` | The delivery number. |
| `body.date` | `string` | The delivery date. |
| `body.supplierId` | `number` | The id of the supplier. |
| `[body.externalNumber]` | `string` | An external (supplier) reference number. |
@@ -31,7 +30,7 @@ Creates a new delivery for the user's selected company with its lines.
**Example**
```js
const delivery = await store.delivery.create(42, { number: 'D-1', date: '2026-01-01', supplierId: 5, lines: [...] });
const delivery = await store.delivery.create(42, { date: '2026-01-01', supplierId: 5, lines: [...] });
// => { id, number, type, entityId, externalNumber, date, lines: [...] }
```