Files
carvalho-finances/apps/api/internal/migration/sql/017_user_settings.sql
T
Mlcavalho1andClaude Sonnet 4.6 1d59cb2a0e feat: #45 meta de poupança configurável + conquistas genéricas
- Nova tabela user_settings com savings_goal_pct (default 40%)
- API GET /api/settings, PUT /api/settings
- DashboardService inclui savings_goal_pct no payload
- DashboardHandler dispara savings_checked com goal configurado
- GameService.NotifyAction: checa pct >= goal (sem hardcode de 40%)
- SettingsView: painel META DE POUPANÇA com input configurável
- HomeView: widget mostra meta dinâmica (META: X%) e usa savingsGoal
- stores/settings.ts: store com fetch e update

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-05-28 22:32:08 -03:00

6 lines
241 B
SQL

CREATE TABLE IF NOT EXISTS user_settings (
profile_id INTEGER PRIMARY KEY REFERENCES profiles(id) ON DELETE CASCADE,
savings_goal_pct NUMERIC(5,2) NOT NULL DEFAULT 40,
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);