fix tests

This commit is contained in:
root
2026-06-11 11:46:12 -04:00
parent c91fa2ce4d
commit 5ead80fdc7
1489 changed files with 11349 additions and 10305 deletions
@@ -2,13 +2,16 @@
namespace App\Services\Parents;
use App\Controllers\ParentProgressController;
use App\Http\Resources\ClassProgress\ClassProgressReportResource;
use App\Models\ClassProgressReport;
use App\Services\ClassProgress\ClassProgressQueryService;
use Carbon\CarbonInterface;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
/**
* legacy {@see \App\Controllers\ParentProgressController} read-side logic.
* legacy {@see ParentProgressController} read-side logic.
*/
class ParentProgressQueryService
{
@@ -133,7 +136,7 @@ class ParentProgressQueryService
$statusLabel = $statusOptions[$row->status] ?? 'Unknown';
$row->setAttribute('status_label', $statusLabel);
$weekStart = $row->week_start instanceof \Carbon\CarbonInterface
$weekStart = $row->week_start instanceof CarbonInterface
? $row->week_start->format('Y-m-d')
: (string) $row->week_start;
$sectionId = (int) $row->class_section_id;
@@ -145,7 +148,7 @@ class ParentProgressQueryService
if (! isset($reportGroups[$key])) {
$reportGroups[$key] = [
'week_start' => $weekStart,
'week_end' => $row->week_end instanceof \Carbon\CarbonInterface
'week_end' => $row->week_end instanceof CarbonInterface
? $row->week_end->format('Y-m-d')
: (string) ($row->week_end ?? ''),
'class_section_name' => $row->class_section_name ?? '',
@@ -159,7 +162,7 @@ class ParentProgressQueryService
continue;
}
$reportGroups[$key]['reports'][$subject] = (new \App\Http\Resources\ClassProgress\ClassProgressReportResource($row))->toArray(request());
$reportGroups[$key]['reports'][$subject] = (new ClassProgressReportResource($row))->toArray(request());
}
return $reportGroups;