Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Deduplicate the registrant CSV row builder (events vs event_registrations exports)

未关闭
#2,128 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
68/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
冷清
技术栈
ruby
领域
backend

调研方向

从 app/controllers/events_controller.rb 中的 EventsController#event_registration_csv_row 和 app/controllers/event_registrations_controller.rb 中的 Events::EventRegistrationsController#csv_export 开始。比较它们的 header 和 row 逻辑,然后查看现有的 controller CSV request spec,再决定共享 builder 的结构。完成的标准是两个 controller 都使用该 builder,有一个直接的 builder spec 覆盖其 options,并且现有 CSV 输出保持逐字节不变。

由索引模型根据 Issue 内容生成。

描述

enhancement event mgmt

🤖 From Claude: follow-up noted during the events-IA refactor (PR #2113); out of scope there.

Summary

Two controllers build essentially the same per-registrant CSV row from scratch:

  • EventsController#event_registration_csv_row (app/controllers/events_controller.rb, ~L876) — the per-event Manage roster export.
  • Events::EventRegistrationsController#csv_export (app/controllers/event_registrations_controller.rb, ~L365) — the cross-event registrations export.

Both emit the same columns — first name, last name, email, phone, org(s), scholarship (yes/no), scholarship completed, payment status, intends to pay, payment total, and CE status/paid/due — with only minor differences:

  • The cross-event export adds an Event column and uses attendance_status_label; the per-event one omits Event and gates payment on cost_required.
  • Org names: the per-event builder derives active-affiliation org names in Ruby; the cross-event one omits orgs.
  • CE columns are always present cross-event; conditional (include_ce) per-event.

They share csv_dollars, allocations_sum, scholarships.any?, payment_status_label, etc. — so the cell logic is duplicated and can drift (a change to how, say, scholarship-completed or CE-due is computed must be made in both).

Proposed approach

Extract a single row/column builder (e.g. an EventRegistrationCsvRow PORO or a shared concern) that takes an EventRegistration plus options (include_event_column:, include_ce:, cost_required:) and returns the header + row. Both controllers call it. Keep the two call sites' column-set differences as explicit options rather than divergent implementations.

Tasks

  • Extract the shared header + row builder.
  • Point both controllers at it (preserving each export's current columns exactly).
  • Spec the builder directly; keep the existing controller CSV request specs green (byte-for-byte output unchanged).

Out of scope

  • No new columns or format changes — pure dedup.
References
  • PR #2113 — the events-IA refactor that surfaced this.
主要语言
Ruby
星标
15
派生
28
平均合并
1 天 12 分钟
30 天内合并 PR
262

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rubyforgood/awbw 的其他 Issue

查看 rubyforgood/awbw 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。