Commit 69783682 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix: auto-activate participant status on enrollment

Participants stayed in 'registered' status even after being enrolled
in active groups. The collect payment wizard filters by status='active',
making them invisible. Now EnrollmentService transitions registered→active
on enrollment. Also fixed 70 existing participants in oc_sport DB.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 3a69923d
...@@ -95,6 +95,11 @@ public function enroll(Participant $participant, TrainingGroup $group, User $act ...@@ -95,6 +95,11 @@ public function enroll(Participant $participant, TrainingGroup $group, User $act
// Update group count // Update group count
$this->groupService->incrementCount($group); $this->groupService->incrementCount($group);
// Activate participant if still in registered status
if ($participant->status->value === 'registered') {
$participant->update(['status' => 'active']);
}
// Auto-create invoice if program has a price (skip if invoice already provided via options) // Auto-create invoice if program has a price (skip if invoice already provided via options)
if (empty($options['invoice_id']) && (bool) $this->settings->get('auto_invoice_on_enrollment', false)) { if (empty($options['invoice_id']) && (bool) $this->settings->get('auto_invoice_on_enrollment', false)) {
$this->createEnrollmentInvoice($enrollment, $participant, $group, $actor); $this->createEnrollmentInvoice($enrollment, $participant, $group, $actor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment