AJ 3f97b34c54 Fix merchant filtering in receipt mapping to be non-exclusive
Changed merchant filtering from exclusionary to relevance-based sorting.
This fixes the issue where transactions don't appear if the merchant
name doesn't exactly match.

Changes:
- Date range (±3 days) remains the primary hard filter
- Merchant name now sorts results by relevance instead of excluding
- Retrieves 100 candidates, sorts by match quality, returns top 50
- Case-insensitive matching using ToLower()

Relevance Scoring:
- Score 3: Exact match on merchant or transaction name
- Score 2: Partial match on merchant name (Contains)
- Score 1: Partial match on transaction name (Contains)
- Score 0: No match (still included if within date range)

Results sorted by: Match score → Date → ID

Benefits:
- McDonald's receipt will show all transactions in date range
- Best matches appear at top
- No transactions excluded due to name variations
- More forgiving for typos, abbreviations, etc.
- User can still see and select any transaction in date window

Example: Receipt says "McDonald's" but transaction says "MCDONALD'S #1234"
- Before: Excluded (no exact Contains match)
- After: Included, sorted to top (partial match score 2)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 14:11:40 -04:00
2025-10-04 02:19:54 -04:00
2025-10-04 02:13:50 -04:00
Description
No description provided
103 MiB
Languages
C# 66.6%
HTML 31.2%
JavaScript 1.9%
CSS 0.2%
Dockerfile 0.1%