Show admins when a recipient opened their invoice#2004
Open
maebeale wants to merge 2 commits into
Open
Conversation
The registrant invoice and bulk-payment invoice pages had no view tracking, so there was no way to tell whether a payer had opened their invoice. Emit an Ahoy view event on each and expose queryable helpers and scopes on EventRegistration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maebeale
marked this pull request as ready for review
July 22, 2026 10:47
Track every invoice open, tagging each with a viewer_role so an admin previewing an invoice never counts as the recipient having seen it. An admin-only badge on the invoice shows when the recipient first opened it (or 'Not opened yet'), with a CSS-only hover tooltip listing all opens. Timestamps render in the viewer's time zone. Renames the bulk-payment event to view.event_bulk_payment_invoice and extracts the shared read logic into an InvoiceViewTrackable concern. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
🤖 suggested review level: 3 Read 📖 contained tracking + read logic behind a concern, one new admin-only view element
Why
Admins had no way to tell whether a registrant/payer had actually opened their invoice (the "Download PDF" button is a client-side
window.print(), so downloads aren't observable). This surfaces recipient opens to admins.What
viewer_role(adminvsrecipient) so an admin previewing an invoice never counts as the recipient seeing it. (user_idcan't distinguish them — a signed-in registrant has one too.)invoice_views/invoice_viewed?/invoice_view_times+invoice_viewed/invoice_not_viewedscopes) extracted into anInvoiceViewTrackableconcern onEventRegistrationandFormSubmission.Notes
admin-only bg-blue-100styling convention, a "reach for JS last" rule, and a stronger comments-only-when-needed guideline — per review feedback while building this.