This commit is contained in:
seb
2026-08-07 04:05:01 +02:00
parent 4833acd680
commit 1e89e19863
22 changed files with 1433 additions and 2 deletions

62
API.customergroup.md Normal file
View File

@@ -0,0 +1,62 @@
# customergroup
This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`.
## `customergroup.create`
*Source: `src/store/customergroup/create.js`*
Creates a new customer group for a company.
```js
const fn = create(pool);
const group = await fn(42, 1, { name: 'Wholesale' });
// => { id, name, sort }
```
## `customergroup.delete`
*Source: `src/store/customergroup/delete.js`*
Deletes a customer group for a company by its id.
```js
const fn = del(pool);
await fn(42, 1, 5);
```
## `customergroup.list`
*Source: `src/store/customergroup/list.js`*
Lists the customer groups of a company.
```js
const fn = list(pool);
const groups = await fn(42, 1);
// => [{ id, name, sort }]
```
## `customergroup.order`
*Source: `src/store/customergroup/order.js`*
Reorders the customer groups of a company.
```js
const fn = order(pool);
const result = await fn(42, 1, { customergroupIds: [3, 1, 2] });
// => { customergroupIds: [3, 1, 2] }
```
## `customergroup.update`
*Source: `src/store/customergroup/update.js`*
Updates the name of a customer group for a company.
```js
const fn = update(pool);
const group = await fn(42, 1, 5, { name: 'Retail' });
// => { id, name, sort }
```