add class progress and fix endpoints

This commit is contained in:
root
2026-03-12 17:27:49 -04:00
parent 0f39dbee62
commit 33be0c9a0d
40 changed files with 2086 additions and 438 deletions
@@ -162,7 +162,7 @@ class StudentDirectoryService
];
}
public function listStudents(?string $schoolYear = null): array
public function listStudents(?string $schoolYear = null, ?array $parentIds = null): array
{
$context = $this->configService->context();
$selectedYear = $schoolYear ?: (string) ($context['school_year'] ?? '');
@@ -189,6 +189,7 @@ class StudentDirectoryService
'school_year',
])
->when($selectedYear !== '', fn ($q) => $q->where('school_year', $selectedYear))
->when(!empty($parentIds), fn ($q) => $q->whereIn('parent_id', $parentIds))
->orderBy('lastname')
->orderBy('firstname')
->get()