u
This commit is contained in:
2
API.md
2
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<object>}, tx?: object): Promise<{manifest: {id: number, number: string, type: string, date: string, createdAt: string}, lines: Array<object>, ledger: Array<object>}>`
|
- `adjust(googleAuthId: number, input: {sku?: string, warehouseId?: number, amount?: number, text?: string, externalNumber?: string, date?: string|Date, lines?: Array<object>}, tx?: object): Promise<{manifest: {id: number, number: string, type: string, date: string, createdAt: string}, lines: Array<object>, ledger: Array<object>}>`
|
||||||
- [posterminal](API.posterminal.md)
|
- [posterminal](API.posterminal.md)
|
||||||
- `delete(googleAuthId: number, id: number, tx?: object): Promise<void>`
|
- `delete(googleAuthId: number, id: number, tx?: object): Promise<void>`
|
||||||
|
- `findByPairingpin(pairingpin: string, tx?: object): Promise<object|null>`
|
||||||
- `list(googleAuthId: number, tx?: object): Promise<Array<{id: number, name: string, token: string, pairingpin: string}>>`
|
- `list(googleAuthId: number, tx?: object): Promise<Array<{id: number, name: string, token: string, pairingpin: string}>>`
|
||||||
|
- `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<number>}>`
|
- `setOff(googleAuthId: number, posterminalId: number, categoryId: number, tx?: object): Promise<{id: number, categoryIds: Array<number>}>`
|
||||||
- `setOffAll(googleAuthId: number, posterminalId: number, tx?: object): Promise<{id: number, categoryIds: Array<number>}>`
|
- `setOffAll(googleAuthId: number, posterminalId: number, tx?: object): Promise<{id: number, categoryIds: Array<number>}>`
|
||||||
- `setOn(googleAuthId: number, posterminalId: number, categoryId: number, tx?: object): Promise<{id: number, categoryIds: Array<number>}>`
|
- `setOn(googleAuthId: number, posterminalId: number, categoryId: number, tx?: object): Promise<{id: number, categoryIds: Array<number>}>`
|
||||||
|
|||||||
@@ -30,6 +30,23 @@ Deletes a posterminal by its id within the user's selected company.
|
|||||||
await store.posterminal.delete(42, 5);
|
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<object|null>` — The posterminal row, or null if not found.
|
||||||
|
|
||||||
## `posterminal.list`
|
## `posterminal.list`
|
||||||
|
|
||||||
*Source: `src/store/posterminal/list.js`*
|
*Source: `src/store/posterminal/list.js`*
|
||||||
@@ -54,6 +71,27 @@ const terminals = await store.posterminal.list(42);
|
|||||||
// => [{ id, name, token, pairingpin }]
|
// => [{ 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`
|
## `posterminal.setOff`
|
||||||
|
|
||||||
*Source: `src/store/posterminal/setOff.js`*
|
*Source: `src/store/posterminal/setOff.js`*
|
||||||
|
|||||||
Reference in New Issue
Block a user