feat: CDI % configurável por conta + fix mocks de teste

- Adiciona campo cdi_percentage (default 100%) na tabela accounts
- Cálculo CDI aplica proporção: balance × (compound-1) × (pct/100)
- Frontend exibe input de % quando yield_type=cdi e badge mostra valor
- Corrige mocks de teste desatualizados (DeleteByMonth, isTax)
- Corrige ConfirmIncome para rejeitar tipo expense (ErrRecurringNotIncome)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-05-28 22:20:32 -03:00
co-authored by Claude Sonnet 4.6
parent 433c4f42a5
commit 6292858970
10 changed files with 73 additions and 37 deletions
+4 -4
View File
@@ -110,16 +110,16 @@ func (s *RecurringService) MonthlyStatus(ctx context.Context, month string) ([]m
return result, nil
}
// ConfirmIncome creates a transaction (income or expense) confirming this recurring item for the month.
// ConfirmIncome creates a transaction confirming an income recurring item for the month.
func (s *RecurringService) ConfirmIncome(ctx context.Context, id int, month string) error {
re, err := s.repo.GetByID(ctx, id)
if err != nil {
return err
}
txType := re.Type
if txType == "" {
txType = "expense"
if re.Type != "income" {
return ErrRecurringNotIncome
}
txType := re.Type
today := time.Now().Format("2006-01-02")
tx := model.Transaction{
Date: today,