feat(admin): track organization donations over time

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か

調査の方向性

Start by locating the organization admin API, the organizations detail page, and the migration and audit-middleware entry points referenced in the requirements. Review how org_memberships and event_sponsorships handle permissions and history, then verify that donation CRUD, per-currency totals, yearly running totals, staff gating, and mutation audit events are covered.

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

説明

Summary

Track financial contributions from organizations across time, separate from the recurring-membership tier system. Donations are one-time or campaign-attributed contributions that don't fit org_memberships (annual recurring) or event_sponsorships (event-tied).

Requirements

  • New org_donations table: id, organization_id (FK → organizations.id ON DELETE restrict), amount_cents (bigint), currency (text, ISO 4217, default 'USD'), donation_date (date NOT NULL), campaign (text, nullable — free-form for now), fiscal_year (int, nullable), notes (text), created_at/updated_at/recorded_by_user_id (audit columns)
  • Migration adds the table + index on (organization_id, donation_date DESC) for fast per-org history queries
  • API: GET/POST/PATCH/DELETE /admin/organizations/:id/donations; list returns rows sorted by donation_date desc with per-currency totals as aggregates
  • Org detail page: new "Donations" tab listing the org's contribution history with running totals by year
  • Permissions: donation writes gated on staff tier (canEditOrganizations); consider a canRecordDonations policy if we want to lock this down further later
  • Audit middleware captures all donation mutations (organizations.donation.create, .update, .delete)

Context

Why not extend org_memberships? Memberships are recurring annual tiers with one active row per org; donations are arbitrarily many transactions across time, often campaign-attributed. Why not extend event_sponsorships? Donations aren't event-bound. The clean split is three independent tables sharing only the organization_id FK.

Implementation Notes

amount_cents as bigint keeps us currency-precision-safe without a numeric type. Storing currency per-row instead of org-level lets a single org's history span currency changes (e.g., GBP → USD after a UK org's US subsidiary takes over donations).

Fiscal year is nullable because US-RSE doesn't have one defined yet — leaving the column means we can backfill it later via a single UPDATE keyed off donation_date once the policy is set.

主要言語
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 を短くまとめたダイジェスト。