feat(#18): import de extratos OFX e CSV — parser, dedup, preview e confirmação

Parser OFX tolerante ao formato SGML de bancos brasileiros (sem closing tags, BOM,
timezone suffix). Parser CSV com separador de campo/decimal configurável. Dedup por
FITID (OFX) ou date+amount+desc normalizado. Fluxo: POST /preview → revisão na UI
→ POST /confirm salva e loga. Migration 002 adiciona external_id com unique index.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-05-26 20:17:46 -03:00
co-authored by Claude Sonnet 4.6
parent d6782d51a5
commit 83dff2de78
15 changed files with 1065 additions and 3 deletions
+7
View File
@@ -52,6 +52,10 @@ func main() {
categorySvc := service.NewCategoryService(categoryRepo)
categoryHandler := handler.NewCategoryHandler(categorySvc)
transactionRepo := repository.NewTransactionRepository(pool)
importSvc := service.NewImportService(transactionRepo)
importHandler := handler.NewImportHandler(importSvc)
r.Get("/health", handler.Health)
r.Route("/api", func(r chi.Router) {
@@ -59,6 +63,9 @@ func main() {
r.Post("/categories", categoryHandler.Create)
r.Put("/categories/{id}", categoryHandler.Update)
r.Delete("/categories/{id}", categoryHandler.Delete)
r.Post("/imports/preview", importHandler.Preview)
r.Post("/imports/confirm", importHandler.Confirm)
})
// Serve Vue SPA — non-API routes fall through to index.html