Commit a3447801 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix(sports): show wizard players in classification page

The classification query required status='completed' AND payment_status=
'paid', but the correct flow is: form fee → photo → disciplines → THEN
coach classifies. Players were invisible because they're still
'in_progress' at that point.

Fixed to: form_payment_status='paid' AND selected_disciplines not empty
AND status IN ('in_progress','completed'). Also fixed the assess()
method's guard from payment_status to form_payment_status.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 6d9424f3
...@@ -19,7 +19,9 @@ final class CoachAssessmentService ...@@ -19,7 +19,9 @@ final class CoachAssessmentService
p.date_of_birth, p.gender, p.phone, p.photo_path, p.medical_status p.date_of_birth, p.gender, p.phone, p.photo_path, p.medical_status
FROM sa_registrations r FROM sa_registrations r
INNER JOIN sa_players p ON p.id = r.player_id INNER JOIN sa_players p ON p.id = r.player_id
WHERE r.status = 'completed' AND r.payment_status = 'paid' WHERE r.form_payment_status = 'paid'
AND r.selected_disciplines IS NOT NULL AND r.selected_disciplines != ''
AND r.status IN ('in_progress', 'completed')
AND NOT EXISTS ( AND NOT EXISTS (
SELECT 1 FROM sa_group_players gp SELECT 1 FROM sa_group_players gp
WHERE gp.player_id = r.player_id AND gp.status IN ('active','pending_payment') WHERE gp.player_id = r.player_id AND gp.status IN ('active','pending_payment')
...@@ -92,11 +94,11 @@ final class CoachAssessmentService ...@@ -92,11 +94,11 @@ final class CoachAssessmentService
"SELECT r.*, p.full_name_ar, p.player_type, p.member_id "SELECT r.*, p.full_name_ar, p.player_type, p.member_id
FROM sa_registrations r FROM sa_registrations r
INNER JOIN sa_players p ON p.id = r.player_id INNER JOIN sa_players p ON p.id = r.player_id
WHERE r.id = ? AND r.payment_status = 'paid'", WHERE r.id = ? AND r.form_payment_status = 'paid'",
[$registrationId] [$registrationId]
); );
if (!$registration) { if (!$registration) {
return ['success' => false, 'error' => 'التسجيل غير موجود أو لم يتم الدفع']; return ['success' => false, 'error' => 'التسجيل غير موجود أو لم يتم دفع رسوم الاستمارة'];
} }
$playerId = (int) $registration['player_id']; $playerId = (int) $registration['player_id'];
......
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