diff --git a/docs/api/routes-all.md b/docs/api/routes-all.md index b829af6..966166b 100644 --- a/docs/api/routes-all.md +++ b/docs/api/routes-all.md @@ -10,41 +10,41 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body). ### Reusable types - `T1` = `{ article: T2 }` -- `T2` = `{ id: int, sku: str, name: str, slug: str, desc: str|null, seo: str|null, track_stock: bool, unitamount: num|null, weight: num|null, unit: T32, brand: T30|null, categoryIds: int[], photos: T28[], eans: str[], prices: T40[], suppliers: T13[] }` +- `T2` = `{ id: int, sku: str, name: str, slug: str, desc: str|null, seo: str|null, track_stock: bool, unitamount: num|null, weight: num|null, unit: T33, brand: T31|null, categoryIds: int[], photos: T29[], eans: str[], prices: T40[], suppliers: T13[] }` - `T3` = `{ order: T4 }` -- `T4` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T23[], createdAt?: str, shipping?: T39|null, shippings?: T39[], payment?: T35|null, payments?: T35[], paid?: bool, delivered?: bool }` +- `T4` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T24[], createdAt?: str, shipping?: T39|null, shippings?: T39[], payment?: T36|null, payments?: T36[], paid?: bool, delivered?: bool }` - `T5` = `{ delivery: T6 }` -- `T6` = `{ id: int, number: str, type: str, supplierId: int|null, date: str, lines: T23[], files: T10[], externalNumber?: str|null, createdAt?: str, ledger?: T44 }` +- `T6` = `{ id: int, number: str, type: str, supplierId: int|null, date: str, lines: T24[], files: T10[], externalNumber?: str|null, createdAt?: str, ledger?: T44 }` - `T7` = `{ labeltemplate: T8 }` -- `T8` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: T19, thumb?: str|null }` +- `T8` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: T20, thumb?: str|null }` - `T9` = `{ quote: T12 }` - `T10` = `{ id: int, manifestId: int, fileId: int, sort: int, hash: str, mimetype: str, name: str, size: int, created?: str, modified?: str, thumbavif?: str|null, thumbx?: int|null, thumby?: int|null, meta?: { [k]: str }|null }` - `T11` = `{ id: int, name: str, pairingpin?: str|null, token?: str|null, pairedAt?: str|null, clientserial?: str|null, rootCategoryId?: int|null, syncRootArticles?: bool, lastseenAt?: str|null, updatedAt?: str|null, categoryIds?: int[] }` -- `T12` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T23[], createdAt?: str }` +- `T12` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T24[], createdAt?: str }` - `T13` = `{ id: int, articleId: int, entityId: int, pu: num, sort: int, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T46|null }` - `T14` = `{ id: int, entityId: int, addressType: str, firstName?: str|null, name?: str|null, street?: str|null, streetNumber?: str|null, zip?: str|null, city?: str|null, county?: str|null }` - `T15` = `{ ledger: T16[] }` - `T16` = `{ id: int, manifestarticle_id: int, transaction_type: str, amount: num, transaction_text: str, hash_version: int, prev_hash?: str, sku?: str|null, created_at?: str }` -- `T17` = `{ id: int, name: str, sort: int, exclusive: bool, values: T33[], articleCount?: int }` +- `T17` = `{ id: int, name: str, sort: int, exclusive: bool, values: T34[], articleCount?: int }` - `T18` = `{ id: int, companyuser_id: int, provider: str, model: str, created_at: str, updated_at: str, state: str, started_by?: integer,null, first_message?: string,null }` -- `T19` = `{ objects: T24[] }` +- `T19` = `{ id: int, name: str, rootCategoryId: int|null, languageId: int|null, iso639: str|null, taxrate: num, reducedtaxrate: num, taxfreerate: num }` - `T20` = `{ objects: T25[] }` -- `T21` = `{ printer: T26 }` -- `T22` = `{ entity: T29 }` -- `T23` = `{ id: int, sku: str|null, name: str|null, pu: num, amount: num, net: num, rebate: num, taxrate: num, comment: str|null }` -- `T24` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }` +- `T21` = `{ objects: T26[] }` +- `T22` = `{ printer: T27 }` +- `T23` = `{ entity: T30 }` +- `T24` = `{ id: int, sku: str|null, name: str|null, pu: num, amount: num, net: num, rebate: num, taxrate: num, comment: str|null }` - `T25` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }` -- `T26` = `{ id: int, company_id: int, address: str, type: str, sort: int, model?: str|null, serial?: str|null, desc?: str|null }` -- `T27` = `{ amount: num, net: num, taxrate: num, sku?: str|null, name?: str|null, pu?: num, rebate?: num, comment?: str|null }` -- `T28` = `{ sort: int, fullHash: str, fullW: int, fullH: int, fullSize: int, thumbW: int, thumbH: int, thumbHash: str }` -- `T29` = `{ id: int, customergroupId: int, firstName: str|null, name: str, number: str|null, createdAt: str, updatedAt: str }` -- `T30` = `{ name: str, id?: int|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null }` -- `T31` = `{ article: T37 }` -- `T32` = `{ si: str, basesi: str, basesifactor: num, symbol?: str|null, name?: str|null }` -- `T33` = `{ id: int, attributeId: int, value: str, sort: int, articleCount?: int }` -- `T34` = `{ id: int, name: str, sort: int, exclusive: bool, articleCount?: int }` -- `T35` = `{ id: int, accountId: int, manifestId: int, type: str, amount: num }` -- `T36` = `{ id: int, iso639: str, name: str, taxrate: num, reducedtaxrate: num }` +- `T26` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }` +- `T27` = `{ id: int, company_id: int, address: str, type: str, sort: int, model?: str|null, serial?: str|null, desc?: str|null }` +- `T28` = `{ amount: num, net: num, taxrate: num, sku?: str|null, name?: str|null, pu?: num, rebate?: num, comment?: str|null }` +- `T29` = `{ sort: int, fullHash: str, fullW: int, fullH: int, fullSize: int, thumbW: int, thumbH: int, thumbHash: str }` +- `T30` = `{ id: int, customergroupId: int, firstName: str|null, name: str, number: str|null, createdAt: str, updatedAt: str }` +- `T31` = `{ name: str, id?: int|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null }` +- `T32` = `{ article: T37 }` +- `T33` = `{ si: str, basesi: str, basesifactor: num, symbol?: str|null, name?: str|null }` +- `T34` = `{ id: int, attributeId: int, value: str, sort: int, articleCount?: int }` +- `T35` = `{ id: int, name: str, sort: int, exclusive: bool, articleCount?: int }` +- `T36` = `{ id: int, accountId: int, manifestId: int, type: str, amount: num }` - `T37` = `{ id: int, categoryId: int, name: str, sku: str, track_stock: bool }` - `T38` = `{ id: int, email: str, selectedCompanyId: int|null, picture?: str }` - `T39` = `{ id: int, manifestId: int, number: str, type: str, state: str }` @@ -77,7 +77,7 @@ _none_ #### Create article in category — `POST /article` - Params: `body: { categoryId: int, name: str, desc?: str, seo?: str, track_stock?: bool }` -- Returns: `201 T31` +- Returns: `201 T32` #### Export articles as ZIP — `GET /article/export.zip` - Params: `query: categoryId?: int` - Returns: `200 zip` @@ -113,7 +113,7 @@ _none_ - Returns: `200 { children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }` #### Create and attach a new child article to a parent article — `POST /article/{sku}/children` - Params: `sku: str, body: { attributeValueId?: int, value?: str, name?: str }` -- Returns: `201 T31` +- Returns: `201 T32` #### Attach an existing article as a child to a parent article — `PUT /article/{sku}/children` - Params: `sku: str, body: { sku: str, attributeValueId?: int, value?: str, reparent?: bool }` - Returns: `200 { article: T37, children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }` @@ -143,7 +143,7 @@ _none_ - Returns: `200 { options: { id: int, articleId: int, sku: str, name: str, count: int, sort: int, mandated: bool }[] }` #### Toggle parent mode for an article — `POST /article/{sku}/parent` - Params: `sku: str, body: { isParent: bool, attributeNameId?: int }` -- Returns: `200 T31` +- Returns: `200 T32` #### Replace POS prices by SKU (net > gross; price=net, tax=taxRate %) — `PUT /article/{sku}/prices` - Params: `sku: str, body: { prices: { net?: num, gross?: num, price?: num, taxRate?: num, tax?: num, minmultiplier?: num }[] }` - Returns: `200 T1` @@ -194,10 +194,10 @@ _none_ - Returns: `200 { ok: bool }` #### List values for an attribute — `GET /attributename/{attributeId}/value` - Params: `attributeId: int` -- Returns: `200 { values: T33[] }` +- Returns: `200 { values: T34[] }` #### Create value for an attribute — `POST /attributename/{attributeId}/value` - Params: `attributeId: int, body: { value: str, sort?: int }` -- Returns: `201 { attributevalue: T33 }` +- Returns: `201 { attributevalue: T34 }` #### Reorder values of an attribute — `PUT /attributename/{attributeId}/value/order` - Params: `attributeId: int, body: { attributevalueIds: int[] }` - Returns: `200 { ok: bool }` @@ -215,7 +215,7 @@ _none_ - Returns: `200 { ok: bool }` #### Update attribute value — `PATCH /attributevalue/{id}` - Params: `id: int, body: { value?: str, sort?: int }` -- Returns: `200 { attributevalue: T33 }` +- Returns: `200 { attributevalue: T34 }` #### Delete attribute value image — `DELETE /attributevalue/{id}/image` - Params: `id: int` - Returns: `200 { attributevalue: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T41[] } }` @@ -272,7 +272,7 @@ _none_ - Returns: `200 { categoryIds: int[] }` #### Category tree — `GET /category/tree` _none_ -- Returns: `200 { languageId: int, tree: { id: int, sort: int, posterminalIds: int[], parentId?: int|null, name?: str|null, slug?: str|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null }[], articles: { id: int, sku: str, name: str, slug: str, track_stock: bool, optionsCount: int, articleListCount: int, childCount: int, net?: num|null, taxRate?: num|null, parentArticleId?: int|null, parentSku?: str|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null, brand?: T30|null }[] }` +- Returns: `200 { languageId: int, tree: { id: int, sort: int, posterminalIds: int[], parentId?: int|null, name?: str|null, slug?: str|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null, articleCount?: int }[], articleCount: int }` #### Delete category — `DELETE /category/{id}` - Params: `id: int, query: recursive?: bool` - Returns: `204 void` @@ -281,7 +281,7 @@ _none_ - Returns: `200 { category: { id: int, name: str, slug: str, parentId: int, sort: int } }` #### Articles in category — `GET /category/{id}/articles` - Params: `id: int` -- Returns: `200 { articles: { id: int, sku: str, name: str, slug: str, track_stock: bool, optionsCount: int, articleListCount: int, childCount: int, net?: num|null, taxRate?: num|null, parentArticleId?: int|null, parentSku?: str|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null, brand?: T30|null }[] }` +- Returns: `200 { articles: { id: int, sku: str, name: str, slug: str, track_stock: bool, optionsCount: int, articleListCount: int, childCount: int, net?: num|null, taxRate?: num|null, parentArticleId?: int|null, parentSku?: str|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null, brand?: T31|null }[] }` #### List category attribute values — `GET /category/{id}/attributevalue` - Params: `id: int` - Returns: `200 { attributevalues: { id: int, attributeId: int, attributeName: str, attributeValueId: int, value: str, sort: int, categoryId?: int, exclusive?: bool }[] }` @@ -308,10 +308,10 @@ _none_ #### List companies — `GET /company` _none_ -- Returns: `200 { companies: T36[] }` +- Returns: `200 { companies: T19[] }` #### Create company — `POST /company` - Params: `body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }` -- Returns: `201 { company: T36, user: T38 }` +- Returns: `201 { company: T19, user: T38 }` #### Get company history — `GET /company/history` - Params: `query: limit?: int` - Returns: `200 { history: { id: int, date: str, text: str, companyuserId?: int|null }[], truncated: bool }` @@ -335,7 +335,7 @@ _none_ - Returns: `204 void` #### Update company — `PUT /company/{id}` - Params: `id: int, body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }` -- Returns: `200 { company: T36 }` +- Returns: `200 { company: T19 }` ### Section: /customergroup @@ -361,7 +361,7 @@ _none_ _none_ - Returns: `200 { deliveries: { id: int, number: str, type: str, supplierId: int|null, date: str, externalNumber?: str|null, createdAt?: str, ledger?: T44 }[] }` #### Create delivery — `POST /delivery` -- Params: `body: { externalNumber: str, date: str, lines: T27[], supplierId?: int|null, files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: { [k]: str } }[] }` +- Params: `body: { externalNumber: str, date: str, lines: T28[], supplierId?: int|null, files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: { [k]: str } }[] }` - Returns: `201 T5` #### Parse document (SSE) — `POST /delivery/parse` - Params: `form: { file: str }` @@ -382,7 +382,7 @@ _none_ - Params: `id: int` - Returns: `200 T5` #### Update delivery — `PATCH /delivery/{id}` -- Params: `id: int, body: { externalNumber?: str|null, date?: str, supplierId?: int|null, lines?: T27[], files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: { [k]: str } }[] }` +- Params: `id: int, body: { externalNumber?: str|null, date?: str, supplierId?: int|null, lines?: T28[], files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: { [k]: str } }[] }` - Returns: `200 T5` #### Get delivery attachment file content — `GET /delivery/{id}/file/{fileId}` - Params: `id: int, fileId: int, query: download?: bool` @@ -392,10 +392,10 @@ _none_ #### List entities — `GET /entity` - Params: `query: customergroupId?: int, role?: str` -- Returns: `200 { entities: T29[] }` +- Returns: `200 { entities: T30[] }` #### Create entity — `POST /entity` - Params: `body: { customergroupId: int, name: str, firstName?: str|null, number?: str }` -- Returns: `201 T22` +- Returns: `201 T23` #### Peek next customer number — `GET /entity/next-number` _none_ - Returns: `200 { number: str }` @@ -428,10 +428,10 @@ _none_ - Returns: `204 void` #### Get entity — `GET /entity/{id}` - Params: `id: int` -- Returns: `200 T22` +- Returns: `200 T23` #### Update entity — `PATCH /entity/{id}` - Params: `id: int, body: { name?: str, firstName?: str|null, number?: str|null }` -- Returns: `200 T22` +- Returns: `200 T23` ### Section: /events @@ -473,7 +473,7 @@ _none_ _none_ - Returns: `200 { labeltemplates: { id: int, name: str, width: num, height: num, dpi: int, type: str, thumb?: str|null }[] }` #### Create label template — `POST /labeltemplate` -- Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: T20 }` +- Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: T21 }` - Returns: `201 T7` #### Delete label template — `DELETE /labeltemplate/{id}` - Params: `id: int` @@ -482,10 +482,10 @@ _none_ - Params: `id: int` - Returns: `200 T7` #### Update label template (partial) — `PATCH /labeltemplate/{id}` -- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T20 }` +- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T21 }` - Returns: `200 T7` #### Update label template — `PUT /labeltemplate/{id}` -- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T20 }` +- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T21 }` - Returns: `200 T7` ### Section: /ledger @@ -542,7 +542,7 @@ _none_ - Params: `query: offset?: int, limit?: int` - Returns: `200 { orders: T4[], total: int, offset: int, limit: int }` #### Create order — `POST /order` -- Params: `body: { number: str, date: str, lines: T27[], entityId?: int|null }` +- Params: `body: { number: str, date: str, lines: T28[], entityId?: int|null }` - Returns: `201 T3` #### Delete order — `DELETE /order/{id}` - Params: `id: int` @@ -551,14 +551,14 @@ _none_ - Params: `id: int` - Returns: `200 T3` #### Update order — `PATCH /order/{id}` -- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T27[] }` +- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T28[] }` - Returns: `200 T3` #### List payments of an order — `GET /order/{id}/payment` - Params: `id: int` -- Returns: `200 { payments: T35[] }` +- Returns: `200 { payments: T36[] }` #### Add payment to an order — `POST /order/{id}/payment` - Params: `id: int, body: { accountId: int, type: str, amount: num }` -- Returns: `201 { payment: T35 }` +- Returns: `201 { payment: T36 }` #### List shippings of an order — `GET /order/{id}/shipping` - Params: `id: int` - Returns: `200 { shippings: T39[] }` @@ -609,10 +609,10 @@ _none_ #### List printers — `GET /printer` _none_ -- Returns: `200 { printers: T26[] }` +- Returns: `200 { printers: T27[] }` #### Create printer — `POST /printer` - Params: `body: { address: str, type: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }` -- Returns: `201 T21` +- Returns: `201 T22` #### Reorder printers — `PUT /printer/order` - Params: `body: { printerIds: int[] }` - Returns: `200 { printerIds: int[] }` @@ -621,22 +621,22 @@ _none_ - Returns: `204 void` #### Get printer by ID — `GET /printer/{id}` - Params: `id: int` -- Returns: `200 T21` +- Returns: `200 T22` #### Update printer (partial) — `PATCH /printer/{id}` - Params: `id: int, body: { address?: str, type?: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }` -- Returns: `200 T21` +- Returns: `200 T22` #### Update printer — `PUT /printer/{id}` - Params: `id: int, body: { address?: str, type?: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }` -- Returns: `200 T21` +- Returns: `200 T22` ### Section: /propertyname #### List property names — `GET /propertyname` _none_ -- Returns: `200 { propertynames: T34[] }` +- Returns: `200 { propertynames: T35[] }` #### Create property name — `POST /propertyname` - Params: `body: { name: str, sort?: int, exclusive?: bool }` -- Returns: `201 { propertyname: T34 }` +- Returns: `201 { propertyname: T35 }` #### Reorder property names — `PUT /propertyname/order` - Params: `body: { propertynameIds: int[] }` - Returns: `200 { ok: bool }` @@ -645,7 +645,7 @@ _none_ - Returns: `200 { ok: bool }` #### Update property name — `PATCH /propertyname/{id}` - Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }` -- Returns: `200 { propertyname: T34 }` +- Returns: `200 { propertyname: T35 }` ### Section: /public @@ -668,7 +668,7 @@ _none_ _none_ - Returns: `200 { quotes: { id: int, number: str, type: str, entityId: int|null, date: str, createdAt?: str }[] }` #### Create quote — `POST /quote` -- Params: `body: { number: str, date: str, lines: T27[], entityId?: int|null }` +- Params: `body: { number: str, date: str, lines: T28[], entityId?: int|null }` - Returns: `201 T9` #### Delete quote — `DELETE /quote/{id}` - Params: `id: int` @@ -677,7 +677,7 @@ _none_ - Params: `id: int` - Returns: `200 T9` #### Update quote — `PATCH /quote/{id}` -- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T27[] }` +- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T28[] }` - Returns: `200 T9` ### Section: /serper @@ -756,10 +756,10 @@ _none_ - Returns: `204 void` #### List units — `GET /unit` _none_ -- Returns: `200 { units: T32[] }` +- Returns: `200 { units: T33[] }` #### Upsert unit — `PUT /unit` - Params: `body: { si: str, basesi: str, basesifactor: num, symbol: str, name: str }` -- Returns: `200 { unit: T32 }` +- Returns: `200 { unit: T33 }` ### Section: /v1 diff --git a/docs/api/routes.md b/docs/api/routes.md index 023757b..d87d964 100644 --- a/docs/api/routes.md +++ b/docs/api/routes.md @@ -252,7 +252,7 @@ _none_ - Returns: `200 { categoryIds: int[] }` #### Category tree — `GET /category/tree` _none_ -- Returns: `200 { languageId: int, tree: { id: int, sort: int, posterminalIds: int[], parentId?: int|null, name?: str|null, slug?: str|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null }[], articles: { id: int, sku: str, name: str, slug: str, track_stock: bool, optionsCount: int, articleListCount: int, childCount: int, net?: num|null, taxRate?: num|null, parentArticleId?: int|null, parentSku?: str|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null, brand?: T28|null }[] }` +- Returns: `200 { languageId: int, tree: { id: int, sort: int, posterminalIds: int[], parentId?: int|null, name?: str|null, slug?: str|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null, articleCount?: int }[], articleCount: int }` #### Delete category — `DELETE /category/{id}` - Params: `id: int, query: recursive?: bool` - Returns: `204 void` @@ -285,7 +285,7 @@ _none_ #### List companies — `GET /company` _none_ -- Returns: `200 { companies: { id: int, iso639: str, name: str, taxrate: num, reducedtaxrate: num }[] }` +- Returns: `200 { companies: { id: int, name: str, rootCategoryId: int|null, languageId: int|null, iso639: str|null, taxrate: num, reducedtaxrate: num, taxfreerate: num }[] }` #### Get company history — `GET /company/history` - Params: `query: limit?: int` - Returns: `200 { history: { id: int, date: str, text: str, companyuserId?: int|null }[], truncated: bool }` @@ -306,7 +306,7 @@ _none_ - Returns: `200 { setting: { key: str, value: str|null } }` #### Update company — `PUT /company/{id}` - Params: `id: int, body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }` -- Returns: `200 { company: { id: int, iso639: str, name: str, taxrate: num, reducedtaxrate: num } }` +- Returns: `200 { company: { id: int, name: str, rootCategoryId: int|null, languageId: int|null, iso639: str|null, taxrate: num, reducedtaxrate: num, taxfreerate: num } }` ### Section: /customergroup diff --git a/docs/api/routes/category/tree.md b/docs/api/routes/category/tree.md index 2fb0877..2cafe3e 100644 --- a/docs/api/routes/category/tree.md +++ b/docs/api/routes/category/tree.md @@ -8,7 +8,7 @@ Returns the category tree for the authenticated user's selected company. ## Response `200` -Tree and articles for the selected company +Tree and article count for the selected company ```json { @@ -24,39 +24,13 @@ Tree and articles for the selected company "thumbW": 1, "thumbH": 1, "thumbHash": "…", + "articleCount": 1, "posterminalIds": [ 1 ] } ], - "articles": [ - { - "id": 1, - "sku": "…", - "name": "…", - "slug": "…", - "net": 1, - "taxRate": 1, - "track_stock": true, - "optionsCount": 1, - "articleListCount": 1, - "childCount": 1, - "parentArticleId": 1, - "parentSku": "…", - "fullHash": "…", - "thumbW": 1, - "thumbH": 1, - "thumbHash": "…", - "brand": { - "id": 1, - "name": "…", - "fullHash": "…", - "thumbW": 1, - "thumbH": 1, - "thumbHash": "…" - } - } - ] + "articleCount": 1 } ``` diff --git a/docs/api/routes/company/create.md b/docs/api/routes/company/create.md index e237ee0..3112283 100644 --- a/docs/api/routes/company/create.md +++ b/docs/api/routes/company/create.md @@ -32,10 +32,13 @@ Created; selected company updated { "company": { "id": 1, - "iso639": "…", "name": "…", + "rootCategoryId": 1, + "languageId": 1, + "iso639": "…", "taxrate": 1, - "reducedtaxrate": 1 + "reducedtaxrate": 1, + "taxfreerate": 1 }, "user": { "id": 1, diff --git a/docs/api/routes/company/list.md b/docs/api/routes/company/list.md index 86f3c65..47003b8 100644 --- a/docs/api/routes/company/list.md +++ b/docs/api/routes/company/list.md @@ -15,10 +15,13 @@ Company list "companies": [ { "id": 1, - "iso639": "…", "name": "…", + "rootCategoryId": 1, + "languageId": 1, + "iso639": "…", "taxrate": 1, - "reducedtaxrate": 1 + "reducedtaxrate": 1, + "taxfreerate": 1 } ] } diff --git a/docs/api/routes/company/update.md b/docs/api/routes/company/update.md index 491eee4..2a0bb78 100644 --- a/docs/api/routes/company/update.md +++ b/docs/api/routes/company/update.md @@ -38,10 +38,13 @@ Updated { "company": { "id": 1, - "iso639": "…", "name": "…", + "rootCategoryId": 1, + "languageId": 1, + "iso639": "…", "taxrate": 1, - "reducedtaxrate": 1 + "reducedtaxrate": 1, + "taxfreerate": 1 } } ``` diff --git a/src/api/openapi.js b/src/api/openapi.js index 17f373a..1b6a77a 100644 --- a/src/api/openapi.js +++ b/src/api/openapi.js @@ -42,14 +42,23 @@ * properties: * id: * type: integer - * iso639: - * type: string * name: * type: string + * rootCategoryId: + * type: integer + * nullable: true + * languageId: + * type: integer + * nullable: true + * iso639: + * type: string + * nullable: true * taxrate: * type: number * reducedtaxrate: * type: number + * taxfreerate: + * type: number * SuccessResponse: * type: object * required: [ok] @@ -513,6 +522,9 @@ * thumbHash: * type: string * nullable: true + * articleCount: + * type: integer + * description: Number of articles assigned directly to this category * posterminalIds: * type: array * items: diff --git a/src/api/routes/category.js b/src/api/routes/category.js index d552e90..93a43dd 100644 --- a/src/api/routes/category.js +++ b/src/api/routes/category.js @@ -74,7 +74,7 @@ export function register(app, basePath = '') { * x-markdown: category/tree.md * responses: * 200: - * description: Tree and articles for the selected company + * description: Tree and article count for the selected company * content: * application/json: * schema: @@ -86,10 +86,9 @@ export function register(app, basePath = '') { * type: array * items: * $ref: '#/components/schemas/CategoryTreeNode' - * articles: - * type: array - * items: - * $ref: '#/components/schemas/CategoryArticle' + * articleCount: + * type: integer + * description: Total number of parent articles across the category tree * 400: * description: No company selected * content: