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 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 }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user