diff --git a/.agents/skills/backend/SKILL.md b/.agents/skills/backend/SKILL.md index a858ae0..d7a720b 100644 --- a/.agents/skills/backend/SKILL.md +++ b/.agents/skills/backend/SKILL.md @@ -17,46 +17,46 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body). ### Reusable types - `T1` = `{ article: T2 }` -- `T2` = `{ id: int, sku: str, name: str, slug: str, desc: str|null, seo: str|null, track_stock: bool, unitamount: num|null, weight: num|null, unit: T31, brand: T28|null, categoryIds: int[], photos: T26[], eans: str[], prices: T35[], 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: T31, brand: T28|null, categoryIds: int[], photos: T26[], eans: str[], prices: T37[], suppliers: T12[] }` - `T3` = `{ delivery: T4 }` -- `T4` = `{ id: int, number: str, type: str, supplierId: int|null, date: str, lines: T20[], files: T9[], externalNumber?: str|null, createdAt?: str, ledger?: T40 }` +- `T4` = `{ id: int, number: str, type: str, supplierId: int|null, date: str, lines: T21[], files: T9[], externalNumber?: str|null, createdAt?: str, ledger?: T41 }` - `T5` = `{ labeltemplate: T6 }` -- `T6` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: T16, thumb?: str|null }` +- `T6` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: T17, thumb?: str|null }` - `T7` = `{ order: T11 }` - `T8` = `{ quote: T11 }` - `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 }` - `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[] }` -- `T11` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T20[], createdAt?: str }` +- `T11` = `{ id: int, number: str, type: str, entityId: int|null, date: str, lines: T21[], createdAt?: str }` - `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 }` - `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` = `{ ledger: T15[] }` - `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: T32[], articleCount?: int }` - `T17` = `{ objects: T22[] }` -- `T18` = `{ printer: T23 }` -- `T19` = `{ entity: T27 }` -- `T20` = `{ id: int, sku: str|null, name: str|null, pu: num, amount: num, net: num, rebate: num, taxrate: num, comment: str|null }` -- `T21` = `{ id: str, type: str, x: num, y: num, w?: num, h?: num, text?: str, font?: str, fontSize?: num, barcodeFormat?: str }` +- `T18` = `{ objects: T23[] }` +- `T19` = `{ printer: T24 }` +- `T20` = `{ entity: T27 }` +- `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 }` -- `T23` = `{ id: int, company_id: int, address: str, type: str, sort: int, model?: str|null, serial?: str|null, desc?: str|null }` -- `T24` = `{ id: int, name: str, sort: int, exclusive: bool, values: T38[] }` +- `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 }` - `T25` = `{ amount: num, net: num, taxrate: num, sku?: str|null, name?: str|null, pu?: num, rebate?: num, comment?: str|null }` - `T26` = `{ sort: int, fullHash: str, fullW: int, fullH: int, fullSize: int, thumbW: int, thumbH: int, thumbHash: str }` - `T27` = `{ id: int, customergroupId: int, firstName: str|null, name: str, number: str|null, createdAt: str, updatedAt: str }` - `T28` = `{ name: str, id?: int|null, fullHash?: str|null, thumbW?: int|null, thumbH?: int|null, thumbHash?: str|null }` - `T29` = `{ id: int, companyuser_id: int, provider: str, model: str, created_at: str, updated_at: str, state: str }` -- `T30` = `{ article: T33 }` +- `T30` = `{ article: T35 }` - `T31` = `{ si: str, basesi: str, basesifactor: num, symbol?: str|null, name?: str|null }` -- `T32` = `{ id: int, iso639: str, name: str, taxrate: num, reducedtaxrate: num }` -- `T33` = `{ id: int, categoryId: int, name: str, sku: str, track_stock: bool }` -- `T34` = `{ id: int, email: str, selectedCompanyId: int|null, picture?: str }` -- `T35` = `{ minmultiplier: num, net: num, taxRate: num, customergroupId: int }` -- `T36` = `{ fullHash: str, thumbW: int, thumbH: int, thumbHash: str }` -- `T37` = `{ id: int, entityId: int, contactType: str, contact: str }` -- `T38` = `{ id: int, attributeId: int, value: str, sort: int }` -- `T39` = `{ id: int, name: str, createdAt: str, updatedAt: str }` -- `T40` = `{ totalPositions: int, completelyOnLedgerPositions: int }` -- `T41` = `{ id: int, name: str, sort: int, exclusive: bool }` +- `T32` = `{ id: int, attributeId: int, value: str, sort: int, articleCount?: int }` +- `T33` = `{ id: int, name: str, sort: int, exclusive: bool, articleCount?: int }` +- `T34` = `{ id: int, iso639: str, name: str, taxrate: num, reducedtaxrate: num }` +- `T35` = `{ id: int, categoryId: int, name: str, sku: str, track_stock: bool }` +- `T36` = `{ id: int, email: str, selectedCompanyId: int|null, picture?: str }` +- `T37` = `{ minmultiplier: num, net: num, taxRate: num, customergroupId: int }` +- `T38` = `{ fullHash: str, thumbW: int, thumbH: int, thumbHash: str }` +- `T39` = `{ id: int, entityId: int, contactType: str, contact: str }` +- `T40` = `{ id: int, name: str, createdAt: str, updatedAt: str }` +- `T41` = `{ totalPositions: int, completelyOnLedgerPositions: int }` - `T42` = `{ warehouse: T44 }` - `T43` = `{ net: num, taxId: int, taxRate?: num|null }` - `T44` = `{ id: int, name: str, sort: int }` @@ -120,7 +120,7 @@ _none_ - Returns: `201 T30` #### Attach an existing article as a child to a parent article — `PUT /article/{sku}/children` - Params: `sku: str, body: { sku: str, attributeValueId?: int, value?: str, reparent?: bool }` -- Returns: `200 { article: T33, children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }` +- Returns: `200 { article: T35, 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}` - Params: `sku: str, childSku: str, query: deleteArticle?: bool` - Returns: `200 { success: bool, deleted: bool }` @@ -189,19 +189,19 @@ _none_ #### List attribute names — `GET /attributename` _none_ -- Returns: `200 { attributenames: T24[] }` +- Returns: `200 { attributenames: T16[] }` #### Create attribute name — `POST /attributename` - Params: `body: { name: str, sort?: int, exclusive?: bool }` -- Returns: `201 { attributename: T24 }` +- Returns: `201 { attributename: T16 }` #### Reorder attribute names — `PUT /attributename/order` - Params: `body: { attributenameIds: int[] }` - Returns: `200 { ok: bool }` #### List values for an attribute — `GET /attributename/{attributeId}/value` - Params: `attributeId: int` -- Returns: `200 { values: T38[] }` +- Returns: `200 { values: T32[] }` #### Create value for an attribute — `POST /attributename/{attributeId}/value` - Params: `attributeId: int, body: { value: str, sort?: int }` -- Returns: `201 { attributevalue: T38 }` +- Returns: `201 { attributevalue: T32 }` #### Reorder values of an attribute — `PUT /attributename/{attributeId}/value/order` - Params: `attributeId: int, body: { attributevalueIds: int[] }` - Returns: `200 { ok: bool }` @@ -210,7 +210,7 @@ _none_ - Returns: `200 { ok: bool }` #### Update attribute name — `PATCH /attributename/{id}` - Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }` -- Returns: `200 { attributename: T24 }` +- Returns: `200 { attributename: T16 }` ### Section: /attributevalue @@ -219,28 +219,28 @@ _none_ - Returns: `200 { ok: bool }` #### Update attribute value — `PATCH /attributevalue/{id}` - Params: `id: int, body: { value?: str, sort?: int }` -- Returns: `200 { attributevalue: T38 }` +- Returns: `200 { attributevalue: T32 }` #### Delete attribute value image — `DELETE /attributevalue/{id}/image` - Params: `id: int` -- Returns: `200 { attributevalue: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T36[] } }` +- Returns: `200 { attributevalue: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T38[] } }` #### Add or replace attribute value image — `POST /attributevalue/{id}/image` - Params: `id: int, image/avif` -- Returns: `201 { attributevalue: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T36[] } }` +- Returns: `201 { attributevalue: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T38[] } }` ### Section: /auth #### Login with Google ID token — `POST /auth/login` - Params: `body: { idToken: str }` -- Returns: `200 { message: str, user: T34 }` +- Returns: `200 { message: str, user: T36 }` #### Logout — `POST /auth/logout` _none_ - Returns: `200 { message: str }` #### Current user — `GET /auth/me` _none_ -- Returns: `200 { user: T34, googleClientId: str }` +- Returns: `200 { user: T36, googleClientId: str }` #### Set selected company — `PUT /auth/selected-company` - Params: `body: { companyId: int }` -- Returns: `200 { user: T34 }` +- Returns: `200 { user: T36 }` ### Section: /brand @@ -249,7 +249,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 }` #### Create brand — `POST /brand` - Params: `body: { name: str, gsprpinfo?: str }` -- Returns: `201 { brand: { id: int, name: str, pics: T36[], gsprpinfo?: str|null } }` +- Returns: `201 { brand: { id: int, name: str, pics: T38[], gsprpinfo?: str|null } }` #### Delete brand — `DELETE /brand/{id}` - Params: `id: int` - Returns: `204 void` @@ -258,10 +258,10 @@ _none_ - Returns: `200 { brand: { id: int, name: str, touchedArticleCount: int, gsprpinfo?: str|null } }` #### Delete brand image — `DELETE /brand/{id}/image` - Params: `id: int` -- Returns: `200 { brand: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T36[] } }` +- Returns: `200 { brand: { id: int, thumbW: int|null, thumbH: int|null, thumbHash: str|null, pics: T38[] } }` #### Add or replace brand image — `POST /brand/{id}/image` - Params: `id: int, image/avif` -- Returns: `201 { brand: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T36[] } }` +- Returns: `201 { brand: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T38[] } }` ### Section: /category @@ -312,10 +312,10 @@ _none_ #### List companies — `GET /company` _none_ -- Returns: `200 { companies: T32[] }` +- Returns: `200 { companies: T34[] }` #### Create company — `POST /company` - Params: `body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }` -- Returns: `201 { company: T32, user: T34 }` +- Returns: `201 { company: T34, user: T36 }` #### Get company history — `GET /company/history` - Params: `query: limit?: int` - Returns: `200 { history: { id: int, date: str, text: str, companyuserId?: int|null }[], truncated: bool }` @@ -339,7 +339,7 @@ _none_ - Returns: `204 void` #### Update company — `PUT /company/{id}` - Params: `id: int, body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }` -- Returns: `200 { company: T32 }` +- Returns: `200 { company: T34 }` ### Section: /customergroup @@ -363,7 +363,7 @@ _none_ #### List deliveries — `GET /delivery` _none_ -- Returns: `200 { deliveries: { id: int, number: str, type: str, supplierId: int|null, date: str, externalNumber?: str|null, createdAt?: str, ledger?: T40 }[] }` +- Returns: `200 { deliveries: { id: int, number: str, type: str, supplierId: int|null, date: str, externalNumber?: str|null, createdAt?: str, ledger?: T41 }[] }` #### 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 } }[] }` - Returns: `201 T3` @@ -399,7 +399,7 @@ _none_ - Returns: `200 { entities: T27[] }` #### Create entity — `POST /entity` - 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` _none_ - Returns: `200 { number: str }` @@ -417,25 +417,25 @@ _none_ - Returns: `200 { address: T13 }` #### List entity contacts — `GET /entity/{entityId}/contact` - Params: `entityId: int` -- Returns: `200 { contacts: T37[] }` +- Returns: `200 { contacts: T39[] }` #### Create entity contact — `POST /entity/{entityId}/contact` - Params: `entityId: int, body: { contactType: str, contact: str }` -- Returns: `201 { contact: T37 }` +- Returns: `201 { contact: T39 }` #### Delete entity contact — `DELETE /entity/{entityId}/contact/{id}` - Params: `entityId: int, id: int` - Returns: `204 void` #### Update entity contact — `PATCH /entity/{entityId}/contact/{id}` - Params: `entityId: int, id: int, body: { contactType?: str, contact?: str }` -- Returns: `200 { contact: T37 }` +- Returns: `200 { contact: T39 }` #### Delete entity — `DELETE /entity/{id}` - Params: `id: int` - Returns: `204 void` #### Get entity — `GET /entity/{id}` - Params: `id: int` -- Returns: `200 T19` +- Returns: `200 T20` #### Update entity — `PATCH /entity/{id}` - Params: `id: int, body: { name?: str, firstName?: str|null, number?: str|null }` -- Returns: `200 T19` +- Returns: `200 T20` ### Section: /events @@ -477,7 +477,7 @@ _none_ _none_ - Returns: `200 { labeltemplates: { id: int, name: str, width: num, height: num, dpi: int, type: str, thumb?: str|null }[] }` #### Create label template — `POST /labeltemplate` -- Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: T17 }` +- Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: T18 }` - Returns: `201 T5` #### Delete label template — `DELETE /labeltemplate/{id}` - Params: `id: int` @@ -486,10 +486,10 @@ _none_ - Params: `id: int` - Returns: `200 T5` #### 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` #### 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` ### Section: /ledger @@ -613,10 +613,10 @@ _none_ #### List printers — `GET /printer` _none_ -- Returns: `200 { printers: T23[] }` +- Returns: `200 { printers: T24[] }` #### Create printer — `POST /printer` - 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` - Params: `body: { printerIds: int[] }` - Returns: `200 { printerIds: int[] }` @@ -625,22 +625,22 @@ _none_ - Returns: `204 void` #### Get printer by ID — `GET /printer/{id}` - Params: `id: int` -- Returns: `200 T18` +- Returns: `200 T19` #### Update printer (partial) — `PATCH /printer/{id}` - Params: `id: int, body: { address?: str, type?: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }` -- Returns: `200 T18` +- Returns: `200 T19` #### Update printer — `PUT /printer/{id}` - Params: `id: int, body: { address?: str, type?: str, model?: str|null, serial?: str|null, sort?: int, desc?: str|null }` -- Returns: `200 T18` +- Returns: `200 T19` ### Section: /propertyname #### List property names — `GET /propertyname` _none_ -- Returns: `200 { propertynames: T41[] }` +- Returns: `200 { propertynames: T33[] }` #### Create property name — `POST /propertyname` - Params: `body: { name: str, sort?: int, exclusive?: bool }` -- Returns: `201 { propertyname: T41 }` +- Returns: `201 { propertyname: T33 }` #### Reorder property names — `PUT /propertyname/order` - Params: `body: { propertynameIds: int[] }` - Returns: `200 { ok: bool }` @@ -649,7 +649,7 @@ _none_ - Returns: `200 { ok: bool }` #### Update property name — `PATCH /propertyname/{id}` - Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }` -- Returns: `200 { propertyname: T41 }` +- Returns: `200 { propertyname: T33 }` ### Section: /public @@ -727,16 +727,16 @@ _none_ #### List suppliers — `GET /supplier` _none_ -- Returns: `200 { suppliers: T39[] }` +- Returns: `200 { suppliers: T40[] }` #### Create supplier — `POST /supplier` - Params: `body: { name: str }` -- Returns: `201 { supplier: T39 }` +- Returns: `201 { supplier: T40 }` #### Delete supplier — `DELETE /supplier/{id}` - Params: `id: int` - Returns: `204 void` #### Update supplier — `PATCH /supplier/{id}` - Params: `id: int, body: { name: str }` -- Returns: `200 { supplier: T39 }` +- Returns: `200 { supplier: T40 }` #### List supplier articles by SKUs — `GET /supplier/{id}/articles` - 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 }[] }` diff --git a/src/components/merkmale/ArtikelMerkmalAuswahl.jsx b/src/components/merkmale/ArtikelMerkmalAuswahl.jsx index 2c8178f..5799332 100644 --- a/src/components/merkmale/ArtikelMerkmalAuswahl.jsx +++ b/src/components/merkmale/ArtikelMerkmalAuswahl.jsx @@ -121,11 +121,13 @@ class ArtikelMerkmalAuswahl extends PureComponent { }; render() { - const { attribute, isSelected, onSelect, disabled, sx } = this.props; + const { attribute: propAttribute, isSelected, onSelect, disabled, sx } = this.props; + const attribute = propAttribute ?? this.props.item; const { draft, busy } = this.state; const name = attribute?.name ?? ''; const exclusive = attribute ? Boolean(attribute.exclusive) : true; const isDisabled = disabled || busy; + const articleCount = attribute?.articleCount ?? 0; return ( + e.stopPropagation()} + sx={{ + height: 24, + width: 52, + minWidth: 52, + maxWidth: 52, + fontSize: '0.75rem', + fontWeight: 600, + fontVariantNumeric: 'tabular-nums', + bgcolor: 'action.hover', + color: articleCount > 0 ? 'text.primary' : 'text.disabled', + flexShrink: 0, + '& .MuiChip-label': { + px: 0.5, + textAlign: 'center', + width: '100%', + }, + }} + /> + + 0 ? 'text.primary' : 'text.disabled', + flexShrink: 0, + '& .MuiChip-label': { + px: 0.5, + textAlign: 'center', + width: '100%', + }, + }} + /> + + 0 ? 'text.primary' : 'text.disabled', + flexShrink: 0, + '& .MuiChip-label': { + px: 0.5, + textAlign: 'center', + width: '100%', + }, + }} + /> +