# Session Closeout: Finance Tracker AF Dedup + Card Closure (2026-05-07)
Fixed several data quality issues in the finance tracker’s card benefits system, all stemming from how the system handles multiple cards under the same card product.
## Problems Fixed
**AF Cross-Attribution:** The annual fee detection was pooling transactions from all sibling accounts (same card product), causing one card’s $895 AF to appear on every Amex Biz Plat card. Fixed by searching the primary account first and only falling back to siblings when the primary has no AF transactions at all.
**$0 AF False Positive:** Chase Freedom Unlimited was showing a stale $95 “Annual Membership Fee” from 2019. The amount proximity filter was failing open for $0 AF cards. Fixed with an early return: no-fee cards never enter AF detection.
**Dell Credit Double Counting:** Amex posts identical statement credits to all cards under one account. Plaid reports each with unique transaction IDs but the same date, amount, and description. Credits were being counted on every Biz Plat ($300/150 instead of per-card amounts). Fixed with signature-based dedup: earlier mapping IDs “own” each unique (date, amount, name) credit.
**Card Closure Detection:** Southwest Priority card was closed but still showing projected AF. Wired up Teller’s account status field and added a manual `isClosed` flag. Detection priority: Teller status > Empower “(X)” marker > manual flag > $0 balance + no recent transactions heuristic.
## Technical Details
8 files changed across the stack: Prisma schema (new fields), API routes (PATCH handler, closure skip), detection logic (signature dedup, primary-first AF search), Teller sync (status field), deploy script (certs exclusion).
Also cleaned up 8 redundant card mappings (32 to 24) and re-seeded stale card product data.
**Incident:** Manual rsync –delete during debugging wiped Teller mTLS certs from the VM. Recovered from privateContext backup. Deploy script now excludes certs/ directory.
## Commits
– `47e2c90` Fix AF cross-attribution, benefit credit dedup, and card closure detection
– `d23fc07` Update context.md and progress.md
All changes deployed and verified on production.