Commit Graph

7 Commits

Author SHA1 Message Date
josh d44c23ef6d Autofill next asset ID and pre-select bin from existing inventory
Build and push image / build (push) Successful in 55s
Asset tag field now defaults to the highest existing asset ID + 1.
Bin selector pre-selects the bin where other instances of the same
product are stored, falling back to the first bin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 21:38:10 -04:00
josh 9aea9535e6 Tailor edible ingestion flow: use mg units and hide cannabinoid % fields
Build and push image / build (push) Successful in 59s
Edibles are dosed in milligrams, not grams, and percentage-based cannabinoid
profiles don't apply. Adds weightUnit and showCannabinoidPct to TypeConfig so
the add/edit/detail views adapt per product type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 21:12:28 -04:00
josh 04bf009a83 Scope ScanField by mode: asset ID only for audit/consume, SKU only for add inventory
Build and push image / build (push) Successful in 57s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 20:32:52 -04:00
josh bae0386766 Simplify add inventory modal: SKU scan only
Build and push image / build (push) Successful in 50s
Remove product dropdown picker and step headers. Entry is now
scan-a-SKU or create-a-new-product only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 19:16:47 -04:00
josh 670d56ba4c Remove quantity option from add/edit forms
Build and push image / build (push) Successful in 43s
Each discrete item (pre-roll, edible, etc.) is now always one
physical unit with its own asset ID. The quantity field is gone
from both add and edit flows, countOriginal is hardcoded to 1,
and price is just "Price" instead of "Price per unit."

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-04 19:05:11 -04:00
josh 80034b47c5 User-supplied asset ids; brand on product; strain is the name
Build and push image / build (push) Successful in 48s
Four UX changes after using the rework for a bit:

1. Asset ids are 6-digit numbers from a roll of physical labels — server
   no longer generates them. POST /api/inventory requires assetId; the
   add-inventory form has a digits-only input that auto-focuses on entry.
2. Strain and product name are the same thing. Drop products.name; the
   strain's name supplies the display. Product creation just asks for
   "Name (strain)" and matches/creates a strain by that name.
3. Brand moves from inventory_items to products. SKUs are brand-specific,
   so all instances of a product share the brand. Brand selector lives
   on the product create/edit form, not the per-instance form.
4. Scanning an unknown SKU on the add-inventory step now opens the
   create-product subform with the SKU prefilled — one less click.

Migration: detect prior shape (products.name column present) and rename
products/inventory_items/audits to *_v1 archives, recreate empty.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 18:17:12 -04:00
josh 02dc6e523f Track inventory at the instance level, not by product
Build and push image / build (push) Successful in 46s
The products table conflated catalog ("kind of thing you scan") with
instance ("this jar I bought") — splitting it lets us record every
purchase as its own asset and autofill brand/shop/price/THC from the
last instance when scanning a known SKU.

- products: sku + strain + name + type + kind (catalog only)
- inventory_items: physical jars with short-UUID asset ids, per-batch
  brand/shop/bin/price/cannabinoids/weight, audits, lifecycle
- audits now key on inventory_id; strains lose brand_id and type
- migration: rename existing products/audits/strains to *_legacy on
  first boot so users keep historical reference, fresh start otherwise
- two-step add flow: scan SKU → select/create product → instance
  details (autofilled from last instance) → generated asset id shown
- ScanField matches asset id first, falls back to SKU
- inventory list defaults flat, "By product" toggle groups instances

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 05:59:46 -04:00