nutrition field
This commit is contained in:
@@ -172,6 +172,20 @@ type Products struct {
|
||||
// scan-into-struct silently drops slice- and map-kind destination fields.
|
||||
Cataloguefacts string `json:"cataloguefacts,omitempty" gorm:"column:cataloguefacts;type:jsonb"`
|
||||
|
||||
// The nutrition panel, for the product screen in the customer app.
|
||||
//
|
||||
// `gorm:"-"`: not a column. It is unpacked from Cataloguefacts above, which
|
||||
// is where the import snapshots it — a second column holding the same facts
|
||||
// is a second thing to keep in step, and this one has no writer of its own.
|
||||
//
|
||||
// ABSENT rather than null when a product has no nutrition. Most products on
|
||||
// the platform have none today, and `"nutrition": null` on every row of a
|
||||
// mobile response is payload spent saying nothing. An app should read a
|
||||
// missing key as "not known", never as "this food has no nutrition".
|
||||
//
|
||||
// Set by the service, not the repository — see decorateNutrition.
|
||||
Nutrition *NutritionPanel `json:"nutrition,omitempty" gorm:"-"`
|
||||
|
||||
Productdesc string `json:"productdesc,omitempty"`
|
||||
Productsku string `json:"productsku,omitempty"`
|
||||
Brandid int `json:"brandid,omitempty"`
|
||||
@@ -226,22 +240,22 @@ type Products struct {
|
||||
}
|
||||
|
||||
type Locationproducts struct {
|
||||
Productid int `json:"productid"`
|
||||
AppLocationid int `json:"applocationid" gorm:"column:applocationid"`
|
||||
Productlocationid int `json:"productlocationid" gorm:"->"`
|
||||
Tenantid int `json:"tenantid,omitempty"`
|
||||
Categoryid int `json:"categoryid"`
|
||||
Categoryname string `json:"categoryname" gorm:"->"`
|
||||
Subcategoryid int `json:"subcategoryid,omitempty"`
|
||||
Subcategoryname string `json:"Subcategoryname" gorm:"->"`
|
||||
Catalogueid int `json:"catalogueid,omitempty"`
|
||||
Addonid int `json:"addonid,omitempty"`
|
||||
Discountid int `json:"discountid,omitempty"`
|
||||
Pricingid int `json:"pricingid,omitempty"`
|
||||
Productname string `json:"productname,omitempty"`
|
||||
Productimage string `json:"productimage,omitempty"`
|
||||
Productdesc string `json:"productdesc,omitempty"`
|
||||
Productsku string `json:"productsku,omitempty"`
|
||||
Productid int `json:"productid"`
|
||||
AppLocationid int `json:"applocationid" gorm:"column:applocationid"`
|
||||
Productlocationid int `json:"productlocationid" gorm:"->"`
|
||||
Tenantid int `json:"tenantid,omitempty"`
|
||||
Categoryid int `json:"categoryid"`
|
||||
Categoryname string `json:"categoryname" gorm:"->"`
|
||||
Subcategoryid int `json:"subcategoryid,omitempty"`
|
||||
Subcategoryname string `json:"Subcategoryname" gorm:"->"`
|
||||
Catalogueid int `json:"catalogueid,omitempty"`
|
||||
Addonid int `json:"addonid,omitempty"`
|
||||
Discountid int `json:"discountid,omitempty"`
|
||||
Pricingid int `json:"pricingid,omitempty"`
|
||||
Productname string `json:"productname,omitempty"`
|
||||
Productimage string `json:"productimage,omitempty"`
|
||||
Productdesc string `json:"productdesc,omitempty"`
|
||||
Productsku string `json:"productsku,omitempty"`
|
||||
|
||||
// Three columns this read used to leave in the table.
|
||||
//
|
||||
@@ -264,19 +278,19 @@ type Locationproducts struct {
|
||||
Productimages string `json:"productimages,omitempty"`
|
||||
Cataloguefacts string `json:"cataloguefacts,omitempty"`
|
||||
|
||||
Brandid int `json:"brandid,omitempty"`
|
||||
Productbrand string `json:"productbrand,omitempty"`
|
||||
Productunit string `json:"productunit"`
|
||||
Unitvalue string `json:"unitvalue"`
|
||||
Toppicks string `json:"toppicks,omitempty"`
|
||||
Productcost float64 `json:"productcost,omitempty"`
|
||||
Taxamount float64 `json:"taxamount,omitempty"`
|
||||
Taxpercent float64 `json:"taxpercent,omitempty"`
|
||||
Producttax int `json:"producttax" gorm:"default:0"`
|
||||
Productstock int `json:"productstock" gorm:"default:0"`
|
||||
Productcombo int `json:"productcombo" gorm:"default:0"`
|
||||
Variants int `json:"variants" gorm:"default:0"`
|
||||
Quantity int `json:"quantity"`
|
||||
Brandid int `json:"brandid,omitempty"`
|
||||
Productbrand string `json:"productbrand,omitempty"`
|
||||
Productunit string `json:"productunit"`
|
||||
Unitvalue string `json:"unitvalue"`
|
||||
Toppicks string `json:"toppicks,omitempty"`
|
||||
Productcost float64 `json:"productcost,omitempty"`
|
||||
Taxamount float64 `json:"taxamount,omitempty"`
|
||||
Taxpercent float64 `json:"taxpercent,omitempty"`
|
||||
Producttax int `json:"producttax" gorm:"default:0"`
|
||||
Productstock int `json:"productstock" gorm:"default:0"`
|
||||
Productcombo int `json:"productcombo" gorm:"default:0"`
|
||||
Variants int `json:"variants" gorm:"default:0"`
|
||||
Quantity int `json:"quantity"`
|
||||
// Price is the per-store selling price from productlocations.price — the one
|
||||
// CreateProductLocation upserts. Read-only here: it comes from the joined
|
||||
// productlocations row, not from products. Without it a store could set a
|
||||
|
||||
Reference in New Issue
Block a user