Commit 7ff8ae2d authored by Fares's avatar Fares

fix(swimming): insert player_medical_records on medical cert upload for medical board visibility

The medical board page reads from player_medical_records table. Without this insert,
uploaded certificates would not appear in /medical-board for approval, and the player
status would stay 'pending' forever.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 933b4f06
...@@ -196,6 +196,20 @@ class SwimmingRegistrationController extends Controller ...@@ -196,6 +196,20 @@ class SwimmingRegistrationController extends Controller
'updated_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'),
]); ]);
$db->insert('player_medical_records', [
'player_id' => null,
'sa_player_id' => $playerId,
'record_type' => 'fitness_cert',
'sa_document_id' => $docId,
'exam_date' => $examDate,
'expiry_date' => $expiryDate,
'approval_status' => 'pending',
'source' => 'sports_activity',
'created_by' => $employeeId,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
$db->update('sa_players', [ $db->update('sa_players', [
'medical_status' => 'pending', 'medical_status' => 'pending',
'medical_expiry_date' => $expiryDate, 'medical_expiry_date' => $expiryDate,
......
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