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 @@ Deletes a company setting by key.
```js
const fn = del(pool);
await fn(42, 1, 'theme');
await fn(42, 'theme');
```
## `companysetting.get`
@@ -21,7 +21,7 @@ Returns a single company setting by key.
```js
const fn = get(pool);
const setting = await fn(42, 1, 'theme');
const setting = await fn(42, 'theme');
// => { key, value, frontend }
```
@@ -33,7 +33,7 @@ Lists the settings of a company, optionally only frontend-visible ones.
```js
const fn = list(pool);
const settings = await fn(42, 1, { frontendOnly: true });
const settings = await fn(42, { frontendOnly: true });
// => [{ key, value, frontend }]
```
@@ -45,6 +45,6 @@ Sets (upserts) a company setting by key.
```js
const fn = set(pool);
const setting = await fn(42, 1, { key: 'theme', value: 'dark', frontend: true });
const setting = await fn(42, { key: 'theme', value: 'dark', frontend: true });
// => { key, value, frontend }
```