feat: categorizar transações no preview de importação
Select de categoria em cada linha da prévia; category_id salvo no BulkInsert. Duplicatas ficam desabilitadas. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
@@ -63,9 +63,9 @@ func (r *transactionRepo) BulkInsert(ctx context.Context, rows []model.ImportRow
|
||||
extID = &row.ExternalID
|
||||
}
|
||||
_, err := tx.Exec(ctx, `
|
||||
INSERT INTO transactions (date, amount, description, type, source, external_id)
|
||||
VALUES ($1, $2, $3, $4, 'import', $5)`,
|
||||
row.Date, row.Amount, row.Description, row.Type, extID)
|
||||
INSERT INTO transactions (date, amount, description, type, source, external_id, category_id)
|
||||
VALUES ($1, $2, $3, $4, 'import', $5, $6)`,
|
||||
row.Date, row.Amount, row.Description, row.Type, extID, row.CategoryID)
|
||||
if err != nil {
|
||||
return count, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user