This commit is contained in:
seb
2026-10-13 01:30:11 +02:00
parent 4b2ca7ce0e
commit 2ef2c0edbf
4 changed files with 416 additions and 25 deletions

View File

@@ -104,9 +104,13 @@ Lists the orders of the user's selected company.
| Name | Type | Description |
| --- | --- | --- |
| `googleAuthId` | `number` | The id of the Google auth user. |
| `[opts]` | `object` | Optional pagination options. |
| `[opts]` | `object` | Optional pagination and filter options. |
| `[opts.offset=0]` | `number` | Number of orders to skip. |
| `[opts.limit=20]` | `number` | Number of orders to return. |
| `[opts.limit=50]` | `number` | Number of orders to return. |
| `[opts.search]` | `string` | Free-text search matching order number, external number, or customer name. |
| `[opts.onlyUnpaid=false]` | `boolean` | When true, returns only unpaid orders. |
| `[opts.onlyUndelivered=false]` | `boolean` | When true, returns only undelivered orders. |
| `[opts.seekMonths]` | `number` | Negative integer for cutoff months ago (e.g. -1). |
| `[tx]` | `object` | Optional transaction. |
**Returns**
@@ -116,8 +120,8 @@ Lists the orders of the user's selected company.
**Example**
```js
const result = await store.order.list(42, { offset: 0, limit: 20 });
// => { orders: [...], total: 100, offset: 0, limit: 20 }
const result = await store.order.list(42, { offset: 0, limit: 50, search: '1002', onlyUnpaid: true, onlyUndelivered: true, seekMonths: -1 });
// => { orders: [...], total: 10, offset: 0, limit: 50 }
const orders = await store.order.list(42);
// => [{ id, number, type, entityId, externalNumber, date, createdAt, lines: [...] }]