management: produce catalog v2 — inventory columns, form fields, deploy triggers #35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Teach
apps/managementto produce catalog v2. Addbrand,partNumber,category,weightGrams,shippable(default true), andinstallServiceto theinventorytable with a generated, committed migration (all nullable or defaulted, so safe on existing rows). ExtendgetPublicCatalogto select and map the new fields, derivingpricefromsellPrice(0→null, the established convention in the bot stock tools) andinStockfromstock > 0, while keepingbuyPrice,avgCost, suppliers, and the raw stock number out of the payload. AddsellPrice,stock, and the six new columns toSTOREFRONT_COLUMNS— price and availability are public now, so stock-decrementing orders trigger a store rebuild, which the workflow'scancel-in-progressconcurrency group collapses. Carry the fields through validators, inventory actions, MCP tools, queries, types, and the stok UI (add modal, edit form, details sheet, plus acategorytable column only), and update the demo seed.Acceptance:
pnpm --filter garage testandpnpm --filter garage lintpass, withaffectsStorefrontrebuilding onsellPrice/stockand still not onbuyPrice/avgCost; the public catalog endpoint returnsschemaVersion: 2with every new field and no cost or stock-count leakage.