add class progress and fix endpoints

This commit is contained in:
root
2026-03-12 17:27:49 -04:00
parent 0f39dbee62
commit 33be0c9a0d
40 changed files with 2086 additions and 438 deletions
@@ -0,0 +1,31 @@
<?php
namespace Tests\Unit\Services\ClassProgress;
use App\Models\ClassProgressReport;
use App\Services\ClassProgress\ClassProgressAttachmentService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Tests\TestCase;
class ClassProgressAttachmentServiceTest extends TestCase
{
use RefreshDatabase;
public function test_store_attachments_persists_records(): void
{
Storage::fake('public');
$report = ClassProgressReport::factory()->create();
$service = new ClassProgressAttachmentService();
$files = [UploadedFile::fake()->create('sample.pdf', 12)];
$stored = $service->storeAttachments($report->id, $files);
$this->assertCount(1, $stored);
$this->assertDatabaseHas('class_progress_attachments', [
'report_id' => $report->id,
]);
}
}