Repository navigation
fix: match the card portion of Amazon refunds split with points - #105
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #105 +/- ##
==========================================
+ Coverage 65.48% 65.75% +0.26%
==========================================
Files 51 51
Lines 7038 7110 +72
==========================================
+ Hits 4609 4675 +66
- Misses 2087 2091 +4
- Partials 342 344 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
The Return Center reports a refund's total across all tenders, but the bank feed only shows the card credit. Bump amazon-go to v0.5.0 for per-tender refund rows, attach them to each return, and match on the card portion.
eshaffer321
force-pushed
the
fix/amazon-refund-card-portion
branch
from
October 14, 2026 11:54
3905fae to
a6f0cac
Compare
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.
Problem
An Amazon refund of +$31.24 was never categorized. Its order was paid $31.24 by card plus $11.15 in Amazon Visa points, and the Return Center reports the refund total ($42.39). Refund matching looked for a $42.39 credit, which never appears in Monarch.
Fix
amazon-goto v0.5.0 (release). It flags refund rows on the payment transactions page (Transaction.IsRefund) and dates each row correctly.convertGoTransactionmapsIsRefundtorefund, so a refunded order no longer looks like it has duplicate card charges.FetchReturnsfetches each refunded order's transactions (one request per order) and attachesRefundTendersto the return. It only does this when the rows match that return unambiguously (same issued day, sum equals the Return Center total).BankRefundAmount(), the card portion. Points-only refunds are skipped with an explicit reason. Returns without a breakdown behave as before.Testing
go test ./... -racepasses../itemize amazon -account wife -dry-run -days 14now categorizes the refund against the +$31.24 credit.Logged in
docs/bug-fixes.md.