feat(my-programs): roster, attendance summary, stats + CSV for program leads#964
Open
jee7s wants to merge 1 commit into
Open
feat(my-programs): roster, attendance summary, stats + CSV for program leads#964jee7s wants to merge 1 commit into
jee7s wants to merge 1 commit into
Conversation
Add a read-only "Roster" subtab to /my-programs for the programs a lead runs:
participant list with household-lead contact ("who do I call"), per-participant
attendance + per-session turnout, a stats card (enrollment vs capacity, session
count, scholarship-request COUNT only), and CSV export.
One scoped route GET /api/my-programs/[id] (withAuth + tight selects, like
nav/todo-counts) returns data only for programs the caller leads (board/sysadmin
override), or a text/csv attachment. Finance-confidential participant fields
(isPaymentPlanRequested / paymentPlanDeniedAt / inventoryHeldAt / pendingSince)
are never selected onto a row — scholarship demand is a bare count. Added to the
routeAuthDrift EDGE_INCLUDE_ALLOWLIST (rule 3). No schema or security-boundary
change.
Design: checkin-app/docs/designs/MY_PROGRAMS_INFO.md.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RsD1zGYyqQFZaHT2wfkSB7
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.
What / why
Program leads have a home (
/my-programs) with an attendance inbox and aconflicts tab, but still can't answer everyday operational questions in-app:
who's in my program, how do I reach their family, who's been showing up, and how
full am I? This adds the read-only Roster surface the scoping doc's "Next"
section called for.
Design:
checkin-app/docs/designs/MY_PROGRAMS_INFO.md(builds on the repo-rootdocs/designs/MY_PROGRAMS_SCOPING.md).Decisions (from the product interview — for programs the caller LEADS)
email/phone ("who do I call").
per-session turnout, co-located with the roster.
?format=csv).COUNT ONLY (no names — finance-confidential).
Implementation
GET /api/my-programs/[id](withAuth, tightselects,like
nav/todo-counts): returns{ program, roster, events }or atext/csvattachment. Data only when the caller leads the program (
leadMentorId) oris board/sysadmin; else 403.
/my-programs/rostersubtab (stats card, roster table with contact +attendance, turnout table, CSV buttons). Reuses the layout's lead-gate.
src/lib/programRoster.ts(unit-tested, no DB).src/security/**edit,ships as one self-contained PR.
PII discipline
leadMentorId) is the control — added toEDGE_INCLUDE_ALLOWLISTintests/security/routeAuthDrift.test.ts(rule 3).isPaymentPlanRequested/paymentPlanDeniedAt/inventoryHeldAt/pendingSince) are never selected onto a row; scholarship isa bare count. Asserted by an integration test grepping the JSON/CSV.
email/phoneare the contact-identity band leads may alreadyhold; not new PII.
Testing evidence
programRoster.test.ts, node): visit aggregation (distinct events/people,last-seen), CSV RFC-4180 escaping, roster/events CSV shape — 8 tests.
roster/__tests__/page.test.tsx): renders stats + contact + turnout + CSV links.myProgramsInfoAPI.integration.test.ts, shared DB): lead sees own,403 for others, board override, 404/401, PII shape, roster + events CSV content — 7 tests.
npx tsc --noEmitclean;eslint --max-warnings 0clean on all touched files.🤖 Generated with Claude Code