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 contact for an entity.
```js
const fn = create(pool);
const contact = await fn(42, 1, 5, { contactType: 'email', contact: 'a@b.c' });
const contact = await fn(42, 5, { contactType: 'email', contact: 'a@b.c' });
// => { id, entityId, contactType, contact, sort }
```
@@ -22,7 +22,7 @@ Deletes a contact of an entity.
```js
const fn = del(pool);
await fn(42, 1, 5, 9);
await fn(42, 5, 9);
```
## `entitycontact.list`
@@ -33,7 +33,7 @@ Lists the contacts of an entity.
```js
const fn = list(pool);
const contacts = await fn(42, 1, 5);
const contacts = await fn(42, 5);
// => [{ id, entityId, contactType, contact, sort }]
```
@@ -45,6 +45,6 @@ Updates a contact of an entity.
```js
const fn = update(pool);
const contact = await fn(42, 1, 5, 9, { contact: 'b@c.d' });
const contact = await fn(42, 5, 9, { contact: 'b@c.d' });
// => { id, entityId, contactType, contact, sort }
```