Transferred-in ticket: surface source financials and service them from the new registration
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
#2044 合并后,从 EventRegistration 开始,检查现有的 transferred_in? delegation methods 和 source financials partial。然后跟踪 app/views/events/callouts/payment.html.erb、Events::CalloutsController、Events::RegistrationsController、event_invoice.rb、event_receipt.rb、builtin_callout_cards.rb 和 pay_charge_extensions.rb。为 source-payment delegation、scholarship servicing、payment-page rendering 和 pay routing 添加 model specs 和 request specs,然后运行 ai/test_extra;完成的标准是 source-held payments 和 scholarships 从新的 ticket 中得到处理,且不会错误归档 payments。
由索引模型根据 Issue 内容生成。
描述
Followup to the event-registration transfer work (#1944 / PR #2044). Start as a new branch off main after #2044 merges — not part of #2044.
Context
A transferred-in registration's registrant-facing ticket/callout pages don't correctly surface or service the money/scholarship that live on the source reg. The read-side "amount due" already delegates to the source; the gaps are the payment ledger, scholarship servicing, and a pay-flow that misfiles a payment onto the transferred-in reg without clearing the delegated balance.
Caveats (main moved since this was drafted):
- Line numbers below are approximate —
mainadvanced through #2237/#1993/#2178/#2258, so verify against current code (method names are stable).- #2178 (scholarship decline flow) is now merged and reworked the scholarship agreement into a tri-state
agreement_response_status(pending/accepted/declined) +ScholarshipAgreementResponsehistory. Part 2 (scholarship servicing) must be built against that new model, not the oldagreement_signed_atboolean.
The governing rule
Delegation to the source is conditional on the source actually having allocations/payments.
- Source has payments → the financial record is anchored on the source. Show the source's ledger + delegated balance on the new ticket; to pay a remaining balance, send the registrant to the source reg's ticket (pay there, allocations stay on source). Never let a payment land on the transferred-in reg in this case.
- Source has no payments → the math should all be on the new reg. The new reg owns its own cost/balance/allocations; the registrant pays on the new reg normally (no delegation). This also removes the misfiling risk.
Implementation seam: gate the existing transferred_in? delegation in EventRegistration (remaining_cost, paid_in_full?, payment_received?, payment_access_granted?, invoice_available?, etc.) on transferred_from_registration.allocations.exists? (or payments_sum.positive?). Add a predicate like source_holds_financials? = transferred_in? && source.allocations.exists? and key the delegations + the pay routing off it. Verify the invoice/receipt from_registration swap (app/presenters/event_invoice.rb, event_receipt.rb) respects the same condition.
Part 1 — Payment ledger
app/views/events/callouts/payment.html.erb (+ payment action, Events::CalloutsController):
- Keep this reg's own allocations rendering as-is (the existing
@allocationslist). - If transferred-in AND the source has allocations, add a separate section below — "Payments on your original registration" — rendering
source.allocations. Reuse the figures the admin summary already computes inapp/views/event_registrations/_transferred_in_financials.html.erb(source.event.cost_cents,source.allocations_sum/payments_sum, due). - "Amount due" already correct via delegated
remaining_cost— leave it, but it now follows the conditional-delegation rule.
Part 2 — Scholarship servicing
Let the registrant view + respond to the source's scholarship from the new ticket, showing the old reg's scholarship record.
scholarshipaction gate +@scholarship: resolve via the chain —EventRegistration#effective_scholarship(scholarships.first || transferred_from_registration&.effective_scholarship) instead of raw@event_registration.scholarships.first. Relax the gate so a transferred-in reg whose source has a scholarship isn't redirected away.sign_agreement(and the new accept/decline flow from #2178): operate on the source's Scholarship record (same person).scholarship_status_cardbuilder (app/services/builtin_callout_cards.rb): use the effective scholarship for the card's gate + data.- Task completion stays admin-only (display only).
- The scholarship view's admin "Edit scholarship" link should point at the source's scholarship record.
Part 3 — Pay-flow correctness
payaction +redirect_to_stripe_checkout(Events::RegistrationsController) and the webhook allocation (pay_charge_extensions.rb): whensource_holds_financials?, route the checkout/allocation to the source reg (metadataevent_registration_id= source), so paying clears the delegated balance. When the source holds no financials, the transferred-in reg pays itself (correct onceremaining_costno longer delegates in that case).- On the ticket/payment page, the pay button for a transferred-in reg with a source balance should link to the source's payment/ticket rather than posting to its own pay path.
Per-builtin (no change needed)
- ce_hours — correct (hours ride on the new reg's own record).
- certificate — correct (earned at the intended/new event).
- videoconference / staff / handouts / faq — correct (this event's content); keep showing (they're attending here), unlike a transferred-out reg.
- art_supplies — reserved key, unused; ignore.
Verification
- Model specs for conditional delegation: transferred-in with source payments → delegates; with no source payments → own math.
- Request specs: payment page shows the source-allocations section only when transferred-in + source has allocations; scholarship page renders + services the source's scholarship from the new slug; pay routing targets the correct reg.
ai/test_extrabefore opening the (draft) PR.
🤖 Filed by Claude for maebeale — followup to #1944.
- 主要语言
- Ruby
- 星标
- 15
- 派生
- 28
- 平均合并
- 1 天 12 分钟
- 30 天内合并 PR
- 262
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rubyforgood/awbw 的其他 Issue
-
blocked
难度 2/5 1-3 小时 新手友好度 68/100
rubyforgood/awbw#2824 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
rubyforgood/awbw#2822 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
rubyforgood/awbw#2160 ·
维护者通常 1 天内回复
-
Update callout faq defualt text when the new person subscription launches可能已有人在做 @maebeale 于 81 天前认领。 未关闭blocked
难度 2/5 1-3 小时 新手友好度 72/100
rubyforgood/awbw#2095 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
rubyforgood/awbw#2088 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
metanorma/metanorma-standoc#1315 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
metanorma/metanorma-iso#1681 ·
维护者通常 1 天内回复
-
Missing zh-CN translation: components/common/CommunitySolution.tsx:communitySolution.authorsSolution未关闭
难度 1/5 1 小时以内 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
openstreetmap/openstreetmap-website#7554 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
manyfold3d/manyfold#7445 ·
维护者通常 1 天内回复