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]>
This commit is contained in:
2026-05-28 22:32:08 -03:00
co-authored by Claude Sonnet 4.6
parent 9fada4997a
commit 1d59cb2a0e
15 changed files with 296 additions and 15 deletions
+9 -2
View File
@@ -86,9 +86,13 @@ func main() {
accountHandler := handler.NewAccountHandler(accountSvc)
creditBillHandler := handler.NewCreditBillHandler(creditBillSvc)
settingsRepo := repository.NewSettingsRepository(pool)
settingsSvc := service.NewSettingsService(settingsRepo)
settingsHandler := handler.NewSettingsHandler(settingsSvc)
dashboardRepo := repository.NewDashboardRepository(pool)
dashboardSvc := service.NewDashboardService(dashboardRepo, recurringSvc, accountRepo, creditBillSvc, pendingBillSvc)
dashboardHandler := handler.NewDashboardHandler(dashboardSvc)
dashboardSvc := service.NewDashboardService(dashboardRepo, recurringSvc, accountRepo, creditBillSvc, pendingBillSvc, settingsSvc)
dashboardHandler := handler.NewDashboardHandler(dashboardSvc, gameSvc)
r.Get("/health", handler.Health)
@@ -142,6 +146,9 @@ func main() {
r.Get("/dashboard", dashboardHandler.Get)
r.Get("/settings", settingsHandler.Get)
r.Put("/settings", settingsHandler.Update)
r.Get("/game/summary", gameHandler.Summary)
r.Post("/game/xp", gameHandler.AwardXP)
r.Post("/game/quests/{id}/claim", gameHandler.ClaimQuest)