feat: add voucher bulk code generation#26
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Adds a management-dashboard workflow for bulk generating voucher codes for a conference, backed by a new registration service that creates voucher batches atomically.
Changes:
- Introduces
VoucherBulkConfigandgenerate_voucher_codes()to generate batches of vouchers in a transaction. - Adds a new management
FormView+ form + template for bulk generation. - Mounts the new route under
<conference>/vouchers/bulk/generate/via a dedicatedurls_vouchers.py.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/django_program/registration/services/voucher_service.py |
New bulk voucher generation service + config dataclass and code generation logic. |
src/django_program/manage/views_vouchers.py |
New management view to render/validate the form and invoke the service. |
src/django_program/manage/forms_vouchers.py |
New form to collect batch generation parameters and optional constraints. |
src/django_program/manage/templates/django_program/manage/voucher_bulk_generate.html |
New dashboard template for bulk voucher generation. |
src/django_program/manage/urls_vouchers.py |
New URLConf for voucher bulk operations. |
src/django_program/manage/urls.py |
Mounts the voucher bulk URLConf under the conference-scoped voucher path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…tion Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rename) - Return form_invalid on voucher generation failure instead of redirecting - Re-fetch vouchers after bulk_create to guarantee PKs on all backends - Rename test_prefix_filter_optimization to match its actual assertion Note: PR description mentioned secrets.token_urlsafe but code correctly uses secrets.choice with uppercase A-Z/0-9 alphabet (from earlier iteration). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
VoucherBulkConfigdataclass andgenerate_voucher_codes()service for bulk code generation with configurable prefix, type, count, and constraintsVoucherBulkGenerateView) for bulk generating voucher batches with form validationsecrets.token_urlsafewith in-memory uniqueness checks and atomicbulk_create<conference>/vouchers/bulk/generate/using separateurls_vouchers.pyto avoid conflictsHow to test in the UI
/manage/<slug>/vouchers/)SPEAKER-(or any prefix)10SPEAKER-Test plan
🤖 Generated with Claude Code