Repository navigation
feat(clubs): members come in through their seat, a first official Round from the club, the youth path and leaving a club (LAUNCH-19.9 · LAUNCH-19.10 · LAUNCH-19.11 · LAUNCH-19.12) - #977
Conversation
… (LAUNCH-19.9) The seat accept, already under the invitee's account fence then the club, now admits a waiting invitee through the gate's own transition and writer under club:<id> when the club plan gives access and the gate's claim rule (with its age floor) allows; on an unpaid plan the seat is taken and the account still waits. decideSeatAdmission sits beside the manager's rule in @daisy/protocol/club-admission (renamed from club-manager-admission: one concept, a paid club admits an account); db shares readClubAdmissionAccount and admitThroughGate. /clubs is now the 'club' access area, invitations included, and the invitation routes admit waiting accounts. ISSUE-1580's 'a seat cannot let them in' copy goes; /beta leads a new invitee on to the invitation instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
… the end of the UTC day, membership ended (LAUNCH-19.12) decideClubLeave (@daisy/protocol/club-seats) frees the leaver's seat as a removal does and refuses the manager (manager-cannot-leave). The db leaveCommand runs in the club order (holders' fences, club, billing rows), rewrites the grants and ends the membership through Tab's writes (endSeatMembership beside activateSeatMembership: membership ended, the member's organisation grants revoked, user version bumped). POST /api/clubs/<id>/leave; /clubs offers Leave <club> with its consequence, and Settings › Billing's seat panel leads there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… official lobby that fits each ladder, its holders named for the Room's invite (LAUNCH-19.10) Seats gains Hold a Round on a paid plan, to an admitted manager: for each ladder with funded holders, the official standing lobby that fits it (defaultStandingLobby: Youth for under-18, Open for adults) and a link to /play/room?lobby=<id>, whose create path rechecks the lobby (club staff may host Youth). Holders are named by username for the Room's Invite people. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…se comes next and is taken to it (LAUNCH-19.11) The open invitation view carries the invitee's ladder (youth, never an age: ADR 0151 §8). A Youth invitee reads that a parent or guardian can sign the media release, or the club confirm one it holds, and on accept moves on to Settings › Media release, which asks either (the club now listed there). Playing in Youth needs no guardian; a guardian-addressed notification waits for counsel (ISSUE-1623). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e; 0962, 0974 and compliance follow (LAUNCH-19.9 · LAUNCH-19.10 · LAUNCH-19.11 · LAUNCH-19.12) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eat and is let in by it (LAUNCH-19.9) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: feat(clubs): members come in through their seat, a first official Round from the club, the youth path and leaving a club (LAUNCH-19.9 · LAUNCH-19.10 · LAUNCH-19.11 · LAUNCH-19.12) at 73cf195Reviewer: ag-pm5yh0t7 · Builder: ag-z3ps5fiu Checks
Findings
Criteria
OWASP Top 10 (runtime change)
Privacy & telemetryThe invitation view adds Verdict0 blocker / 1 major / 2 minor / 1 nit — CHANGES REQUESTED |
2witstudios
left a comment
There was a problem hiding this comment.
Inline threads for the /review at 73cf195 (summary comment: #977 (comment)).
| * rule, with its age floor, decides who may come in. Accepting still takes | ||
| * the seat when this skips; the account then waits as before. | ||
| */ | ||
| export function decideSeatAdmission(input: { |
There was a problem hiding this comment.
major (CONFIRMED by code trace): one paid seat can admit any number of waiting accounts through the gate. Remove a holder (decideClubSeating remove frees the seat at once and leaves the gate as it is), invite the next person, they accept and are admitted, and so on. ADR 0962 §3 bounds member invitations at 5, counting accepted ones. Either bound club:<id> admissions (for example, at most the paid seat count, counted under the fence and passed in as a fact), or record unbounded recycling as an accepted consequence in ADR 0977 and ask the point guard.
| * A membership that is not active is left as it is. The caller holds the | ||
| * club row lock and its scope, and has refused the owner. | ||
| */ | ||
| export async function endSeatMembership( |
There was a problem hiding this comment.
minor: this re-spells Tab's pure endMembership (apps/web/src/features/tab/commands/organization.ts:354) in db: the active guard, which grants to revoke, the revoke shape and the bumps. The writes match today, but ending a membership now has two homes that can drift. Have one Tab-owned pure function produce these writes for both, or file it together with activateSeatMembership.
| return moveOn(incoming, answer === 'accept' ? '/settings/billing' : '/'); | ||
| // A Youth debater goes on to the media release (LAUNCH-19.11); the bound | ||
| // flag only chooses between two pages that check their own access. | ||
| return moveOn( |
There was a problem hiding this comment.
minor: no test covers 19.11's "taken to the media release on accept" destination. Pull the destination into a small pure function (answer, youth → path) with a unit test, or assert the Youth redirect in a journey.
| @@ -606,6 +632,87 @@ export function createClubSeats(input: { | |||
| }, | |||
|
|
|||
| /** Addressed invitee facts and their atomic seat/mail/membership/grant application. */ | |||
There was a problem hiding this comment.
nit: this is answerCommand's JSDoc. It now sits above leaveCommand's own doc block, so answerCommand (:716) has none. Move it back.
Change
The rest of the organizer's first sitting after #974, the leaves LAUNCH-19.9 to LAUNCH-19.12 (point guard, Delivery 7293):
club:<organisation id>. A paid club admits an account; this is one concept (ADR 0974, extended by this PR's ADR). On an unpaid plan the seat is taken and the account keeps waiting. ISSUE-1580's "a club seat cannot let them in" copy goes./betanow leads a new invitee on to their invitation./play/room?lobby=<id>. The Room's create path rechecks the lobby in its transaction, and club staff may host Youth. Holders are named by username for the Room's Invite people dialog. No new command.decideClubLeavefrees the leaver's seat as a removal does, so its Premium ends at the end of the UTC day, and refuses the manager. The DBleaveCommandruns in the club order (holders' fences, then the club, then billing rows), rewrites the grants and ends the membership through Tab's writes (endSeatMembership). Route:POST /api/clubs/<id>/leave./clubsoffers "Leave " with its consequence, and Settings › Billing's seat panel links there.club-journey.e2e.tsnow also has a waiting student open the emailed link, accept the paid seat, and reach/lobbywithout/beta.PageSpace
Builder: ag-z3ps5fiu
Criteria
decideSeatAdmission), packages/db/src/club-admission.ts, packages/db/src/club-seat-commands.ts (answerCommand), apps/web/src/features/clubs/invitee-command.ts, apps/web/src/features/access/decision.ts (clubarea), apps/web/src/ui/beta/beta-waiting.tsxyouth), apps/web/src/features/clubs/views.ts, apps/web/src/ui/clubs/invitation-page.tsx, apps/web/src/app/(shell)/clubs/actions.ts (clubInvitationActiondestination)decideClubLeave), packages/db/src/club-seat-commands.ts (leaveCommand), packages/db/src/tab/seat-membership.ts (endSeatMembership), apps/web/src/features/clubs/leave-command.ts, routes.ts (leave), apps/web/src/ui/clubs/leave-club-form.tsxValidation
At 73cf195:
bun test(protocol club-admission and club-seats, web clubs, beta, access, member-boundary): pass.tsgofor protocol (both tsconfigs), db and web; eslint and prettier on changed files;bun scripts/check-boundaries.ts; regeneratedbun log:routesandnets/route-table.ts: all clean.Changed test assertions
decision-beta.test.ts:/clubs/invitationswasparticipant, and a waiting account was sent to/beta. It is now theclubarea, and the waiting account is allowed.seats-page.test.tsx: the invite section's sentence changed from "A club seat does not let them in" to "accepting the seat lets them in".beta-waiting.test.tsx: the ISSUE-1580 notice test is replaced by "an account that signed up from a club invitation is led on to it".Operational impact
No configuration change. New route:
POST /api/clubs/<id>/leave, behindclub-seats. No migration: the access-event principalclub:<id>already exists (#974).Architecture
The protocol module
club-manager-admissionis renamedclub-admission: a paid club admits an account, whether its manager or a seat holder. The DB sharesreadClubAdmissionAccountandadmitThroughGate. The ADR comes with this PR.Compliance & telemetry
🤖 Generated with Claude Code