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.
lib/db/product_attribute.ts — TemplateRow gains trackInventory: boolean; both getTemplateWithLinesById + listTemplatesWithLines select T.trackInventory and propagate to the row map.lib/actions/product_attribute.ts — createTemplateAction returned row gains trackInventory: false (new templates default off; admin opts in).lib/db/products.ts — UpdateProductInput gains trackInventory?: boolean; updateProduct threads it into the template patch fan-out alongside isHidden / nameKh / categoryId.lib/actions/products.ts — updateProductAction patch shape accepts trackInventory?: boolean; threads it into the DAO call.app/(authed)/products/[id]/product-detail-client.tsx — hydration via useState(template.trackInventory); new "Inventory" Field with a "Track inventory" checkbox in the General Information grid; saveGeneral patch now sends trackInventory alongside the other template fields.| ✓ | 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 false → updateProduct({trackInventory: true}) → reload returns true → updateProduct({trackInventory: false}) → reload returns false |
Typecheck: npx tsc --noEmit on nix-cafe → 0 errors.
karouna-dev → CF auto-deploy.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.