add all controllers logic
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user