feat: implement barebones inventory, costing parity, navigation fixes, and Meez design polish

This commit is contained in:
2026-08-17 10:49:03 -05:00
parent d378842b68
commit 685cf86819
40 changed files with 6132 additions and 1110 deletions
+37
View File
@@ -0,0 +1,37 @@
PRAGMA foreign_keys = ON;
CREATE TABLE IF NOT EXISTS inventory_locations (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
position INTEGER NOT NULL,
deleted_at TEXT
);
CREATE TABLE IF NOT EXISTS inventory_counts (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
counted_at TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'open',
notes TEXT,
created_at TEXT NOT NULL,
deleted_at TEXT
);
CREATE TABLE IF NOT EXISTS inventory_count_items (
count_id TEXT NOT NULL REFERENCES inventory_counts(id) ON DELETE CASCADE,
location_id TEXT REFERENCES inventory_locations(id),
ingredient_id TEXT NOT NULL REFERENCES ingredients(id),
quantity REAL NOT NULL,
unit_id TEXT NOT NULL REFERENCES units(id),
unit_cost REAL,
extended_cost REAL,
PRIMARY KEY (count_id, location_id, ingredient_id)
);
-- Seed baseline standard locations if table is empty
INSERT OR IGNORE INTO inventory_locations (id, name, position, deleted_at) VALUES
('loc_walk_in', 'Walk-in Cooler', 1, NULL),
('loc_dry_storage', 'Dry Storage', 2, NULL),
('loc_freezer', 'Freezer', 3, NULL),
('loc_bar', 'Bar & Service', 4, NULL),
('loc_line', 'Prep Line', 5, NULL);