docs
This commit is contained in:
51
API.tax.md
Normal file
51
API.tax.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# tax
|
||||
|
||||
This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`.
|
||||
|
||||
## `tax.create`
|
||||
|
||||
*Source: `src/store/tax/create.js`*
|
||||
|
||||
Creates a new tax rate.
|
||||
|
||||
```js
|
||||
const fn = create(pool);
|
||||
const id = await fn(19);
|
||||
// => 1
|
||||
```
|
||||
|
||||
## `tax.ensure`
|
||||
|
||||
*Source: `src/store/tax/ensure.js`*
|
||||
|
||||
Returns the id of a tax rate, creating it if it does not exist.
|
||||
|
||||
```js
|
||||
const fn = ensure(pool);
|
||||
const id = await fn(19);
|
||||
// => 1
|
||||
```
|
||||
|
||||
## `tax.getByRate`
|
||||
|
||||
*Source: `src/store/tax/getByRate.js`*
|
||||
|
||||
Returns a tax row by its rate.
|
||||
|
||||
```js
|
||||
const fn = getByRate(pool);
|
||||
const tax = await fn(19);
|
||||
// => { id, rate }
|
||||
```
|
||||
|
||||
## `tax.list`
|
||||
|
||||
*Source: `src/store/tax/list.js`*
|
||||
|
||||
Lists all tax rates.
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const taxes = await fn();
|
||||
// => [{ id, rate }]
|
||||
```
|
||||
Reference in New Issue
Block a user