Add entity customer numbers and scope APIs via selected company.
Entity gets an optional unique-per-company number with allocate/peek/isNumberFree helpers. Company-scoped store methods no longer take companyId and resolve google_auth.selected_company instead.
This commit is contained in:
@@ -10,7 +10,7 @@ Creates a new customer group for a company.
|
||||
|
||||
```js
|
||||
const fn = create(pool);
|
||||
const group = await fn(42, 1, { name: 'Wholesale' });
|
||||
const group = await fn(42, { name: 'Wholesale' });
|
||||
// => { id, name, sort }
|
||||
```
|
||||
|
||||
@@ -22,7 +22,7 @@ Deletes a customer group for a company by its id.
|
||||
|
||||
```js
|
||||
const fn = del(pool);
|
||||
await fn(42, 1, 5);
|
||||
await fn(42, 5);
|
||||
```
|
||||
|
||||
## `customergroup.list`
|
||||
@@ -33,7 +33,7 @@ Lists the customer groups of a company.
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const groups = await fn(42, 1);
|
||||
const groups = await fn(42);
|
||||
// => [{ id, name, sort }]
|
||||
```
|
||||
|
||||
@@ -45,7 +45,7 @@ Reorders the customer groups of a company.
|
||||
|
||||
```js
|
||||
const fn = order(pool);
|
||||
const result = await fn(42, 1, { customergroupIds: [3, 1, 2] });
|
||||
const result = await fn(42, { customergroupIds: [3, 1, 2] });
|
||||
// => { customergroupIds: [3, 1, 2] }
|
||||
```
|
||||
|
||||
@@ -57,6 +57,6 @@ Updates the name of a customer group for a company.
|
||||
|
||||
```js
|
||||
const fn = update(pool);
|
||||
const group = await fn(42, 1, 5, { name: 'Retail' });
|
||||
const group = await fn(42, 5, { name: 'Retail' });
|
||||
// => { id, name, sort }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user