feat(admin): surface org membership and sponsor tier in admin UI

オープン
#1,970 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
html
領域
api, database, frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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_memberships row: 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/:id is extended to include memberships[] and eventSponsorships[]; new POST/PATCH/DELETE /admin/organizations/:id/memberships endpoints
  • 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.

主要言語
HTML
スター
33
フォーク
107
平均マージ
14時間 6分
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

USRSE/usrse.github.io のほかの issue

USRSE/usrse.github.io の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。