Giao diện
API · catalog
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.
9 query · 9 mutation.
Query
brands
Flat list of live brands (WEB_ADMIN); a deleted brand never appears. search: case-insensitive, partial, on the name only (not the code). Brands have no status. Order by "sort" (default NAME_ASC), then id; name orders use the Vietnamese order. pageSize 1 to 500, default 50. Requires catalog.read.
query · quyền: catalog.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
search | String | ||
sort | BrandSort | NAME_ASC | |
page | Int | 1 | |
pageSize | Int | 50 |
Trả về BrandPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [Brand!]! | |
page | Int! | |
pageSize | Int! | |
total | Int! | |
sourceStatus | SourceStatus! |
catalogKeyAvailability
Is a category or brand code / name free among live rows (soft-deleted rows do not count)? excludeId leaves out the row being edited. Advisory: the save checks again. Requires catalog.read.
query · quyền: catalog.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
entity | CatalogEntity! | ||
code | String | ||
name | String | ||
excludeId | ID |
Trả về CatalogKeyAvailability!
| Field | Kiểu | Mô tả |
|---|---|---|
codeAvailable | Boolean | False when another live row has the same code (trimmed, case-insensitive). |
nameAvailable | Boolean | False when another live row has the same name (trimmed, case-insensitive). |
categories
Category tree in tree order, siblings by name A to Z (Vietnamese order). Search is case-insensitive and partial on the name. Requires catalog.read.
query · quyền: catalog.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
search | String | ||
status | CategoryStatus | ||
page | Int | 1 | |
pageSize | Int | 20 |
Trả về CategoryPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [Category!]! | |
page | Int! | |
pageSize | Int! | |
total | Int! | |
sourceStatus | SourceStatus! |
categoryDeletePreview
The delete popup line 'N thông số sẽ chuyển sang Lưu trữ, M sản phẩm giữ giá trị' (single and batch). Requires catalog.write.
query · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
ids | [ID!]! |
Trả về CategoryDeletePreview!
| Field | Kiểu | Mô tả |
|---|---|---|
archivedAttributeCount | Int! | Live attributes of these categories that become ARCHIVED (Lưu trữ); they stay on products. |
productsKeepingValues | Int! | Live products holding a value of one of those attributes (they keep it). |
categoryTree
The whole category tree, not paged (WEB_ADMIN). search: case-insensitive, partial on the name; each match keeps its ancestors as context rows. status alone returns only rows in that status, without ancestors. Both combine with AND. Requires catalog.read.
query · quyền: catalog.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
search | String | ||
status | CategoryStatus |
Trả về CategoryTree!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [Category!]! | Matching rows and, with a search, their ancestors as context; tree order (parents first). |
contextIds | [ID!]! | Ids in items present only as an ancestor of a search match. Empty without a search. |
total | Int! | Rows matching the filter (context rows not counted). 0 = nothing matches. |
sourceStatus | SourceStatus! |
productUnitNameAvailability
Is a unit name free among live units (excludeId leaves out the unit being edited)? Advisory: the save checks again. Requires catalog.read.
query · quyền: catalog.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
name | String! | ||
excludeId | ID |
Trả về ProductUnitNameAvailability!
| Field | Kiểu | Mô tả |
|---|---|---|
nameAvailable | Boolean! | False when another live unit has the same name (trimmed, case-insensitive). |
productUnitOptions
ACTIVE units only, A to Z (Vietnamese order), for the product form. forSale / hasConversion filter (the product and accessory lists send forSale true); includeId is always returned too (the unit already chosen, whatever its state). limit 1 to 500, default 100. Requires catalog.read.
query · quyền: catalog.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
search | String | ||
forSale | Boolean | ||
hasConversion | Boolean | ||
includeId | ID | ||
limit | Int | 100 |
Trả về [ProductUnitOption!]!
| Field | Kiểu | Mô tả |
|---|---|---|
id | ID! | |
name | String! | |
baseUnitId | ID | Base of its conversion group (null: standalone or itself a base): units of one group share coalesce(baseUnitId, id). |
factor | Float | |
forSale | Boolean! |
productUnits
Live units (WEB_ADMIN); a deleted unit never appears. search: case-insensitive, partial, on the name. status filters ACTIVE or INACTIVE. Order by "sort" (default NAME_ASC), then id. pageSize 1 to 500, default 50. Requires catalog.read.
query · quyền: catalog.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
search | String | ||
status | ProductUnitStatus | ||
forSale | Boolean | ||
hasConversion | Boolean | ||
sort | ProductUnitSort | NAME_ASC | |
page | Int | 1 | |
pageSize | Int | 50 |
Trả về ProductUnitPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [ProductUnit!]! | |
page | Int! | |
pageSize | Int! | |
total | Int! | |
sourceStatus | SourceStatus! |
productUnitUnmatched
Old product unit labels without a unit, most affected live products first. Read-only report (G-UNIT: never auto-created). reason filters. pageSize 1 to 500, default 50. Requires catalog.read.
query · quyền: catalog.read
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
reason | ProductUnitUnmatchedReason | ||
page | Int | 1 | |
pageSize | Int | 50 |
Trả về ProductUnitUnmatchedPage!
| Field | Kiểu | Mô tả |
|---|---|---|
items | [ProductUnitUnmatched!]! | |
page | Int! | |
pageSize | Int! | |
total | Int! | |
sourceStatus | SourceStatus! |
Mutation
deleteBrand
Soft-delete a brand; always allowed, its live products lose the link. Requires catalog.write.
mutation · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | DeleteBrandInput! |
Trả về DeleteBrandResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
affectedProductCount | Int! | Products that lose their brand link (warning only; Rule #3). |
deleteBrands
Soft-delete several brands at once, all or none (TH-US-04 AC03). Brands are always deletable; their live products lose the brand link. Refused, deleting nothing, when a selected brand was edited, deleted or is gone since the list was read (stale_version batch_changed with items[]); that refusal cancels the whole batch (Q-12). Requires catalog.write.
mutation · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | DeleteBrandsInput! |
Trả về DeleteBrandsResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | First id of the batch in sorted order. |
version | Int! | New version of that first row. |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
deletedCount | Int! | |
affectedProductCount | Int! | Sum over the batch (warning only; Rule #3). |
items | [DeletedBrand!]! | Every deleted brand, sorted by id. |
deleteCategories
Soft-delete several categories at once, all or none. Refused, deleting nothing, when a selected category still has live children (conflict has_children with blocked[]) or was edited, deleted or is gone since the list was read (stale_version batch_changed with items[]); both refusals cancel the whole batch (Q-12). Requires catalog.write.
mutation · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | DeleteCategoriesInput! |
Trả về DeleteCategoriesResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | First id of the batch in sorted order. |
version | Int! | New version of that first row. |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
deletedCount | Int! | |
affectedProductCount | Int! | Sum over the batch (warning only; Rule #3). |
items | [DeletedCategory!]! | Every deleted category, sorted by id. |
deleteCategory
Soft-delete a category without live children. Requires catalog.write.
mutation · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | DeleteCategoryInput! |
Trả về DeleteCategoryResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
affectedProductCount | Int! | Products that lose their category link (warning only; Rule #3). |
deleteProductUnit
Soft-delete an unused unit; conflict{reason: unit_in_use, productCount, usedBy, usage} while anything uses it (usedBy: PRODUCTS, BASE_OF_UNITS, ACCESSORIES, ATTRIBUTES, ATTRIBUTE_VALUES). Requires catalog.write.
mutation · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | DeleteProductUnitInput! |
Trả về DeleteProductUnitResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | |
version | Int! | Version of the soft-deleted row. |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction |
saveBrand
Create or edit a brand. Requires catalog.write.
mutation · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | SaveBrandInput! |
Trả về SaveBrandResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
changed | Boolean! | False when an edit asked for nothing new: nothing written, version unchanged, no audit row. Always true for a create. |
brand | Brand! |
saveCategory
Create or edit a category. Requires catalog.write.
mutation · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | SaveCategoryInput! |
Trả về SaveCategoryResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
changed | Boolean! | False when an edit asked for nothing new: nothing written, version unchanged, no audit row. Always true for a create. |
category | Category! |
saveProductUnit
Create or edit a product unit. Requires catalog.write.
mutation · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | SaveProductUnitInput! |
Trả về SaveProductUnitResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
changed | Boolean! | False when an edit asked for nothing new: nothing written, version unchanged, no audit row. Always true for a create. |
unit | ProductUnit! |
setProductUnitStatus
Deactivate or reactivate a unit; allowed while products use it (they keep it). Requires catalog.write.
mutation · quyền: catalog.write
| Tham số | Kiểu | Mặc định | Mô tả |
|---|---|---|---|
input | SetProductUnitStatusInput! |
Trả về SetProductUnitStatusResult!
| Field | Kiểu | Mô tả |
|---|---|---|
aggregateId | ID! | |
version | Int! | |
status | CommandStatus! | |
requestId | ID! | |
correlationId | ID! | |
nextAction | NextAction | |
changed | Boolean! | False when the unit already had that status: nothing written, no audit row. |
unit | ProductUnit! |