This commit is contained in:
seb
2026-10-08 12:59:10 +02:00
parent b51149c7f0
commit 46ea04c0cb
8 changed files with 33 additions and 106 deletions

View File

@@ -95,11 +95,8 @@ Creates a new article under a given parent category, allocating a SKU and a defa
| `input.googleAuthId` | `number` | The id of the Google auth user. |
| `input.parentId` | `number` | The id of the parent category. |
| `input.name` | `string` | The article name. |
| `[input.description]` | `string` | The article description. |
| `[input.desc]` | `string` | Alias for description. |
| `[input.seo]` | `object|string` | The SEO configuration or JSON string. |
| `[input.seoTitle]` | `string` | The SEO title. |
| `[input.seoDescription]` | `string` | The SEO meta description. |
| `[input.desc]` | `string` | The article description text/HTML. |
| `[input.seo]` | `string` | The article SEO text. |
| `[input.track_stock=true]` | `boolean|number` | Whether inventory stock is tracked. |
| `[tx]` | `object` | Optional transaction to run within. |
@@ -189,7 +186,7 @@ Returns the full detail of an article by its SKU, including unit, brand, categor
**Returns**
`Promise<{article: {id: number, sku: string, name: string, slug: string, description: string|null, seo: string|null, seoTitle: string|null, seoDescription: string|null, unitamount: number|null, weight: number|null, track_stock: boolean, unit: {si: string|null, basesi: string|null, basesifactor: number|null, symbol: string|null, name: string|null}, brand: {id: number|null, name: string, fullHash: string|null, thumbW: number|null, thumbH: number|null, thumbHash: string|null}|null, categoryIds: number[], photos: Array<{sort: number, fullHash: string, fullW: number, fullH: number, fullSize: number, thumbW: number, thumbH: number, thumbHash: string}>, eans: string[], prices: Array<{minmultiplier: number, net: number, taxRate: number, customergroupId: number}>, suppliers: Array<{id: number, articleId: number, entityId: number, supplierName: string|null, sku: string|null, pu: number, stock: number|null, sort: number, price: {net: number, taxId: number, taxRate?: number}|null}>, optionsCount: number, articleListCount: number, childCount: number, parentArticleId: number|null, parentSku: string|null}}>` — The full article detail.
`Promise<{article: {id: number, sku: string, name: string, slug: string, desc: string|null, seo: string|null, unitamount: number|null, weight: number|null, track_stock: boolean, unit: {si: string|null, basesi: string|null, basesifactor: number|null, symbol: string|null, name: string|null}, brand: {id: number|null, name: string, fullHash: string|null, thumbW: number|null, thumbH: number|null, thumbHash: string|null}|null, categoryIds: number[], photos: Array<{sort: number, fullHash: string, fullW: number, fullH: number, fullSize: number, thumbW: number, thumbH: number, thumbHash: string}>, eans: string[], prices: Array<{minmultiplier: number, net: number, taxRate: number, customergroupId: number}>, suppliers: Array<{id: number, articleId: number, entityId: number, supplierName: string|null, sku: string|null, pu: number, stock: number|null, sort: number, price: {net: number, taxId: number, taxRate?: number}|null}>, optionsCount: number, articleListCount: number, childCount: number, parentArticleId: number|null, parentSku: string|null}}>` — The full article detail.
**Throws**
@@ -669,11 +666,8 @@ Updates an article's name and/or unit (SI and amount), recording history.
| `sku` | `string` | The article SKU. |
| `patch` | `object` | The update patch. |
| `[patch.name]` | `string` | The new article name. |
| `[patch.description]` | `string` | The article description. |
| `[patch.desc]` | `string` | Alias for description. |
| `[patch.seo]` | `object|string` | The SEO configuration or JSON string. |
| `[patch.seoTitle]` | `string` | The SEO title. |
| `[patch.seoDescription]` | `string` | The SEO meta description. |
| `[patch.desc]` | `string` | The article description text/HTML. |
| `[patch.seo]` | `string` | The article SEO text. |
| `[patch.unitSi]` | `string` | The new unit SI code. |
| `[patch.unitamount]` | `number` | The new unit amount (must be > 0). |
| `[patch.track_stock]` | `boolean|number` | Whether inventory stock is tracked. |