<?php

namespace Tests\Unit\Resources\Staff;

use App\Http\Resources\Staff\StaffResource;
use App\Models\Staff;
use Tests\TestCase;

class StaffResourceTest extends TestCase
{
    public function test_resource_returns_expected_shape(): void
    {
        $staff = new Staff([
            'id' => 1,
            'user_id' => 2,
            'firstname' => 'Test',
            'lastname' => 'User',
            'email' => 'test@example.com',
            'role_name' => 'teacher',
            'active_role' => 'teacher',
            'school_year' => '2025-2026',
        ]);

        $payload = (new StaffResource($staff))->toArray(request());

        $this->assertSame(1, $payload['id']);
        $this->assertSame('teacher', $payload['role_name']);
    }
}
