feat(articlesupplier): add listByEntityAndSkus API with linked article, photos, and eans
This commit is contained in:
@@ -100,6 +100,35 @@ const suppliers = await store.articlesupplier.listByArticleSku(42, 'SKU-1');
|
||||
// => [{ id, articleId, entityId, supplierName, sku, pu, stock, priceId, price }]
|
||||
```
|
||||
|
||||
## `articlesupplier.listByEntityAndSkus`
|
||||
|
||||
*Source: `src/store/articlesupplier/listByEntityAndSkus.js`*
|
||||
|
||||
Lists article-supplier assignments for a given supplier (entityId) and SKU list, including linked article details (name, slug, photos/articlepic, eans/articleean).
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `entityIdOrOptions` | `number|{entityId?: number, supplierId?: number, skus?: string[]|string}` | The supplier entity id or an options object. |
|
||||
| `[maybeSkus]` | `string[]|string` | The list of SKUs to filter by (or single SKU string). |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<Array<{id: number, articleId: number, entityId: number, supplierName: string|null, sku: string|null, pu: number, stock: number|null, sort: number, priceId: number|null, price: {net: number, taxId: number, taxRate?: number}|null, article: {id: number, sku: string, name: string|null, slug: string|null, photos: Array<{sort: number, thumbhash: string, hash: string, thumbw: number, thumbh: number}>, articlepic: Array<{sort: number, thumbhash: string, hash: string, thumbw: number, thumbh: number}>, eans: string[], articleean: string[]}}>>` — The supplier assignments with article details.
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If user is not authorized, entityId is missing, or supplier does not exist.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const items = await store.articlesupplier.listByEntityAndSkus(42, 5, ['SKU-1', 'SKU-2']);
|
||||
// => [{ id, articleId, entityId, supplierName, sku, pu, stock, sort, price, article: { id, sku, name, slug, photos, eans } }]
|
||||
```
|
||||
|
||||
## `articlesupplier.order`
|
||||
|
||||
*Source: `src/store/articlesupplier/order.js`*
|
||||
|
||||
Reference in New Issue
Block a user