Add W-9 download to the registration ticket via an "Additional forms" question#1707
Conversation
…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", |
There was a problem hiding this comment.
🤖 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 |
There was a problem hiding this comment.
🤖 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?", |
There was a problem hiding this comment.
🤖 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.
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>
* 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>
What is the goal of this PR and why is this important?
How did you approach the change?
ce_credit_requested"magic question" pattern so the seed, service, and ticket agree on one well-knownfield_identifier.w9_requestedandinvoice_requestedbooleans toevent_registrations(defaultfalse, not null).EventRegistrationServices::PublicRegistration): newADDITIONAL_FORMS_IDENTIFIERconstant +w9_requested?/invoice_requested?that read the multi-select answer, setting both flags on create and on re-registration.multi_select_checkboxquestion (options Invoice, W-9) in its own section, idempotent on re-seed.w9_requested?), styled to match the existing "Before you attend" callout.public/documents/awbw-w9.pdf— served at a stable, undigested/documents/awbw-w9.pdfURL (not the asset pipeline, which would fingerprint the filename).UI Testing Checklist
public/documents/awbw-w9.pdf.invoice_requestedis set (no ticket link yet — follow-up PR).Anything else to add?
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.invoice_requestedflag.w9_requested). All green; lint clean; seed verified idempotent.🤖 Generated with Claude Code