Skip to content

API · product-attribute ​

Trang sinh tự động

Parse từ schema.graphql (SDL backend export) bằng parser graphql. Mô tả và quyền lấy nguyên văn từ description trong SDL.

4 query · 11 mutation.

Query ​

previewProductAttributeMerge ​

Compatibility, counts, conflicts and the unit / option mapping of a merge (wizard step 3). Requires catalog.write.

query · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
sourceIdID!
targetIdID!
optionMap[ProductAttributeOptionMapInput!]

Trả về ProductAttributeMergePreview!

FieldKiểuMô tả
sourceProductAttribute!
targetProductAttribute!
compatibleBoolean!
blockProductAttributeMergeBlockNull when compatible.
textConversionBoolean!Any type -> TEXT: the values become their formatted text (warning).
affectedProductCountInt!Live products holding a source value.
conflicts[ProductAttributeMergeConflict!]!Products holding both: the target value is kept unless conflictChoices says otherwise.
outOfScopeProducts[ProductRef!]!Products whose category scope does not include the target; the merge is refused while any is listed.
unitsToAdd[ProductAttributeUnit!]!Source units the target lacks (unitAdds must list them).
options[ProductAttributeMergeOption!]!SELECT / MULTI_SELECT: each source option with its target match.

productAttribute ​

One live attribute (drawer). A deleted or merged one is not_found. Requires catalog.read.

query · quyền: catalog.read

Tham sốKiểuMặc địnhMô tả
idID!

Trả về ProductAttribute!

FieldKiểuMô tả
idID!
nameString!1..50 characters, unique ignoring case in its category branch (ancestors and descendants) or among Chung (R3).
descriptionStringAt most 500 characters.
dataTypeProductAttributeDataType!Immutable once a product holds a value.
categoryIdIDNull = Chung (COMMON).
categoryProductAttributeCategory
phaseProductAttributePhase!
inheritedFromProductAttributeCategoryRead for a category with inherited rows or for a product (forProduct): the ancestor it comes from; null for the category's own and for Chung.
units[ProductAttributeUnit!]!NUMBER only: the allowed units, the default first; empty = a number without unit.
decimalsIntNUMBER only: 0..4 decimals.
minValueFloatNUMBER only, in the default unit (compared on the base value).
maxValueFloat
isRequiredBoolean!Checked on Lưu sản phẩm (mode != DRAFT) only, never on Lưu nháp or reactivation.
positionInt!Order inside its category; seeds the order of required values added on a product form (DEC-OWN28-SPECS-ORDER).
statusProductAttributeStatus!
options[ProductAttributeOption!]!SELECT / MULTI_SELECT: every live option in order, INACTIVE included.
optionCountInt!
productCountInt!Live products holding a value (Số SP; 0 = Chưa dùng).
possibleDuplicates[ProductAttributeRef!]!Live attributes whose name is nearly the same (unaccented, trigram) in the same branch or among Chung (Có thể trùng).
versionInt!
createdAtDateTime!
updatedAtDateTime!

productAttributeNameSuggestions ​

Near-identical names while typing (unaccented, spaces folded, pg_trgm when available), in the scope of categoryId (its branch) plus Chung; excludeId leaves out the attribute being edited. Advisory: the save checks again. limit 1..20, default 5. Requires catalog.write.

query · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
nameString!
categoryIdID
excludeIdID
limitInt5

Trả về [ProductAttributeSuggestion!]!

FieldKiểuMô tả
attributeProductAttributeRef!
exactBoolean!Same name_key as the typed name: the form shows Đã có and picks it.
similarityFloat!0..1 similarity of the unaccented names.

productAttributes ​

Product attributes (WEB_ADMIN), deleted and merged ones never included, with the chip counts. Without forProduct: the central page and the category tab, ordered by category path, position, then name. pageSize 1..500, default 50. Requires catalog.read.

query · quyền: catalog.read

