apply the school year concept
Tests / PHPUnit (push) Failing after 1m19s

This commit is contained in:
root
2026-07-14 00:59:00 -04:00
parent 504c3bc9f9
commit feb1b29a32
73 changed files with 4288 additions and 620 deletions
+4 -4
View File
@@ -2,8 +2,8 @@
namespace App\Services;
use App\Exceptions\SchoolYear\SchoolYearWriteConflictException;
use App\Support\SchoolYear\SchoolYearContext;
use RuntimeException;
final class SchoolYearWriteGuard
{
@@ -12,14 +12,14 @@ final class SchoolYearWriteGuard
bool $allowDraftForAdmin = false,
bool $isAdmin = false
): void {
if ($context->status() === 'active') {
if (strtolower($context->status()) === 'active') {
return;
}
if ($context->status() === 'draft' && $allowDraftForAdmin && $isAdmin) {
if (strtolower($context->status()) === 'draft' && $allowDraftForAdmin && $isAdmin) {
return;
}
throw new RuntimeException('The selected school year is read-only.');
throw new SchoolYearWriteConflictException('The selected school year is read-only.');
}
}