feat: expense settlement — track who paid, show who owes whom — closes #41

- Click member avatars on budget items to mark who paid (green = paid)
- Multiple green chips = those people split the payment equally
- Settlement dropdown in the total budget card shows optimized payment
  flows (who owes whom how much) and net balances per person
- Info tooltip explains how the feature works
- New server endpoint GET /budget/settlement calculates net balances
  and minimized payment flows using a greedy algorithm
- Merged category legend: amount + percentage in one row
- i18n keys added for DE and EN
This commit is contained in:
Maurice
2026-03-30 11:12:22 +02:00
parent 8d9a511edf
commit f6d08582ec
6 changed files with 208 additions and 19 deletions

View File

@@ -325,6 +325,10 @@ function runMigrations(db: Database.Database): void {
// Add day_plan_position to reservations for persistent transport ordering in day timeline
try { db.exec('ALTER TABLE reservations ADD COLUMN day_plan_position REAL DEFAULT NULL'); } catch {}
},
() => {
// Add paid_by_user_id to budget_items for expense tracking / settlement
try { db.exec('ALTER TABLE budget_items ADD COLUMN paid_by_user_id INTEGER REFERENCES users(id)'); } catch {}
},
];
if (currentVersion < migrations.length) {