product images added to the catalogue

This commit is contained in:
2026-08-11 15:05:27 +05:30
parent d35caf34d3
commit c179e4d642
9 changed files with 412 additions and 11 deletions

View File

@@ -62,6 +62,23 @@ type Products struct {
Pricingid int `json:"pricingid,omitempty"`
Productname string `json:"productname,omitempty"`
Productimage string `json:"productimage,omitempty"`
// Every photo the product has, as a JSON array of URLs.
//
// `Productimage` above stays the first of these and is left untouched: every
// existing reader — the store catalogue, the customer app, the POS catalogue
// pull, each order line — reads that column, and repointing them all at an
// array is a far larger change than giving the extra photos somewhere to live.
//
// Before this the import kept `Images[0]` and discarded the rest, so a product
// with ten photos in the global catalogue arrived in a shop with one. 90 of
// nestle's 123 products have more than one.
//
// Held as a string rather than a []string because GORM's raw scan-into-struct
// silently drops slice-kind destination fields — the same reason
// `catalogueProductColumns` casts its text[] columns to text.
Productimages string `json:"productimages,omitempty" gorm:"column:productimages;type:jsonb"`
Productdesc string `json:"productdesc,omitempty"`
Productsku string `json:"productsku,omitempty"`
Brandid int `json:"brandid,omitempty"`