u
This commit is contained in:
@@ -10,50 +10,53 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
|
|||||||
### Reusable types
|
### Reusable types
|
||||||
|
|
||||||
- `T1` = `{ article: T2 }`
|
- `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: T31, brand: T28|null, categoryIds: int[], photos: T26[], eans: str[], prices: T37[], suppliers: T12[] }`
|
- `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: T29|null, categoryIds: int[], photos: T27[], eans: str[], prices: T40[], suppliers: T13[] }`
|
||||||
- `T3` = `{ delivery: T4 }`
|
- `T3` = `{ order: T4 }`
|
||||||
- `T4` = `{ id: int, number: str, type: str, supplierId: int|null, date: str, lines: T21[], files: T9[], externalNumber?: str|null, createdAt?: str, ledger?: T41 }`
|
- `T4` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T22[], createdAt?: str, shipping?: T39|null, shippings?: T39[], payment?: T35|null, payments?: T35[], paid?: bool, delivered?: bool }`
|
||||||
- `T5` = `{ labeltemplate: T6 }`
|
- `T5` = `{ delivery: T6 }`
|
||||||
- `T6` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: T17, thumb?: str|null }`
|
- `T6` = `{ id: int, number: str, type: str, supplierId: int|null, date: str, lines: T22[], files: T10[], externalNumber?: str|null, createdAt?: str, ledger?: T44 }`
|
||||||
- `T7` = `{ order: T11 }`
|
- `T7` = `{ labeltemplate: T8 }`
|
||||||
- `T8` = `{ quote: T11 }`
|
- `T8` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: T18, thumb?: str|null }`
|
||||||
- `T9` = `{ 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 }`
|
- `T9` = `{ quote: T12 }`
|
||||||
- `T10` = `{ 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[] }`
|
- `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, number: str, type: str, entityId: int|null, date: str, lines: T21[], createdAt?: str }`
|
- `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, articleId: int, entityId: int, pu: num, sort: int, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T43|null }`
|
- `T12` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T22[], createdAt?: str }`
|
||||||
- `T13` = `{ 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 }`
|
- `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` = `{ ledger: T15[] }`
|
- `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` = `{ 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 }`
|
- `T15` = `{ ledger: T16[] }`
|
||||||
- `T16` = `{ id: int, name: str, sort: int, exclusive: bool, values: T32[], articleCount?: int }`
|
- `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` = `{ objects: T22[] }`
|
- `T17` = `{ id: int, name: str, sort: int, exclusive: bool, values: T33[], articleCount?: int }`
|
||||||
- `T18` = `{ objects: T23[] }`
|
- `T18` = `{ objects: T23[] }`
|
||||||
- `T19` = `{ printer: T24 }`
|
- `T19` = `{ objects: T24[] }`
|
||||||
- `T20` = `{ entity: T27 }`
|
- `T20` = `{ printer: T25 }`
|
||||||
- `T21` = `{ id: int, sku: str|null, name: str|null, pu: num, amount: num, net: num, rebate: num, taxrate: num, comment: str|null }`
|
- `T21` = `{ entity: T28 }`
|
||||||
- `T22` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }`
|
- `T22` = `{ id: int, sku: str|null, name: str|null, pu: num, amount: num, net: num, rebate: num, taxrate: num, comment: str|null }`
|
||||||
- `T23` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }`
|
- `T23` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }`
|
||||||
- `T24` = `{ id: int, company_id: int, address: str, type: str, sort: int, model?: str|null, serial?: str|null, desc?: str|null }`
|
- `T24` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }`
|
||||||
- `T25` = `{ amount: num, net: num, taxrate: num, sku?: str|null, name?: str|null, pu?: num, rebate?: num, comment?: str|null }`
|
- `T25` = `{ id: int, company_id: int, address: str, type: str, sort: int, model?: str|null, serial?: str|null, desc?: str|null }`
|
||||||
- `T26` = `{ sort: int, fullHash: str, fullW: int, fullH: int, fullSize: int, thumbW: int, thumbH: int, thumbHash: str }`
|
- `T26` = `{ amount: num, net: num, taxrate: num, sku?: str|null, name?: str|null, pu?: num, rebate?: num, comment?: str|null }`
|
||||||
- `T27` = `{ id: int, customergroupId: int, firstName: str|null, name: str, number: str|null, createdAt: str, updatedAt: str }`
|
- `T27` = `{ sort: int, fullHash: str, fullW: int, fullH: int, fullSize: int, thumbW: int, thumbH: int, thumbHash: str }`
|
||||||
- `T28` = `{ name: str, id?: int|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null }`
|
- `T28` = `{ id: int, customergroupId: int, firstName: str|null, name: str, number: str|null, createdAt: str, updatedAt: str }`
|
||||||
- `T29` = `{ id: int, companyuser_id: int, provider: str, model: str, created_at: str, updated_at: str, state: str }`
|
- `T29` = `{ name: str, id?: int|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null }`
|
||||||
- `T30` = `{ article: T35 }`
|
- `T30` = `{ id: int, companyuser_id: int, provider: str, model: str, created_at: str, updated_at: str, state: str }`
|
||||||
- `T31` = `{ si: str, basesi: str, basesifactor: num, symbol?: str|null, name?: str|null }`
|
- `T31` = `{ article: T37 }`
|
||||||
- `T32` = `{ id: int, attributeId: int, value: str, sort: int, articleCount?: int }`
|
- `T32` = `{ si: str, basesi: str, basesifactor: num, symbol?: str|null, name?: str|null }`
|
||||||
- `T33` = `{ id: int, name: str, sort: int, exclusive: bool, articleCount?: int }`
|
- `T33` = `{ id: int, attributeId: int, value: str, sort: int, articleCount?: int }`
|
||||||
- `T34` = `{ id: int, iso639: str, name: str, taxrate: num, reducedtaxrate: num }`
|
- `T34` = `{ id: int, name: str, sort: int, exclusive: bool, articleCount?: int }`
|
||||||
- `T35` = `{ id: int, categoryId: int, name: str, sku: str, track_stock: bool }`
|
- `T35` = `{ id: int, accountId: int, manifestId: int, type: str, amount: num }`
|
||||||
- `T36` = `{ id: int, email: str, selectedCompanyId: int|null, picture?: str }`
|
- `T36` = `{ id: int, iso639: str, name: str, taxrate: num, reducedtaxrate: num }`
|
||||||
- `T37` = `{ minmultiplier: num, net: num, taxRate: num, customergroupId: int }`
|
- `T37` = `{ id: int, categoryId: int, name: str, sku: str, track_stock: bool }`
|
||||||
- `T38` = `{ fullHash: str, thumbW: int, thumbH: int, thumbHash: str }`
|
- `T38` = `{ id: int, email: str, selectedCompanyId: int|null, picture?: str }`
|
||||||
- `T39` = `{ id: int, entityId: int, contactType: str, contact: str }`
|
- `T39` = `{ id: int, manifestId: int, number: str, type: str, state: str }`
|
||||||
- `T40` = `{ id: int, name: str, createdAt: str, updatedAt: str }`
|
- `T40` = `{ minmultiplier: num, net: num, taxRate: num, customergroupId: int }`
|
||||||
- `T41` = `{ totalPositions: int, completelyOnLedgerPositions: int }`
|
- `T41` = `{ fullHash: str, thumbW: int, thumbH: int, thumbHash: str }`
|
||||||
- `T42` = `{ warehouse: T44 }`
|
- `T42` = `{ id: int, entityId: int, contactType: str, contact: str }`
|
||||||
- `T43` = `{ net: num, taxId: int, taxRate?: num|null }`
|
- `T43` = `{ id: int, name: str, createdAt: str, updatedAt: str }`
|
||||||
- `T44` = `{ id: int, name: str, sort: int }`
|
- `T44` = `{ totalPositions: int, completelyOnLedgerPositions: int }`
|
||||||
- `T45` = `{ id: int, categoryIds: int[] }`
|
- `T45` = `{ warehouse: T47 }`
|
||||||
|
- `T46` = `{ net: num, taxId: int, taxRate?: num|null }`
|
||||||
|
- `T47` = `{ id: int, name: str, sort: int }`
|
||||||
|
- `T48` = `{ id: int, categoryIds: int[] }`
|
||||||
|
|
||||||
### Routes
|
### Routes
|
||||||
|
|
||||||
@@ -74,7 +77,7 @@ _none_
|
|||||||
|
|
||||||
#### Create article in category — `POST /article`
|
#### Create article in category — `POST /article`
|
||||||
- Params: `body: { categoryId: int, name: str, desc?: str, seo?: str, track_stock?: bool }`
|
- Params: `body: { categoryId: int, name: str, desc?: str, seo?: str, track_stock?: bool }`
|
||||||
- Returns: `201 T30`
|
- Returns: `201 T31`
|
||||||
#### Export articles as ZIP — `GET /article/export.zip`
|
#### Export articles as ZIP — `GET /article/export.zip`
|
||||||
- Params: `query: categoryId?: int`
|
- Params: `query: categoryId?: int`
|
||||||
- Returns: `200 zip`
|
- Returns: `200 zip`
|
||||||
@@ -110,10 +113,10 @@ _none_
|
|||||||
- Returns: `200 { children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }`
|
- 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`
|
#### 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 }`
|
- Params: `sku: str, body: { attributeValueId?: int, value?: str, name?: str }`
|
||||||
- Returns: `201 T30`
|
- Returns: `201 T31`
|
||||||
#### Attach an existing article as a child to a parent article — `PUT /article/{sku}/children`
|
#### 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 }`
|
- Params: `sku: str, body: { sku: str, attributeValueId?: int, value?: str, reparent?: bool }`
|
||||||
- Returns: `200 { article: T35, children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }`
|
- Returns: `200 { article: T37, children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }`
|
||||||
#### Remove a child article from a parent article — `DELETE /article/{sku}/children/{childSku}`
|
#### Remove a child article from a parent article — `DELETE /article/{sku}/children/{childSku}`
|
||||||
- Params: `sku: str, childSku: str, query: deleteArticle?: bool`
|
- Params: `sku: str, childSku: str, query: deleteArticle?: bool`
|
||||||
- Returns: `200 { success: bool, deleted: bool }`
|
- Returns: `200 { success: bool, deleted: bool }`
|
||||||
@@ -140,7 +143,7 @@ _none_
|
|||||||
- Returns: `200 { options: { id: int, articleId: int, sku: str, name: str, count: int, sort: int, mandated: bool }[] }`
|
- 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`
|
#### Toggle parent mode for an article — `POST /article/{sku}/parent`
|
||||||
- Params: `sku: str, body: { isParent: bool, attributeNameId?: int }`
|
- Params: `sku: str, body: { isParent: bool, attributeNameId?: int }`
|
||||||
- Returns: `200 T30`
|
- Returns: `200 T31`
|
||||||
#### Replace POS prices by SKU (net > gross; price=net, tax=taxRate %) — `PUT /article/{sku}/prices`
|
#### 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 }[] }`
|
- Params: `sku: str, body: { prices: { net?: num, gross?: num, price?: num, taxRate?: num, tax?: num, minmultiplier?: num }[] }`
|
||||||
- Returns: `200 T1`
|
- Returns: `200 T1`
|
||||||
@@ -158,10 +161,10 @@ _none_
|
|||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
#### List article suppliers — `GET /article/{sku}/supplier`
|
#### List article suppliers — `GET /article/{sku}/supplier`
|
||||||
- Params: `sku: str`
|
- Params: `sku: str`
|
||||||
- Returns: `200 { suppliers: T12[] }`
|
- Returns: `200 { suppliers: T13[] }`
|
||||||
#### Assign supplier to article — `POST /article/{sku}/supplier`
|
#### Assign supplier to article — `POST /article/{sku}/supplier`
|
||||||
- Params: `sku: str, body: { entityId: int, sku?: str|null, pu?: num, stock?: num|null, sort?: int|null, netPrice?: num|null, taxId?: int|null, taxRate?: num|null }`
|
- Params: `sku: str, body: { entityId: int, sku?: str|null, pu?: num, stock?: num|null, sort?: int|null, netPrice?: num|null, taxId?: int|null, taxRate?: num|null }`
|
||||||
- Returns: `201 { supplier: T12 }`
|
- Returns: `201 { supplier: T13 }`
|
||||||
#### Reorder article suppliers — `PUT /article/{sku}/supplier/order`
|
#### Reorder article suppliers — `PUT /article/{sku}/supplier/order`
|
||||||
- Params: `sku: str, body: { ids: int[] }`
|
- Params: `sku: str, body: { ids: int[] }`
|
||||||
- Returns: `200 { ids: int[] }`
|
- Returns: `200 { ids: int[] }`
|
||||||
@@ -170,7 +173,7 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update article supplier assignment — `PATCH /article/{sku}/supplier/{id}`
|
#### Update article supplier assignment — `PATCH /article/{sku}/supplier/{id}`
|
||||||
- Params: `sku: str, id: int, body: { sku?: str|null, pu?: num, stock?: num|null, sort?: int, netPrice?: num|null, taxId?: int|null, taxRate?: num|null }`
|
- Params: `sku: str, id: int, body: { sku?: str|null, pu?: num, stock?: num|null, sort?: int, netPrice?: num|null, taxId?: int|null, taxRate?: num|null }`
|
||||||
- Returns: `200 { supplier: T12 }`
|
- Returns: `200 { supplier: T13 }`
|
||||||
#### Set article track_stock flag by SKU — `PUT /article/{sku}/track_stock`
|
#### Set article track_stock flag by SKU — `PUT /article/{sku}/track_stock`
|
||||||
- Params: `sku: str, body: { track_stock: bool }`
|
- Params: `sku: str, body: { track_stock: bool }`
|
||||||
- Returns: `200 T1`
|
- Returns: `200 T1`
|
||||||
@@ -182,19 +185,19 @@ _none_
|
|||||||
|
|
||||||
#### List attribute names — `GET /attributename`
|
#### List attribute names — `GET /attributename`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { attributenames: T16[] }`
|
- Returns: `200 { attributenames: T17[] }`
|
||||||
#### Create attribute name — `POST /attributename`
|
#### Create attribute name — `POST /attributename`
|
||||||
- Params: `body: { name: str, sort?: int, exclusive?: bool }`
|
- Params: `body: { name: str, sort?: int, exclusive?: bool }`
|
||||||
- Returns: `201 { attributename: T16 }`
|
- Returns: `201 { attributename: T17 }`
|
||||||
#### Reorder attribute names — `PUT /attributename/order`
|
#### Reorder attribute names — `PUT /attributename/order`
|
||||||
- Params: `body: { attributenameIds: int[] }`
|
- Params: `body: { attributenameIds: int[] }`
|
||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
#### List values for an attribute — `GET /attributename/{attributeId}/value`
|
#### List values for an attribute — `GET /attributename/{attributeId}/value`
|
||||||
- Params: `attributeId: int`
|
- Params: `attributeId: int`
|
||||||
- Returns: `200 { values: T32[] }`
|
- Returns: `200 { values: T33[] }`
|
||||||
#### Create value for an attribute — `POST /attributename/{attributeId}/value`
|
#### Create value for an attribute — `POST /attributename/{attributeId}/value`
|
||||||
- Params: `attributeId: int, body: { value: str, sort?: int }`
|
- Params: `attributeId: int, body: { value: str, sort?: int }`
|
||||||
- Returns: `201 { attributevalue: T32 }`
|
- Returns: `201 { attributevalue: T33 }`
|
||||||
#### Reorder values of an attribute — `PUT /attributename/{attributeId}/value/order`
|
#### Reorder values of an attribute — `PUT /attributename/{attributeId}/value/order`
|
||||||
- Params: `attributeId: int, body: { attributevalueIds: int[] }`
|
- Params: `attributeId: int, body: { attributevalueIds: int[] }`
|
||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
@@ -203,7 +206,7 @@ _none_
|
|||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
#### Update attribute name — `PATCH /attributename/{id}`
|
#### Update attribute name — `PATCH /attributename/{id}`
|
||||||
- Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }`
|
- Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }`
|
||||||
- Returns: `200 { attributename: T16 }`
|
- Returns: `200 { attributename: T17 }`
|
||||||
|
|
||||||
### Section: /attributevalue
|
### Section: /attributevalue
|
||||||
|
|
||||||
@@ -212,28 +215,28 @@ _none_
|
|||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
#### Update attribute value — `PATCH /attributevalue/{id}`
|
#### Update attribute value — `PATCH /attributevalue/{id}`
|
||||||
- Params: `id: int, body: { value?: str, sort?: int }`
|
- Params: `id: int, body: { value?: str, sort?: int }`
|
||||||
- Returns: `200 { attributevalue: T32 }`
|
- Returns: `200 { attributevalue: T33 }`
|
||||||
#### Delete attribute value image — `DELETE /attributevalue/{id}/image`
|
#### Delete attribute value image — `DELETE /attributevalue/{id}/image`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { attributevalue: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T38[] } }`
|
- Returns: `200 { attributevalue: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T41[] } }`
|
||||||
#### Add or replace attribute value image — `POST /attributevalue/{id}/image`
|
#### Add or replace attribute value image — `POST /attributevalue/{id}/image`
|
||||||
- Params: `id: int, image/avif`
|
- Params: `id: int, image/avif`
|
||||||
- Returns: `201 { attributevalue: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T38[] } }`
|
- Returns: `201 { attributevalue: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T41[] } }`
|
||||||
|
|
||||||
### Section: /auth
|
### Section: /auth
|
||||||
|
|
||||||
#### Login with Google ID token — `POST /auth/login`
|
#### Login with Google ID token — `POST /auth/login`
|
||||||
- Params: `body: { idToken: str }`
|
- Params: `body: { idToken: str }`
|
||||||
- Returns: `200 { message: str, user: T36 }`
|
- Returns: `200 { message: str, user: T38 }`
|
||||||
#### Logout — `POST /auth/logout`
|
#### Logout — `POST /auth/logout`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { message: str }`
|
- Returns: `200 { message: str }`
|
||||||
#### Current user — `GET /auth/me`
|
#### Current user — `GET /auth/me`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { user: T36, googleClientId: str }`
|
- Returns: `200 { user: T38, googleClientId: str }`
|
||||||
#### Set selected company — `PUT /auth/selected-company`
|
#### Set selected company — `PUT /auth/selected-company`
|
||||||
- Params: `body: { companyId: int }`
|
- Params: `body: { companyId: int }`
|
||||||
- Returns: `200 { user: T36 }`
|
- Returns: `200 { user: T38 }`
|
||||||
|
|
||||||
### Section: /brand
|
### Section: /brand
|
||||||
|
|
||||||
@@ -242,7 +245,7 @@ _none_
|
|||||||
- Returns: `200 { brands: { id: int, name: str, articleCount: int, pics: { fullHash: str, thumbW: int, thumbH: int, thumbHash: str, smallThumbW?: int|null, smallThumbH?: int|null, smallThumbBinary?: str|null }[], gsprpinfo?: str|null }[], total: int, offset: int, limit: int }`
|
- Returns: `200 { brands: { id: int, name: str, articleCount: int, pics: { fullHash: str, thumbW: int, thumbH: int, thumbHash: str, smallThumbW?: int|null, smallThumbH?: int|null, smallThumbBinary?: str|null }[], gsprpinfo?: str|null }[], total: int, offset: int, limit: int }`
|
||||||
#### Create brand — `POST /brand`
|
#### Create brand — `POST /brand`
|
||||||
- Params: `body: { name: str, gsprpinfo?: str }`
|
- Params: `body: { name: str, gsprpinfo?: str }`
|
||||||
- Returns: `201 { brand: { id: int, name: str, pics: T38[], gsprpinfo?: str|null } }`
|
- Returns: `201 { brand: { id: int, name: str, pics: T41[], gsprpinfo?: str|null } }`
|
||||||
#### Delete brand — `DELETE /brand/{id}`
|
#### Delete brand — `DELETE /brand/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
@@ -251,10 +254,10 @@ _none_
|
|||||||
- Returns: `200 { brand: { id: int, name: str, touchedArticleCount: int, gsprpinfo?: str|null } }`
|
- Returns: `200 { brand: { id: int, name: str, touchedArticleCount: int, gsprpinfo?: str|null } }`
|
||||||
#### Delete brand image — `DELETE /brand/{id}/image`
|
#### Delete brand image — `DELETE /brand/{id}/image`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { brand: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T38[] } }`
|
- Returns: `200 { brand: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T41[] } }`
|
||||||
#### Add or replace brand image — `POST /brand/{id}/image`
|
#### Add or replace brand image — `POST /brand/{id}/image`
|
||||||
- Params: `id: int, image/avif`
|
- Params: `id: int, image/avif`
|
||||||
- Returns: `201 { brand: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T38[] } }`
|
- Returns: `201 { brand: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T41[] } }`
|
||||||
|
|
||||||
### Section: /category
|
### Section: /category
|
||||||
|
|
||||||
@@ -269,7 +272,7 @@ _none_
|
|||||||
- Returns: `200 { categoryIds: int[] }`
|
- Returns: `200 { categoryIds: int[] }`
|
||||||
#### Category tree — `GET /category/tree`
|
#### Category tree — `GET /category/tree`
|
||||||
_none_
|
_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 }[], 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?: T29|null }[] }`
|
||||||
#### Delete category — `DELETE /category/{id}`
|
#### Delete category — `DELETE /category/{id}`
|
||||||
- Params: `id: int, query: recursive?: bool`
|
- Params: `id: int, query: recursive?: bool`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
@@ -278,7 +281,7 @@ _none_
|
|||||||
- Returns: `200 { category: { id: int, name: str, slug: str, parentId: int, sort: int } }`
|
- Returns: `200 { category: { id: int, name: str, slug: str, parentId: int, sort: int } }`
|
||||||
#### Articles in category — `GET /category/{id}/articles`
|
#### Articles in category — `GET /category/{id}/articles`
|
||||||
- Params: `id: int`
|
- 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?: T28|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?: T29|null }[] }`
|
||||||
#### List category attribute values — `GET /category/{id}/attributevalue`
|
#### List category attribute values — `GET /category/{id}/attributevalue`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { attributevalues: { id: int, attributeId: int, attributeName: str, attributeValueId: int, value: str, sort: int, categoryId?: int, exclusive?: bool }[] }`
|
- Returns: `200 { attributevalues: { id: int, attributeId: int, attributeName: str, attributeValueId: int, value: str, sort: int, categoryId?: int, exclusive?: bool }[] }`
|
||||||
@@ -305,10 +308,10 @@ _none_
|
|||||||
|
|
||||||
#### List companies — `GET /company`
|
#### List companies — `GET /company`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { companies: T34[] }`
|
- Returns: `200 { companies: T36[] }`
|
||||||
#### Create company — `POST /company`
|
#### Create company — `POST /company`
|
||||||
- Params: `body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }`
|
- Params: `body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }`
|
||||||
- Returns: `201 { company: T34, user: T36 }`
|
- Returns: `201 { company: T36, user: T38 }`
|
||||||
#### Get company history — `GET /company/history`
|
#### Get company history — `GET /company/history`
|
||||||
- Params: `query: limit?: int`
|
- Params: `query: limit?: int`
|
||||||
- Returns: `200 { history: { id: int, date: str, text: str, companyuserId?: int|null }[], truncated: bool }`
|
- Returns: `200 { history: { id: int, date: str, text: str, companyuserId?: int|null }[], truncated: bool }`
|
||||||
@@ -332,7 +335,7 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update company — `PUT /company/{id}`
|
#### Update company — `PUT /company/{id}`
|
||||||
- Params: `id: int, body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }`
|
- Params: `id: int, body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }`
|
||||||
- Returns: `200 { company: T34 }`
|
- Returns: `200 { company: T36 }`
|
||||||
|
|
||||||
### Section: /customergroup
|
### Section: /customergroup
|
||||||
|
|
||||||
@@ -341,7 +344,7 @@ _none_
|
|||||||
- Returns: `200 { customergroups: { id: int, name: str, sort: int, editable: bool }[] }`
|
- Returns: `200 { customergroups: { id: int, name: str, sort: int, editable: bool }[] }`
|
||||||
#### Create customer group — `POST /customergroup`
|
#### Create customer group — `POST /customergroup`
|
||||||
- Params: `body: { name: str }`
|
- Params: `body: { name: str }`
|
||||||
- Returns: `201 { customergroup: T44 }`
|
- Returns: `201 { customergroup: T47 }`
|
||||||
#### Reorder customer groups — `PUT /customergroup/order`
|
#### Reorder customer groups — `PUT /customergroup/order`
|
||||||
- Params: `body: { customergroupIds: int[] }`
|
- Params: `body: { customergroupIds: int[] }`
|
||||||
- Returns: `200 { customergroupIds: int[] }`
|
- Returns: `200 { customergroupIds: int[] }`
|
||||||
@@ -350,16 +353,16 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update customer group — `PATCH /customergroup/{id}`
|
#### Update customer group — `PATCH /customergroup/{id}`
|
||||||
- Params: `id: int, body: { name: str }`
|
- Params: `id: int, body: { name: str }`
|
||||||
- Returns: `200 { customergroup: T44 }`
|
- Returns: `200 { customergroup: T47 }`
|
||||||
|
|
||||||
### Section: /delivery
|
### Section: /delivery
|
||||||
|
|
||||||
#### List deliveries — `GET /delivery`
|
#### List deliveries — `GET /delivery`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { deliveries: { id: int, number: str, type: str, supplierId: int|null, date: str, externalNumber?: str|null, createdAt?: str, ledger?: T41 }[] }`
|
- 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`
|
#### Create delivery — `POST /delivery`
|
||||||
- Params: `body: { externalNumber: str, date: str, lines: T25[], 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: T26[], 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 T3`
|
- Returns: `201 T5`
|
||||||
#### Parse document (SSE) — `POST /delivery/parse`
|
#### Parse document (SSE) — `POST /delivery/parse`
|
||||||
- Params: `form: { file: str }`
|
- Params: `form: { file: str }`
|
||||||
- Returns: `200 SSE`
|
- Returns: `200 SSE`
|
||||||
@@ -377,10 +380,10 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get delivery — `GET /delivery/{id}`
|
#### Get delivery — `GET /delivery/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T3`
|
- Returns: `200 T5`
|
||||||
#### Update delivery — `PATCH /delivery/{id}`
|
#### Update delivery — `PATCH /delivery/{id}`
|
||||||
- Params: `id: int, body: { externalNumber?: str|null, date?: str, supplierId?: int|null, lines?: T25[], 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?: T26[], files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: { [k]: str } }[] }`
|
||||||
- Returns: `200 T3`
|
- Returns: `200 T5`
|
||||||
#### Get delivery attachment file content — `GET /delivery/{id}/file/{fileId}`
|
#### Get delivery attachment file content — `GET /delivery/{id}/file/{fileId}`
|
||||||
- Params: `id: int, fileId: int, query: download?: bool`
|
- Params: `id: int, fileId: int, query: download?: bool`
|
||||||
- Returns: `200 str`
|
- Returns: `200 str`
|
||||||
@@ -389,46 +392,46 @@ _none_
|
|||||||
|
|
||||||
#### List entities — `GET /entity`
|
#### List entities — `GET /entity`
|
||||||
- Params: `query: customergroupId?: int, role?: str`
|
- Params: `query: customergroupId?: int, role?: str`
|
||||||
- Returns: `200 { entities: T27[] }`
|
- Returns: `200 { entities: T28[] }`
|
||||||
#### Create entity — `POST /entity`
|
#### Create entity — `POST /entity`
|
||||||
- Params: `body: { customergroupId: int, name: str, firstName?: str|null, number?: str }`
|
- Params: `body: { customergroupId: int, name: str, firstName?: str|null, number?: str }`
|
||||||
- Returns: `201 T20`
|
- Returns: `201 T21`
|
||||||
#### Peek next customer number — `GET /entity/next-number`
|
#### Peek next customer number — `GET /entity/next-number`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { number: str }`
|
- Returns: `200 { number: str }`
|
||||||
#### List entity addresses — `GET /entity/{entityId}/address`
|
#### List entity addresses — `GET /entity/{entityId}/address`
|
||||||
- Params: `entityId: int`
|
- Params: `entityId: int`
|
||||||
- Returns: `200 { addresses: T13[] }`
|
- Returns: `200 { addresses: T14[] }`
|
||||||
#### Create entity address — `POST /entity/{entityId}/address`
|
#### Create entity address — `POST /entity/{entityId}/address`
|
||||||
- Params: `entityId: int, body: { addressType: str, firstName?: str|null, name?: str|null, street?: str|null, streetNumber?: str|null, zip?: str|null, city?: str|null, county?: str|null }`
|
- Params: `entityId: int, body: { addressType: str, firstName?: str|null, name?: str|null, street?: str|null, streetNumber?: str|null, zip?: str|null, city?: str|null, county?: str|null }`
|
||||||
- Returns: `201 { address: T13 }`
|
- Returns: `201 { address: T14 }`
|
||||||
#### Delete entity address — `DELETE /entity/{entityId}/address/{id}`
|
#### Delete entity address — `DELETE /entity/{entityId}/address/{id}`
|
||||||
- Params: `entityId: int, id: int`
|
- Params: `entityId: int, id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update entity address — `PATCH /entity/{entityId}/address/{id}`
|
#### Update entity address — `PATCH /entity/{entityId}/address/{id}`
|
||||||
- Params: `entityId: int, id: int, body: { addressType?: str, firstName?: str|null, name?: str|null, street?: str|null, streetNumber?: str|null, zip?: str|null, city?: str|null, county?: str|null }`
|
- Params: `entityId: int, id: int, body: { addressType?: str, firstName?: str|null, name?: str|null, street?: str|null, streetNumber?: str|null, zip?: str|null, city?: str|null, county?: str|null }`
|
||||||
- Returns: `200 { address: T13 }`
|
- Returns: `200 { address: T14 }`
|
||||||
#### List entity contacts — `GET /entity/{entityId}/contact`
|
#### List entity contacts — `GET /entity/{entityId}/contact`
|
||||||
- Params: `entityId: int`
|
- Params: `entityId: int`
|
||||||
- Returns: `200 { contacts: T39[] }`
|
- Returns: `200 { contacts: T42[] }`
|
||||||
#### Create entity contact — `POST /entity/{entityId}/contact`
|
#### Create entity contact — `POST /entity/{entityId}/contact`
|
||||||
- Params: `entityId: int, body: { contactType: str, contact: str }`
|
- Params: `entityId: int, body: { contactType: str, contact: str }`
|
||||||
- Returns: `201 { contact: T39 }`
|
- Returns: `201 { contact: T42 }`
|
||||||
#### Delete entity contact — `DELETE /entity/{entityId}/contact/{id}`
|
#### Delete entity contact — `DELETE /entity/{entityId}/contact/{id}`
|
||||||
- Params: `entityId: int, id: int`
|
- Params: `entityId: int, id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update entity contact — `PATCH /entity/{entityId}/contact/{id}`
|
#### Update entity contact — `PATCH /entity/{entityId}/contact/{id}`
|
||||||
- Params: `entityId: int, id: int, body: { contactType?: str, contact?: str }`
|
- Params: `entityId: int, id: int, body: { contactType?: str, contact?: str }`
|
||||||
- Returns: `200 { contact: T39 }`
|
- Returns: `200 { contact: T42 }`
|
||||||
#### Delete entity — `DELETE /entity/{id}`
|
#### Delete entity — `DELETE /entity/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get entity — `GET /entity/{id}`
|
#### Get entity — `GET /entity/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T20`
|
- Returns: `200 T21`
|
||||||
#### Update entity — `PATCH /entity/{id}`
|
#### Update entity — `PATCH /entity/{id}`
|
||||||
- Params: `id: int, body: { name?: str, firstName?: str|null, number?: str|null }`
|
- Params: `id: int, body: { name?: str, firstName?: str|null, number?: str|null }`
|
||||||
- Returns: `200 T20`
|
- Returns: `200 T21`
|
||||||
|
|
||||||
### Section: /events
|
### Section: /events
|
||||||
|
|
||||||
@@ -470,50 +473,50 @@ _none_
|
|||||||
_none_
|
_none_
|
||||||
- Returns: `200 { labeltemplates: { id: int, name: str, width: num, height: num, dpi: int, type: str, thumb?: str|null }[] }`
|
- Returns: `200 { labeltemplates: { id: int, name: str, width: num, height: num, dpi: int, type: str, thumb?: str|null }[] }`
|
||||||
#### Create label template — `POST /labeltemplate`
|
#### Create label template — `POST /labeltemplate`
|
||||||
- Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: T18 }`
|
- Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: T19 }`
|
||||||
- Returns: `201 T5`
|
- Returns: `201 T7`
|
||||||
#### Delete label template — `DELETE /labeltemplate/{id}`
|
#### Delete label template — `DELETE /labeltemplate/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get label template by ID — `GET /labeltemplate/{id}`
|
#### Get label template by ID — `GET /labeltemplate/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T5`
|
- Returns: `200 T7`
|
||||||
#### Update label template (partial) — `PATCH /labeltemplate/{id}`
|
#### Update label template (partial) — `PATCH /labeltemplate/{id}`
|
||||||
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T18 }`
|
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T19 }`
|
||||||
- Returns: `200 T5`
|
- Returns: `200 T7`
|
||||||
#### Update label template — `PUT /labeltemplate/{id}`
|
#### Update label template — `PUT /labeltemplate/{id}`
|
||||||
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T18 }`
|
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T19 }`
|
||||||
- Returns: `200 T5`
|
- Returns: `200 T7`
|
||||||
|
|
||||||
### Section: /ledger
|
### Section: /ledger
|
||||||
|
|
||||||
#### Query ledger by manifest article ID or SKU — `GET /ledger`
|
#### Query ledger by manifest article ID or SKU — `GET /ledger`
|
||||||
- Params: `query: manifestarticle_id?: int, sku?: str, transaction_type?: str`
|
- Params: `query: manifestarticle_id?: int, sku?: str, transaction_type?: str`
|
||||||
- Returns: `200 T14`
|
- Returns: `200 T15`
|
||||||
#### Add ledger entry — `POST /ledger`
|
#### Add ledger entry — `POST /ledger`
|
||||||
- Params: `body: { manifestarticle_id: int, transaction_type: str, amount: num, transaction_text: str }`
|
- Params: `body: { manifestarticle_id: int, transaction_type: str, amount: num, transaction_text: str }`
|
||||||
- Returns: `201 { ledger: T15 }`
|
- Returns: `201 { ledger: T16 }`
|
||||||
#### Query ledger by manifest article ID — `GET /ledger/manifestarticle/{manifestarticleId}`
|
#### Query ledger by manifest article ID — `GET /ledger/manifestarticle/{manifestarticleId}`
|
||||||
- Params: `manifestarticleId: int, query: transaction_type?: str`
|
- Params: `manifestarticleId: int, query: transaction_type?: str`
|
||||||
- Returns: `200 T14`
|
- Returns: `200 T15`
|
||||||
#### Query ledger by article SKU — `GET /ledger/sku/{sku}`
|
#### Query ledger by article SKU — `GET /ledger/sku/{sku}`
|
||||||
- Params: `sku: str, query: transaction_type?: str`
|
- Params: `sku: str, query: transaction_type?: str`
|
||||||
- Returns: `200 T14`
|
- Returns: `200 T15`
|
||||||
|
|
||||||
### Section: /modelconversation
|
### Section: /modelconversation
|
||||||
|
|
||||||
#### List conversations — `GET /modelconversation`
|
#### List conversations — `GET /modelconversation`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { conversations: T29[] }`
|
- Returns: `200 { conversations: T30[] }`
|
||||||
#### Create conversation — `POST /modelconversation`
|
#### Create conversation — `POST /modelconversation`
|
||||||
- Params: `body: { provider: str, model: str }`
|
- Params: `body: { provider: str, model: str }`
|
||||||
- Returns: `201 { conversation: T29 }`
|
- Returns: `201 { conversation: T30 }`
|
||||||
#### Delete conversation — `DELETE /modelconversation/{id}`
|
#### Delete conversation — `DELETE /modelconversation/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get conversation — `GET /modelconversation/{id}`
|
#### Get conversation — `GET /modelconversation/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { conversation: T29 }`
|
- Returns: `200 { conversation: T30 }`
|
||||||
#### List conversation messages — `GET /modelconversation/{id}/message`
|
#### List conversation messages — `GET /modelconversation/{id}/message`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { messages: { id: int, conversation_id: int, created_at: str, role: str, message: str }[] }`
|
- Returns: `200 { messages: { id: int, conversation_id: int, created_at: str, role: str, message: str }[] }`
|
||||||
@@ -537,31 +540,31 @@ _none_
|
|||||||
|
|
||||||
#### List orders — `GET /order`
|
#### List orders — `GET /order`
|
||||||
- Params: `query: offset?: int, limit?: int`
|
- Params: `query: offset?: int, limit?: int`
|
||||||
- Returns: `200 { orders: T11[], total: int, offset: int, limit: int }`
|
- Returns: `200 { orders: T4[], total: int, offset: int, limit: int }`
|
||||||
#### Create order — `POST /order`
|
#### Create order — `POST /order`
|
||||||
- Params: `body: { number: str, date: str, lines: T25[], entityId?: int|null }`
|
- Params: `body: { number: str, date: str, lines: T26[], entityId?: int|null }`
|
||||||
- Returns: `201 T7`
|
- Returns: `201 T3`
|
||||||
#### Delete order — `DELETE /order/{id}`
|
#### Delete order — `DELETE /order/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get order — `GET /order/{id}`
|
#### Get order — `GET /order/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T7`
|
- Returns: `200 T3`
|
||||||
#### Update order — `PATCH /order/{id}`
|
#### Update order — `PATCH /order/{id}`
|
||||||
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T25[] }`
|
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T26[] }`
|
||||||
- Returns: `200 T7`
|
- Returns: `200 T3`
|
||||||
#### List payments of an order — `GET /order/{id}/payment`
|
#### List payments of an order — `GET /order/{id}/payment`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { payments: { id: int, accountId: int, manifestId: int, type: str, amount: num }[] }`
|
- Returns: `200 { payments: T35[] }`
|
||||||
#### Add payment to an order — `POST /order/{id}/payment`
|
#### Add payment to an order — `POST /order/{id}/payment`
|
||||||
- Params: `id: int, body: { accountId: int, type: str, amount: num }`
|
- Params: `id: int, body: { accountId: int, type: str, amount: num }`
|
||||||
- Returns: `201 { payment: { id: int, accountId: int, manifestId: int, type: str, amount: num } }`
|
- Returns: `201 { payment: T35 }`
|
||||||
#### List shippings of an order — `GET /order/{id}/shipping`
|
#### List shippings of an order — `GET /order/{id}/shipping`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { shippings: { id: int, manifestId: int, number: str, type: str, state: str }[] }`
|
- Returns: `200 { shippings: T39[] }`
|
||||||
#### Create shipping for an order — `POST /order/{id}/shipping`
|
#### Create shipping for an order — `POST /order/{id}/shipping`
|
||||||
- Params: `id: int, body: { type: str, state: str }`
|
- Params: `id: int, body: { type: str, state: str }`
|
||||||
- Returns: `201 { shipping: { id: int, manifestId: int, number: str, type: str, state: str } }`
|
- Returns: `201 { shipping: T39 }`
|
||||||
|
|
||||||
### Section: /package
|
### Section: /package
|
||||||
|
|
||||||
@@ -579,37 +582,37 @@ _none_
|
|||||||
|
|
||||||
#### List POS terminals — `GET /posterminal`
|
#### List POS terminals — `GET /posterminal`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { posterminals: T10[] }`
|
- Returns: `200 { posterminals: T11[] }`
|
||||||
#### Create POS terminal — `PUT /posterminal`
|
#### Create POS terminal — `PUT /posterminal`
|
||||||
- Params: `body: { name: str, rootCategoryId?: int|null, syncRootArticles?: bool }`
|
- Params: `body: { name: str, rootCategoryId?: int|null, syncRootArticles?: bool }`
|
||||||
- Returns: `200 { posterminal: T10 }`
|
- Returns: `200 { posterminal: T11 }`
|
||||||
#### Delete POS terminal — `DELETE /posterminal/{id}`
|
#### Delete POS terminal — `DELETE /posterminal/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update POS terminal — `PATCH /posterminal/{id}`
|
#### Update POS terminal — `PATCH /posterminal/{id}`
|
||||||
- Params: `id: int, body: { name?: str, rootCategoryId?: int|null, syncRootArticles?: bool, pairingpin?: str|null }`
|
- Params: `id: int, body: { name?: str, rootCategoryId?: int|null, syncRootArticles?: bool, pairingpin?: str|null }`
|
||||||
- Returns: `200 { posterminal: T10 }`
|
- Returns: `200 { posterminal: T11 }`
|
||||||
#### Disable all categories on terminal — `DELETE /posterminal/{id}/all`
|
#### Disable all categories on terminal — `DELETE /posterminal/{id}/all`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T45`
|
- Returns: `200 T48`
|
||||||
#### Enable all categories on terminal — `PUT /posterminal/{id}/all`
|
#### Enable all categories on terminal — `PUT /posterminal/{id}/all`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T45`
|
- Returns: `200 T48`
|
||||||
#### Disable category on terminal — `DELETE /posterminal/{id}/category/{categoryId}`
|
#### Disable category on terminal — `DELETE /posterminal/{id}/category/{categoryId}`
|
||||||
- Params: `id: int, categoryId: int`
|
- Params: `id: int, categoryId: int`
|
||||||
- Returns: `200 T45`
|
- Returns: `200 T48`
|
||||||
#### Enable category on terminal — `PUT /posterminal/{id}/category/{categoryId}`
|
#### Enable category on terminal — `PUT /posterminal/{id}/category/{categoryId}`
|
||||||
- Params: `id: int, categoryId: int`
|
- Params: `id: int, categoryId: int`
|
||||||
- Returns: `200 T45`
|
- Returns: `200 T48`
|
||||||
|
|
||||||
### Section: /printer
|
### Section: /printer
|
||||||
|
|
||||||
#### List printers — `GET /printer`
|
#### List printers — `GET /printer`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { printers: T24[] }`
|
- Returns: `200 { printers: T25[] }`
|
||||||
#### Create printer — `POST /printer`
|
#### Create printer — `POST /printer`
|
||||||
- Params: `body: { address: str, type: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }`
|
- Params: `body: { address: str, type: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }`
|
||||||
- Returns: `201 T19`
|
- Returns: `201 T20`
|
||||||
#### Reorder printers — `PUT /printer/order`
|
#### Reorder printers — `PUT /printer/order`
|
||||||
- Params: `body: { printerIds: int[] }`
|
- Params: `body: { printerIds: int[] }`
|
||||||
- Returns: `200 { printerIds: int[] }`
|
- Returns: `200 { printerIds: int[] }`
|
||||||
@@ -618,22 +621,22 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get printer by ID — `GET /printer/{id}`
|
#### Get printer by ID — `GET /printer/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T19`
|
- Returns: `200 T20`
|
||||||
#### Update printer (partial) — `PATCH /printer/{id}`
|
#### 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 }`
|
- Params: `id: int, body: { address?: str, type?: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }`
|
||||||
- Returns: `200 T19`
|
- Returns: `200 T20`
|
||||||
#### Update printer — `PUT /printer/{id}`
|
#### Update printer — `PUT /printer/{id}`
|
||||||
- Params: `id: int, body: { address?: str, type?: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }`
|
- Params: `id: int, body: { address?: str, type?: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }`
|
||||||
- Returns: `200 T19`
|
- Returns: `200 T20`
|
||||||
|
|
||||||
### Section: /propertyname
|
### Section: /propertyname
|
||||||
|
|
||||||
#### List property names — `GET /propertyname`
|
#### List property names — `GET /propertyname`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { propertynames: T33[] }`
|
- Returns: `200 { propertynames: T34[] }`
|
||||||
#### Create property name — `POST /propertyname`
|
#### Create property name — `POST /propertyname`
|
||||||
- Params: `body: { name: str, sort?: int, exclusive?: bool }`
|
- Params: `body: { name: str, sort?: int, exclusive?: bool }`
|
||||||
- Returns: `201 { propertyname: T33 }`
|
- Returns: `201 { propertyname: T34 }`
|
||||||
#### Reorder property names — `PUT /propertyname/order`
|
#### Reorder property names — `PUT /propertyname/order`
|
||||||
- Params: `body: { propertynameIds: int[] }`
|
- Params: `body: { propertynameIds: int[] }`
|
||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
@@ -642,7 +645,7 @@ _none_
|
|||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
#### Update property name — `PATCH /propertyname/{id}`
|
#### Update property name — `PATCH /propertyname/{id}`
|
||||||
- Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }`
|
- Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }`
|
||||||
- Returns: `200 { propertyname: T33 }`
|
- Returns: `200 { propertyname: T34 }`
|
||||||
|
|
||||||
### Section: /public
|
### Section: /public
|
||||||
|
|
||||||
@@ -665,17 +668,17 @@ _none_
|
|||||||
_none_
|
_none_
|
||||||
- Returns: `200 { quotes: { id: int, number: str, type: str, entityId: int|null, date: str, createdAt?: str }[] }`
|
- Returns: `200 { quotes: { id: int, number: str, type: str, entityId: int|null, date: str, createdAt?: str }[] }`
|
||||||
#### Create quote — `POST /quote`
|
#### Create quote — `POST /quote`
|
||||||
- Params: `body: { number: str, date: str, lines: T25[], entityId?: int|null }`
|
- Params: `body: { number: str, date: str, lines: T26[], entityId?: int|null }`
|
||||||
- Returns: `201 T8`
|
- Returns: `201 T9`
|
||||||
#### Delete quote — `DELETE /quote/{id}`
|
#### Delete quote — `DELETE /quote/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get quote — `GET /quote/{id}`
|
#### Get quote — `GET /quote/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T8`
|
- Returns: `200 T9`
|
||||||
#### Update quote — `PATCH /quote/{id}`
|
#### Update quote — `PATCH /quote/{id}`
|
||||||
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T25[] }`
|
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T26[] }`
|
||||||
- Returns: `200 T8`
|
- Returns: `200 T9`
|
||||||
|
|
||||||
### Section: /serper
|
### Section: /serper
|
||||||
|
|
||||||
@@ -714,28 +717,28 @@ _none_
|
|||||||
|
|
||||||
#### Adjust stock manually — `POST /stock/adjust`
|
#### Adjust stock manually — `POST /stock/adjust`
|
||||||
- Params: `body: { sku?: str, warehouseId?: int, amount?: num, text?: str|null, lines?: { sku: str, amount: num, warehouseId?: int, text?: str }[] }`
|
- Params: `body: { sku?: str, warehouseId?: int, amount?: num, text?: str|null, lines?: { sku: str, amount: num, warehouseId?: int, text?: str }[] }`
|
||||||
- Returns: `201 { manifest: { id: int, number: str, type: str, date: str, createdAt: str }, lines: { manifestarticle_id: int, sku: str, name: str, warehouse_id: int, amount: num, text: str }[], ledger: T15[] }`
|
- Returns: `201 { manifest: { id: int, number: str, type: str, date: str, createdAt: str }, lines: { manifestarticle_id: int, sku: str, name: str, warehouse_id: int, amount: num, text: str }[], ledger: T16[] }`
|
||||||
|
|
||||||
### Section: /supplier
|
### Section: /supplier
|
||||||
|
|
||||||
#### List suppliers — `GET /supplier`
|
#### List suppliers — `GET /supplier`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { suppliers: T40[] }`
|
- Returns: `200 { suppliers: T43[] }`
|
||||||
#### Create supplier — `POST /supplier`
|
#### Create supplier — `POST /supplier`
|
||||||
- Params: `body: { name: str }`
|
- Params: `body: { name: str }`
|
||||||
- Returns: `201 { supplier: T40 }`
|
- Returns: `201 { supplier: T43 }`
|
||||||
#### Delete supplier — `DELETE /supplier/{id}`
|
#### Delete supplier — `DELETE /supplier/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update supplier — `PATCH /supplier/{id}`
|
#### Update supplier — `PATCH /supplier/{id}`
|
||||||
- Params: `id: int, body: { name: str }`
|
- Params: `id: int, body: { name: str }`
|
||||||
- Returns: `200 { supplier: T40 }`
|
- Returns: `200 { supplier: T43 }`
|
||||||
#### List supplier articles by SKUs — `GET /supplier/{id}/articles`
|
#### List supplier articles by SKUs — `GET /supplier/{id}/articles`
|
||||||
- Params: `id: int, query: skus?: string`
|
- Params: `id: int, query: skus?: string`
|
||||||
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, pu: num, sort: int, article: { id: int, sku: str, name?: str|null, slug?: str|null, photos?: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans?: str[] }, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T43|null }[] }`
|
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, pu: num, sort: int, article: { id: int, sku: str, name?: str|null, slug?: str|null, photos?: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans?: str[] }, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T46|null }[] }`
|
||||||
#### Query supplier articles by SKUs (bulk) — `POST /supplier/{id}/articles`
|
#### Query supplier articles by SKUs (bulk) — `POST /supplier/{id}/articles`
|
||||||
- Params: `id: int, body?: { skus?: str[] }`
|
- Params: `id: int, body?: { skus?: str[] }`
|
||||||
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, pu: num, sort: int, article: { id: int, sku: str, name?: str|null, slug?: str|null, photos?: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans?: str[] }, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T43|null }[] }`
|
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, pu: num, sort: int, article: { id: int, sku: str, name?: str|null, slug?: str|null, photos?: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans?: str[] }, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T46|null }[] }`
|
||||||
|
|
||||||
### Section: /thumb
|
### Section: /thumb
|
||||||
|
|
||||||
@@ -750,10 +753,10 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### List units — `GET /unit`
|
#### List units — `GET /unit`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { units: T31[] }`
|
- Returns: `200 { units: T32[] }`
|
||||||
#### Upsert unit — `PUT /unit`
|
#### Upsert unit — `PUT /unit`
|
||||||
- Params: `body: { si: str, basesi: str, basesifactor: num, symbol: str, name: str }`
|
- Params: `body: { si: str, basesi: str, basesifactor: num, symbol: str, name: str }`
|
||||||
- Returns: `200 { unit: T31 }`
|
- Returns: `200 { unit: T32 }`
|
||||||
|
|
||||||
### Section: /v1
|
### Section: /v1
|
||||||
|
|
||||||
@@ -804,10 +807,10 @@ _none_
|
|||||||
|
|
||||||
#### List warehouses — `GET /warehouse`
|
#### List warehouses — `GET /warehouse`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { warehouses: T44[] }`
|
- Returns: `200 { warehouses: T47[] }`
|
||||||
#### Create warehouse — `POST /warehouse`
|
#### Create warehouse — `POST /warehouse`
|
||||||
- Params: `body: { name: str, sort?: int }`
|
- Params: `body: { name: str, sort?: int }`
|
||||||
- Returns: `201 T42`
|
- Returns: `201 T45`
|
||||||
#### Reorder warehouses — `PUT /warehouse/order`
|
#### Reorder warehouses — `PUT /warehouse/order`
|
||||||
- Params: `body: { warehouseIds: int[] }`
|
- Params: `body: { warehouseIds: int[] }`
|
||||||
- Returns: `200 { warehouseIds: int[] }`
|
- Returns: `200 { warehouseIds: int[] }`
|
||||||
@@ -816,10 +819,10 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get warehouse by ID — `GET /warehouse/{id}`
|
#### Get warehouse by ID — `GET /warehouse/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T42`
|
- Returns: `200 T45`
|
||||||
#### Update warehouse (partial) — `PATCH /warehouse/{id}`
|
#### Update warehouse (partial) — `PATCH /warehouse/{id}`
|
||||||
- Params: `id: int, body: { name?: str, sort?: int }`
|
- Params: `id: int, body: { name?: str, sort?: int }`
|
||||||
- Returns: `200 T42`
|
- Returns: `200 T45`
|
||||||
#### Update warehouse — `PUT /warehouse/{id}`
|
#### Update warehouse — `PUT /warehouse/{id}`
|
||||||
- Params: `id: int, body: { name?: str, sort?: int }`
|
- Params: `id: int, body: { name?: str, sort?: int }`
|
||||||
- Returns: `200 T42`
|
- Returns: `200 T45`
|
||||||
|
|||||||
@@ -10,45 +10,48 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
|
|||||||
### Reusable types
|
### Reusable types
|
||||||
|
|
||||||
- `T1` = `{ article: T2 }`
|
- `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: T29, brand: T27|null, categoryIds: int[], photos: T25[], eans: str[], prices: T33[], suppliers: T11[] }`
|
- `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: T30, brand: T28|null, categoryIds: int[], photos: T26[], eans: str[], prices: T36[], suppliers: T12[] }`
|
||||||
- `T3` = `{ delivery: T4 }`
|
- `T3` = `{ order: T4 }`
|
||||||
- `T4` = `{ id: int, number: str, type: str, supplierId: int|null, date: str, lines: T20[], files: T9[], externalNumber?: str|null, createdAt?: str, ledger?: T37 }`
|
- `T4` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T21[], createdAt?: str, shipping?: T35|null, shippings?: T35[], payment?: T33|null, payments?: T33[], paid?: bool, delivered?: bool }`
|
||||||
- `T5` = `{ labeltemplate: T6 }`
|
- `T5` = `{ delivery: T6 }`
|
||||||
- `T6` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: T16, thumb?: str|null }`
|
- `T6` = `{ id: int, number: str, type: str, supplierId: int|null, date: str, lines: T21[], files: T10[], externalNumber?: str|null, createdAt?: str, ledger?: T40 }`
|
||||||
- `T7` = `{ order: T10 }`
|
- `T7` = `{ labeltemplate: T8 }`
|
||||||
- `T8` = `{ quote: T10 }`
|
- `T8` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: T17, thumb?: str|null }`
|
||||||
- `T9` = `{ 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 }`
|
- `T9` = `{ quote: T11 }`
|
||||||
- `T10` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T20[], createdAt?: str }`
|
- `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, articleId: int, entityId: int, pu: num, sort: int, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T39|null }`
|
- `T11` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T21[], createdAt?: str }`
|
||||||
- `T12` = `{ 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 }`
|
- `T12` = `{ id: int, articleId: int, entityId: int, pu: num, sort: int, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T42|null }`
|
||||||
- `T13` = `{ ledger: T14[] }`
|
- `T13` = `{ 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 }`
|
||||||
- `T14` = `{ 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 }`
|
- `T14` = `{ ledger: T15[] }`
|
||||||
- `T15` = `{ id: int, name: str, sort: int, exclusive: bool, values: T30[], articleCount?: int }`
|
- `T15` = `{ 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 }`
|
||||||
- `T16` = `{ objects: T21[] }`
|
- `T16` = `{ id: int, name: str, sort: int, exclusive: bool, values: T31[], articleCount?: int }`
|
||||||
- `T17` = `{ objects: T22[] }`
|
- `T17` = `{ objects: T22[] }`
|
||||||
- `T18` = `{ printer: T23 }`
|
- `T18` = `{ objects: T23[] }`
|
||||||
- `T19` = `{ entity: T26 }`
|
- `T19` = `{ printer: T24 }`
|
||||||
- `T20` = `{ id: int, sku: str|null, name: str|null, pu: num, amount: num, net: num, rebate: num, taxrate: num, comment: str|null }`
|
- `T20` = `{ entity: T27 }`
|
||||||
- `T21` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }`
|
- `T21` = `{ id: int, sku: str|null, name: str|null, pu: num, amount: num, net: num, rebate: num, taxrate: num, comment: str|null }`
|
||||||
- `T22` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }`
|
- `T22` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }`
|
||||||
- `T23` = `{ id: int, company_id: int, address: str, type: str, sort: int, model?: str|null, serial?: str|null, desc?: str|null }`
|
- `T23` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }`
|
||||||
- `T24` = `{ amount: num, net: num, taxrate: num, sku?: str|null, name?: str|null, pu?: num, rebate?: num, comment?: str|null }`
|
- `T24` = `{ id: int, company_id: int, address: str, type: str, sort: int, model?: str|null, serial?: str|null, desc?: str|null }`
|
||||||
- `T25` = `{ sort: int, fullHash: str, fullW: int, fullH: int, fullSize: int, thumbW: int, thumbH: int, thumbHash: str }`
|
- `T25` = `{ amount: num, net: num, taxrate: num, sku?: str|null, name?: str|null, pu?: num, rebate?: num, comment?: str|null }`
|
||||||
- `T26` = `{ id: int, customergroupId: int, firstName: str|null, name: str, number: str|null, createdAt: str, updatedAt: str }`
|
- `T26` = `{ sort: int, fullHash: str, fullW: int, fullH: int, fullSize: int, thumbW: int, thumbH: int, thumbHash: str }`
|
||||||
- `T27` = `{ name: str, id?: int|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null }`
|
- `T27` = `{ id: int, customergroupId: int, firstName: str|null, name: str, number: str|null, createdAt: str, updatedAt: str }`
|
||||||
- `T28` = `{ article: T32 }`
|
- `T28` = `{ name: str, id?: int|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null }`
|
||||||
- `T29` = `{ si: str, basesi: str, basesifactor: num, symbol?: str|null, name?: str|null }`
|
- `T29` = `{ article: T34 }`
|
||||||
- `T30` = `{ id: int, attributeId: int, value: str, sort: int, articleCount?: int }`
|
- `T30` = `{ si: str, basesi: str, basesifactor: num, symbol?: str|null, name?: str|null }`
|
||||||
- `T31` = `{ id: int, name: str, sort: int, exclusive: bool, articleCount?: int }`
|
- `T31` = `{ id: int, attributeId: int, value: str, sort: int, articleCount?: int }`
|
||||||
- `T32` = `{ id: int, categoryId: int, name: str, sku: str, track_stock: bool }`
|
- `T32` = `{ id: int, name: str, sort: int, exclusive: bool, articleCount?: int }`
|
||||||
- `T33` = `{ minmultiplier: num, net: num, taxRate: num, customergroupId: int }`
|
- `T33` = `{ id: int, accountId: int, manifestId: int, type: str, amount: num }`
|
||||||
- `T34` = `{ fullHash: str, thumbW: int, thumbH: int, thumbHash: str }`
|
- `T34` = `{ id: int, categoryId: int, name: str, sku: str, track_stock: bool }`
|
||||||
- `T35` = `{ id: int, entityId: int, contactType: str, contact: str }`
|
- `T35` = `{ id: int, manifestId: int, number: str, type: str, state: str }`
|
||||||
- `T36` = `{ id: int, name: str, createdAt: str, updatedAt: str }`
|
- `T36` = `{ minmultiplier: num, net: num, taxRate: num, customergroupId: int }`
|
||||||
- `T37` = `{ totalPositions: int, completelyOnLedgerPositions: int }`
|
- `T37` = `{ fullHash: str, thumbW: int, thumbH: int, thumbHash: str }`
|
||||||
- `T38` = `{ warehouse: T40 }`
|
- `T38` = `{ id: int, entityId: int, contactType: str, contact: str }`
|
||||||
- `T39` = `{ net: num, taxId: int, taxRate?: num|null }`
|
- `T39` = `{ id: int, name: str, createdAt: str, updatedAt: str }`
|
||||||
- `T40` = `{ id: int, name: str, sort: int }`
|
- `T40` = `{ totalPositions: int, completelyOnLedgerPositions: int }`
|
||||||
|
- `T41` = `{ warehouse: T43 }`
|
||||||
|
- `T42` = `{ net: num, taxId: int, taxRate?: num|null }`
|
||||||
|
- `T43` = `{ id: int, name: str, sort: int }`
|
||||||
|
|
||||||
### Routes
|
### Routes
|
||||||
|
|
||||||
@@ -69,7 +72,7 @@ _none_
|
|||||||
|
|
||||||
#### Create article in category — `POST /article`
|
#### Create article in category — `POST /article`
|
||||||
- Params: `body: { categoryId: int, name: str, desc?: str, seo?: str, track_stock?: bool }`
|
- Params: `body: { categoryId: int, name: str, desc?: str, seo?: str, track_stock?: bool }`
|
||||||
- Returns: `201 T28`
|
- Returns: `201 T29`
|
||||||
#### Delete article by SKU — `DELETE /article/{sku}`
|
#### Delete article by SKU — `DELETE /article/{sku}`
|
||||||
- Params: `sku: str, query: cascade?: bool`
|
- Params: `sku: str, query: cascade?: bool`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
@@ -102,10 +105,10 @@ _none_
|
|||||||
- Returns: `200 { children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }`
|
- 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`
|
#### 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 }`
|
- Params: `sku: str, body: { attributeValueId?: int, value?: str, name?: str }`
|
||||||
- Returns: `201 T28`
|
- Returns: `201 T29`
|
||||||
#### Attach an existing article as a child to a parent article — `PUT /article/{sku}/children`
|
#### 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 }`
|
- Params: `sku: str, body: { sku: str, attributeValueId?: int, value?: str, reparent?: bool }`
|
||||||
- Returns: `200 { article: T32, children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }`
|
- Returns: `200 { article: T34, children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }`
|
||||||
#### Remove a child article from a parent article — `DELETE /article/{sku}/children/{childSku}`
|
#### Remove a child article from a parent article — `DELETE /article/{sku}/children/{childSku}`
|
||||||
- Params: `sku: str, childSku: str, query: deleteArticle?: bool`
|
- Params: `sku: str, childSku: str, query: deleteArticle?: bool`
|
||||||
- Returns: `200 { success: bool, deleted: bool }`
|
- Returns: `200 { success: bool, deleted: bool }`
|
||||||
@@ -129,7 +132,7 @@ _none_
|
|||||||
- Returns: `200 { options: { id: int, articleId: int, sku: str, name: str, count: int, sort: int, mandated: bool }[] }`
|
- 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`
|
#### Toggle parent mode for an article — `POST /article/{sku}/parent`
|
||||||
- Params: `sku: str, body: { isParent: bool, attributeNameId?: int }`
|
- Params: `sku: str, body: { isParent: bool, attributeNameId?: int }`
|
||||||
- Returns: `200 T28`
|
- Returns: `200 T29`
|
||||||
#### Replace POS prices by SKU (net > gross; price=net, tax=taxRate %) — `PUT /article/{sku}/prices`
|
#### 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 }[] }`
|
- Params: `sku: str, body: { prices: { net?: num, gross?: num, price?: num, taxRate?: num, tax?: num, minmultiplier?: num }[] }`
|
||||||
- Returns: `200 T1`
|
- Returns: `200 T1`
|
||||||
@@ -147,10 +150,10 @@ _none_
|
|||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
#### List article suppliers — `GET /article/{sku}/supplier`
|
#### List article suppliers — `GET /article/{sku}/supplier`
|
||||||
- Params: `sku: str`
|
- Params: `sku: str`
|
||||||
- Returns: `200 { suppliers: T11[] }`
|
- Returns: `200 { suppliers: T12[] }`
|
||||||
#### Assign supplier to article — `POST /article/{sku}/supplier`
|
#### Assign supplier to article — `POST /article/{sku}/supplier`
|
||||||
- Params: `sku: str, body: { entityId: int, sku?: str|null, pu?: num, stock?: num|null, sort?: int|null, netPrice?: num|null, taxId?: int|null, taxRate?: num|null }`
|
- Params: `sku: str, body: { entityId: int, sku?: str|null, pu?: num, stock?: num|null, sort?: int|null, netPrice?: num|null, taxId?: int|null, taxRate?: num|null }`
|
||||||
- Returns: `201 { supplier: T11 }`
|
- Returns: `201 { supplier: T12 }`
|
||||||
#### Reorder article suppliers — `PUT /article/{sku}/supplier/order`
|
#### Reorder article suppliers — `PUT /article/{sku}/supplier/order`
|
||||||
- Params: `sku: str, body: { ids: int[] }`
|
- Params: `sku: str, body: { ids: int[] }`
|
||||||
- Returns: `200 { ids: int[] }`
|
- Returns: `200 { ids: int[] }`
|
||||||
@@ -159,7 +162,7 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update article supplier assignment — `PATCH /article/{sku}/supplier/{id}`
|
#### Update article supplier assignment — `PATCH /article/{sku}/supplier/{id}`
|
||||||
- Params: `sku: str, id: int, body: { sku?: str|null, pu?: num, stock?: num|null, sort?: int, netPrice?: num|null, taxId?: int|null, taxRate?: num|null }`
|
- Params: `sku: str, id: int, body: { sku?: str|null, pu?: num, stock?: num|null, sort?: int, netPrice?: num|null, taxId?: int|null, taxRate?: num|null }`
|
||||||
- Returns: `200 { supplier: T11 }`
|
- Returns: `200 { supplier: T12 }`
|
||||||
#### Set article track_stock flag by SKU — `PUT /article/{sku}/track_stock`
|
#### Set article track_stock flag by SKU — `PUT /article/{sku}/track_stock`
|
||||||
- Params: `sku: str, body: { track_stock: bool }`
|
- Params: `sku: str, body: { track_stock: bool }`
|
||||||
- Returns: `200 T1`
|
- Returns: `200 T1`
|
||||||
@@ -171,19 +174,19 @@ _none_
|
|||||||
|
|
||||||
#### List attribute names — `GET /attributename`
|
#### List attribute names — `GET /attributename`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { attributenames: T15[] }`
|
- Returns: `200 { attributenames: T16[] }`
|
||||||
#### Create attribute name — `POST /attributename`
|
#### Create attribute name — `POST /attributename`
|
||||||
- Params: `body: { name: str, sort?: int, exclusive?: bool }`
|
- Params: `body: { name: str, sort?: int, exclusive?: bool }`
|
||||||
- Returns: `201 { attributename: T15 }`
|
- Returns: `201 { attributename: T16 }`
|
||||||
#### Reorder attribute names — `PUT /attributename/order`
|
#### Reorder attribute names — `PUT /attributename/order`
|
||||||
- Params: `body: { attributenameIds: int[] }`
|
- Params: `body: { attributenameIds: int[] }`
|
||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
#### List values for an attribute — `GET /attributename/{attributeId}/value`
|
#### List values for an attribute — `GET /attributename/{attributeId}/value`
|
||||||
- Params: `attributeId: int`
|
- Params: `attributeId: int`
|
||||||
- Returns: `200 { values: T30[] }`
|
- Returns: `200 { values: T31[] }`
|
||||||
#### Create value for an attribute — `POST /attributename/{attributeId}/value`
|
#### Create value for an attribute — `POST /attributename/{attributeId}/value`
|
||||||
- Params: `attributeId: int, body: { value: str, sort?: int }`
|
- Params: `attributeId: int, body: { value: str, sort?: int }`
|
||||||
- Returns: `201 { attributevalue: T30 }`
|
- Returns: `201 { attributevalue: T31 }`
|
||||||
#### Reorder values of an attribute — `PUT /attributename/{attributeId}/value/order`
|
#### Reorder values of an attribute — `PUT /attributename/{attributeId}/value/order`
|
||||||
- Params: `attributeId: int, body: { attributevalueIds: int[] }`
|
- Params: `attributeId: int, body: { attributevalueIds: int[] }`
|
||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
@@ -192,7 +195,7 @@ _none_
|
|||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
#### Update attribute name — `PATCH /attributename/{id}`
|
#### Update attribute name — `PATCH /attributename/{id}`
|
||||||
- Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }`
|
- Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }`
|
||||||
- Returns: `200 { attributename: T15 }`
|
- Returns: `200 { attributename: T16 }`
|
||||||
|
|
||||||
### Section: /attributevalue
|
### Section: /attributevalue
|
||||||
|
|
||||||
@@ -201,13 +204,13 @@ _none_
|
|||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
#### Update attribute value — `PATCH /attributevalue/{id}`
|
#### Update attribute value — `PATCH /attributevalue/{id}`
|
||||||
- Params: `id: int, body: { value?: str, sort?: int }`
|
- Params: `id: int, body: { value?: str, sort?: int }`
|
||||||
- Returns: `200 { attributevalue: T30 }`
|
- Returns: `200 { attributevalue: T31 }`
|
||||||
#### Delete attribute value image — `DELETE /attributevalue/{id}/image`
|
#### Delete attribute value image — `DELETE /attributevalue/{id}/image`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { attributevalue: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T34[] } }`
|
- Returns: `200 { attributevalue: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T37[] } }`
|
||||||
#### Add or replace attribute value image — `POST /attributevalue/{id}/image`
|
#### Add or replace attribute value image — `POST /attributevalue/{id}/image`
|
||||||
- Params: `id: int, image/avif`
|
- Params: `id: int, image/avif`
|
||||||
- Returns: `201 { attributevalue: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T34[] } }`
|
- Returns: `201 { attributevalue: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T37[] } }`
|
||||||
|
|
||||||
### Section: /auth
|
### Section: /auth
|
||||||
|
|
||||||
@@ -225,7 +228,7 @@ _none_
|
|||||||
- Returns: `200 { brands: { id: int, name: str, articleCount: int, pics: { fullHash: str, thumbW: int, thumbH: int, thumbHash: str, smallThumbW?: int|null, smallThumbH?: int|null, smallThumbBinary?: str|null }[], gsprpinfo?: str|null }[], total: int, offset: int, limit: int }`
|
- Returns: `200 { brands: { id: int, name: str, articleCount: int, pics: { fullHash: str, thumbW: int, thumbH: int, thumbHash: str, smallThumbW?: int|null, smallThumbH?: int|null, smallThumbBinary?: str|null }[], gsprpinfo?: str|null }[], total: int, offset: int, limit: int }`
|
||||||
#### Create brand — `POST /brand`
|
#### Create brand — `POST /brand`
|
||||||
- Params: `body: { name: str, gsprpinfo?: str }`
|
- Params: `body: { name: str, gsprpinfo?: str }`
|
||||||
- Returns: `201 { brand: { id: int, name: str, pics: T34[], gsprpinfo?: str|null } }`
|
- Returns: `201 { brand: { id: int, name: str, pics: T37[], gsprpinfo?: str|null } }`
|
||||||
#### Delete brand — `DELETE /brand/{id}`
|
#### Delete brand — `DELETE /brand/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
@@ -234,10 +237,10 @@ _none_
|
|||||||
- Returns: `200 { brand: { id: int, name: str, touchedArticleCount: int, gsprpinfo?: str|null } }`
|
- Returns: `200 { brand: { id: int, name: str, touchedArticleCount: int, gsprpinfo?: str|null } }`
|
||||||
#### Delete brand image — `DELETE /brand/{id}/image`
|
#### Delete brand image — `DELETE /brand/{id}/image`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { brand: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T34[] } }`
|
- Returns: `200 { brand: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T37[] } }`
|
||||||
#### Add or replace brand image — `POST /brand/{id}/image`
|
#### Add or replace brand image — `POST /brand/{id}/image`
|
||||||
- Params: `id: int, image/avif`
|
- Params: `id: int, image/avif`
|
||||||
- Returns: `201 { brand: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T34[] } }`
|
- Returns: `201 { brand: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T37[] } }`
|
||||||
|
|
||||||
### Section: /category
|
### Section: /category
|
||||||
|
|
||||||
@@ -249,7 +252,7 @@ _none_
|
|||||||
- Returns: `200 { categoryIds: int[] }`
|
- Returns: `200 { categoryIds: int[] }`
|
||||||
#### Category tree — `GET /category/tree`
|
#### Category tree — `GET /category/tree`
|
||||||
_none_
|
_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?: T27|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 }[], 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 }[] }`
|
||||||
#### Delete category — `DELETE /category/{id}`
|
#### Delete category — `DELETE /category/{id}`
|
||||||
- Params: `id: int, query: recursive?: bool`
|
- Params: `id: int, query: recursive?: bool`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
@@ -258,7 +261,7 @@ _none_
|
|||||||
- Returns: `200 { category: { id: int, name: str, slug: str, parentId: int, sort: int } }`
|
- Returns: `200 { category: { id: int, name: str, slug: str, parentId: int, sort: int } }`
|
||||||
#### Articles in category — `GET /category/{id}/articles`
|
#### Articles in category — `GET /category/{id}/articles`
|
||||||
- Params: `id: int`
|
- 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?: T27|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?: T28|null }[] }`
|
||||||
#### List category attribute values — `GET /category/{id}/attributevalue`
|
#### List category attribute values — `GET /category/{id}/attributevalue`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { attributevalues: { id: int, attributeId: int, attributeName: str, attributeValueId: int, value: str, sort: int, categoryId?: int, exclusive?: bool }[] }`
|
- Returns: `200 { attributevalues: { id: int, attributeId: int, attributeName: str, attributeValueId: int, value: str, sort: int, categoryId?: int, exclusive?: bool }[] }`
|
||||||
@@ -312,7 +315,7 @@ _none_
|
|||||||
- Returns: `200 { customergroups: { id: int, name: str, sort: int, editable: bool }[] }`
|
- Returns: `200 { customergroups: { id: int, name: str, sort: int, editable: bool }[] }`
|
||||||
#### Create customer group — `POST /customergroup`
|
#### Create customer group — `POST /customergroup`
|
||||||
- Params: `body: { name: str }`
|
- Params: `body: { name: str }`
|
||||||
- Returns: `201 { customergroup: T40 }`
|
- Returns: `201 { customergroup: T43 }`
|
||||||
#### Reorder customer groups — `PUT /customergroup/order`
|
#### Reorder customer groups — `PUT /customergroup/order`
|
||||||
- Params: `body: { customergroupIds: int[] }`
|
- Params: `body: { customergroupIds: int[] }`
|
||||||
- Returns: `200 { customergroupIds: int[] }`
|
- Returns: `200 { customergroupIds: int[] }`
|
||||||
@@ -321,25 +324,25 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update customer group — `PATCH /customergroup/{id}`
|
#### Update customer group — `PATCH /customergroup/{id}`
|
||||||
- Params: `id: int, body: { name: str }`
|
- Params: `id: int, body: { name: str }`
|
||||||
- Returns: `200 { customergroup: T40 }`
|
- Returns: `200 { customergroup: T43 }`
|
||||||
|
|
||||||
### Section: /delivery
|
### Section: /delivery
|
||||||
|
|
||||||
#### List deliveries — `GET /delivery`
|
#### List deliveries — `GET /delivery`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { deliveries: { id: int, number: str, type: str, supplierId: int|null, date: str, externalNumber?: str|null, createdAt?: str, ledger?: T37 }[] }`
|
- Returns: `200 { deliveries: { id: int, number: str, type: str, supplierId: int|null, date: str, externalNumber?: str|null, createdAt?: str, ledger?: T40 }[] }`
|
||||||
#### Create delivery — `POST /delivery`
|
#### Create delivery — `POST /delivery`
|
||||||
- Params: `body: { externalNumber: str, date: str, lines: T24[], 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: T25[], 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 T3`
|
- Returns: `201 T5`
|
||||||
#### Delete delivery — `DELETE /delivery/{id}`
|
#### Delete delivery — `DELETE /delivery/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get delivery — `GET /delivery/{id}`
|
#### Get delivery — `GET /delivery/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T3`
|
- Returns: `200 T5`
|
||||||
#### Update delivery — `PATCH /delivery/{id}`
|
#### Update delivery — `PATCH /delivery/{id}`
|
||||||
- Params: `id: int, body: { externalNumber?: str|null, date?: str, supplierId?: int|null, lines?: T24[], 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?: T25[], files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: { [k]: str } }[] }`
|
||||||
- Returns: `200 T3`
|
- Returns: `200 T5`
|
||||||
#### Get delivery attachment file content — `GET /delivery/{id}/file/{fileId}`
|
#### Get delivery attachment file content — `GET /delivery/{id}/file/{fileId}`
|
||||||
- Params: `id: int, fileId: int, query: download?: bool`
|
- Params: `id: int, fileId: int, query: download?: bool`
|
||||||
- Returns: `200 str`
|
- Returns: `200 str`
|
||||||
@@ -348,46 +351,46 @@ _none_
|
|||||||
|
|
||||||
#### List entities — `GET /entity`
|
#### List entities — `GET /entity`
|
||||||
- Params: `query: customergroupId?: int, role?: str`
|
- Params: `query: customergroupId?: int, role?: str`
|
||||||
- Returns: `200 { entities: T26[] }`
|
- Returns: `200 { entities: T27[] }`
|
||||||
#### Create entity — `POST /entity`
|
#### Create entity — `POST /entity`
|
||||||
- Params: `body: { customergroupId: int, name: str, firstName?: str|null, number?: str }`
|
- Params: `body: { customergroupId: int, name: str, firstName?: str|null, number?: str }`
|
||||||
- Returns: `201 T19`
|
- Returns: `201 T20`
|
||||||
#### Peek next customer number — `GET /entity/next-number`
|
#### Peek next customer number — `GET /entity/next-number`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { number: str }`
|
- Returns: `200 { number: str }`
|
||||||
#### List entity addresses — `GET /entity/{entityId}/address`
|
#### List entity addresses — `GET /entity/{entityId}/address`
|
||||||
- Params: `entityId: int`
|
- Params: `entityId: int`
|
||||||
- Returns: `200 { addresses: T12[] }`
|
- Returns: `200 { addresses: T13[] }`
|
||||||
#### Create entity address — `POST /entity/{entityId}/address`
|
#### Create entity address — `POST /entity/{entityId}/address`
|
||||||
- Params: `entityId: int, body: { addressType: str, firstName?: str|null, name?: str|null, street?: str|null, streetNumber?: str|null, zip?: str|null, city?: str|null, county?: str|null }`
|
- Params: `entityId: int, body: { addressType: str, firstName?: str|null, name?: str|null, street?: str|null, streetNumber?: str|null, zip?: str|null, city?: str|null, county?: str|null }`
|
||||||
- Returns: `201 { address: T12 }`
|
- Returns: `201 { address: T13 }`
|
||||||
#### Delete entity address — `DELETE /entity/{entityId}/address/{id}`
|
#### Delete entity address — `DELETE /entity/{entityId}/address/{id}`
|
||||||
- Params: `entityId: int, id: int`
|
- Params: `entityId: int, id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update entity address — `PATCH /entity/{entityId}/address/{id}`
|
#### Update entity address — `PATCH /entity/{entityId}/address/{id}`
|
||||||
- Params: `entityId: int, id: int, body: { addressType?: str, firstName?: str|null, name?: str|null, street?: str|null, streetNumber?: str|null, zip?: str|null, city?: str|null, county?: str|null }`
|
- Params: `entityId: int, id: int, body: { addressType?: str, firstName?: str|null, name?: str|null, street?: str|null, streetNumber?: str|null, zip?: str|null, city?: str|null, county?: str|null }`
|
||||||
- Returns: `200 { address: T12 }`
|
- Returns: `200 { address: T13 }`
|
||||||
#### List entity contacts — `GET /entity/{entityId}/contact`
|
#### List entity contacts — `GET /entity/{entityId}/contact`
|
||||||
- Params: `entityId: int`
|
- Params: `entityId: int`
|
||||||
- Returns: `200 { contacts: T35[] }`
|
- Returns: `200 { contacts: T38[] }`
|
||||||
#### Create entity contact — `POST /entity/{entityId}/contact`
|
#### Create entity contact — `POST /entity/{entityId}/contact`
|
||||||
- Params: `entityId: int, body: { contactType: str, contact: str }`
|
- Params: `entityId: int, body: { contactType: str, contact: str }`
|
||||||
- Returns: `201 { contact: T35 }`
|
- Returns: `201 { contact: T38 }`
|
||||||
#### Delete entity contact — `DELETE /entity/{entityId}/contact/{id}`
|
#### Delete entity contact — `DELETE /entity/{entityId}/contact/{id}`
|
||||||
- Params: `entityId: int, id: int`
|
- Params: `entityId: int, id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update entity contact — `PATCH /entity/{entityId}/contact/{id}`
|
#### Update entity contact — `PATCH /entity/{entityId}/contact/{id}`
|
||||||
- Params: `entityId: int, id: int, body: { contactType?: str, contact?: str }`
|
- Params: `entityId: int, id: int, body: { contactType?: str, contact?: str }`
|
||||||
- Returns: `200 { contact: T35 }`
|
- Returns: `200 { contact: T38 }`
|
||||||
#### Delete entity — `DELETE /entity/{id}`
|
#### Delete entity — `DELETE /entity/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get entity — `GET /entity/{id}`
|
#### Get entity — `GET /entity/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T19`
|
- Returns: `200 T20`
|
||||||
#### Update entity — `PATCH /entity/{id}`
|
#### Update entity — `PATCH /entity/{id}`
|
||||||
- Params: `id: int, body: { name?: str, firstName?: str|null, number?: str|null }`
|
- Params: `id: int, body: { name?: str, firstName?: str|null, number?: str|null }`
|
||||||
- Returns: `200 T19`
|
- Returns: `200 T20`
|
||||||
|
|
||||||
### Section: /labeltemplate
|
### Section: /labeltemplate
|
||||||
|
|
||||||
@@ -395,35 +398,35 @@ _none_
|
|||||||
_none_
|
_none_
|
||||||
- Returns: `200 { labeltemplates: { id: int, name: str, width: num, height: num, dpi: int, type: str, thumb?: str|null }[] }`
|
- Returns: `200 { labeltemplates: { id: int, name: str, width: num, height: num, dpi: int, type: str, thumb?: str|null }[] }`
|
||||||
#### Create label template — `POST /labeltemplate`
|
#### Create label template — `POST /labeltemplate`
|
||||||
- Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: T17 }`
|
- Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: T18 }`
|
||||||
- Returns: `201 T5`
|
- Returns: `201 T7`
|
||||||
#### Delete label template — `DELETE /labeltemplate/{id}`
|
#### Delete label template — `DELETE /labeltemplate/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get label template by ID — `GET /labeltemplate/{id}`
|
#### Get label template by ID — `GET /labeltemplate/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T5`
|
- Returns: `200 T7`
|
||||||
#### Update label template (partial) — `PATCH /labeltemplate/{id}`
|
#### Update label template (partial) — `PATCH /labeltemplate/{id}`
|
||||||
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T17 }`
|
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T18 }`
|
||||||
- Returns: `200 T5`
|
- Returns: `200 T7`
|
||||||
#### Update label template — `PUT /labeltemplate/{id}`
|
#### Update label template — `PUT /labeltemplate/{id}`
|
||||||
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T17 }`
|
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: T18 }`
|
||||||
- Returns: `200 T5`
|
- Returns: `200 T7`
|
||||||
|
|
||||||
### Section: /ledger
|
### Section: /ledger
|
||||||
|
|
||||||
#### Query ledger by manifest article ID or SKU — `GET /ledger`
|
#### Query ledger by manifest article ID or SKU — `GET /ledger`
|
||||||
- Params: `query: manifestarticle_id?: int, sku?: str, transaction_type?: str`
|
- Params: `query: manifestarticle_id?: int, sku?: str, transaction_type?: str`
|
||||||
- Returns: `200 T13`
|
- Returns: `200 T14`
|
||||||
#### Add ledger entry — `POST /ledger`
|
#### Add ledger entry — `POST /ledger`
|
||||||
- Params: `body: { manifestarticle_id: int, transaction_type: str, amount: num, transaction_text: str }`
|
- Params: `body: { manifestarticle_id: int, transaction_type: str, amount: num, transaction_text: str }`
|
||||||
- Returns: `201 { ledger: T14 }`
|
- Returns: `201 { ledger: T15 }`
|
||||||
#### Query ledger by manifest article ID — `GET /ledger/manifestarticle/{manifestarticleId}`
|
#### Query ledger by manifest article ID — `GET /ledger/manifestarticle/{manifestarticleId}`
|
||||||
- Params: `manifestarticleId: int, query: transaction_type?: str`
|
- Params: `manifestarticleId: int, query: transaction_type?: str`
|
||||||
- Returns: `200 T13`
|
- Returns: `200 T14`
|
||||||
#### Query ledger by article SKU — `GET /ledger/sku/{sku}`
|
#### Query ledger by article SKU — `GET /ledger/sku/{sku}`
|
||||||
- Params: `sku: str, query: transaction_type?: str`
|
- Params: `sku: str, query: transaction_type?: str`
|
||||||
- Returns: `200 T13`
|
- Returns: `200 T14`
|
||||||
|
|
||||||
### Section: /number
|
### Section: /number
|
||||||
|
|
||||||
@@ -438,31 +441,31 @@ _none_
|
|||||||
|
|
||||||
#### List orders — `GET /order`
|
#### List orders — `GET /order`
|
||||||
- Params: `query: offset?: int, limit?: int`
|
- Params: `query: offset?: int, limit?: int`
|
||||||
- Returns: `200 { orders: T10[], total: int, offset: int, limit: int }`
|
- Returns: `200 { orders: T4[], total: int, offset: int, limit: int }`
|
||||||
#### Create order — `POST /order`
|
#### Create order — `POST /order`
|
||||||
- Params: `body: { number: str, date: str, lines: T24[], entityId?: int|null }`
|
- Params: `body: { number: str, date: str, lines: T25[], entityId?: int|null }`
|
||||||
- Returns: `201 T7`
|
- Returns: `201 T3`
|
||||||
#### Delete order — `DELETE /order/{id}`
|
#### Delete order — `DELETE /order/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get order — `GET /order/{id}`
|
#### Get order — `GET /order/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T7`
|
- Returns: `200 T3`
|
||||||
#### Update order — `PATCH /order/{id}`
|
#### Update order — `PATCH /order/{id}`
|
||||||
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T24[] }`
|
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T25[] }`
|
||||||
- Returns: `200 T7`
|
- Returns: `200 T3`
|
||||||
#### List payments of an order — `GET /order/{id}/payment`
|
#### List payments of an order — `GET /order/{id}/payment`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { payments: { id: int, accountId: int, manifestId: int, type: str, amount: num }[] }`
|
- Returns: `200 { payments: T33[] }`
|
||||||
#### Add payment to an order — `POST /order/{id}/payment`
|
#### Add payment to an order — `POST /order/{id}/payment`
|
||||||
- Params: `id: int, body: { accountId: int, type: str, amount: num }`
|
- Params: `id: int, body: { accountId: int, type: str, amount: num }`
|
||||||
- Returns: `201 { payment: { id: int, accountId: int, manifestId: int, type: str, amount: num } }`
|
- Returns: `201 { payment: T33 }`
|
||||||
#### List shippings of an order — `GET /order/{id}/shipping`
|
#### List shippings of an order — `GET /order/{id}/shipping`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 { shippings: { id: int, manifestId: int, number: str, type: str, state: str }[] }`
|
- Returns: `200 { shippings: T35[] }`
|
||||||
#### Create shipping for an order — `POST /order/{id}/shipping`
|
#### Create shipping for an order — `POST /order/{id}/shipping`
|
||||||
- Params: `id: int, body: { type: str, state: str }`
|
- Params: `id: int, body: { type: str, state: str }`
|
||||||
- Returns: `201 { shipping: { id: int, manifestId: int, number: str, type: str, state: str } }`
|
- Returns: `201 { shipping: T35 }`
|
||||||
|
|
||||||
### Section: /package
|
### Section: /package
|
||||||
|
|
||||||
@@ -480,10 +483,10 @@ _none_
|
|||||||
|
|
||||||
#### List printers — `GET /printer`
|
#### List printers — `GET /printer`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { printers: T23[] }`
|
- Returns: `200 { printers: T24[] }`
|
||||||
#### Create printer — `POST /printer`
|
#### Create printer — `POST /printer`
|
||||||
- Params: `body: { address: str, type: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }`
|
- Params: `body: { address: str, type: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }`
|
||||||
- Returns: `201 T18`
|
- Returns: `201 T19`
|
||||||
#### Reorder printers — `PUT /printer/order`
|
#### Reorder printers — `PUT /printer/order`
|
||||||
- Params: `body: { printerIds: int[] }`
|
- Params: `body: { printerIds: int[] }`
|
||||||
- Returns: `200 { printerIds: int[] }`
|
- Returns: `200 { printerIds: int[] }`
|
||||||
@@ -492,22 +495,22 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get printer by ID — `GET /printer/{id}`
|
#### Get printer by ID — `GET /printer/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T18`
|
- Returns: `200 T19`
|
||||||
#### Update printer (partial) — `PATCH /printer/{id}`
|
#### 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 }`
|
- Params: `id: int, body: { address?: str, type?: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }`
|
||||||
- Returns: `200 T18`
|
- Returns: `200 T19`
|
||||||
#### Update printer — `PUT /printer/{id}`
|
#### Update printer — `PUT /printer/{id}`
|
||||||
- Params: `id: int, body: { address?: str, type?: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }`
|
- Params: `id: int, body: { address?: str, type?: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }`
|
||||||
- Returns: `200 T18`
|
- Returns: `200 T19`
|
||||||
|
|
||||||
### Section: /propertyname
|
### Section: /propertyname
|
||||||
|
|
||||||
#### List property names — `GET /propertyname`
|
#### List property names — `GET /propertyname`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { propertynames: T31[] }`
|
- Returns: `200 { propertynames: T32[] }`
|
||||||
#### Create property name — `POST /propertyname`
|
#### Create property name — `POST /propertyname`
|
||||||
- Params: `body: { name: str, sort?: int, exclusive?: bool }`
|
- Params: `body: { name: str, sort?: int, exclusive?: bool }`
|
||||||
- Returns: `201 { propertyname: T31 }`
|
- Returns: `201 { propertyname: T32 }`
|
||||||
#### Reorder property names — `PUT /propertyname/order`
|
#### Reorder property names — `PUT /propertyname/order`
|
||||||
- Params: `body: { propertynameIds: int[] }`
|
- Params: `body: { propertynameIds: int[] }`
|
||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
@@ -516,7 +519,7 @@ _none_
|
|||||||
- Returns: `200 { ok: bool }`
|
- Returns: `200 { ok: bool }`
|
||||||
#### Update property name — `PATCH /propertyname/{id}`
|
#### Update property name — `PATCH /propertyname/{id}`
|
||||||
- Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }`
|
- Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }`
|
||||||
- Returns: `200 { propertyname: T31 }`
|
- Returns: `200 { propertyname: T32 }`
|
||||||
|
|
||||||
### Section: /quote
|
### Section: /quote
|
||||||
|
|
||||||
@@ -524,17 +527,17 @@ _none_
|
|||||||
_none_
|
_none_
|
||||||
- Returns: `200 { quotes: { id: int, number: str, type: str, entityId: int|null, date: str, createdAt?: str }[] }`
|
- Returns: `200 { quotes: { id: int, number: str, type: str, entityId: int|null, date: str, createdAt?: str }[] }`
|
||||||
#### Create quote — `POST /quote`
|
#### Create quote — `POST /quote`
|
||||||
- Params: `body: { number: str, date: str, lines: T24[], entityId?: int|null }`
|
- Params: `body: { number: str, date: str, lines: T25[], entityId?: int|null }`
|
||||||
- Returns: `201 T8`
|
- Returns: `201 T9`
|
||||||
#### Delete quote — `DELETE /quote/{id}`
|
#### Delete quote — `DELETE /quote/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get quote — `GET /quote/{id}`
|
#### Get quote — `GET /quote/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T8`
|
- Returns: `200 T9`
|
||||||
#### Update quote — `PATCH /quote/{id}`
|
#### Update quote — `PATCH /quote/{id}`
|
||||||
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T24[] }`
|
- Params: `id: int, body: { number?: str, date?: str, entityId?: int|null, lines?: T25[] }`
|
||||||
- Returns: `200 T8`
|
- Returns: `200 T9`
|
||||||
|
|
||||||
### Section: /shipping
|
### Section: /shipping
|
||||||
|
|
||||||
@@ -558,28 +561,28 @@ _none_
|
|||||||
|
|
||||||
#### Adjust stock manually — `POST /stock/adjust`
|
#### Adjust stock manually — `POST /stock/adjust`
|
||||||
- Params: `body: { sku?: str, warehouseId?: int, amount?: num, text?: str|null, lines?: { sku: str, amount: num, warehouseId?: int, text?: str }[] }`
|
- Params: `body: { sku?: str, warehouseId?: int, amount?: num, text?: str|null, lines?: { sku: str, amount: num, warehouseId?: int, text?: str }[] }`
|
||||||
- Returns: `201 { manifest: { id: int, number: str, type: str, date: str, createdAt: str }, lines: { manifestarticle_id: int, sku: str, name: str, warehouse_id: int, amount: num, text: str }[], ledger: T14[] }`
|
- Returns: `201 { manifest: { id: int, number: str, type: str, date: str, createdAt: str }, lines: { manifestarticle_id: int, sku: str, name: str, warehouse_id: int, amount: num, text: str }[], ledger: T15[] }`
|
||||||
|
|
||||||
### Section: /supplier
|
### Section: /supplier
|
||||||
|
|
||||||
#### List suppliers — `GET /supplier`
|
#### List suppliers — `GET /supplier`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { suppliers: T36[] }`
|
- Returns: `200 { suppliers: T39[] }`
|
||||||
#### Create supplier — `POST /supplier`
|
#### Create supplier — `POST /supplier`
|
||||||
- Params: `body: { name: str }`
|
- Params: `body: { name: str }`
|
||||||
- Returns: `201 { supplier: T36 }`
|
- Returns: `201 { supplier: T39 }`
|
||||||
#### Delete supplier — `DELETE /supplier/{id}`
|
#### Delete supplier — `DELETE /supplier/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Update supplier — `PATCH /supplier/{id}`
|
#### Update supplier — `PATCH /supplier/{id}`
|
||||||
- Params: `id: int, body: { name: str }`
|
- Params: `id: int, body: { name: str }`
|
||||||
- Returns: `200 { supplier: T36 }`
|
- Returns: `200 { supplier: T39 }`
|
||||||
#### List supplier articles by SKUs — `GET /supplier/{id}/articles`
|
#### List supplier articles by SKUs — `GET /supplier/{id}/articles`
|
||||||
- Params: `id: int, query: skus?: string`
|
- Params: `id: int, query: skus?: string`
|
||||||
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, pu: num, sort: int, article: { id: int, sku: str, name?: str|null, slug?: str|null, photos?: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans?: str[] }, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T39|null }[] }`
|
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, pu: num, sort: int, article: { id: int, sku: str, name?: str|null, slug?: str|null, photos?: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans?: str[] }, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T42|null }[] }`
|
||||||
#### Query supplier articles by SKUs (bulk) — `POST /supplier/{id}/articles`
|
#### Query supplier articles by SKUs (bulk) — `POST /supplier/{id}/articles`
|
||||||
- Params: `id: int, body?: { skus?: str[] }`
|
- Params: `id: int, body?: { skus?: str[] }`
|
||||||
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, pu: num, sort: int, article: { id: int, sku: str, name?: str|null, slug?: str|null, photos?: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans?: str[] }, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T39|null }[] }`
|
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, pu: num, sort: int, article: { id: int, sku: str, name?: str|null, slug?: str|null, photos?: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans?: str[] }, supplierName?: str|null, sku?: str|null, stock?: num|null, priceId?: int|null, price?: T42|null }[] }`
|
||||||
|
|
||||||
### Section: /unit
|
### Section: /unit
|
||||||
|
|
||||||
@@ -588,19 +591,19 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### List units — `GET /unit`
|
#### List units — `GET /unit`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { units: T29[] }`
|
- Returns: `200 { units: T30[] }`
|
||||||
#### Upsert unit — `PUT /unit`
|
#### Upsert unit — `PUT /unit`
|
||||||
- Params: `body: { si: str, basesi: str, basesifactor: num, symbol: str, name: str }`
|
- Params: `body: { si: str, basesi: str, basesifactor: num, symbol: str, name: str }`
|
||||||
- Returns: `200 { unit: T29 }`
|
- Returns: `200 { unit: T30 }`
|
||||||
|
|
||||||
### Section: /warehouse
|
### Section: /warehouse
|
||||||
|
|
||||||
#### List warehouses — `GET /warehouse`
|
#### List warehouses — `GET /warehouse`
|
||||||
_none_
|
_none_
|
||||||
- Returns: `200 { warehouses: T40[] }`
|
- Returns: `200 { warehouses: T43[] }`
|
||||||
#### Create warehouse — `POST /warehouse`
|
#### Create warehouse — `POST /warehouse`
|
||||||
- Params: `body: { name: str, sort?: int }`
|
- Params: `body: { name: str, sort?: int }`
|
||||||
- Returns: `201 T38`
|
- Returns: `201 T41`
|
||||||
#### Reorder warehouses — `PUT /warehouse/order`
|
#### Reorder warehouses — `PUT /warehouse/order`
|
||||||
- Params: `body: { warehouseIds: int[] }`
|
- Params: `body: { warehouseIds: int[] }`
|
||||||
- Returns: `200 { warehouseIds: int[] }`
|
- Returns: `200 { warehouseIds: int[] }`
|
||||||
@@ -609,13 +612,13 @@ _none_
|
|||||||
- Returns: `204 void`
|
- Returns: `204 void`
|
||||||
#### Get warehouse by ID — `GET /warehouse/{id}`
|
#### Get warehouse by ID — `GET /warehouse/{id}`
|
||||||
- Params: `id: int`
|
- Params: `id: int`
|
||||||
- Returns: `200 T38`
|
- Returns: `200 T41`
|
||||||
#### Update warehouse (partial) — `PATCH /warehouse/{id}`
|
#### Update warehouse (partial) — `PATCH /warehouse/{id}`
|
||||||
- Params: `id: int, body: { name?: str, sort?: int }`
|
- Params: `id: int, body: { name?: str, sort?: int }`
|
||||||
- Returns: `200 T38`
|
- Returns: `200 T41`
|
||||||
#### Update warehouse — `PUT /warehouse/{id}`
|
#### Update warehouse — `PUT /warehouse/{id}`
|
||||||
- Params: `id: int, body: { name?: str, sort?: int }`
|
- Params: `id: int, body: { name?: str, sort?: int }`
|
||||||
- Returns: `200 T38`
|
- Returns: `200 T41`
|
||||||
### Binary & streaming routes (reachable only via `fetch()` in javascript_execute)
|
### Binary & streaming routes (reachable only via `fetch()` in javascript_execute)
|
||||||
|
|
||||||
These routes are NOT in the table above because their responses are binary or long-lived streams, which the `dashback_request` tool cannot return usefully. They ARE reachable from inside `javascript_execute` with `fetch("/route")`, where you can decode the bytes, write them to the VFS and embed them in your reply:
|
These routes are NOT in the table above because their responses are binary or long-lived streams, which the `dashback_request` tool cannot return usefully. They ARE reachable from inside `javascript_execute` with `fetch("/route")`, where you can decode the bytes, write them to the VFS and embed them in your reply:
|
||||||
|
|||||||
@@ -62,7 +62,41 @@ Created order
|
|||||||
"taxrate": 1,
|
"taxrate": 1,
|
||||||
"comment": "…"
|
"comment": "…"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"shipping": {
|
||||||
|
"id": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"number": "…",
|
||||||
|
"type": "…",
|
||||||
|
"state": "…"
|
||||||
|
},
|
||||||
|
"shippings": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"number": "…",
|
||||||
|
"type": "…",
|
||||||
|
"state": "…"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"payment": {
|
||||||
|
"id": 1,
|
||||||
|
"accountId": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"type": "…",
|
||||||
|
"amount": 1
|
||||||
|
},
|
||||||
|
"payments": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"accountId": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"type": "…",
|
||||||
|
"amount": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paid": true,
|
||||||
|
"delivered": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -37,7 +37,41 @@ Order
|
|||||||
"taxrate": 1,
|
"taxrate": 1,
|
||||||
"comment": "…"
|
"comment": "…"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"shipping": {
|
||||||
|
"id": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"number": "…",
|
||||||
|
"type": "…",
|
||||||
|
"state": "…"
|
||||||
|
},
|
||||||
|
"shippings": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"number": "…",
|
||||||
|
"type": "…",
|
||||||
|
"state": "…"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"payment": {
|
||||||
|
"id": 1,
|
||||||
|
"accountId": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"type": "…",
|
||||||
|
"amount": 1
|
||||||
|
},
|
||||||
|
"payments": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"accountId": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"type": "…",
|
||||||
|
"amount": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paid": true,
|
||||||
|
"delivered": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ List orders
|
|||||||
|
|
||||||
Lists sales orders (`manifest` rows with `type = 'order'`)
|
Lists sales orders (`manifest` rows with `type = 'order'`)
|
||||||
for the authenticated user's selected company.
|
for the authenticated user's selected company.
|
||||||
Results are paged, include line items, and provide total unpaged count.
|
Results are paged, include line items, shipping, payment, and provide total unpaged count.
|
||||||
|
|
||||||
|
|
||||||
## Query parameters
|
## Query parameters
|
||||||
@@ -42,7 +42,41 @@ Order list
|
|||||||
"taxrate": 1,
|
"taxrate": 1,
|
||||||
"comment": "…"
|
"comment": "…"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"shipping": {
|
||||||
|
"id": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"number": "…",
|
||||||
|
"type": "…",
|
||||||
|
"state": "…"
|
||||||
|
},
|
||||||
|
"shippings": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"number": "…",
|
||||||
|
"type": "…",
|
||||||
|
"state": "…"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"payment": {
|
||||||
|
"id": 1,
|
||||||
|
"accountId": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"type": "…",
|
||||||
|
"amount": 1
|
||||||
|
},
|
||||||
|
"payments": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"accountId": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"type": "…",
|
||||||
|
"amount": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paid": true,
|
||||||
|
"delivered": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"total": 1,
|
"total": 1,
|
||||||
|
|||||||
@@ -56,7 +56,41 @@ Updated order
|
|||||||
"taxrate": 1,
|
"taxrate": 1,
|
||||||
"comment": "…"
|
"comment": "…"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"shipping": {
|
||||||
|
"id": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"number": "…",
|
||||||
|
"type": "…",
|
||||||
|
"state": "…"
|
||||||
|
},
|
||||||
|
"shippings": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"number": "…",
|
||||||
|
"type": "…",
|
||||||
|
"state": "…"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"payment": {
|
||||||
|
"id": 1,
|
||||||
|
"accountId": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"type": "…",
|
||||||
|
"amount": 1
|
||||||
|
},
|
||||||
|
"payments": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"accountId": 1,
|
||||||
|
"manifestId": 1,
|
||||||
|
"type": "…",
|
||||||
|
"amount": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paid": true,
|
||||||
|
"delivered": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -995,6 +995,24 @@
|
|||||||
* type: array
|
* type: array
|
||||||
* items:
|
* items:
|
||||||
* $ref: '#/components/schemas/ManifestLine'
|
* $ref: '#/components/schemas/ManifestLine'
|
||||||
|
* shipping:
|
||||||
|
* $ref: '#/components/schemas/Shipping'
|
||||||
|
* nullable: true
|
||||||
|
* shippings:
|
||||||
|
* type: array
|
||||||
|
* items:
|
||||||
|
* $ref: '#/components/schemas/Shipping'
|
||||||
|
* payment:
|
||||||
|
* $ref: '#/components/schemas/Payment'
|
||||||
|
* nullable: true
|
||||||
|
* payments:
|
||||||
|
* type: array
|
||||||
|
* items:
|
||||||
|
* $ref: '#/components/schemas/Payment'
|
||||||
|
* paid:
|
||||||
|
* type: boolean
|
||||||
|
* delivered:
|
||||||
|
* type: boolean
|
||||||
* ArticleImage:
|
* ArticleImage:
|
||||||
* type: object
|
* type: object
|
||||||
* required: [picId, sort, full, thumb, hash, thumbHash]
|
* required: [picId, sort, full, thumb, hash, thumbHash]
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export function register(app, basePath = '') {
|
|||||||
* description: |
|
* description: |
|
||||||
* Lists sales orders (`manifest` rows with `type = 'order'`)
|
* Lists sales orders (`manifest` rows with `type = 'order'`)
|
||||||
* for the authenticated user's selected company.
|
* for the authenticated user's selected company.
|
||||||
* Results are paged, include line items, and provide total unpaged count.
|
* Results are paged, include line items, shipping, payment, and provide total unpaged count.
|
||||||
* security:
|
* security:
|
||||||
* - cookieAuth: []
|
* - cookieAuth: []
|
||||||
* parameters:
|
* parameters:
|
||||||
|
|||||||
@@ -1,26 +1,69 @@
|
|||||||
import { getStore } from './store.js';
|
import { getStore } from './store.js';
|
||||||
|
|
||||||
|
async function enrichSingleOrder(store, googleAuthId, order) {
|
||||||
|
if (!order) return order;
|
||||||
|
const [shippings, payments] = await Promise.all([
|
||||||
|
store.shipping.listByManifestId(googleAuthId, order.id).catch(() => []),
|
||||||
|
store.payment.listByManifestId(googleAuthId, order.id).catch(() => []),
|
||||||
|
]);
|
||||||
|
|
||||||
|
const isPaid = Array.isArray(payments) && payments.length > 0;
|
||||||
|
const isDelivered = Array.isArray(shippings) && shippings.some((s) => s.state === 'shipped' || s.state === 'delivered');
|
||||||
|
|
||||||
|
return {
|
||||||
|
...order,
|
||||||
|
shipping: shippings[0] ?? null,
|
||||||
|
shippings: shippings ?? [],
|
||||||
|
payment: payments[0] ?? null,
|
||||||
|
payments: payments ?? [],
|
||||||
|
paid: isPaid,
|
||||||
|
delivered: isDelivered,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async function enrichOrderResult(store, googleAuthId, result) {
|
||||||
|
if (!result) return result;
|
||||||
|
if (Array.isArray(result)) {
|
||||||
|
return Promise.all(result.map((o) => enrichSingleOrder(store, googleAuthId, o)));
|
||||||
|
}
|
||||||
|
if (Array.isArray(result.orders)) {
|
||||||
|
const enrichedOrders = await Promise.all(
|
||||||
|
result.orders.map((o) => enrichSingleOrder(store, googleAuthId, o))
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
...result,
|
||||||
|
orders: enrichedOrders,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
export async function list(googleAuthId, opts) {
|
export async function list(googleAuthId, opts) {
|
||||||
const store = await getStore();
|
const store = await getStore();
|
||||||
return store.order.list(googleAuthId, opts);
|
const result = await store.order.list(googleAuthId, opts);
|
||||||
|
return enrichOrderResult(store, googleAuthId, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getById(googleAuthId, id) {
|
export async function getById(googleAuthId, id) {
|
||||||
const store = await getStore();
|
const store = await getStore();
|
||||||
return store.order.getById(googleAuthId, id);
|
const order = await store.order.getById(googleAuthId, id);
|
||||||
|
return enrichSingleOrder(store, googleAuthId, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function create(googleAuthId, data) {
|
export async function create(googleAuthId, data) {
|
||||||
const store = await getStore();
|
const store = await getStore();
|
||||||
return store.order.create(googleAuthId, data);
|
const order = await store.order.create(googleAuthId, data);
|
||||||
|
return enrichSingleOrder(store, googleAuthId, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function update(googleAuthId, id, data) {
|
export async function update(googleAuthId, id, data) {
|
||||||
const store = await getStore();
|
const store = await getStore();
|
||||||
return store.order.update(googleAuthId, id, data);
|
const order = await store.order.update(googleAuthId, id, data);
|
||||||
|
return enrichSingleOrder(store, googleAuthId, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function remove(googleAuthId, id) {
|
export async function remove(googleAuthId, id) {
|
||||||
const store = await getStore();
|
const store = await getStore();
|
||||||
return store.order.delete(googleAuthId, id);
|
return store.order.delete(googleAuthId, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -179,11 +179,19 @@ export async function executeCompanyImport({
|
|||||||
|
|
||||||
// MARK: - Phase 7: Orders / Receipts
|
// MARK: - Phase 7: Orders / Receipts
|
||||||
// #region Phase 7: Orders / Receipts
|
// #region Phase 7: Orders / Receipts
|
||||||
|
const allArtIdToSku = new Map();
|
||||||
|
for (const a of artRecords) {
|
||||||
|
const kArt = cleanValue(a.id ?? a.kArtikel);
|
||||||
|
const sku = cleanValue(a.sku ?? a.cArtNr);
|
||||||
|
if (kArt && sku) allArtIdToSku.set(kArt, sku);
|
||||||
|
}
|
||||||
|
|
||||||
const ordersResult = await importOrders({
|
const ordersResult = await importOrders({
|
||||||
store,
|
store,
|
||||||
googleAuthId,
|
googleAuthId,
|
||||||
manRecords,
|
manRecords,
|
||||||
itemRecords,
|
itemRecords,
|
||||||
|
jtlArtIdToSku: allArtIdToSku,
|
||||||
progressTracker,
|
progressTracker,
|
||||||
});
|
});
|
||||||
// #endregion
|
// #endregion
|
||||||
@@ -213,6 +221,8 @@ export async function executeCompanyImport({
|
|||||||
ordersTotal: totalReceiptsCount,
|
ordersTotal: totalReceiptsCount,
|
||||||
ordersImported: ordersResult.ordersImported,
|
ordersImported: ordersResult.ordersImported,
|
||||||
ordersSkipped: ordersResult.ordersSkipped,
|
ordersSkipped: ordersResult.ordersSkipped,
|
||||||
|
paymentsImported: ordersResult.paymentsImported,
|
||||||
|
shippingsImported: ordersResult.shippingsImported,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ export async function importArticles({
|
|||||||
let articlesUpdated = 0;
|
let articlesUpdated = 0;
|
||||||
|
|
||||||
for (const a of includedArticles) {
|
for (const a of includedArticles) {
|
||||||
const jtlArtId = String(a.kArtikel);
|
const jtlArtId = String(a.id ?? a.kArtikel);
|
||||||
const sku = cleanValue(a.cArtNr);
|
const sku = cleanValue(a.sku ?? a.cArtNr);
|
||||||
if (!sku) {
|
if (!sku) {
|
||||||
progressTracker.counts.articlesdone++;
|
progressTracker.counts.articlesdone++;
|
||||||
continue;
|
continue;
|
||||||
@@ -45,15 +45,15 @@ export async function importArticles({
|
|||||||
|
|
||||||
jtlArtIdToSku.set(jtlArtId, sku);
|
jtlArtIdToSku.set(jtlArtId, sku);
|
||||||
|
|
||||||
let name = cleanValue(a.cName);
|
let name = cleanValue(a.name ?? a.cName);
|
||||||
let desc = cleanValue(a.descriptions);
|
let desc = cleanValue(a.desc ?? a.descriptions);
|
||||||
|
|
||||||
if (!name && desc) {
|
if (!name && desc) {
|
||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(desc);
|
const parsed = JSON.parse(desc);
|
||||||
const item = Array.isArray(parsed) ? parsed[0] : parsed;
|
const item = Array.isArray(parsed) ? parsed[0] : parsed;
|
||||||
if (item?.cName) name = String(item.cName).trim();
|
if (item?.cName || item?.name) name = String(item.cName || item.name).trim();
|
||||||
if (item?.cBeschreibung) desc = String(item.cBeschreibung).trim();
|
if (item?.cBeschreibung || item?.desc) desc = String(item.cBeschreibung || item.desc).trim();
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
if (!name) name = `Artikel ${sku}`;
|
if (!name) name = `Artikel ${sku}`;
|
||||||
@@ -66,7 +66,7 @@ export async function importArticles({
|
|||||||
if (rawCatStr.startsWith('[') || rawCatStr.startsWith('{')) {
|
if (rawCatStr.startsWith('[') || rawCatStr.startsWith('{')) {
|
||||||
try {
|
try {
|
||||||
const raw = JSON.parse(rawCatStr);
|
const raw = JSON.parse(rawCatStr);
|
||||||
parsedIds = (Array.isArray(raw) ? raw : [raw]).map((it) => String(it.kKategorie || it));
|
parsedIds = (Array.isArray(raw) ? raw : [raw]).map((it) => String(it.id ?? it.kKategorie ?? it));
|
||||||
} catch {
|
} catch {
|
||||||
parsedIds = rawCatStr.split(/[\r\n,;]+/).map((s) => s.trim()).filter(Boolean);
|
parsedIds = rawCatStr.split(/[\r\n,;]+/).map((s) => s.trim()).filter(Boolean);
|
||||||
}
|
}
|
||||||
@@ -81,12 +81,13 @@ export async function importArticles({
|
|||||||
}
|
}
|
||||||
const primaryCatId = assignedDashCatIds[0] || hauptDashId;
|
const primaryCatId = assignedDashCatIds[0] || hauptDashId;
|
||||||
|
|
||||||
const trackStock = a.cLagerAktiv === 'Y' ? 1 : 0;
|
const rawTrack = cleanValue(a.track_strock ?? a.track_stock ?? a.cLagerAktiv);
|
||||||
const netPrice = parseGermanFloat(a.fVKNetto, 0);
|
const trackStock = (rawTrack === 'Y' || rawTrack === '1' || rawTrack === 'true') ? 1 : 0;
|
||||||
const taxRate = a.kSteuerklasse === '3' ? 7 : 19;
|
const netPrice = parseGermanFloat(a.net ?? a.fVKNetto, 0);
|
||||||
const barcode = cleanValue(a.cBarcode);
|
const taxRate = a.taxrate != null && String(a.taxrate).trim() !== '' ? parseGermanFloat(a.taxrate, 19) : (a.kSteuerklasse === '3' ? 7 : 19);
|
||||||
|
const barcode = cleanValue(a.ean ?? a.cBarcode);
|
||||||
|
|
||||||
const hersteller = cleanValue(a.Hersteller);
|
const hersteller = cleanValue(a.brand ?? a.Hersteller);
|
||||||
const brandId = hersteller ? (brandNameToId.get(hersteller.toLowerCase()) || null) : null;
|
const brandId = hersteller ? (brandNameToId.get(hersteller.toLowerCase()) || null) : null;
|
||||||
|
|
||||||
let existingArticle = null;
|
let existingArticle = null;
|
||||||
|
|||||||
@@ -20,15 +20,15 @@ export function filterCatalogRecords(catRecords, artRecords) {
|
|||||||
const excludedJtlIds = new Set(['72']);
|
const excludedJtlIds = new Set(['72']);
|
||||||
|
|
||||||
for (const c of catRecords) {
|
for (const c of catRecords) {
|
||||||
let name = (c.cName || '').trim();
|
let name = (c.name || c.cName || '').trim();
|
||||||
if (!name) {
|
if (!name) {
|
||||||
try {
|
try {
|
||||||
const tr = JSON.parse(c.translations || '[]');
|
const tr = JSON.parse(c.translations || '[]');
|
||||||
name = tr[0]?.cName || '';
|
name = tr[0]?.cName || tr[0]?.name || '';
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
if (name.toLowerCase().includes('papierkorb') || name.toLowerCase().includes('trash')) {
|
if (name.toLowerCase().includes('papierkorb') || name.toLowerCase().includes('trash')) {
|
||||||
excludedJtlIds.add(String(c.kKategorie));
|
excludedJtlIds.add(String(c.id ?? c.kKategorie));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,8 +36,8 @@ export function filterCatalogRecords(catRecords, artRecords) {
|
|||||||
while (addedExcluded) {
|
while (addedExcluded) {
|
||||||
addedExcluded = false;
|
addedExcluded = false;
|
||||||
for (const c of catRecords) {
|
for (const c of catRecords) {
|
||||||
const id = String(c.kKategorie);
|
const id = String(c.id ?? c.kKategorie);
|
||||||
const parent = String(c.kOberKategorie);
|
const parent = String(c.parentid ?? c.kOberKategorie);
|
||||||
if (!excludedJtlIds.has(id) && excludedJtlIds.has(parent)) {
|
if (!excludedJtlIds.has(id) && excludedJtlIds.has(parent)) {
|
||||||
excludedJtlIds.add(id);
|
excludedJtlIds.add(id);
|
||||||
addedExcluded = true;
|
addedExcluded = true;
|
||||||
@@ -45,16 +45,21 @@ export function filterCatalogRecords(catRecords, artRecords) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const includedCategories = catRecords.filter((c) => !excludedJtlIds.has(String(c.kKategorie)));
|
const includedCategories = catRecords.filter((c) => !excludedJtlIds.has(String(c.id ?? c.kKategorie)));
|
||||||
|
|
||||||
const includedArticles = artRecords.filter((a) => {
|
const includedArticles = artRecords.filter((a) => {
|
||||||
|
const rawActive = cleanValue(a.active ?? a.cAktiv);
|
||||||
|
if (rawActive === '0' || rawActive === 'N' || rawActive === 'false') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const catStr = String(a.categories || '').trim();
|
const catStr = String(a.categories || '').trim();
|
||||||
if (!catStr) return true;
|
if (!catStr) return true;
|
||||||
let catIds = [];
|
let catIds = [];
|
||||||
if (catStr.startsWith('[') || catStr.startsWith('{')) {
|
if (catStr.startsWith('[') || catStr.startsWith('{')) {
|
||||||
try {
|
try {
|
||||||
const raw = JSON.parse(catStr);
|
const raw = JSON.parse(catStr);
|
||||||
catIds = (Array.isArray(raw) ? raw : [raw]).map((it) => String(it.kKategorie || it));
|
catIds = (Array.isArray(raw) ? raw : [raw]).map((it) => String(it.id ?? it.kKategorie ?? it));
|
||||||
} catch {
|
} catch {
|
||||||
catIds = catStr.split(/[\r\n,;]+/).map((s) => s.trim()).filter(Boolean);
|
catIds = catStr.split(/[\r\n,;]+/).map((s) => s.trim()).filter(Boolean);
|
||||||
}
|
}
|
||||||
@@ -94,7 +99,7 @@ export function prepareImportTasks({ importDir, includedCategories, includedArti
|
|||||||
for (const rel of picRel.split(/[\r\n,;]+/).map((s) => s.trim()).filter(Boolean)) {
|
for (const rel of picRel.split(/[\r\n,;]+/).map((s) => s.trim()).filter(Boolean)) {
|
||||||
const full = path.resolve(importDir, rel);
|
const full = path.resolve(importDir, rel);
|
||||||
if (fs.existsSync(full)) {
|
if (fs.existsSync(full)) {
|
||||||
categoryImageTasks.push({ catJtlId: String(c.kKategorie), relPath: rel, fullPath: full });
|
categoryImageTasks.push({ catJtlId: String(c.id ?? c.kKategorie), relPath: rel, fullPath: full });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,11 +108,11 @@ export function prepareImportTasks({ importDir, includedCategories, includedArti
|
|||||||
// Brand images (unique manufacturers, 1 primary logo)
|
// Brand images (unique manufacturers, 1 primary logo)
|
||||||
const brandMap = new Map(); // brandName -> array of { relPath, fullPath }
|
const brandMap = new Map(); // brandName -> array of { relPath, fullPath }
|
||||||
for (const a of includedArticles) {
|
for (const a of includedArticles) {
|
||||||
const brand = cleanValue(a.Hersteller);
|
const brand = cleanValue(a.brand ?? a.Hersteller);
|
||||||
if (!brand) continue;
|
if (!brand) continue;
|
||||||
if (!brandMap.has(brand)) {
|
if (!brandMap.has(brand)) {
|
||||||
brandMap.set(brand, []);
|
brandMap.set(brand, []);
|
||||||
const rawPics = String(a.manufacturerPictureFiles || '').trim();
|
const rawPics = String(a.brandPictureFiles ?? a.manufacturerPictureFiles ?? '').trim();
|
||||||
if (rawPics) {
|
if (rawPics) {
|
||||||
for (const rel of rawPics.split(/[\r\n,;]+/).map((s) => s.trim()).filter(Boolean)) {
|
for (const rel of rawPics.split(/[\r\n,;]+/).map((s) => s.trim()).filter(Boolean)) {
|
||||||
const full = path.resolve(importDir, rel);
|
const full = path.resolve(importDir, rel);
|
||||||
@@ -129,7 +134,7 @@ export function prepareImportTasks({ importDir, includedCategories, includedArti
|
|||||||
// Article images
|
// Article images
|
||||||
const articleImageTasks = [];
|
const articleImageTasks = [];
|
||||||
for (const a of includedArticles) {
|
for (const a of includedArticles) {
|
||||||
const sku = cleanValue(a.cArtNr);
|
const sku = cleanValue(a.sku ?? a.cArtNr);
|
||||||
if (!sku) continue;
|
if (!sku) continue;
|
||||||
const rawPics = String(a.pictureFiles || '').trim();
|
const rawPics = String(a.pictureFiles || '').trim();
|
||||||
if (rawPics) {
|
if (rawPics) {
|
||||||
|
|||||||
@@ -64,14 +64,14 @@ export async function importCategories({
|
|||||||
safety++;
|
safety++;
|
||||||
const remaining = [];
|
const remaining = [];
|
||||||
for (const c of pendingCats) {
|
for (const c of pendingCats) {
|
||||||
const jtlId = String(c.kKategorie);
|
const jtlId = String(c.id ?? c.kKategorie);
|
||||||
const jtlParent = String(c.kOberKategorie || '0');
|
const jtlParent = String(c.parentid ?? c.kOberKategorie ?? '0');
|
||||||
|
|
||||||
let name = cleanValue(c.cName);
|
let name = cleanValue(c.name ?? c.cName);
|
||||||
if (!name) {
|
if (!name) {
|
||||||
try {
|
try {
|
||||||
const tr = JSON.parse(c.translations || '[]');
|
const tr = JSON.parse(c.translations || '[]');
|
||||||
name = tr[0]?.cName || '';
|
name = tr[0]?.name || tr[0]?.cName || '';
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
if (!name) name = `Kategorie ${jtlId}`;
|
if (!name) name = `Kategorie ${jtlId}`;
|
||||||
|
|||||||
@@ -10,33 +10,37 @@ const log = createLogger('import');
|
|||||||
// #region Order / Manifest Importer
|
// #region Order / Manifest Importer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Imports order manifests and line items, resolving customer entities.
|
* Imports order manifests and line items, resolving customer entities, payments, and shippings.
|
||||||
*
|
*
|
||||||
* @param {object} params
|
* @param {object} params
|
||||||
* @param {object} params.store - Store singleton
|
* @param {object} params.store - Store singleton
|
||||||
* @param {number} params.googleAuthId
|
* @param {number} params.googleAuthId
|
||||||
* @param {Array<Record<string, string>>} params.manRecords
|
* @param {Array<Record<string, string>>} params.manRecords
|
||||||
* @param {Array<Record<string, string>>} params.itemRecords
|
* @param {Array<Record<string, string>>} params.itemRecords
|
||||||
|
* @param {Map<string, string>} [params.jtlArtIdToSku]
|
||||||
* @param {object} params.progressTracker
|
* @param {object} params.progressTracker
|
||||||
* @returns {Promise<{ ordersImported: number, ordersSkipped: number }>}
|
* @returns {Promise<{ ordersImported: number, ordersSkipped: number, paymentsImported: number, shippingsImported: number }>}
|
||||||
*/
|
*/
|
||||||
export async function importOrders({
|
export async function importOrders({
|
||||||
store,
|
store,
|
||||||
googleAuthId,
|
googleAuthId,
|
||||||
manRecords,
|
manRecords,
|
||||||
itemRecords,
|
itemRecords,
|
||||||
|
jtlArtIdToSku = new Map(),
|
||||||
progressTracker,
|
progressTracker,
|
||||||
}) {
|
}) {
|
||||||
let ordersImported = 0;
|
let ordersImported = 0;
|
||||||
let ordersSkipped = 0;
|
let ordersSkipped = 0;
|
||||||
|
let paymentsImported = 0;
|
||||||
|
let shippingsImported = 0;
|
||||||
|
|
||||||
if (manRecords.length === 0 || itemRecords.length === 0) {
|
if (manRecords.length === 0 || itemRecords.length === 0) {
|
||||||
return { ordersImported, ordersSkipped };
|
return { ordersImported, ordersSkipped, paymentsImported, shippingsImported };
|
||||||
}
|
}
|
||||||
|
|
||||||
const itemsByAuftrag = new Map();
|
const itemsByAuftrag = new Map();
|
||||||
for (const it of itemRecords) {
|
for (const it of itemRecords) {
|
||||||
const kAuftrag = String(it.kAuftrag || '').trim();
|
const kAuftrag = String(it.manifestid ?? it.kAuftrag ?? '').trim();
|
||||||
if (!kAuftrag) continue;
|
if (!kAuftrag) continue;
|
||||||
if (!itemsByAuftrag.has(kAuftrag)) {
|
if (!itemsByAuftrag.has(kAuftrag)) {
|
||||||
itemsByAuftrag.set(kAuftrag, []);
|
itemsByAuftrag.set(kAuftrag, []);
|
||||||
@@ -88,8 +92,38 @@ export async function importOrders({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const accountMap = new Map();
|
||||||
|
try {
|
||||||
|
const accounts = await store.account.list(googleAuthId);
|
||||||
|
for (const acc of accounts) {
|
||||||
|
if (acc.name) {
|
||||||
|
accountMap.set(acc.name.trim().toLowerCase(), acc.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
log.warn('Could not list accounts:', err.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
const resolveAccountId = async (accountName) => {
|
||||||
|
const cleanAccName = (accountName || 'Bar').trim();
|
||||||
|
const key = cleanAccName.toLowerCase();
|
||||||
|
if (accountMap.has(key)) return accountMap.get(key);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const created = await store.account.create(googleAuthId, {
|
||||||
|
type: cleanAccName,
|
||||||
|
name: cleanAccName,
|
||||||
|
});
|
||||||
|
accountMap.set(key, created.id);
|
||||||
|
return created.id;
|
||||||
|
} catch (err) {
|
||||||
|
log.warn(`Could not create account "${cleanAccName}":`, err.message);
|
||||||
|
return accountMap.values().next().value || null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
for (const m of manRecords) {
|
for (const m of manRecords) {
|
||||||
const orderNumber = cleanValue(m.cAuftragsNr);
|
const orderNumber = cleanValue(m.nr ?? m.cAuftragsNr);
|
||||||
if (!orderNumber || existingOrderNumbers.has(orderNumber)) {
|
if (!orderNumber || existingOrderNumbers.has(orderNumber)) {
|
||||||
ordersSkipped++;
|
ordersSkipped++;
|
||||||
progressTracker.counts.receiptsdone++;
|
progressTracker.counts.receiptsdone++;
|
||||||
@@ -97,7 +131,8 @@ export async function importOrders({
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rawItems = itemsByAuftrag.get(String(m.kAuftrag || '').trim()) || [];
|
const manifestKey = String(m.id ?? m.kAuftrag ?? '').trim();
|
||||||
|
const rawItems = itemsByAuftrag.get(manifestKey) || [];
|
||||||
if (rawItems.length === 0) {
|
if (rawItems.length === 0) {
|
||||||
ordersSkipped++;
|
ordersSkipped++;
|
||||||
progressTracker.counts.receiptsdone++;
|
progressTracker.counts.receiptsdone++;
|
||||||
@@ -105,15 +140,18 @@ export async function importOrders({
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rawItems.sort((a, b) => (Number(a.sort ?? a.nSort) || 0) - (Number(b.sort ?? b.nSort) || 0));
|
||||||
|
|
||||||
const lines = rawItems.map((it) => {
|
const lines = rawItems.map((it) => {
|
||||||
const sku = cleanValue(it.cArtNr) || null;
|
const articleId = cleanValue(it.articleid ?? it.kArtikel);
|
||||||
const rawName = cleanValue(it.cName || it.cNameStandard);
|
const sku = cleanValue(it.sku ?? it.cArtNr) || (articleId && jtlArtIdToSku?.get?.(articleId)) || null;
|
||||||
|
const rawName = cleanValue(it.name ?? it.cName ?? it.cNameStandard);
|
||||||
const name = rawName || (sku ? `Artikel ${sku}` : 'Artikel');
|
const name = rawName || (sku ? `Artikel ${sku}` : 'Artikel');
|
||||||
const amount = parseGermanFloat(it.fAnzahl, 1);
|
const amount = parseGermanFloat(it.amount ?? it.fAnzahl, 1);
|
||||||
const net = parseGermanFloat(it.fVKNetto, 0);
|
const net = parseGermanFloat(it.net ?? it.fVKNetto, 0);
|
||||||
const taxrate = parseGermanFloat(it.fMwSt, 19);
|
const taxrate = parseGermanFloat(it.taxrate ?? it.fMwSt, 19);
|
||||||
const rebate = parseGermanFloat(it.fRabatt, 0);
|
const rebate = parseGermanFloat(it.rebate ?? it.fRabatt, 0);
|
||||||
const comment = cleanValue(it.cHinweis) || null;
|
const comment = cleanValue(it.comment ?? it.cHinweis) || null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
sku,
|
sku,
|
||||||
@@ -126,18 +164,19 @@ export async function importOrders({
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const custName = cleanValue(m.cName) || 'Laufkunde';
|
const custName = cleanValue(m.name ?? m.cName) || 'Laufkunde';
|
||||||
const custFirstName = cleanValue(m.cVorname);
|
const custFirstName = cleanValue(m.firstName ?? m.cVorname);
|
||||||
const entityId = await resolveEntityId(custName, custFirstName);
|
const entityId = await resolveEntityId(custName, custFirstName);
|
||||||
|
|
||||||
const dateStr = cleanValue(m.dErstellt);
|
const dateStr = cleanValue(m.created_at ?? m.dErstellt);
|
||||||
const parsedDate = dateStr ? new Date(dateStr) : new Date();
|
const parsedDate = dateStr ? new Date(dateStr) : new Date();
|
||||||
const validDate = !Number.isNaN(parsedDate.getTime()) ? parsedDate.toISOString() : new Date().toISOString();
|
const validDate = !Number.isNaN(parsedDate.getTime()) ? parsedDate.toISOString() : new Date().toISOString();
|
||||||
|
|
||||||
|
let createdOrder = null;
|
||||||
try {
|
try {
|
||||||
await store.order.create(googleAuthId, {
|
createdOrder = await store.order.create(googleAuthId, {
|
||||||
number: orderNumber,
|
number: orderNumber,
|
||||||
externalNumber: cleanValue(m.cExterneAuftragsnummer) || null,
|
externalNumber: cleanValue(m.extnr ?? m.cExterneAuftragsnummer) || null,
|
||||||
date: validDate,
|
date: validDate,
|
||||||
createdAt: validDate,
|
createdAt: validDate,
|
||||||
entityId: entityId || undefined,
|
entityId: entityId || undefined,
|
||||||
@@ -149,16 +188,67 @@ export async function importOrders({
|
|||||||
log.warn(`Failed to create order ${orderNumber}:`, err.message);
|
log.warn(`Failed to create order ${orderNumber}:`, err.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (createdOrder) {
|
||||||
|
// Handle Payment
|
||||||
|
const isPayed = String(m.payed ?? '').trim() === '1';
|
||||||
|
const paymentType = cleanValue(m.paymentType);
|
||||||
|
if (isPayed && paymentType) {
|
||||||
|
const orderTotal = Math.round(
|
||||||
|
lines.reduce(
|
||||||
|
(sum, l) => sum + (l.amount * l.net * (1 - (l.rebate || 0) / 100) * (1 + (l.taxrate || 0) / 100)),
|
||||||
|
0
|
||||||
|
) * 100
|
||||||
|
) / 100;
|
||||||
|
|
||||||
|
if (orderTotal > 0) {
|
||||||
|
try {
|
||||||
|
const accountId = await resolveAccountId(paymentType);
|
||||||
|
if (accountId) {
|
||||||
|
await store.payment.create(googleAuthId, {
|
||||||
|
accountId,
|
||||||
|
manifestId: createdOrder.id,
|
||||||
|
type: paymentType,
|
||||||
|
amount: orderTotal,
|
||||||
|
});
|
||||||
|
paymentsImported++;
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
log.warn(`Failed to create payment for order ${orderNumber}:`, err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle Delivery / Shipping
|
||||||
|
const shippingType = cleanValue(m.shippingType);
|
||||||
|
if (shippingType) {
|
||||||
|
const isShipped = String(m.shipped ?? '').trim() === '1';
|
||||||
|
const shippingState = isShipped ? 'shipped' : 'open';
|
||||||
|
|
||||||
|
try {
|
||||||
|
await store.shipping.create(googleAuthId, {
|
||||||
|
manifestId: createdOrder.id,
|
||||||
|
type: shippingType,
|
||||||
|
state: shippingState,
|
||||||
|
});
|
||||||
|
shippingsImported++;
|
||||||
|
} catch (err) {
|
||||||
|
log.warn(`Failed to create shipping for order ${orderNumber}:`, err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
progressTracker.counts.receiptsdone++;
|
progressTracker.counts.receiptsdone++;
|
||||||
progressTracker.emitProgress();
|
progressTracker.emitProgress();
|
||||||
}
|
}
|
||||||
|
|
||||||
progressTracker.emitProgress(true);
|
progressTracker.emitProgress(true);
|
||||||
log.info(`Orders complete: ${ordersImported} created, ${ordersSkipped} skipped`);
|
log.info(`Orders complete: ${ordersImported} created, ${ordersSkipped} skipped, ${paymentsImported} payments, ${shippingsImported} shippings`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ordersImported,
|
ordersImported,
|
||||||
ordersSkipped,
|
ordersSkipped,
|
||||||
|
paymentsImported,
|
||||||
|
shippingsImported,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,12 +72,12 @@ export async function importPfand({
|
|||||||
// 1. Identify parent articles and map their Pfand values so child variants can inherit
|
// 1. Identify parent articles and map their Pfand values so child variants can inherit
|
||||||
const parentPfandMap = new Map();
|
const parentPfandMap = new Map();
|
||||||
for (const a of includedArticles) {
|
for (const a of includedArticles) {
|
||||||
const sku = cleanValue(a.cArtNr);
|
const sku = cleanValue(a.sku ?? a.cArtNr);
|
||||||
const isParent = a.nIstVater === '1' || (sku && parentSkus.has(sku));
|
const isParent = a.is_parent === '1' || a.nIstVater === '1' || (sku && parentSkus.has(sku));
|
||||||
if (isParent) {
|
if (isParent) {
|
||||||
const val = extractPfandValue(a.attributes);
|
const val = extractPfandValue(a.attributes);
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
parentPfandMap.set(String(a.kArtikel), val);
|
parentPfandMap.set(String(a.id ?? a.kArtikel), val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,19 +85,20 @@ export async function importPfand({
|
|||||||
// 2. Discover target articles (purchasable standalone or variant items) and their Pfand values
|
// 2. Discover target articles (purchasable standalone or variant items) and their Pfand values
|
||||||
const articleTargets = [];
|
const articleTargets = [];
|
||||||
for (const a of includedArticles) {
|
for (const a of includedArticles) {
|
||||||
const sku = cleanValue(a.cArtNr);
|
const sku = cleanValue(a.sku ?? a.cArtNr);
|
||||||
if (!sku) continue;
|
if (!sku) continue;
|
||||||
|
|
||||||
const isParent = a.nIstVater === '1' || parentSkus.has(sku);
|
const isParent = a.is_parent === '1' || a.nIstVater === '1' || parentSkus.has(sku);
|
||||||
if (isParent) {
|
if (isParent) {
|
||||||
// Parent articles cannot have options in Dash
|
// Parent articles cannot have options in Dash
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pfandVal = extractPfandValue(a.attributes);
|
let pfandVal = extractPfandValue(a.attributes);
|
||||||
if (pfandVal == null && a.kVaterArtikel && a.kVaterArtikel !== '0') {
|
const parentId = cleanValue(a.parentid ?? a.kVaterArtikel);
|
||||||
if (parentPfandMap.has(String(a.kVaterArtikel))) {
|
if (pfandVal == null && parentId && parentId !== '0') {
|
||||||
pfandVal = parentPfandMap.get(String(a.kVaterArtikel));
|
if (parentPfandMap.has(parentId)) {
|
||||||
|
pfandVal = parentPfandMap.get(parentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,15 +60,15 @@ export async function importVariants({
|
|||||||
// Group children by parent SKU
|
// Group children by parent SKU
|
||||||
const parentChildrenMap = new Map();
|
const parentChildrenMap = new Map();
|
||||||
for (const child of includedArticles) {
|
for (const child of includedArticles) {
|
||||||
const parentJtlId = String(child.kVaterArtikel || '').trim();
|
const parentJtlId = String(child.parentid ?? child.kVaterArtikel ?? '').trim();
|
||||||
if (!parentJtlId || parentJtlId === '0') continue;
|
if (!parentJtlId || parentJtlId === '0') continue;
|
||||||
|
|
||||||
const parentSku = jtlArtIdToSku.get(parentJtlId);
|
const parentSku = jtlArtIdToSku.get(parentJtlId);
|
||||||
const childSku = cleanValue(child.cArtNr);
|
const childSku = cleanValue(child.sku ?? child.cArtNr);
|
||||||
if (!parentSku || !childSku || parentSku === childSku) continue;
|
if (!parentSku || !childSku || parentSku === childSku) continue;
|
||||||
|
|
||||||
if (!parentChildrenMap.has(parentSku)) {
|
if (!parentChildrenMap.has(parentSku)) {
|
||||||
const parentRow = includedArticles.find((a) => String(a.kArtikel) === parentJtlId) || null;
|
const parentRow = includedArticles.find((a) => String(a.id ?? a.kArtikel) === parentJtlId) || null;
|
||||||
parentChildrenMap.set(parentSku, { parentRow, children: [] });
|
parentChildrenMap.set(parentSku, { parentRow, children: [] });
|
||||||
}
|
}
|
||||||
parentChildrenMap.get(parentSku).children.push(child);
|
parentChildrenMap.get(parentSku).children.push(child);
|
||||||
@@ -76,7 +76,7 @@ export async function importVariants({
|
|||||||
|
|
||||||
let variantsLinked = 0;
|
let variantsLinked = 0;
|
||||||
for (const [parentSku, { parentRow, children }] of parentChildrenMap.entries()) {
|
for (const [parentSku, { parentRow, children }] of parentChildrenMap.entries()) {
|
||||||
const rawAttrName = parentRow ? cleanValue(parentRow.kEigenschaftKombi) : '';
|
const rawAttrName = parentRow ? cleanValue(parentRow.variation ?? parentRow.kEigenschaftKombi) : '';
|
||||||
const targetAttrId = await resolveAttributeId(rawAttrName || 'Variante');
|
const targetAttrId = await resolveAttributeId(rawAttrName || 'Variante');
|
||||||
|
|
||||||
if (targetAttrId) {
|
if (targetAttrId) {
|
||||||
@@ -92,8 +92,8 @@ export async function importVariants({
|
|||||||
|
|
||||||
const usedValues = new Set();
|
const usedValues = new Set();
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
const childSku = cleanValue(child.cArtNr);
|
const childSku = cleanValue(child.sku ?? child.cArtNr);
|
||||||
let val = cleanValue(child.kEigenschaftKombi) || 'Standard';
|
let val = cleanValue(child.variation ?? child.kEigenschaftKombi) || 'Standard';
|
||||||
|
|
||||||
if (usedValues.has(val.toLowerCase())) {
|
if (usedValues.has(val.toLowerCase())) {
|
||||||
val = `${val} (${childSku})`;
|
val = `${val} (${childSku})`;
|
||||||
|
|||||||
2
todo.md
2
todo.md
@@ -29,3 +29,5 @@ We use a KassenSichV **`SonstigerVorgang`** transaction as the absolute cryptogr
|
|||||||
```text
|
```text
|
||||||
[TSE Signed Genesis] -> [Tx 2 (prev_hash = Genesis Signature)] -> [Tx 3] -> ...
|
[TSE Signed Genesis] -> [Tx 2 (prev_hash = Genesis Signature)] -> [Tx 3] -> ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
webhook into public applet.
|
||||||
Reference in New Issue
Block a user