- Migration 010: colunas yield_type e last_yield_date em accounts + source='yield' nas transações
- CDIYieldService: busca taxas BCB (serie 12) e cria transação source=yield com rendimento acumulado
- Weekends/feriados sem taxa usam última taxa disponível (AC4)
- GET /api/accounts dispara cálculo CDI on-demand antes de retornar saldos
- AccountsView: seletor yield_type (none/cdi/variable) + badge CDI/VAR na listagem
- Transações source=yield aparecem no histórico com descrição 'Rendimento CDI — {período}'
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
21 lines
693 B
Go
21 lines
693 B
Go
package model
|
|
|
|
type Account struct {
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
InitialBalance float64 `json:"initial_balance"`
|
|
Balance float64 `json:"balance"`
|
|
YieldType string `json:"yield_type"` // "none" | "cdi" | "variable"
|
|
LastYieldDate *string `json:"last_yield_date,omitempty"`
|
|
CreatedAt string `json:"created_at"`
|
|
UpdatedAt string `json:"updated_at"`
|
|
}
|
|
|
|
type AccountInput struct {
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
InitialBalance float64 `json:"initial_balance"`
|
|
YieldType string `json:"yield_type"` // "none" | "cdi" | "variable"
|
|
}
|