Files
dashlibstorage/API.company.md
2026-08-07 05:21:56 +02:00

75 lines
1.6 KiB
Markdown

# company
This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`.
## `company.create`
*Source: `src/store/company/create.js`*
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 company = await store.company.create({
iso639: 'de',
name: 'Acme',
taxrate: 19,
reducedtaxrate: 7,
googleAuthId: 42,
});
// => { id, rootCategoryId, languageId, taxrateId, reducedtaxrateId, taxfreerateId, posCustomerGroupId }
```
## `company.delete`
*Source: `src/store/company/delete.js`*
Deletes a company by its id.
```js
await store.company.delete(1);
```
## `company.getById`
*Source: `src/store/company/getById.js`*
Returns a single company by its id.
```js
const company = await store.company.getById(1);
// => { id, name, ... }
```
## `company.getByName`
*Source: `src/store/company/getByName.js`*
Returns a single company by its name.
```js
const company = await store.company.getByName('Acme');
// => { id, name, ... }
```
## `company.list`
*Source: `src/store/company/list.js`*
Lists the companies accessible to the given Google auth user.
```js
const companies = await store.company.list(42);
// => [{ id, name, ... }]
```
## `company.update`
*Source: `src/store/company/update.js`*
Updates an existing company's name, language and tax rates.
```js
const result = await store.company.update(1, { iso639: 'de', name: 'Acme', taxrate: 19, reducedtaxrate: 7 });
// => { id, rootCategoryId, languageId, taxrateId, reducedtaxrateId, taxfreerateId }
```