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
@@ -0,0 +1,38 @@
<?php
namespace App\Support\SchoolYear;
final class SchoolYearStatus
{
public const DRAFT = 'draft';
public const ACTIVE = 'active';
public const CLOSING = 'closing';
public const CLOSED = 'closed';
public const ARCHIVED = 'archived';
public const ALL = [
self::DRAFT,
self::ACTIVE,
self::CLOSING,
self::CLOSED,
self::ARCHIVED,
];
public const TRANSITIONS = [
self::DRAFT => [self::ACTIVE],
self::ACTIVE => [self::CLOSING],
self::CLOSING => [self::ACTIVE, self::CLOSED],
self::CLOSED => [self::ACTIVE, self::ARCHIVED],
self::ARCHIVED => [],
];
public static function canTransition(string $from, string $to): bool
{
return in_array($to, self::TRANSITIONS[$from] ?? [], true);
}
public static function isReadonly(string $status): bool
{
return in_array($status, [self::CLOSED, self::ARCHIVED], true);
}
}