feat: #44 fatura de cartão com data futura fica pendente até confirmação

- Nova tabela pending_bill_imports (migration 016)
- ImportHandler.Confirm: quando is_credit_card=true e payment_date > hoje,
  salva como pending em vez de inserir transações
- Novos endpoints: GET /pending-bills, POST /pending-bills/:id/confirm,
  DELETE /pending-bills/:id
- Dashboard inclui pending_bill_imports no payload
- Frontend: resultado "fatura salva como pendente" no ImportView
- AccountsView exibe widget de faturas pendentes com ações de confirmar/descartar
- dashboard_test: mock de PendingBillRepo + TransactionRepository

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-05-28 22:26:42 -03:00
co-authored by Claude Sonnet 4.6
parent 9742ae7469
commit 2b8524dcde
16 changed files with 453 additions and 32 deletions
@@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS pending_bill_imports (
id SERIAL PRIMARY KEY,
profile_id INTEGER NOT NULL REFERENCES profiles(id) ON DELETE CASCADE,
filename TEXT NOT NULL,
payment_date DATE NOT NULL,
total NUMERIC(12,2) NOT NULL DEFAULT 0,
rows JSONB NOT NULL DEFAULT '[]',
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);