feat(admin): surface org membership and sponsor tier in admin UI
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 33
- Forks
- 104
- Avg merge
- 12h 3m
- Merged PRs (30d)
- 10
Description
Summary
The schema already has org_memberships (recurring annual support tier with start/end/renewal dates) and event_sponsorships (per-event sponsorship with tier). Neither is exposed in the admin UI today — staff can't designate an org as a US-RSE member or sponsor without touching the DB.
Requirements
- Org detail page gains a "Support" tab (or section) showing the current active org membership row, if any, plus a button to start a new one
- Editable fields per
org_membershipsrow: tier (enum), startedAt, endedAt, renewalDueAt, notes - List view of historical memberships on the same tab so renewals don't lose context
- Same surface for
event_sponsorships— list of historical sponsorships across all events the org has supported - API:
GET /admin/organizations/:idis extended to includememberships[]andeventSponsorships[]; newPOST/PATCH/DELETE /admin/organizations/:id/membershipsendpoints - Member ↔ sponsor are independent (an org can be one, both, or neither) — the UI must not couple them
- Public surfaces (sponsors page, directory "Org member" facet) pick up changes automatically via the existing predicate (
started_at <= now() AND (ended_at IS NULL OR ended_at >= now()))
Context
See packages/api/src/db/schema/joins.ts:107-184 — orgMemberships and eventSponsorships already exist with partial unique indexes that prevent two open memberships per org and duplicate event/org sponsorship rows.
Implementation Notes
The "one active membership per org" partial unique index means closing the current membership (setting endedAt) must precede opening a new one. The UI should make this a single action ("Renew membership") that updates both rows in one PATCH, rather than exposing the two-step workflow to admins.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/api/src/db/schema/joins.ts:107-184 to understand the existing membership and sponsorship relations, then trace the admin organization detail page and GET /admin/organizations/:id handler. Implement the Support surface and membership endpoints without coupling memberships to sponsorships. Done means active and historical records are visible and editable, renewal closes the old membership before opening the new one, and the API returns both collections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- api, database, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100