fix: [44] fix: notify negative balance on the transition into the red #45
No reviewers
Labels
No labels
auto-merge
bug
chore
dependency
duplicate
enhancement
upstream-sync
wontfix
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
hobbypunk/centinel!45
Loading…
Reference in a new issue
No description provided.
Delete branch "bug/44"
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?
Problem
Aus #44:
NotifyNegativeBalanceJobwar anafter_create_commit ... if: -> { virtual_balance.negative? }gekoppelt – aberbalanceist beim Anlegen eines Accounts immernil(der Resolve-Job setzt kein Balance), also gibtvirtual_balancedort0zurück und der Event konnte nie feuern. Ein späterer Wechsel in den negativen Bereich über den stündlichenSyncBalanceJobhatte gar keinen Trigger – ein Konto, das nachträglich ins Minus rutscht, blieb komplett unbemerkt.Fix
Bank::Accountbekommt einenafter_update_commit-Hook mitbecame_negative?-Bedingung, der nur beim Übergang der virtuellen Bilanz (Differenzbalance − virtual_zero) von ≥ 0 auf < 0 feuert:balanceodervirtual_zero(beide können das Vorzeichen kippen)*_previously_was; eine bisherigenil-Balance zählt als 0 – dadurch erkennt auch der erste Sync eines neu angelegten, negativen Kontos den ÜbergangArchivierte Accounts sind automatisch ausgenommen (deren Syncs stoppen ohnehin), und der Job selbst prüft die Bedingung nochmal.
Fixes #44
📊 Coverage
Patch-Coverage: 100.0% (6/6 geänderte Zeilen)
Geänderte Dateien (schwach zuerst)
Schwächste Dateien im Projekt
🔍 Report im Browser ansehen · 📄 Run-Artifact „coverage-report“
7587702fc814d138c686fix: trigger negative balance notifications from the hourly balance sync [44]to fix: [44] trigger negative balance notifications from the hourly balance syncfix: [44] trigger negative balance notifications from the hourly balance syncto [44] fix: notify negative balance on the transition into the red[44] fix: notify negative balance on the transition into the redto fix: [44] fix: notify negative balance on the transition into the red