Capital One Account Changes

This commit is contained in:
2026-08-04 11:52:01 -04:00
parent 1400aa99d6
commit 2a4522a09a
3 changed files with 49 additions and 23 deletions

View File

@@ -187,20 +187,21 @@ model BalanceSnapshot {
All 4 user banks with exact column mappings. Implement in `src/lib/csv/bank-profiles.ts`.
### Discover High Yield Savings → `BANK`
- **Strategy**: B (split debit/credit columns)
- **Strategy**: C (single unsigned amount column + type column)
- `date` ← `Transaction Date`
- `description` ← `Transaction Description`
- `debitAmount` ← `Debit`
- `creditAmount` `Credit`
- `amount` ← `Transaction Amount`
- `type` ← `Transaction Type` — value is literally `Debit` or `Credit`
- `balance` ← `Balance` (reference only)
- Ignore: `Transaction Type`
- Ignore: `Account Number`
### Discover Credit Card → `CREDIT_CARD`
- **Strategy**: A (single signed column)
- `date` ← `Trans. Date`
- **Strategy**: B (split debit/credit columns)
- `date` ← `Transaction Date`
- `description` ← `Description`
- `amount` ← `Amount` — **positive = DEBIT (charge), negative = CREDIT (payment/refund)**
- Ignore: `Post Date`, `Category`
- `debitAmount` ← `Debit`
- `creditAmount` ← `Credit`
- Ignore: `Posted Date`, `Card No.`, `Category`
### Huntington Checking → `BANK`
- **Strategy**: A (single signed column)
@@ -224,10 +225,14 @@ All 4 user banks with exact column mappings. Implement in `src/lib/csv/bank-prof
// Sign convention varies per bank; each profile has invertAmountSign: boolean
function parseStrategyA(raw: string, invert: boolean): { amountCents: number; type: TransactionType }
// Strategy B — separate debit/credit columns (Discover Savings)
// Strategy B — separate debit/credit columns (Discover Credit Card)
// The non-empty/non-zero column determines type and amount
function parseStrategyB(debitRaw: string, creditRaw: string): { amountCents: number; type: TransactionType }
// Strategy C — single unsigned amount column + separate type column (Discover Savings)
// The type column's literal value ("Debit" / "Credit") determines type
function parseStrategyC(amountRaw: string, typeRaw: string): { amountCents: number; type: TransactionType }
// All amounts via:
function parseCents(raw: string): number {
return Math.round(parseFloat(raw.replace(/[$,\s]/g, '')) * 100)