feat(go): port matching helpers (M2.7-2.9) #9
Reference in New Issue
Block a user
Delete Branch "feat/m2-7-2-9-matching-package"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
go/internal/domain/matchingpackage porting three tightly coupled helpers fromscripts/match_payments.py.BuildNameVariants— extracts normalized ASCII search variants (full name, nickname, last/first); filters variants <3 chars;variants[0]is always the full base (load-bearing invariant forMatchMembers).MatchMembers— auto/review confidence matching with an exact-name short-circuit that prevents nickname substrings (e.g.tov) from firing inside longer surnames (e.g.ottova); common-surname filter for the review tier (novak,novakova,prach).FormatDate— nil/empty/serial int/float64 (since 1899-12-30, fractional days supported)/YYYY-MM-DD passthrough/garbage → never errors. Fractional serials computed viatime.Durationto preserve Pythontimedelta(days=float)sub-day precision.InferTransactionDetails— composes name + month matching over sender/message/user_id; falls back to sender-only member match and date-derived month when text carries no signal.SearchTextkey matches what the Python code actually returns (not the misleadingmatched_textdocstring).go-build,go-test,go-lintall clean.Done together per plan since the three functions form a tight dependency chain:
InferTransactionDetails→MatchMembers→BuildNameVariants+FormatDate.Ticks M2.7, M2.8, M2.9 in the progress tracker. Next up: M2.10
domain/reconcile.Reconcile.