feat: implement Story 3.1 Open Registration

Add complete implementation with tests:
- New route POST /admin/exchange/<id>/state/open-registration
- State validation (only from draft state)
- Success/error messages
- Authentication required
- Update exchange detail template with "Open Registration" button
- 8 comprehensive integration tests

All acceptance criteria met:
- "Open Registration" action available from Draft state
- Exchange state changes to "Registration Open"
- Registration link becomes active
- Participants can now access registration form
- Success message displayed
- Only admin can perform action
- Redirects to exchange detail after completion

Story: 3.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-22 13:06:00 -07:00
parent 3b0257c377
commit cc865a85dc
4 changed files with 653 additions and 0 deletions

View File

@@ -42,6 +42,12 @@
</div>
<div class="actions">
{% if exchange.state == 'draft' %}
<form method="POST" action="{{ url_for('admin.open_registration', exchange_id=exchange.id) }}" style="display: inline;">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-primary">Open Registration</button>
</form>
{% endif %}
<a href="{{ url_for('admin.dashboard') }}" class="btn btn-secondary">Back to Dashboard</a>
</div>
</div>