Matching heuristic: normalise debit/credit sign and revisit the date window #47
Labels
No labels
bug
enhancement
pr-split
question
security
transaction-matcher
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
momsse/octant#47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Surfaced in the #32 local review against the merged matcher (#38).
Two correctness concerns in
packages/application/transaction-matching/src/matching/exact-match.ts:Signed amounts.
amountsMatchrequires identical signedamountMinor. Bank outflows are conventionally negative while invoice/document amounts are positive, so a -15000 payment never equals a +15000 invoice — the common payment-vs-invoice case produces zero candidates. Needs a sign-normalisation rule (e.g. compare absolute values, or normalise debit/credit by direction) decided at the domain level.Date window.
MATCH_DATE_WINDOW = 5 daysbetweendocument.issuedAtandtransaction.valueDate. Invoices on net-15/net-30 terms are issued well before payment, so legitimate pairs fall outside the window and never get a candidate. Revisit the window (or make it configurable via@octant/config).Both were deliberate first-cut choices for the exact-match heuristic; this ticket tracks tuning them against real-world invoice/payment data before the matcher is relied upon.