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.
This commit is contained in:
16
API.quote.md
16
API.quote.md
@@ -17,11 +17,12 @@ Creates a new quote for the user's selected company with its lines.
|
||||
| `body.number` | `string` | The quote number. |
|
||||
| `body.date` | `string` | The quote date. |
|
||||
| `[body.entityId]` | `number` | The id of the customer entity. |
|
||||
| `[body.externalNumber]` | `string` | An external (customer) reference number. |
|
||||
| `[body.lines]` | `Array<object>` | The quote lines. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{id: number, number: string, type: string, entityId: number|null, date: string, lines: Array<object>}>` — The created quote.
|
||||
`Promise<{id: number, number: string, type: string, entityId: number|null, externalNumber: string|null, date: string, lines: Array<object>}>` — The created quote.
|
||||
|
||||
**Throws**
|
||||
|
||||
@@ -31,7 +32,7 @@ Creates a new quote for the user's selected company with its lines.
|
||||
|
||||
```js
|
||||
const quote = await store.quote.create(42, { number: 'A-2026-001', date: '2026-09-01', entityId: 12, lines: [...] });
|
||||
// => { id, number, type, entityId, date, lines: [...] }
|
||||
// => { id, number, type, entityId, externalNumber, date, lines: [...] }
|
||||
```
|
||||
|
||||
## `quote.delete`
|
||||
@@ -76,7 +77,7 @@ Returns a single quote by its id within the user's selected company.
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{id: number, number: string, type: string, entityId: number|null, date: string, lines: Array<object>}>` — The quote with its lines.
|
||||
`Promise<{id: number, number: string, type: string, entityId: number|null, externalNumber: string|null, date: string, lines: Array<object>}>` — The quote with its lines.
|
||||
|
||||
**Throws**
|
||||
|
||||
@@ -86,7 +87,7 @@ Returns a single quote by its id within the user's selected company.
|
||||
|
||||
```js
|
||||
const quote = await store.quote.getById(42, 5);
|
||||
// => { id, number, type, entityId, date, lines: [...] }
|
||||
// => { id, number, type, entityId, externalNumber, date, lines: [...] }
|
||||
```
|
||||
|
||||
## `quote.list`
|
||||
@@ -103,13 +104,13 @@ Lists the quotes of the user's selected company.
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<Array<{id: number, number: string, type: string, entityId: number|null, date: string}>>` — The quotes.
|
||||
`Promise<Array<{id: number, number: string, type: string, entityId: number|null, externalNumber: string|null, date: string}>>` — The quotes.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const quotes = await store.quote.list(42);
|
||||
// => [{ id, number, type, entityId, date }]
|
||||
// => [{ id, number, type, entityId, externalNumber, date }]
|
||||
```
|
||||
|
||||
## `quote.update`
|
||||
@@ -128,11 +129,12 @@ Updates a quote's header and/or lines.
|
||||
| `[patch.number]` | `string` | The new quote number. |
|
||||
| `[patch.date]` | `string` | The new quote date. |
|
||||
| `[patch.entityId]` | `number` | The new customer entity id. |
|
||||
| `[patch.externalNumber]` | `string` | The new external (customer) reference number. |
|
||||
| `[patch.lines]` | `Array<object>` | The new quote lines. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{id: number, number: string, type: string, entityId: number|null, date: string, lines: Array<object>}>` — The updated quote.
|
||||
`Promise<{id: number, number: string, type: string, entityId: number|null, externalNumber: string|null, date: string, lines: Array<object>}>` — The updated quote.
|
||||
|
||||
**Throws**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user