Repository navigation
fix(aggregator): preserve charges with conflicting card masks during merge (#3123) - #3128
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 36 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Stale-PR warden: no activity for 2 days. Resolution task: #4443 — this PR should be merged, fixed, or closed. |
04b58e3 to
cf3f3f1
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
agent-note:v1
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Resolves #3123.
Summary
In
sameCharge(pm-stack/aggregator/src/charges-collect.ts), charge deduplication previously matched hand-fed rows against auto-matched rows based on amount, 3-day date window, and merchant label alone. When two distinct charges occurred with identical amounts and merchants within the deduplication window but were charged on different cards (e.g.Visa •7535vsVisa •9545), the hand-fed row was improperly dropped.This change:
extractCardMask(method)to parse payment method card masks (such asVisa •7535or•7535).sameChargeto check whether both rows carry known card masks, and if they conflict (maskA !== maskB), preserve them as distinct charges.extractCardMask, conflicting card masks, matching masks, and missing masks.Targeted tests
bun test pm-stack/aggregator/test/charges-collect.test.ts— 13 passed, 0 failed.bun test pm-stack/aggregator/test/charges-*.test.ts— 23 passed, 0 failed.Need help on this PR? Tag
@codesmith-botwith what you need.