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:
seb
2026-08-07 04:29:35 +02:00
parent 1e89e19863
commit 70e0a9ddc4
78 changed files with 940 additions and 772 deletions

View File

@@ -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 }
```