feat(#37): módulo de cartão de crédito com faturas mensais

- Migration 011: closing_day/due_day em accounts + tabela credit_bills
- CreditBillService: cria/atualiza fatura corrente on-demand no GET /accounts
- Widget FATURA ATUAL no dashboard com total e botão PAGAR
- AccountsView: campos closing_day/due_day para contas credit + painel fatura
- Dashboard: current_bills lista faturas não pagas de todos os cartões

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-05-27 15:12:53 -03:00
co-authored by Claude Sonnet 4.6
parent ee6cd9f37e
commit e3b3433703
17 changed files with 530 additions and 29 deletions
+9 -2
View File
@@ -71,11 +71,14 @@ func main() {
accountRepo := repository.NewAccountRepository(pool)
cdiSvc := service.NewCDIYieldService(accountRepo, manualTxRepo)
accountSvc := service.NewAccountService(accountRepo, cdiSvc)
creditBillRepo := repository.NewCreditBillRepository(pool)
creditBillSvc := service.NewCreditBillService(creditBillRepo, accountRepo)
accountSvc := service.NewAccountService(accountRepo, cdiSvc, creditBillSvc)
accountHandler := handler.NewAccountHandler(accountSvc)
creditBillHandler := handler.NewCreditBillHandler(creditBillSvc)
dashboardRepo := repository.NewDashboardRepository(pool)
dashboardSvc := service.NewDashboardService(dashboardRepo, recurringSvc, accountRepo)
dashboardSvc := service.NewDashboardService(dashboardRepo, recurringSvc, accountRepo, creditBillSvc)
dashboardHandler := handler.NewDashboardHandler(dashboardSvc)
r.Get("/health", handler.Health)
@@ -113,6 +116,10 @@ func main() {
r.Post("/accounts", accountHandler.Create)
r.Put("/accounts/{id}", accountHandler.Update)
r.Delete("/accounts/{id}", accountHandler.Delete)
r.Get("/accounts/{id}/bills", creditBillHandler.ListByAccount)
r.Get("/accounts/{id}/bills/current", creditBillHandler.GetCurrent)
r.Post("/accounts/{id}/bills/ensure", creditBillHandler.EnsureCurrent)
r.Post("/bills/{id}/pay", creditBillHandler.MarkPaid)
r.Get("/dashboard", dashboardHandler.Get)