kiwi/app/db/migrations
pyr0ball fb18a9c78c feat: partial consumption tracking and waste/disposal logging (#12 #60)
#12 — partial consume:
- POST /inventory/items/{id}/consume now accepts optional {quantity}
  body; decrements by that amount and only marks status=consumed when
  quantity reaches zero (store.partial_consume_item)
- OFFs barcode scan pre-fills sub-unit quantity when product data
  includes a pack size (number_of_units or 'N x ...' quantity string)
- Consume button shows quantity-aware label and opens ActionDialog
  with number input for multi-unit items ('use some or all')
- consumeItem() in api.ts now returns InventoryItem and accepts
  optional quantity param

#60 — disposal logging:
- Migration 031: adds disposal_reason TEXT column to inventory_items
  (status='discarded' was already in the CHECK constraint)
- POST /inventory/items/{id}/discard endpoint with optional DiscardRequest
  body (free text or preset reason)
- Calm framing: 'item not used' not 'wasted'; reason presets avoid
  blame language ('went bad before I could use it', 'too much — had excess')
- Muted discard button (X icon, tertiary color) — not alarming

Shared:
- New ActionDialog.vue component for dialogs with inline inputs
  (quantity stepper or reason dropdown); keeps ConfirmDialog simple
- disposal_reason field added to InventoryItemResponse

Closes #12
Closes #60
2026-04-16 07:28:21 -07:00
..
001_initial_schema.sql chore: initial commit — kiwi Phase 2 complete 2026-03-30 22:20:48 -07:00
002_inventory_and_products.sql chore: initial commit — kiwi Phase 2 complete 2026-03-30 22:20:48 -07:00
003_receipt_data.sql chore: initial commit — kiwi Phase 2 complete 2026-03-30 22:20:48 -07:00
004_tagging_system.sql chore: initial commit — kiwi Phase 2 complete 2026-03-30 22:20:48 -07:00
005_receipt_staged_status.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
006_element_profiles.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
007_recipe_corpus.sql fix: data pipeline — R-vector parser, allrecipes dataset, unique recipe index 2026-03-31 21:36:13 -07:00
008_substitution_pairs.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
009_staple_library.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
010_recipe_feedback.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
011_rate_limits.sql feat: migrations 005-011 — fix receipts column bug + recipe engine tables 2026-03-30 22:33:25 -07:00
012_user_settings.sql feat: recipe engine Phase 3 — StyleAdapter, LLM levels 3-4, user settings 2026-03-31 14:15:18 -07:00
013_background_tasks.sql fix: renumber background_tasks migration 006→013 (conflict with element_profiles) 2026-03-31 14:28:10 -07:00
014_nutrition_macros.sql feat: recipe engine — assembly templates, prep notes, FTS fixes, texture backfill 2026-04-02 22:12:35 -07:00
015_recipe_fts.sql fix: add FTS5 sync triggers so recipe inserts are indexed immediately 2026-04-02 23:14:22 -07:00
016_recipe_fts_triggers.sql fix: add FTS5 sync triggers so recipe inserts are indexed immediately 2026-04-02 23:14:22 -07:00
017_household_invites.sql feat: add household_invites migration (017) 2026-04-04 22:27:56 -07:00
018_saved_recipes.sql feat: saved recipes, recipe browser, and recipe detail panel 2026-04-08 14:35:02 -07:00
019_recipe_collections.sql feat: saved recipes, recipe browser, and recipe detail panel 2026-04-08 14:35:02 -07:00
020_browser_telemetry.sql feat: saved recipes, recipe browser, and recipe detail panel 2026-04-08 14:35:02 -07:00
021_recipe_browser_fts.sql perf(browser): replace LIKE scans with FTS5; cache category counts 2026-04-08 23:10:48 -07:00
022_meal_plans.sql feat(db): add meal_plans, slots, prep_sessions, prep_tasks migrations (022-025) 2026-04-12 13:11:34 -07:00
022_recipe_generic_flag.sql chore: commit in-progress work -- tag inferrer, imitate endpoint, hall-of-chaos easter egg, migration files, Dockerfile .env defense 2026-04-14 13:23:15 -07:00
023_meal_plan_slots.sql feat(db): add meal_plans, slots, prep_sessions, prep_tasks migrations (022-025) 2026-04-12 13:11:34 -07:00
024_prep_sessions.sql feat(db): add meal_plans, slots, prep_sessions, prep_tasks migrations (022-025) 2026-04-12 13:11:34 -07:00
025_prep_tasks.sql feat(db): add meal_plans, slots, prep_sessions, prep_tasks migrations (022-025) 2026-04-12 13:11:34 -07:00
028_community_pseudonyms.sql feat(community): migration 028 — community_pseudonyms table in per-user kiwi.db 2026-04-13 08:13:39 -07:00
029_inferred_tags.sql chore: commit in-progress work -- tag inferrer, imitate endpoint, hall-of-chaos easter egg, migration files, Dockerfile .env defense 2026-04-14 13:23:15 -07:00
030_opened_date.sql feat: pantry intel cluster — #61 expiry display, #64 cook log, #66 scaling, #59 open-package tracking 2026-04-16 06:01:25 -07:00
031_disposal_reason.sql feat: partial consumption tracking and waste/disposal logging (#12 #60) 2026-04-16 07:28:21 -07:00