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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user