Fix Pint formatting
This commit is contained in:
@@ -15,8 +15,7 @@ class ParentRegistrationService
|
||||
public function __construct(
|
||||
private ParentConfigService $configService,
|
||||
private SchoolIdService $schoolIdService
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function overview(int $parentId): array
|
||||
{
|
||||
@@ -39,6 +38,7 @@ 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,6 +105,7 @@ class ParentRegistrationService
|
||||
'dob' => $student['dob'],
|
||||
'reason' => 'already_registered',
|
||||
];
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -115,7 +116,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,
|
||||
@@ -186,7 +187,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();
|
||||
@@ -234,6 +235,7 @@ class ParentRegistrationService
|
||||
try {
|
||||
$dobObj = new \DateTimeImmutable($dob);
|
||||
$refObj = new \DateTimeImmutable($referenceDate);
|
||||
|
||||
return (int) $dobObj->diff($refObj)->y;
|
||||
} catch (\Throwable $e) {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user