Tham sốKiểuMặc địnhMô tả
filterProductAttributeFilter
pageInt1
pageSizeInt50

Trả về ProductAttributePage!

FieldKiểuMô tả
items[ProductAttribute!]!
pageInt!
pageSizeInt!
totalInt!
sourceStatusSourceStatus!
countsProductAttributeCounts!

Mutation ​

addProductAttributeOption ​

Add an option (drawer, or quick add on the product form, Q4). Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputAddProductAttributeOptionInput!

Trả về ProductAttributeOptionResult!

FieldKiểuMô tả
aggregateIdID!The attribute id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
attributeProductAttribute!
optionProductAttributeOptionThe added / changed option; null after a delete.

createProductAttribute ​

Create an attribute (drawer, or the product form popup: saved at once). Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputCreateProductAttributeInput!

Trả về ProductAttributeResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False for an edit that changes nothing: no write, same version, no audit row.
attributeProductAttribute!

deleteProductAttribute ​

Soft-delete an attribute no product uses (Xoá hẳn; else conflict attribute_in_use). Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputDeleteProductAttributeInput!

Trả về DeleteProductAttributeResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!Version of the soft-deleted row.
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction

deleteProductAttributeOption ​

Remove an option no product uses. Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputDeleteProductAttributeOptionInput!

Trả về ProductAttributeOptionResult!

FieldKiểuMô tả
aggregateIdID!The attribute id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
attributeProductAttribute!
optionProductAttributeOptionThe added / changed option; null after a delete.

mergeProductAttribute ​

Merge source into target in one transaction (design §4): values move (or convert), the source is soft-deleted with merged_into_id = target, one ATTRIBUTE_MERGE history event per affected product. Refused (conflict merge_blocked {block}) when incompatible or a product is outside the target scope. Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputMergeProductAttributeInput!

Trả về MergeProductAttributeResult!

FieldKiểuMô tả
aggregateIdID!The target id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
targetProductAttribute!
affectedProductCountInt!Products whose value moved to the target (one ATTRIBUTE_MERGE history event each).

moveProductAttribute ​

Chuyển vào ngành hàng / Chuyển thành Chung (name taken: conflict duplicate_name). Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputMoveProductAttributeInput!

Trả về ProductAttributeResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False for an edit that changes nothing: no write, same version, no audit row.
attributeProductAttribute!

reorderProductAttributeOptions ​

Order the options. Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputReorderProductAttributeOptionsInput!

Trả về ProductAttributeOptionResult!

FieldKiểuMô tả
aggregateIdID!The attribute id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
attributeProductAttribute!
optionProductAttributeOptionThe added / changed option; null after a delete.

reorderProductAttributes ​

Order the attributes of one category (drag and drop). Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputReorderProductAttributesInput!

Trả về ReorderProductAttributesResult!

FieldKiểuMô tả
aggregateIdID!The category id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
items[ProductAttribute!]!The category's attributes in their new order.

setProductAttributeOptionStatus ​

Deactivate or reactivate an option. Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputSetProductAttributeOptionStatusInput!

Trả về ProductAttributeOptionResult!

FieldKiểuMô tả
aggregateIdID!The attribute id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
attributeProductAttribute!
optionProductAttributeOptionThe added / changed option; null after a delete.

updateProductAttribute ​

Edit an attribute. Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputUpdateProductAttributeInput!

Trả về ProductAttributeResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False for an edit that changes nothing: no write, same version, no audit row.
attributeProductAttribute!

updateProductAttributeOption ​

Rename an option. Requires catalog.write.

mutation · quyền: catalog.write

Tham sốKiểuMặc địnhMô tả
inputUpdateProductAttributeOptionInput!

Trả về ProductAttributeOptionResult!

FieldKiểuMô tả
aggregateIdID!The attribute id.
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
attributeProductAttribute!
optionProductAttributeOptionThe added / changed option; null after a delete.

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17