add test batches
This commit is contained in:
@@ -8,7 +8,9 @@ use App\Models\StudentClass;
|
||||
|
||||
class StudentStatusService
|
||||
{
|
||||
public function __construct(private StudentConfigService $configService) {}
|
||||
public function __construct(private StudentConfigService $configService)
|
||||
{
|
||||
}
|
||||
|
||||
public function setActive(int $studentId, bool $isActive, ?int $userId = null): array
|
||||
{
|
||||
@@ -17,7 +19,7 @@ class StudentStatusService
|
||||
$schoolYear = (string) ($context['school_year'] ?? '');
|
||||
|
||||
$student = Student::query()->find($studentId);
|
||||
if (! $student) {
|
||||
if (!$student) {
|
||||
return ['ok' => false, 'message' => 'Student not found.'];
|
||||
}
|
||||
|
||||
@@ -34,7 +36,7 @@ class StudentStatusService
|
||||
->when($schoolYear !== '', fn ($q) => $q->where('school_year', $schoolYear))
|
||||
->first();
|
||||
|
||||
if (! $hasCurrentClass) {
|
||||
if (!$hasCurrentClass) {
|
||||
$lastClass = StudentClass::query()
|
||||
->where('student_id', $studentId)
|
||||
->orderByDesc('updated_at')
|
||||
@@ -57,7 +59,7 @@ class StudentStatusService
|
||||
|
||||
$classLabel = ClassSection::getClassSectionNameBySectionId($restoreClassId);
|
||||
if ($classLabel) {
|
||||
$message .= ' Class assignment restored to '.$classLabel.'.';
|
||||
$message .= ' Class assignment restored to ' . $classLabel . '.';
|
||||
}
|
||||
} else {
|
||||
$message .= ' No class assignment found for the current term.';
|
||||
|
||||
Reference in New Issue
Block a user