From 6d3e328126a722aeb289daafcad0cf34e7e50152 Mon Sep 17 00:00:00 2001 From: seb Date: Tue, 29 Sep 2026 11:31:37 +0200 Subject: [PATCH] u --- API.md | 2 ++ API.posterminal.md | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/API.md b/API.md index 490786b..cdaa531 100644 --- a/API.md +++ b/API.md @@ -188,7 +188,9 @@ The store is exposed as a `LibDashStore` instance (see `src/index.js`). Each met - `adjust(googleAuthId: number, input: {sku?: string, warehouseId?: number, amount?: number, text?: string, externalNumber?: string, date?: string|Date, lines?: Array}, tx?: object): Promise<{manifest: {id: number, number: string, type: string, date: string, createdAt: string}, lines: Array, ledger: Array}>` - [posterminal](API.posterminal.md) - `delete(googleAuthId: number, id: number, tx?: object): Promise` + - `findByPairingpin(pairingpin: string, tx?: object): Promise` - `list(googleAuthId: number, tx?: object): Promise>` + - `pair(id: number, input: {token: string, clientserial?: string, pairedAt?: string}, tx?: object): Promise<{id: number, token: string, clientserial: string|null, pairedAt: string|null}>` - `setOff(googleAuthId: number, posterminalId: number, categoryId: number, tx?: object): Promise<{id: number, categoryIds: Array}>` - `setOffAll(googleAuthId: number, posterminalId: number, tx?: object): Promise<{id: number, categoryIds: Array}>` - `setOn(googleAuthId: number, posterminalId: number, categoryId: number, tx?: object): Promise<{id: number, categoryIds: Array}>` diff --git a/API.posterminal.md b/API.posterminal.md index cfc0d1d..71c745f 100644 --- a/API.posterminal.md +++ b/API.posterminal.md @@ -30,6 +30,23 @@ Deletes a posterminal by its id within the user's selected company. await store.posterminal.delete(42, 5); ``` +## `posterminal.findByPairingpin` + +*Source: `src/store/posterminal/findByPairingpin.js`* + +Finds a posterminal by its pairingpin. + +**Parameters** + +| Name | Type | Description | +| --- | --- | --- | +| `pairingpin` | `string` | The pairing pin to search for. | +| `[tx]` | `object` | Optional transaction to run within. | + +**Returns** + +`Promise` — The posterminal row, or null if not found. + ## `posterminal.list` *Source: `src/store/posterminal/list.js`* @@ -54,6 +71,27 @@ const terminals = await store.posterminal.list(42); // => [{ id, name, token, pairingpin }] ``` +## `posterminal.pair` + +*Source: `src/store/posterminal/pair.js`* + +Completes POS device pairing for a terminal. + +**Parameters** + +| Name | Type | Description | +| --- | --- | --- | +| `id` | `number` | The posterminal id. | +| `input` | `object` | | +| `input.token` | `string` | The auth token for the paired device. | +| `[input.clientserial]` | `string` | The client name or serial identifier. | +| `[input.pairedAt]` | `string` | Timestamp when paired. | +| `[tx]` | `object` | Optional transaction to run within. | + +**Returns** + +`Promise<{id: number, token: string, clientserial: string|null, pairedAt: string|null}>` + ## `posterminal.setOff` *Source: `src/store/posterminal/setOff.js`*