part1
This commit is contained in:
@@ -9,8 +9,7 @@ This document is auto-generated from the JSDoc comments in `src/store` by runnin
|
||||
Creates a new company together with its root category, POS customer group, default language and tax rates, and links it to the given Google auth user.
|
||||
|
||||
```js
|
||||
const fn = create(pool);
|
||||
const company = await fn({
|
||||
const company = await store.company.create({
|
||||
iso639: 'de',
|
||||
name: 'Acme',
|
||||
taxrate: 19,
|
||||
@@ -27,8 +26,7 @@ const company = await fn({
|
||||
Deletes a company by its id.
|
||||
|
||||
```js
|
||||
const fn = del(pool);
|
||||
await fn(1);
|
||||
await store.company.delete(1);
|
||||
```
|
||||
|
||||
## `company.getById`
|
||||
@@ -38,8 +36,7 @@ await fn(1);
|
||||
Returns a single company by its id.
|
||||
|
||||
```js
|
||||
const fn = getById(pool);
|
||||
const company = await fn(1);
|
||||
const company = await store.company.getById(1);
|
||||
// => { id, name, ... }
|
||||
```
|
||||
|
||||
@@ -50,8 +47,7 @@ const company = await fn(1);
|
||||
Returns a single company by its name.
|
||||
|
||||
```js
|
||||
const fn = getByName(pool);
|
||||
const company = await fn('Acme');
|
||||
const company = await store.company.getByName('Acme');
|
||||
// => { id, name, ... }
|
||||
```
|
||||
|
||||
@@ -62,8 +58,7 @@ const company = await fn('Acme');
|
||||
Lists the companies accessible to the given Google auth user.
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const companies = await fn(42);
|
||||
const companies = await store.company.list(42);
|
||||
// => [{ id, name, ... }]
|
||||
```
|
||||
|
||||
@@ -74,7 +69,6 @@ const companies = await fn(42);
|
||||
Updates an existing company's name, language and tax rates.
|
||||
|
||||
```js
|
||||
const fn = update(pool);
|
||||
const result = await fn(1, { iso639: 'de', name: 'Acme', taxrate: 19, reducedtaxrate: 7 });
|
||||
const result = await store.company.update(1, { iso639: 'de', name: 'Acme', taxrate: 19, reducedtaxrate: 7 });
|
||||
// => { id, rootCategoryId, languageId, taxrateId, reducedtaxrateId, taxfreerateId }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user