Repository navigation
🐛 Stop counting card repayments twice in safe to spend - #1295
Merged
Merged
Conversation
A direct debit that pays one of the user's credit cards was taken off as a bill on top of what card cover says the card owes, so the same money came off twice. Such debits are now left out of the bills and listed in card_payments instead. Merchant and payee names sent in capitals are title-cased for display in spending and bills, leaving names the merchant cased itself alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C1jkrANqELbkXC4ibM62v1
|
🎉 This PR is included in version 1.0.0-dev.436 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Will · project thread
Why
Safe to spend took off the American Express direct debit as a bill, on top of what card cover says the card owes. On 1 Nov that came to £4,886.62 owed on British Airways Premium Plus (spending since the 7 Oct statement). On top of that, the £9,621.74 "American Express" debit due 21 Nov was also taken off. The 21 Nov debit pays the statement that closes on 7 Nov, which is the same spending. So it was counted twice, and safe to spend read about £9,600 lower than it should.
What changes
UpcomingBillsleaves out any direct debit whose payee matches a credit card's issuer (metadata.provider) or name. These now go in a newcard_paymentslist, whichSafeToSpendpasses through.upcoming_billsandamountno longer include them. Clients that don't read the new key are unaffected.App\Support\MerchantName::displaychanges "AMERICAN EXPRESS" to "American Express" and "SAINSBURY'S S/MKTS" to "Sainsbury's S/Mkts".Testing
SafeToSpendTest::a_direct_debit_that_pays_a_credit_card_is_not_counted_twice;MerchantNameTest, which covers the casing rules.composer installcan't reach the privatewire-elements-propackage host from this container. I checked the casing helper by hand, with the results above, and checked syntax withphp -l. CI is the first full run.Generated by Claude Code