feat: Implement deterministic expense matching using configurable providers and keywords, integrating it into the processing pipeline.

This commit is contained in:
Marco Gallegos
2025-12-18 12:25:48 -06:00
parent 899482580e
commit 519a5ad705
9 changed files with 338 additions and 136 deletions

36
verify_matcher.py Normal file
View File

@@ -0,0 +1,36 @@
"""
Verification script for matching logic.
"""
import sys
import os
# Add project root to path
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from app.preprocessing.matcher import get_metadata_from_match
def test_match(description: str):
print(f"\nTesting: '{description}'")
metadata = get_metadata_from_match(description)
if metadata:
print(f" Match Found!")
print(f" Type: {metadata.get('match_type')}")
print(f" Name: {metadata.get('matched_name')}")
print(f" Category: {metadata.get('category')}")
print(f" Subcategory: {metadata.get('subcategory')}")
print(f" Expense Type: {metadata.get('expense_type')}")
else:
print(" No match found.")
if __name__ == "__main__":
# Test providers
test_match("Lunch at Amazon")
test_match("Uber Eats dinner")
test_match("Office Depot supplies")
# Test keywords
test_match("New monitor for work")
test_match("Croquetas for the dog")
# Test no match
test_match("Random expense")