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 @@ Deletes a unit for a company by its SI code.
|
||||
|
||||
```js
|
||||
const fn = del(pool);
|
||||
await fn(42, 1, 'l');
|
||||
await fn(42, 'l');
|
||||
```
|
||||
|
||||
## `unit.list`
|
||||
@@ -21,7 +21,7 @@ Lists the units available for a company.
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const units = await fn(42, 1);
|
||||
const units = await fn(42);
|
||||
// => [{ id, si, basesi, basesifactor, symbol, name }]
|
||||
```
|
||||
|
||||
@@ -33,6 +33,6 @@ Creates or updates a unit for a company, keyed by its SI code.
|
||||
|
||||
```js
|
||||
const fn = upsert(pool);
|
||||
const unit = await fn(42, 1, { si: 'l', basesi: 'm3', basesifactor: 0.001, symbol: 'L', name: 'Liter' });
|
||||
const unit = await fn(42, { si: 'l', basesi: 'm3', basesifactor: 0.001, symbol: 'L', name: 'Liter' });
|
||||
// => { id, si, basesi, basesifactor, symbol, name }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user