Initial scaffold: Flask/SQLite backend, React/Vite PWA frontend
Backend: receipt upload -> LLM vision extraction (OpenAI-compatible, provider-agnostic), item review/edit, per-group splitting against Cospend projects/members, highlight+upload via WebDAV, public share link, bill creation via Cospend's OCS API (verified against real source, not just doc summaries). Frontend: capture -> review -> group -> summary flow as an installable PWA. install.sh / run.sh (venv + npm, tmux session) instead of Docker, per the ~/Projects/gain pattern.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
CREATE TABLE IF NOT EXISTS receipts (
|
||||
id TEXT PRIMARY KEY,
|
||||
image_path TEXT NOT NULL,
|
||||
image_width INTEGER,
|
||||
image_height INTEGER,
|
||||
items_json TEXT NOT NULL DEFAULT '[]',
|
||||
store_name TEXT, -- extracted from the receipt, editable
|
||||
receipt_date TEXT, -- YYYY-MM-DD, extracted; falls back to
|
||||
-- today's date if unreadable/unset
|
||||
status TEXT NOT NULL DEFAULT 'extracted', -- extracted | grouped | done
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS groups (
|
||||
id TEXT PRIMARY KEY,
|
||||
receipt_id TEXT NOT NULL REFERENCES receipts(id) ON DELETE CASCADE,
|
||||
name TEXT NOT NULL,
|
||||
cospend_project_id TEXT NOT NULL,
|
||||
payer_member_id TEXT NOT NULL,
|
||||
member_ids_json TEXT NOT NULL, -- json list of cospend member ids (owers)
|
||||
item_ids_json TEXT NOT NULL, -- json list of item ids from receipts.items_json
|
||||
status TEXT NOT NULL DEFAULT 'pending', -- pending | submitted | failed
|
||||
share_url TEXT,
|
||||
cospend_bill_id TEXT,
|
||||
error TEXT,
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
);
|
||||
Reference in New Issue
Block a user