count(3)->create(); }); it('returns 200 OK for default employees list request', function (): void { // GIVEN /** @var \Tests\TestCase $test */ $test = $this; // WHEN $response = $test->getJson('/api/v1/employees'); // THEN $response->assertStatus(200); $response->assertJsonStructure([ 'employees', 'pagination' => [ 'page', 'pageSize', 'totalItems', 'totalPages', 'links', ], ]); }); it('returns 200 OK for page and pageSize pagination query', function (): void { // GIVEN /** @var \Tests\TestCase $test */ $test = $this; // WHEN $response = $test->getJson('/api/v1/employees?page=1&pageSize=2'); // THEN $response->assertStatus(200); $response->assertJsonPath('pagination.pageSize', 2); }); it('returns 200 OK for offset and limit pagination query', function (): void { // GIVEN /** @var \Tests\TestCase $test */ $test = $this; // WHEN $response = $test->getJson('/api/v1/employees?offset=0&limit=2'); // THEN $response->assertStatus(200); $response->assertJsonPath('pagination.pageSize', 2); }); it('returns 200 OK for sorting query parameters', function (string $sortBy, string $direction): void { // GIVEN /** @var \Tests\TestCase $test */ $test = $this; // WHEN $response = $test->getJson("/api/v1/employees?sortBy={$sortBy}&sortDirection={$direction}"); // THEN $response->assertStatus(200); })->with([ ['arcadiaId', 'Ascending'], ['startDate', 'Descending'], ['createdAt', 'Ascending'], ]); it('returns 200 OK for date filtering with since parameter', function (): void { // GIVEN /** @var \Tests\TestCase $test */ $test = $this; // WHEN $response = $test->getJson('/api/v1/employees?since=2024-01-01'); // THEN $response->assertStatus(200); }); it('returns 200 OK for establishment, site, and service query filters', function (): void { // GIVEN /** @var \Tests\TestCase $test */ $test = $this; // WHEN $response = $test->getJson('/api/v1/employees?establishment=01&siteId=LDCSER&serviceId=097'); // THEN $response->assertStatus(200); }); });