add test batches
This commit is contained in:
@@ -4,12 +4,13 @@ namespace App\Services\Invoices;
|
||||
|
||||
class InvoiceGradeService
|
||||
{
|
||||
public function __construct(private int $gradeFee) {}
|
||||
public function __construct(private int $gradeFee)
|
||||
{
|
||||
}
|
||||
|
||||
public function isKindergarten(string $grade): bool
|
||||
{
|
||||
$g = strtolower(trim($grade));
|
||||
|
||||
return in_array($g, ['KG', 'kg', 'k', 'kindergarten', 'k-g', 'k.g', 'k g'], true);
|
||||
}
|
||||
|
||||
@@ -28,7 +29,6 @@ class InvoiceGradeService
|
||||
public function gradeLevelInt(string $grade): int
|
||||
{
|
||||
$gl = $this->getGradeLevel($grade);
|
||||
|
||||
return (int) ($gl['level'] ?? 0);
|
||||
}
|
||||
|
||||
@@ -39,11 +39,10 @@ class InvoiceGradeService
|
||||
if ($num === 13) {
|
||||
return ['level' => 1, 'suffix' => '', 'classId' => 13];
|
||||
}
|
||||
|
||||
return ['level' => $num, 'suffix' => '', 'classId' => null];
|
||||
}
|
||||
|
||||
if (! is_string($grade)) {
|
||||
if (!is_string($grade)) {
|
||||
return ['level' => 999, 'suffix' => '', 'classId' => null];
|
||||
}
|
||||
|
||||
@@ -64,7 +63,6 @@ class InvoiceGradeService
|
||||
|
||||
if (preg_match('/^Y(?:OUTH)?(?:\s*(\d+))?$/', $g, $m)) {
|
||||
$n = isset($m[1]) && $m[1] !== '' ? max(1, (int) $m[1]) : 1;
|
||||
|
||||
return [
|
||||
'level' => $this->gradeFee + $n,
|
||||
'suffix' => '',
|
||||
|
||||
Reference in New Issue
Block a user