feat(grants): Pretix voucher and email when grantee confirms#4602
feat(grants): Pretix voucher and email when grantee confirms#4602
Conversation
Queue `create_and_send_voucher_to_grantee` when `sendGrantReply` moves status to `confirmed`. Task mirrors schedule voucher flow: Pretix via `create_conference_voucher`, then grant_voucher_code email. Grant admin Create grant vouchers now uses `create_conference_voucher` and handles co-speaker upgrade. Grant pending-status proxy keeps shared confirm_pending_status from custom_admin. Tests patch Pretix in grant voucher admin tests; sendGrantReply tests assert voucher task on confirm only.
Add tests for send_grant_voucher_email and create_and_send_voucher_to_grantee (not confirmed, no user, existing speaker/grant voucher, co-speaker upgrade, voucher on other conference), aligned with schedule voucher task tests.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This PR wires up Pretix voucher creation and email dispatch when a grantee confirms their grant via External API call inside
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4602 +/- ##
==========================================
+ Coverage 92.51% 92.52% +0.01%
==========================================
Files 359 359
Lines 10764 10794 +30
Branches 814 821 +7
==========================================
+ Hits 9958 9987 +29
Misses 696 696
- Partials 110 111 +1 🚀 New features to boost your workflow:
|
- create_grant_vouchers: load conference vouchers for selected users in one query; update map after creating new vouchers (avoids N+1). - send_grant_voucher_email: no-op when voucher_email_sent_at is set. - Clear voucher_email_sent_at when upgrading CO_SPEAKER to GRANT so the grant template still sends after a prior voucher email. - Tests: skip-when-sent; co-speaker upgrade with prior sent_at.
…er_code - create_and_send_voucher_to_grantee queues send_conference_voucher_email with conference_voucher_id (lazy import avoids circular import with get_name). - Remove send_grant_voucher_email; grantees get the shared voucher_code template like the Voucher admin action. - send_conference_voucher_email: skip if voucher_email_sent_at set; save with update_fields. - Remove EmailTemplateIdentifier.grant_voucher_code; migration reassigns any rows to voucher_code then tightens choices.
|
@claude do the code review again |
|
Claude finished @estyxx's task in 1m 14s —— View job Code Review Complete
Overall AssessmentThe implementation is well-structured and the test coverage is comprehensive. The PR successfully wires up Pretix voucher creation when a grantee confirms, and properly reuses Issues to Address1. External API Call Inside
|
When a grantee confirms via
sendGrantReply(status becomesconfirmed), enqueuecreate_and_send_voucher_to_grantee: ensure a GRANTConferenceVoucherin Pretix (create_conference_voucher), then email withsend_conference_voucher_email(same Voucher code template as the conference admin action).Admin: Create grant vouchers uses Pretix creation and co-speaker → grant upgrade. Confirm pending status is unchanged (no vouchers there).
Data: Migration rewrites any
grant_voucher_codeemail templates tovoucher_codeand drops that identifier from choices.Tests: GraphQL confirm path, grant admin voucher action, grant task branches.