add controllers, servoices

This commit is contained in:
root
2026-03-09 02:52:13 -04:00
parent c8de5f7edc
commit d76c871cb7
501 changed files with 34439 additions and 21843 deletions
@@ -0,0 +1,50 @@
<?php
namespace Tests\Unit\Services\Finance;
use App\Services\Finance\FinancialSchoolYearService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class FinancialSchoolYearServiceTest extends TestCase
{
use RefreshDatabase;
public function test_list_years_returns_distinct_sorted_years(): void
{
DB::table('invoices')->insert([
[
'id' => 1,
'parent_id' => 1,
'invoice_number' => 'INV-100',
'total_amount' => 10,
'balance' => 10,
'paid_amount' => 0,
'has_discount' => 0,
'issue_date' => '2024-01-01',
'due_date' => '2024-02-01',
'status' => 'unpaid',
'school_year' => '2024-2025',
],
[
'id' => 2,
'parent_id' => 1,
'invoice_number' => 'INV-101',
'total_amount' => 10,
'balance' => 10,
'paid_amount' => 0,
'has_discount' => 0,
'issue_date' => '2025-01-01',
'due_date' => '2025-02-01',
'status' => 'unpaid',
'school_year' => '2025-2026',
],
]);
$service = new FinancialSchoolYearService();
$years = $service->listYears();
$this->assertSame(['2025-2026', '2024-2025'], $years);
}
}