Files
dashlibstorage/API.brand.md
seb aefd97a171 Rewrite store JSDoc, split quote/order into modules, and generate typed API docs
- Rewrite JSDoc across all store methods to document the actual async
  methods (real params, returns, throws) instead of the internal wrappers
- Split quote/order into individual module files backed by shared
  manifestDoc helpers; remove the createStore factory and thin wrappers
- Deduplicate manifest line helpers into src/store/manifestLines.js
- Extend generate-api-doc.js to render parameter/return/throws types and
  emit per-namespace API.<module>.md files with an API.md index
- Regenerate all API docs
2026-08-07 06:23:17 +02:00

84 lines
1.6 KiB
Markdown

# brand
This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`.
## `brand.delete`
*Source: `src/store/brand/delete.js`*
Deletes a brand for the user's selected company by its id.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `googleAuthId` | `number` | The id of the Google auth user. |
| `id` | `number` | The id of the brand to delete. |
**Returns**
`Promise<void>`
**Throws**
`Error` — If the brand is not found.
**Example**
```js
await store.brand.delete(42, 3);
```
## `brand.list`
*Source: `src/store/brand/list.js`*
Lists the brands of the user's selected company.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `googleAuthId` | `number` | The id of the Google auth user. |
**Returns**
`Promise<Array<{id: number, name: string, gsprpinfo: string|null}>>` — The brands.
**Example**
```js
const brands = await store.brand.list(42);
// => [{ id, name, gsprpinfo }]
```
## `brand.upsert`
*Source: `src/store/brand/upsert.js`*
Creates or updates a brand for the user's selected company, keyed by name.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `googleAuthId` | `number` | The id of the Google auth user. |
| `input` | `object` | The brand input. |
| `input.name` | `string` | The brand name. |
| `[input.gsprpinfo]` | `string` | Optional GSPRP info. |
**Returns**
`Promise<{id: number, name: string, gsprpinfo: string|null}>` — The upserted brand.
**Throws**
`Error` — If the brand is invalid.
**Example**
```js
const brand = await store.brand.upsert(42, { name: 'Coca-Cola', gsprpinfo: 'x' });
// => { id, name, gsprpinfo }
```