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,36 @@
<?php
namespace Tests\Unit\Services\ClassPreparation;
use App\Services\ClassPreparation\ClassPreparationLogService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class ClassPreparationLogServiceTest extends TestCase
{
use RefreshDatabase;
public function test_has_prep_changed_detects_diff(): void
{
$service = new ClassPreparationLogService();
$this->assertTrue($service->hasPrepChanged(['a' => 1], ['a' => 2]));
$this->assertFalse($service->hasPrepChanged(['a' => 1], ['a' => 1]));
}
public function test_create_log_and_get_latest(): void
{
$service = new ClassPreparationLogService();
$created = $service->createLog('101', '1-A', '2025-2026', ['Small Table' => 2], '2025-09-01 00:00:00');
$this->assertTrue($created);
$this->assertDatabaseHas('class_preparation_log', [
'class_section_id' => 101,
'school_year' => '2025-2026',
]);
$log = $service->getLatestLog('101', '2025-2026');
$this->assertNotNull($log);
}
}