This commit is contained in:
seb
2026-10-08 01:37:26 +02:00
parent 36dd81ee69
commit 69eb2c9a0d
18 changed files with 1479 additions and 1403 deletions

View File

@@ -45,7 +45,7 @@ Finds a posterminal by its pairingpin.
**Returns**
`Promise<object|null>` — The posterminal row, or null if not found.
`Promise<{id: number, companyId: number, name: string, token: string|null, pairingpin: string|null, pairedAt: string|null, clientserial: string|null, maxknowntombstoneid: number|null, rootCategoryId: number|null, syncRootArticles: boolean|number, lastseenAt: string|null, updatedAt: string}|null>` — The posterminal, or null if not found.
## `posterminal.findByToken`
@@ -62,7 +62,7 @@ Finds a posterminal by its auth token.
**Returns**
`Promise<object|null>` — The posterminal row, or null if not found.
`Promise<{id: number, companyId: number, name: string, token: string|null, pairingpin: string|null, pairedAt: string|null, clientserial: string|null, maxknowntombstoneid: number|null, rootCategoryId: number|null, syncRootArticles: boolean|number, lastseenAt: string|null, updatedAt: string}|null>` — The posterminal, or null if not found.
## `posterminal.getCategoryCount`
@@ -250,13 +250,13 @@ Lists the posterminals of the user's selected company.
**Returns**
`Promise<Array<{id: number, name: string, token: string, pairingpin: string}>>` — The posterminals.
`Promise<Array<{id: number, name: string, token: string|null, pairingpin: string|null, pairedAt: string|null, clientserial: string|null, maxknowntombstoneid: number|null, rootCategoryId: number|null, syncRootArticles: boolean|number, lastseenAt: string|null, updatedAt: string}>>` — The posterminals.
**Example**
```js
const terminals = await store.posterminal.list(42);
// => [{ id, name, token, pairingpin }]
// => [{ id, name, token, pairingpin, pairedAt, clientserial, maxknowntombstoneid, rootCategoryId, syncRootArticles, lastseenAt, updatedAt }]
```
## `posterminal.pair`
@@ -416,6 +416,23 @@ const result = await store.posterminal.setOnAll(42, 5);
// => { id, categoryIds: [...] }
```
## `posterminal.touchLastseen`
*Source: `src/store/posterminal/touchLastseen.js`*
Updates lastseen_at for a POS terminal to the current timestamp.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `id` | `number` | The posterminal id. |
| `[tx]` | `object` | Optional transaction to run within. |
**Returns**
`Promise<{id: number}>`
## `posterminal.upsert`
*Source: `src/store/posterminal/upsert.js`*