WIP: receipt feature implementation

This commit is contained in:
2026-01-19 08:47:21 +01:00
parent 333f3d94bf
commit e5933aacc2
5 changed files with 142 additions and 8 deletions

View File

@@ -34,6 +34,28 @@ async function initDB(db) {
lastfm_name TEXT
);
`);
await db.exec(`
CREATE TABLE IF NOT EXISTS bot_config (
id INTEGER PRIMARY KEY CHECK (id = 1),
weekly_budget REAL DEFAULT 0,
exchange_rate_eur_kr REAL DEFAULT 0,
last_budget_notification_date TEXT
);
`);
await db.exec(`
CREATE TABLE IF NOT EXISTS grocery_budgets (
ID INTEGER PRIMARY KEY AUTOINCREMENT,
discord_id VARCHAR(50) NOT NULL,
budget_spent REAL,
total_spent REAL
);
`);
// Optional: Initialize the row if it doesn't exist yet
await db.exec(`
INSERT OR IGNORE INTO bot_config (id, weekly_budget, last_budget_notification_date)
VALUES (1, 0, NULL);
`);
console.log('[DATABASE] Created new DB table');
}