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 address for an entity.
|
||||
|
||||
```js
|
||||
const fn = create(pool);
|
||||
const address = await fn(42, 1, 5, { addressType: 'billing', street: 'Main St', city: 'Berlin' });
|
||||
const address = await fn(42, 5, { addressType: 'billing', street: 'Main St', city: 'Berlin' });
|
||||
// => { id, entityId, firstName, name, street, streetNumber, zip, city, county, addressType, sort }
|
||||
```
|
||||
|
||||
@@ -22,7 +22,7 @@ Deletes an address of an entity.
|
||||
|
||||
```js
|
||||
const fn = del(pool);
|
||||
await fn(42, 1, 5, 9);
|
||||
await fn(42, 5, 9);
|
||||
```
|
||||
|
||||
## `entityaddress.list`
|
||||
@@ -33,7 +33,7 @@ Lists the addresses of an entity.
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const addresses = await fn(42, 1, 5);
|
||||
const addresses = await fn(42, 5);
|
||||
// => [{ id, entityId, firstName, name, street, streetNumber, zip, city, county, addressType, sort }]
|
||||
```
|
||||
|
||||
@@ -45,6 +45,6 @@ Updates an address of an entity.
|
||||
|
||||
```js
|
||||
const fn = update(pool);
|
||||
const address = await fn(42, 1, 5, 9, { city: 'Hamburg' });
|
||||
const address = await fn(42, 5, 9, { city: 'Hamburg' });
|
||||
// => { id, entityId, firstName, name, street, streetNumber, zip, city, county, addressType, sort }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user