add test batches

This commit is contained in:
root
2026-06-08 23:45:55 -04:00
parent c792b8be05
commit 8d4d610b82
1480 changed files with 22587 additions and 10762 deletions
@@ -15,7 +15,8 @@ class ParentRegistrationService
public function __construct(
private ParentConfigService $configService,
private SchoolIdService $schoolIdService
) {}
) {
}
public function overview(int $parentId): array
{
@@ -38,7 +39,6 @@ class ParentRegistrationService
$kids = $kids->map(function ($kid) use ($allergies, $conditions) {
$kid->allergies = ($allergies[$kid->id] ?? collect())->pluck('allergy')->all();
$kid->medical_conditions = ($conditions[$kid->id] ?? collect())->pluck('condition_name')->all();
return $kid->toArray();
})->all();
@@ -105,7 +105,6 @@ class ParentRegistrationService
'dob' => $student['dob'],
'reason' => 'already_registered',
];
continue;
}
@@ -116,7 +115,7 @@ class ParentRegistrationService
'age' => $this->calculateAge($student['dob'], $ageReference),
'gender' => $student['gender'],
'registration_grade' => $student['registration_grade'] ?? null,
'photo_consent' => ! empty($student['photo_consent']) ? 1 : 0,
'photo_consent' => !empty($student['photo_consent']) ? 1 : 0,
'parent_id' => $parentId,
'year_of_registration' => (string) date('Y'),
'school_year' => $schoolYear,
@@ -187,7 +186,7 @@ class ParentRegistrationService
'age' => $this->calculateAge($payload['dob'], $ageReference),
'gender' => $payload['gender'],
'registration_grade' => $payload['registration_grade'] ?? null,
'photo_consent' => ! empty($payload['photo_consent']) ? 1 : 0,
'photo_consent' => !empty($payload['photo_consent']) ? 1 : 0,
]);
StudentMedicalCondition::query()->where('student_id', $studentId)->delete();
@@ -235,7 +234,6 @@ class ParentRegistrationService
try {
$dobObj = new \DateTimeImmutable($dob);
$refObj = new \DateTimeImmutable($referenceDate);
return (int) $dobObj->diff($refObj)->y;
} catch (\Throwable $e) {
return 0;