feat: salvar data original da transação e data de vencimento no cartão

Ao importar fatura de cartão com PaymentDate configurado, a data efetiva
da transação passa a ser o vencimento e a data de compra é preservada em
original_date. Migration 013 adiciona a coluna original_date em transactions.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-05-27 16:25:52 -03:00
co-authored by Claude Sonnet 4.6
parent 9ba3a3678b
commit 2b0aa352d5
7 changed files with 40 additions and 15 deletions
+13 -4
View File
@@ -96,11 +96,20 @@ func ParseCSV(r io.Reader, m model.CSVMapping) ([]model.ImportRow, []string) {
txType = "income"
}
purchaseDate := t.Format("2006-01-02")
effectiveDate := purchaseDate
originalDate := ""
if m.PaymentDate != "" {
effectiveDate = m.PaymentDate
originalDate = purchaseDate
}
rows = append(rows, model.ImportRow{
Date: t.Format("2006-01-02"),
Amount: math.Abs(amt),
Description: desc,
Type: txType,
Date: effectiveDate,
OriginalDate: originalDate,
Amount: math.Abs(amt),
Description: desc,
Type: txType,
})
}
return rows, errs