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:
seb
2026-08-08 09:13:20 +02:00
parent f302cda39e
commit 29099b2a16
23 changed files with 210 additions and 143 deletions

View File

@@ -10,12 +10,12 @@ export default function getById(pool) {
*
* @param {number} googleAuthId - The id of the Google auth user.
* @param {number} id - The id of the order.
* @returns {Promise<{id: number, number: string, type: string, entityId: number|null, date: string, lines: Array<object>}>} The order with its lines.
* @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, date, lines: [...] }
* // => { id, number, type, entityId, externalNumber, date, lines: [...] }
*/
return async (googleAuthId, id) => {
if (!Number.isFinite(id)) {