fix: bugs-01

This commit is contained in:
2026-03-12 19:57:30 +08:00
parent 9e609f89a3
commit ce537bb3dc
7 changed files with 62 additions and 37 deletions

View File

@@ -1,13 +1,14 @@
"""Transaction deduplication and matching engine.
Multi-layer strategy:
1. Exact order_no match
2. Amount + time-window + account-tail match
3. Fuzzy text similarity (placeholder for LLM-assisted matching)
Strategy:
1. Deduplicate only by exact order_no match
2. Mark transit (self-transfer) records for exclusion from fraud totals
Note:
Highly similar records (same amount/time/counterparty) are preserved so they
can be reviewed by officers in the assessment review stage.
"""
from uuid import UUID
from datetime import timedelta
from sqlalchemy.ext.asyncio import AsyncSession
from app.models.transaction import TransactionRecord