ADD SCHOOL YEAR MANAGEMENT
Tests / PHPUnit (push) Failing after 40s

This commit is contained in:
root
2026-07-12 02:21:39 -04:00
parent c7f67da9bf
commit e06ccc9cc0
36 changed files with 6722 additions and 327 deletions
+23
View File
@@ -9,6 +9,8 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\ApiClient;
use App\Support\SchoolYear\SchoolYearContext;
use Throwable;
/**
* Class BaseController
@@ -88,6 +90,27 @@ abstract class BaseController extends Controller
return $payload;
}
protected function resolveSchoolYearContext(?int $routeSchoolYearId = null): SchoolYearContext
{
try {
return service('schoolYearContext')->resolve($this->request, $routeSchoolYearId);
} catch (Throwable $e) {
log_message('warning', 'School-year resolution failed: {message}', [
'message' => $e->getMessage(),
]);
throw $e;
}
}
protected function assertSchoolYearWritable(
SchoolYearContext $context,
bool $allowDraftForAdmin = false,
bool $isAdmin = false
): void {
service('schoolYearWriteGuard')->assertWritable($context, $allowDraftForAdmin, $isAdmin);
}
}
?>