-
d13d8ca6ab
Milestones 4-5. UI is broken into individual toga ui elements.
master
Funky Waddle
2025-12-20 00:10:30 -0600
-
c8655e24e4
feat(db,models,dao,logic): nicotine inventory + flavor snapshots; drop legacy nic_pct; migrations, tests • Migrations ◦ Create nicotine table with NOCASE strings, base PG/VG check, strength_mg_per_ml (>0), soft-delete, and optional inventory metadata (bottle_size_ml, cost, purchase_date). ◦ Alter recipe: add nic_target_mg_per_ml (NOT NULL), nic_strength_mg_per_ml (NOT NULL), nicotine_id (FK ON DELETE SET NULL); keep nic_base. Drop legacy nic_pct via rebuild migration. ◦ Alter flavor: add bottle_size_ml, cost, purchase_date (nullable). ◦ Alter recipe_flavor: add flavor snapshot columns (flavor_name_snapshot, flavor_company_snapshot NOCASE, flavor_base_snapshot PG/VG CHECK). ◦ Ensure migration order runs “_created” before ALTERs. • Models ◦ Add Nicotine model. ◦ Update Recipe with nic_target_mg_per_ml, nic_strength_mg_per_ml, nic_base, optional nicotine FK. ◦ Update Flavor with optional inventory metadata. ◦ Update RecipeFlavor with snapshot fields and unique index remains. • DAOs ◦ Add NicotineRepository (CRUD, list with soft-delete filters; hard_delete_when_safe blocked when referenced by recipes). ◦ Update RecipeRepository: ▪ create/update accept nic_target_mg_per_ml, nic_strength_mg_per_ml, nic_base, optional nicotine_id. ▪ If nicotine_id provided, snapshot strength/base from inventory unless overridden. ▪ replace_ingredients uses diff-based updates and populates flavor snapshots on insert. ◦ Update FlavorRepository to edit inventory metadata; soft/undelete; hard delete only when safe. • DB init ◦ Bind Peewee models to runtime DB; tweak migration ordering logic. • Logic ◦ Add calculation engine (compute_breakdown, breakdown_for_view) supporting target nicotine mg/mL and stock strength mg/mL; rounding policy for display. • Tests ◦ Update/init DB tests to include nicotine table and flexible migration counts. ◦ Add calculation tests (120 mL example, nic in VG, 50 mg/mL stock, validations). ◦ Add DAO tests including flavor snapshots stability and replace_ingredients diff behavior. ◦ All tests passing: 15 passed. • Docs ◦ Update SPECS and MILESTONES; strike through Milestones 3 and 4.
Funky Waddle
2025-12-18 19:55:22 -0600
-
8b8b04539e
Initial commit. Milestones 1-3
Funky Waddle
2025-12-18 14:30:09 -0600
-
05aad26e21
Fix merge conflicts
Funky Waddle
2025-12-18 09:54:27 -0600
-
-
6779aa3b80
Initial commit
Funky Waddle
2025-12-18 09:49:31 -0600
-
-
df8c25a161
Initial commit
Funky Waddle
2025-12-18 15:41:46 +0000