Skip to content

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ểuMặc địnhMô tả
searchString
sortBrandSortNAME_ASC
pageInt1
pageSizeInt50

Trả về BrandPage!

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

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ểuMặc địnhMô tả
entityCatalogEntity!
codeString
nameString
excludeIdID

Trả về CatalogKeyAvailability!

FieldKiểuMô tả
codeAvailableBooleanFalse when another live row has the same code (trimmed, case-insensitive).
nameAvailableBooleanFalse 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ểuMặc địnhMô tả
searchString
statusCategoryStatus
pageInt1
pageSizeInt20

Trả về CategoryPage!

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

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ểuMặc địnhMô tả
ids[ID!]!

Trả về CategoryDeletePreview!

FieldKiểuMô tả
archivedAttributeCountInt!Live attributes of these categories that become ARCHIVED (Lưu trữ); they stay on products.
productsKeepingValuesInt!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ểuMặc địnhMô tả
searchString
statusCategoryStatus

Trả về CategoryTree!

FieldKiểuMô 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.
totalInt!Rows matching the filter (context rows not counted). 0 = nothing matches.
sourceStatusSourceStatus!

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ểuMặc địnhMô tả
nameString!
excludeIdID

Trả về ProductUnitNameAvailability!

FieldKiểuMô tả
nameAvailableBoolean!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ểuMặc địnhMô tả
searchString
forSaleBoolean
hasConversionBoolean
includeIdID
limitInt100

Trả về [ProductUnitOption!]!

FieldKiểuMô tả
idID!
nameString!
baseUnitIdIDBase of its conversion group (null: standalone or itself a base): units of one group share coalesce(baseUnitId, id).
factorFloat
forSaleBoolean!

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ểuMặc địnhMô tả
searchString
statusProductUnitStatus
forSaleBoolean
hasConversionBoolean
sortProductUnitSortNAME_ASC
pageInt1
pageSizeInt50

Trả về ProductUnitPage!

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

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ểuMặc địnhMô tả
reasonProductUnitUnmatchedReason
pageInt1
pageSizeInt50

Trả về ProductUnitUnmatchedPage!

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

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ểuMặc địnhMô tả
inputDeleteBrandInput!

Trả về DeleteBrandResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
affectedProductCountInt!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ểuMặc địnhMô tả
inputDeleteBrandsInput!

Trả về DeleteBrandsResult!

FieldKiểuMô tả
aggregateIdID!First id of the batch in sorted order.
versionInt!New version of that first row.
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
deletedCountInt!
affectedProductCountInt!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ểuMặc địnhMô tả
inputDeleteCategoriesInput!

Trả về DeleteCategoriesResult!

FieldKiểuMô tả
aggregateIdID!First id of the batch in sorted order.
versionInt!New version of that first row.
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
deletedCountInt!
affectedProductCountInt!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ểuMặc địnhMô tả
inputDeleteCategoryInput!

Trả về DeleteCategoryResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
affectedProductCountInt!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ểuMặc địnhMô tả
inputDeleteProductUnitInput!

Trả về DeleteProductUnitResult!

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

saveBrand ​

Create or edit a brand. Requires catalog.write.

mutation · quyền: catalog.write

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

Trả về SaveBrandResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False when an edit asked for nothing new: nothing written, version unchanged, no audit row. Always true for a create.
brandBrand!

saveCategory ​

Create or edit a category. Requires catalog.write.

mutation · quyền: catalog.write

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

Trả về SaveCategoryResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False when an edit asked for nothing new: nothing written, version unchanged, no audit row. Always true for a create.
categoryCategory!

saveProductUnit ​

Create or edit a product unit. Requires catalog.write.

mutation · quyền: catalog.write

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

Trả về SaveProductUnitResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False when an edit asked for nothing new: nothing written, version unchanged, no audit row. Always true for a create.
unitProductUnit!

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ểuMặc địnhMô tả
inputSetProductUnitStatusInput!

Trả về SetProductUnitStatusResult!

FieldKiểuMô tả
aggregateIdID!
versionInt!
statusCommandStatus!
requestIdID!
correlationIdID!
nextActionNextAction
changedBoolean!False when the unit already had that status: nothing written, no audit row.
unitProductUnit!

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17