app sbucategories

This commit is contained in:
2026-09-08 11:49:34 +05:30
parent e87f09c4f2
commit 7d9e628fd0
2 changed files with 26 additions and 7 deletions

View File

@@ -21,11 +21,21 @@ type Productcount struct {
Outofstock int `json:"outofstock"`
}
// ProductCategoryUpdate is one row of a bulk re-filing: which product, and
// which category it should sit in.
// ProductCategoryUpdate is one row of a bulk re-filing: which product, which
// category it sits in, and — the field that actually decides what a shopper
// sees — which subcategory.
//
// Both are here because they do different jobs. GetProducts filters on
// categoryid (the customer app asks for 2), while GetProductsBySubcategory
// GROUPS on subcategoryid, so the aisle heading in the app comes from the
// second and the first only decides whether the product is returned at all.
// A caller re-filing products into aisles sends categoryid 2 unchanged and the
// subcategory it worked out.
type ProductCategoryUpdate struct {
Productid int `json:"productid"`
Categoryid int `json:"categoryid"`
// Optional: 0 leaves whatever the product already has.
Subcategoryid int `json:"subcategoryid"`
}
type ProductCategory struct {