product on shelf

This commit is contained in:
2026-08-31 14:59:48 +05:30
parent ffc66462fc
commit 4bce5ac854
6 changed files with 103 additions and 0 deletions

View File

@@ -59,6 +59,24 @@ type CatalogueUpload struct {
// the service reports, so a drop that never runs still says how big it was.
Rowcount int `json:"rowcount" gorm:"column:rowcount"`
// The sheet itself, as the console parsed it: SKU, price and opening stock
// per row, as JSON.
//
// Stored because the ingest service cannot hold it and nothing else can.
// Their pipeline writes the GLOBAL catalogue, which every merchant shares
// and which therefore carries no price and no stock; both live only in the
// sheet. Shelving is the step that joins the two, and it used to be possible
// only in the browser tab that did the upload, because that tab was the only
// place the parsed rows existed.
//
// That failed in the ordinary case rather than a rare one. A drop waits for
// their admin to release it and the run then takes minutes, so by the time
// there is anything to shelve the tab is usually gone — and the products sit
// in the global catalogue, unpriced and unstocked, with no way left to
// finish. Keeping the rows here is what lets the Uploads page complete it
// days later.
Sheetrows string `json:"sheetrows" gorm:"column:sheetrows;type:jsonb"`
// ── Cached from the ingest service, by whoever last polled ──────────────
Laststatus string `json:"laststatus" gorm:"column:laststatus;default:pending"`