[Card Locking] Move to a time-based upload requirement#13705
Open
manuthecoder wants to merge 20 commits into
Open
[Card Locking] Move to a time-based upload requirement#13705manuthecoder wants to merge 20 commits into
manuthecoder wants to merge 20 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Exclude HcbCodes marked no-or-lost from no-receipt scope Remove obsolete spec covering unlock-only card lock behavior
Co-authored-by: Claude <noreply@anthropic.com>
The second describe block expected HTTP 201 but the controller returns 200, and stubbed StripeService::PaymentIntent.create after donation creation — a call the payment_intent action never makes. The first block already covers this endpoint correctly. https://claude.ai/code/session_016PnTwan62ypAyZNpohFLaH
Add an early return in User#cards_should_lock? to immediately lock when total missing receipts reach the hard threshold. Update create_settled_card_charge to accept an optional stripe_card and add specs for locking when violations reach the violation threshold and when total missing receipts hit the hard threshold without violations.
…ard-locking-requirements
Comment on lines
+668
to
+671
| canonical_transactions.select { |ct| ct.amount_cents.negative? }.min_by(&:created_at)&.created_at | ||
| else | ||
| canonical_transactions.expense.minimum(:created_at) | ||
| end |
Contributor
There was a problem hiding this comment.
Suggested change
| canonical_transactions.select { |ct| ct.amount_cents.negative? }.min_by(&:created_at)&.created_at | |
| else | |
| canonical_transactions.expense.minimum(:created_at) | |
| end | |
| canonical_transactions.select { |ct| ct.amount_cents.negative? }.min_by(&:created_at)&.created_at | |
| else | |
| canonical_transactions.expense.minimum(:created_at) | |
| end |
| expect { | ||
| service.run | ||
| }.to change { user.reload.cards_locked? }.from(false).to(true) | ||
| .and have_enqueued_mail(CardLockingMailer, :cards_locked) |
Contributor
There was a problem hiding this comment.
Suggested change
| .and have_enqueued_mail(CardLockingMailer, :cards_locked) | |
| .and have_enqueued_mail(CardLockingMailer, :cards_locked) |
| expect { | ||
| service.run | ||
| }.to change { user.reload.cards_locked? }.from(true).to(false) | ||
| .and have_enqueued_mail(CardLockingMailer, :cards_unlocked) |
Contributor
There was a problem hiding this comment.
Suggested change
| .and have_enqueued_mail(CardLockingMailer, :cards_unlocked) | |
| .and have_enqueued_mail(CardLockingMailer, :cards_unlocked) |
Add @total_missing_count and memoize card_locking_missing_receipts. Update locked_message and cards_locked view to show an alternate message when there are no 72-hour violations and to hide the violations table.
…ard-locking-requirements
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.
Closes #13194 by moving card locking to a time based requirement