management: produce catalog v2 — inventory columns, form fields, deploy triggers #35

Closed
opened 2026-08-24 08:27:40 +00:00 by yuris · 0 comments
Owner

Teach apps/management to produce catalog v2. Add brand, partNumber, category, weightGrams, shippable (default true), and installService to the inventory table with a generated, committed migration (all nullable or defaulted, so safe on existing rows). Extend getPublicCatalog to select and map the new fields, deriving price from sellPrice (0 → null, the established convention in the bot stock tools) and inStock from stock > 0, while keeping buyPrice, avgCost, suppliers, and the raw stock number out of the payload. Add sellPrice, stock, and the six new columns to STOREFRONT_COLUMNS — price and availability are public now, so stock-decrementing orders trigger a store rebuild, which the workflow's cancel-in-progress concurrency group collapses. Carry the fields through validators, inventory actions, MCP tools, queries, types, and the stok UI (add modal, edit form, details sheet, plus a category table column only), and update the demo seed.

Acceptance: pnpm --filter garage test and pnpm --filter garage lint pass, with affectsStorefront rebuilding on sellPrice/stock and still not on buyPrice/avgCost; the public catalog endpoint returns schemaVersion: 2 with every new field and no cost or stock-count leakage.

Teach `apps/management` to produce catalog v2. Add `brand`, `partNumber`, `category`, `weightGrams`, `shippable` (default true), and `installService` to the `inventory` table with a generated, committed migration (all nullable or defaulted, so safe on existing rows). Extend `getPublicCatalog` to select and map the new fields, deriving `price` from `sellPrice` (`0` → `null`, the established convention in the bot stock tools) and `inStock` from `stock > 0`, while keeping `buyPrice`, `avgCost`, suppliers, and the raw stock number out of the payload. Add `sellPrice`, `stock`, and the six new columns to `STOREFRONT_COLUMNS` — price and availability are public now, so stock-decrementing orders trigger a store rebuild, which the workflow's `cancel-in-progress` concurrency group collapses. Carry the fields through validators, inventory actions, MCP tools, queries, types, and the stok UI (add modal, edit form, details sheet, plus a `category` table column only), and update the demo seed. Acceptance: `pnpm --filter garage test` and `pnpm --filter garage lint` pass, with `affectsStorefront` rebuilding on `sellPrice`/`stock` and still not on `buyPrice`/`avgCost`; the public catalog endpoint returns `schemaVersion: 2` with every new field and no cost or stock-count leakage.
yuris closed this issue 2026-08-24 10:14:35 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/garage#35
No description provided.