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
+15 -1
View File
@@ -41,10 +41,24 @@ func (m *mockAccountRepo) Delete(_ context.Context, _ int) error
func (m *mockAccountRepo) TotalPatrimony(_ context.Context) (float64, error) { return 0, nil }
func (m *mockAccountRepo) UpdateLastYieldDate(_ context.Context, _ int, _ string) error { return nil }
type mockCreditBillRepo struct{}
func (m *mockCreditBillRepo) ListByAccount(_ context.Context, _ int) ([]model.CreditBill, error) {
return nil, nil
}
func (m *mockCreditBillRepo) GetCurrent(_ context.Context, _ int) (*model.CreditBill, error) {
return nil, nil
}
func (m *mockCreditBillRepo) Upsert(_ context.Context, _ model.CreditBillInput) (*model.CreditBill, error) {
return &model.CreditBill{}, nil
}
func (m *mockCreditBillRepo) MarkPaid(_ context.Context, _ int, _ *int) error { return nil }
func newAccountSvc() *service.AccountService {
repo := &mockAccountRepo{}
cdiSvc := service.NewCDIYieldService(repo, &mockTxRepo{})
return service.NewAccountService(repo, cdiSvc)
billSvc := service.NewCreditBillService(&mockCreditBillRepo{}, repo)
return service.NewAccountService(repo, cdiSvc, billSvc)
}
func TestCreateAccount_EmptyName(t *testing.T) {