Skip to content

Certificates unlock on their own; roster shows Available, slider makes it available now - #2942

Merged
maebeale merged 4 commits into
mainfrom
maebeale/eventregistration-certificate_available-logic
Nov 3, 2026
Merged

maebeale merged 4 commits into
mainfrom
maebeale/eventregistration-certificate_available-logic

Conversation

@maebeale

@maebeale maebeale commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 4 Check ✅ availability predicates gain an issued override, roster cell + readiness read availability, CE reads preloaded

This PR makes both the certs work the same.

The roster's certificate sliders read like "available," but they only stored "sent." So someone who attended (and finished scholarship tasks) showed grey even though they could already download their certificate, sliding the event certificate on never unlocked it, and readiness kept them at "Certificate not sent" until an admin flipped it by hand. Admins were also unsure what the unlock conditions were.

  • Both certificates still unlock automatically — no callback or stored flag
    • Event: training ended + attended + scholarship tasks done
    • CE: ended + attended + CE approved and paid + CE form (if any) + signed-in time (if tracked)
  • Marking issued now unlocks (the admin "make it available now")
    • Event certificate: certificate_sent_at now counts in EventRegistration#certificate_available? (before it only fed readiness)
    • CE certificate: certificate_sent_at now counts in ContinuingEducationRegistration#certificate_available? (before, an issued CE cert could still be locked)
  • Roster cell
    • Unlocked on its own → green "Available", no slider
    • Otherwise → slider; once on, stays a slider so it can be switched off
    • Tooltips spell out the exact unlock requirements (CERTIFICATE_REQUIREMENTS on each model)
    • CE toggle also refreshes the event certificate cell (issued CE unlocks it)
    • Column headers unchanged
  • CE edit page: switch relabeled "CE certificate availability", same requirements tooltip
  • Readiness: "Certificate not sent" → "Certificate not available" (event + CE)
    • Completed once the certificate(s) unlock — no manual send needed
    • Denied CE is skipped by every CE readiness check (unpaid, license, certificate); the badge notes "CE denied" instead
  • No per-row queries for CE availability
    • Event#ce_callout memoized (like scholarship_callout)
    • Roster preloads attendance entries + form completions for CE rows only
    • Query-count spec: adding CE registrants adds no roster queries
  • ⚠️ An issued CE cert now unlocks even if that CE was denied — issuing is the admin's explicit call

🤖 Generated with Claude Code

maebeale and others added 4 commits November 3, 2026 08:34
…s it available now

- Marking the event's own certificate issued now unlocks it (it only fed readiness before)
- Marking a CE certificate issued now unlocks the CE certificate too
- Roster certificate cells show "Available" once a certificate unlocks on its own;
  otherwise a slider that makes it available now
- Toggling CE also refreshes the event certificate cell (issued CE unlocks it)
- CE edit page switch relabeled "CE certificate availability"

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…te reads

- Readiness "Certificate not sent" → "Certificate not available" (event + CE);
  a registrant is Completed once their certificate(s) unlock, no manual send needed
- Event#ce_callout memoized (like scholarship_callout) so RegistrantCeForm hits
  the callouts once per event
- Roster preloads attendance entries + form completions for CE rows only;
  RegistrantCeForm reads the preloaded completions when loaded
- Query-count spec: adding CE registrants adds no roster queries

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nstead

- Readiness CE checks (unpaid, license, certificate) skip denied CE
- Status badge shows "CE denied" as a note (tooltip, and under the badge
  when there's no other reason)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@maebeale
maebeale merged commit 7dc446f into main Nov 3, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/eventregistration-certificate_available-logic branch November 3, 2026 14:09
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