← back to index

U11 — Track Inventory toggle on product detailLOCAL

Direct U9 followup. U9 stored track_inventory via the XLSX import flow but never surfaced it for editing. U11 adds a checkbox to the General Information section on /cafe/products/[id], mirroring the U6 isHidden pattern.

Summary

Status
7/7 local · typecheck clean · awaiting Gate 1 approval
Repo
nix-cafe only — no migration, no backend, no schema
Files
4 modified · ~30 LOC net

What ships

7/7 local checks

TemplateRow interface gains trackInventory: boolean
Both DAOs select via T.trackInventory and return via t.trackInventory / tmpl.trackInventory
createTemplateAction returns trackInventory: false on the new row literal
updateProduct DAO: UpdateProductInput declares it; tmplPatch.trackInventory assignment present
updateProductAction signature widened to { isHidden?: boolean; trackInventory?: boolean }; dbPatch assignment present
Client: useState(template.trackInventory) + data-testid="product-track-inventory" + checked={trackInventory} + setTrackInventory(e.target.checked) + included in saveGeneral patch
DAO round-trip on local lumiere: new product defaults falseupdateProduct({trackInventory: true}) → reload returns trueupdateProduct({trackInventory: false}) → reload returns false

Typecheck: npx tsc --noEmit on nix-cafe → 0 errors.

Gate 2 plan

  1. Commit nix-cafe (single-line).
  2. Push to karouna-dev → CF auto-deploy.
  3. test-u11-prod.mjs on lumiere: seed product → navigate to detail page → assert checkbox unchecked (default) → tick + Save → DB confirms track_inventory=true → reload, assert checkbox checked → untick + Save → DB confirms track_inventory=false.
  4. Regression sweep 51/51 (phase2-cafe-multishop solo).
  5. Publish prod gallery.