feat(infer): messages starting with "other:" are not monthly fees
When the bank message starts with "other:" (case-insensitive), inference does not look for a month, neither in the text nor from the payment date. The trimmed message is written to Purpose, so reconcile books the payment as an "other" transaction for the person instead of a monthly fee. Messages containing "other:" elsewhere are unchanged. - matching.IsOtherPurpose / is_other_purpose shared by inference and reconcile - reconcile applies the rule to rows not yet processed by inference - no person found: Purpose is still written, row shows as unmatched - implemented in Go and legacy Python; four new parity fixtures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"case": "11_other_message_fallback",
|
||||
"func": "scripts.match_payments.reconcile",
|
||||
"captured_at": "2026-10-08",
|
||||
"input": {
|
||||
"members": [
|
||||
{
|
||||
"name": "Member_d035d9f9",
|
||||
"tier": "A",
|
||||
"fees": {
|
||||
"2026-01": [
|
||||
750,
|
||||
3
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"sorted_months": [
|
||||
"2026-01"
|
||||
],
|
||||
"transactions": [
|
||||
{
|
||||
"date": "2026-01-10",
|
||||
"amount": 300,
|
||||
"manual_fix": "",
|
||||
"person": "",
|
||||
"purpose": "",
|
||||
"inferred_amount": 300,
|
||||
"sender": "Member_d035d9f9",
|
||||
"message": "other: tournament",
|
||||
"bank_id": ""
|
||||
}
|
||||
],
|
||||
"exceptions": [],
|
||||
"default_year": 2026
|
||||
},
|
||||
"output": {
|
||||
"members": {
|
||||
"Member_d035d9f9": {
|
||||
"tier": "A",
|
||||
"months": {
|
||||
"2026-01": {
|
||||
"expected": 750,
|
||||
"original_expected": 750,
|
||||
"attendance_count": 3,
|
||||
"exception": null,
|
||||
"paid": 0.0,
|
||||
"transactions": []
|
||||
}
|
||||
},
|
||||
"other_transactions": [
|
||||
{
|
||||
"amount": 300.0,
|
||||
"date": "2026-01-10",
|
||||
"sender": "Member_d035d9f9",
|
||||
"message": "other: tournament",
|
||||
"purpose": "other: tournament",
|
||||
"confidence": "auto"
|
||||
}
|
||||
],
|
||||
"total_balance": -750
|
||||
}
|
||||
},
|
||||
"unmatched": [],
|
||||
"credits": {
|
||||
"Member_d035d9f9": -750
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user