add all controllers logic

This commit is contained in:
root
2026-03-11 17:53:15 -04:00
parent 3e6c577085
commit 2ef71cc92b
421 changed files with 12009 additions and 5211 deletions
@@ -12,6 +12,8 @@ class ClassPreparationService
private ClassPreparationCalculatorService $calculator;
private ClassPreparationAdjustmentService $adjustments;
private ClassPreparationLogService $logs;
private ClassPreparationAdjustmentWriterService $adjustmentWriter;
private ClassPreparationPrintService $printService;
public function __construct(
ClassPreparationContextService $context,
@@ -19,7 +21,9 @@ class ClassPreparationService
ClassPreparationInventoryService $inventory,
ClassPreparationCalculatorService $calculator,
ClassPreparationAdjustmentService $adjustments,
ClassPreparationLogService $logs
ClassPreparationLogService $logs,
ClassPreparationAdjustmentWriterService $adjustmentWriter,
ClassPreparationPrintService $printService
) {
$this->context = $context;
$this->roster = $roster;
@@ -27,6 +31,8 @@ class ClassPreparationService
$this->calculator = $calculator;
$this->adjustments = $adjustments;
$this->logs = $logs;
$this->adjustmentWriter = $adjustmentWriter;
$this->printService = $printService;
}
public function listPrep(?string $schoolYear = null, ?string $semester = null): array
@@ -111,6 +117,23 @@ class ClassPreparationService
return $count;
}
public function saveAdjustments(string $classSectionId, string $schoolYear, array $adjustments): int
{
$schoolYear = $schoolYear !== '' ? $schoolYear : $this->context->getSchoolYear();
return $this->adjustmentWriter->saveAdjustments(
$classSectionId,
$schoolYear,
$adjustments,
$this->calculator->getAllowedCategories()
);
}
public function printPrep(string $classSectionId, string $schoolYear, ?string $semester = null): array
{
return $this->printService->printPrep($classSectionId, $schoolYear, $semester);
}
private function utcNow(): string
{
if (function_exists('utc_now')) {