Skip to content

Add W-9 download to the registration ticket via an "Additional forms" question#1707

Merged
maebeale merged 1 commit into
mainfrom
maebeale/registration-ticket-links
Jun 17, 2026
Merged

Add W-9 download to the registration ticket via an "Additional forms" question#1707
maebeale merged 1 commit into
mainfrom
maebeale/registration-ticket-links

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

What is the goal of this PR and why is this important?

  • Registrants who need AWBW's W-9 (or an invoice) had no way to request it during registration, and staff had no signal to act on.
  • This adds an "Additional forms" question to the registration form and surfaces the requested document(s) on the registrant's digital ticket.
  • Scoped to the W-9 download for now; the invoice flag is wired up but its print/page lives in a follow-up PR.

How did you approach the change?

  • Followed the existing ce_credit_requested "magic question" pattern so the seed, service, and ticket agree on one well-known field_identifier.
  • Migration: added w9_requested and invoice_requested booleans to event_registrations (default false, not null).
  • Service (EventRegistrationServices::PublicRegistration): new ADDITIONAL_FORMS_IDENTIFIER constant + w9_requested? / invoice_requested? that read the multi-select answer, setting both flags on create and on re-registration.
  • Seed: added an "Additional forms" group header + multi_select_checkbox question (options Invoice, W-9) in its own section, idempotent on re-seed.
  • Ticket: conditional Download W-9 card (shown only when w9_requested?), styled to match the existing "Before you attend" callout.
  • W-9 file: committed AWBW's W-9 to public/documents/awbw-w9.pdf — served at a stable, undigested /documents/awbw-w9.pdf URL (not the asset pipeline, which would fingerprint the filename).

UI Testing Checklist

  • Register for an event and check W-9 under "Additional forms" → the ticket shows a Download W-9 link that opens public/documents/awbw-w9.pdf.
  • Register without checking W-9 → no download link on the ticket.
  • Check Invoiceinvoice_requested is set (no ticket link yet — follow-up PR).

Anything else to add?

  • Decision: the question is required: false. "Do you need either of the following?" must allow "neither," matching the CE magic-question precedent — despite the red * in the original mock.
  • Follow-up PR (deferred): the invoice print page + its conditional ticket link, consuming the already-present invoice_requested flag.
  • Tests: service specs (both / one / none / re-registration) + request specs (W-9 link shows iff w9_requested). All green; lint clean; seed verified idempotent.

🤖 Generated with Claude Code

…uestion

Registrants who need AWBW's W-9 (or an invoice) had no way to ask for it during
registration, and staff had no signal to act on. Add an "Additional forms"
multi-select question whose selections drive new w9_requested / invoice_requested
flags on the registration — mirroring the existing ce_credit "magic question" so
the seed, service, and ticket stay consistent.

The digital ticket now surfaces a W-9 download (static public PDF) when w9_requested
is set. The invoice flag is wired up but its download page is intentionally left for
a follow-up PR, which only needs to consume the existing flag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

<!-- Additional forms the registrant asked for during registration -->
<% if event_registration.w9_requested? %>
<%= link_to "/documents/awbw-w9.pdf",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: Links to a stable, undigested public path on purpose — the W-9 lives at public/documents/awbw-w9.pdf, not the asset pipeline (which would fingerprint the filename and break this URL). Shown only when w9_requested?.


# The "Additional forms" question is a multi-select, so its submitted value is
# an array of the checked option labels (e.g. [ "Invoice", "W-9" ]).
def additional_forms_selections

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: "Additional forms" is a multi-select, so its submitted value is an array of checked labels (e.g. ["Invoice", "W-9"]). Array(...) normalizes the nil/single/array cases before the per-flag casecmp? checks below.

visibility: :always_ask
)
additional_forms_field = registration_form.form_fields.create!(
name: "Do you need either of the following?",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: Deliberately required: false (set on the field below): "Do you need either of the following?" must allow "neither," matching the CE magic-question precedent — despite the red * in the original mock. Flag if you actually want it required.

@maebeale maebeale marked this pull request as ready for review June 17, 2026 17:51
@maebeale maebeale merged commit 5691399 into main Jun 17, 2026
3 checks passed
@maebeale maebeale deleted the maebeale/registration-ticket-links branch June 17, 2026 17:52
maebeale added a commit that referenced this pull request Jun 17, 2026
Main (#1707) added an "Invoice"/"W-9" opt-in to public registration that
sets invoice_requested/w9_requested, with the digital ticket surfacing those
downloads — but only the W-9 download was wired up, since the invoice page
didn't exist yet. Surface the invoice the same way: a card matching the W-9
one, shown when the registrant requested an invoice, completing that intent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
maebeale added a commit that referenced this pull request Jun 17, 2026
* Add dynamically generated event invoice with PDF download

AWBW staff and registrants need a printable invoice for paid events.
Rather than maintaining a static template per event, this generates the
invoice from live data — the brand logo from the asset pipeline, the
recipient from the registration/payer, and the line item from the event.

One EventInvoice presenter normalizes three sources into a single
printable layout: a per-registration invoice (public, reached via the
registration's secret slug), and an admin-side event invoice that renders
a blank template prefilled with the event's content, autofilling the
bill-to/attention from a bulk-payment submission when submission_id is
present. PDF export reuses the app's existing print convention (print:
Tailwind utilities + a small print Stimulus controller) so no PDF gem or
binary is introduced.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Reach the invoice from submission pages; use the existing print pattern

Bulk-payment payers are emailed a link to their (public) submission page, so
the invoice needs to be reachable from there — add a "View invoice" link on
both the public bulk-payment show page and the admin form-submission page.
A bulk-payment submission's invoice is now public (gated by FormSubmission
show_invoice?), matching that the submission show page is already public by id;
the blank template stays admin-only.

Also drop the bespoke print Stimulus controller in favor of the inline
onclick="window.print();" pattern already used by sibling event views
(recipients, background, social share), and render the invoice on a neutral
public background rather than the admin blue tint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Gate the ticket invoice link on the invoice_requested opt-in

Main (#1707) added an "Invoice"/"W-9" opt-in to public registration that
sets invoice_requested/w9_requested, with the digital ticket surfacing those
downloads — but only the W-9 download was wired up, since the invoice page
didn't exist yet. Surface the invoice the same way: a card matching the W-9
one, shown when the registrant requested an invoice, completing that intent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Seed dev registrations with invoice_requested

Mark two facilitator/trauma training registrations as having requested an
invoice so the dev dataset exercises the ticket's "View invoice" surface,
mirroring the existing scholarship_requested seed flag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Seed Amy's training registration with W-9 and invoice requested

Gives the dev dataset a registration that exercises both the W-9 and invoice
ticket surfaces at once, and threads w9_requested through the seed create.
Maria and Sarah keep their invoice-only flag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Register invoice views in page_bg_class alignment spec

The new event/registration invoice views set content_for(:page_bg_class),
which the alignment guard requires to be accounted for. Both are publicly
reachable (slug / bulk-payment submission id), so "public" is the honest
value; the blank-template admin gating is enforced in the controller.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant