Skip to content

Judge each scholarship's program status at its own training - #2367

Merged
maebeale merged 3 commits into
mainfrom
maebeale/scholarship-program-status-anchor
Aug 24, 2026
Merged

Judge each scholarship's program status at its own training#2367
maebeale merged 3 commits into
mainfrom
maebeale/scholarship-program-status-anchor

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 one column's rule swapped to the canonical service; no shared semantics touched

Split out of #2336 so it can ship on its own — it fixes a live bug and doesn't depend on that PR's active? / .active change.

Why

  • The New / Ongoing / Reinstated column judged every award against today (Organization#program_statusAffiliation#active?).
  • So a 2018 award showed the program's status now: an org that has since lapsed read Reinstate on a row where it was plainly Ongoing at that training — and the value moved silently as affiliations changed underneath it.
  • It was also the last surface computing this word ad hoc, so it could disagree with the event reports and org profile chips about the same program on the same day.

What

  • Each row anchors on the start date of the training it paid for, via Scholarship#event (allocation → event registration).
  • Routes through FacilitatorProgramStatus, which ADR-0001 D4 already names as the one rule.
  • Hover text names the anchor date and the reasoning, worded like the org profile's per-event chips.
  • No registration behind the award (grant-first, or funding a CE registration) → year anchor, labelled "no event in view".
  • Organization#program_status(recipient) deleted; it had no other caller.

Notes for reviewers

  • Two rows on one page can now read differently. That's the point, but it's the visible behaviour change.
  • Scholarship#event resolves through the preloaded recipient.event_registrations, not allocation.allocatable — a polymorphic preload can't reach the event, so walking the allocatable cost a query per row. recipient_must_match_allocation_registrant guarantees the funded registration belongs to the recipient. Verified: 0 per-row queries on the index scope.
  • The strict-< anchor (ADR-0001 D8) means a first-time org still reads New at its own training — the affiliation that training minted starts on the anchor, so it doesn't count as prior history.

Tests

  • Scholarship#event with and without an allocation.
  • Ongoing / New / Reinstated at a given training; two awards judged at their own trainings; the year-anchor fallback; the explanation text.

The New / Ongoing / Reinstated column judged every award against today,
via Organization#program_status → Affiliation#active?. So a 2018 award
showed the program's status *now*: an org that has since lapsed read
Reinstate on a row where it was plainly Ongoing at that training, and the
value moved silently as affiliations changed underneath it.

Anchor each row on the start date of the training it paid for instead.
That means routing through FacilitatorProgramStatus, which ADR-0001 D4
already names as the one rule for this word — the scholarship index was
the last surface computing it ad hoc, and the only one that could
disagree with the event reports and org profile chips about the same
program on the same day. Hover text names the anchor and the reasoning.

An award with no registration behind it (grant-first, or funding a CE
registration) keeps the year anchor, labelled "no event in view".

Organization#program_status had no other caller, so it goes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
maebeale and others added 2 commits August 23, 2026 21:18
The seed summary exceeded Feature's 300-char maximum, so import! raised
RecordInvalid — failing the catalog seed-validity spec and returning 422
from POST /features/import.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The entry describes the scholarship index, so it belongs beside the other
scholarship features on /features — filed under Events & trainings it was
invisible to anyone filtering by the area it actually ships in.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@maebeale
maebeale marked this pull request as ready for review August 24, 2026 01:58
@maebeale
maebeale merged commit 165699b into main Aug 24, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/scholarship-program-status-anchor branch August 24, 2026 01:59
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