add more controllers and fix tests

This commit is contained in:
root
2026-03-09 11:54:13 -04:00
parent 0c3e9b16f7
commit 1cb3573d4b
74 changed files with 2761 additions and 2728 deletions
+57
View File
@@ -0,0 +1,57 @@
<?php
namespace App\Services\Fees;
use App\Models\Configuration;
class FeeConfigService
{
public function getSchoolYear(): string
{
return (string) (Configuration::getConfig('school_year') ?? '');
}
public function getRefundDeadline(): ?string
{
$raw = (string) (Configuration::getConfig('refund_deadline') ?? '');
if ($raw === '') {
return null;
}
$timestamp = strtotime($raw);
if ($timestamp === false) {
return null;
}
return date('Y-m-d', $timestamp);
}
public function getWeeksOfStudy(): float
{
return (float) (Configuration::getConfig('weeks_study') ?? 8);
}
public function getSchoolEndDate(): ?string
{
$raw = (string) (Configuration::getConfig('last_school_day') ?? '');
if ($raw === '') {
return null;
}
$timestamp = strtotime($raw);
if ($timestamp === false) {
return null;
}
return date('Y-m-d', $timestamp);
}
public function getFees(): array
{
return [
'first_student_fee' => (float) (Configuration::getConfig('first_student_fee') ?? 350),
'second_student_fee' => (float) (Configuration::getConfig('second_student_fee') ?? 200),
'youth_fee' => (float) (Configuration::getConfig('youth_fee') ?? 180),
];
}
}