From 0adbe7175b5e8891d771eb69af92b9fb11128b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Fri, 18 Sep 2026 11:51:15 +0200 Subject: [PATCH] feat(employees): remove siteId parameter in favor of siteIds in request, OpenAPI spec and Bruno --- .../Arcadia Api/Api/V1/Employees/List Employees.yml | 5 ----- documentation/OpenApi/openapi.yaml | 13 +------------ .../Requests/Employees/EmployeesIndexRequest.php | 5 ----- .../Feature/Api/V1/Employees/EmployeesIndexTest.php | 2 +- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/documentation/Bruno/Arcadia Api/Api/V1/Employees/List Employees.yml b/documentation/Bruno/Arcadia Api/Api/V1/Employees/List Employees.yml index 9d4fc9e..4862089 100644 --- a/documentation/Bruno/Arcadia Api/Api/V1/Employees/List Employees.yml +++ b/documentation/Bruno/Arcadia Api/Api/V1/Employees/List Employees.yml @@ -35,11 +35,6 @@ http: type: query description: Filter by establishment code (e.g. 01, PA, LY) disabled: true - - name: siteId - value: LDCSER - type: query - description: Filter by site ID (e.g. LDCSER, SLELA) - disabled: true - name: siteIds value: LDCSER type: query diff --git a/documentation/OpenApi/openapi.yaml b/documentation/OpenApi/openapi.yaml index 3edb7c8..c370c61 100644 --- a/documentation/OpenApi/openapi.yaml +++ b/documentation/OpenApi/openapi.yaml @@ -68,7 +68,7 @@ paths: description: | Retourne la liste paginée des employés du système Arcadia. Prend en charge le filtrage par date de modification (`since`), code établissement (`establishment`), - code site (`siteId`), code service (`serviceId`), ainsi que le tri et la pagination HATEOAS. + codes sites (`siteIds`), code service (`serviceId`), ainsi que le tri et la pagination HATEOAS. operationId: listEmployees parameters: - $ref: "#/components/parameters/Page" @@ -77,7 +77,6 @@ paths: - $ref: "#/components/parameters/Limit" - $ref: "#/components/parameters/Since" - $ref: "#/components/parameters/Establishment" - - $ref: "#/components/parameters/SiteId" - $ref: "#/components/parameters/SiteIds" - $ref: "#/components/parameters/ServiceId" - $ref: "#/components/parameters/SortBy" @@ -455,16 +454,6 @@ components: pattern: '^[\dA-Z]{2,}$' example: "01" - SiteId: - name: siteId - in: query - required: false - description: "Filtrer par code site (ex: LDCSER, SLELA)." - schema: - type: string - pattern: "^[A-Z]{2,}$" - example: "LDCSER" - SiteIds: name: siteIds in: query diff --git a/src/Presentation/Api/V1/Http/Requests/Employees/EmployeesIndexRequest.php b/src/Presentation/Api/V1/Http/Requests/Employees/EmployeesIndexRequest.php index 5ca3169..55f11c4 100644 --- a/src/Presentation/Api/V1/Http/Requests/Employees/EmployeesIndexRequest.php +++ b/src/Presentation/Api/V1/Http/Requests/Employees/EmployeesIndexRequest.php @@ -35,7 +35,6 @@ final class EmployeesIndexRequest extends FormRequest 'sortDirection' => ['sometimes', Rule::in(['Ascending', 'Descending'])], 'since' => ['sometimes', 'date'], 'establishment' => ['sometimes', 'string'], - 'siteId' => ['sometimes', 'string'], 'siteIds' => ['sometimes', 'array'], 'siteIds.*' => ['sometimes', 'string'], 'serviceId' => ['sometimes', 'string'], @@ -77,10 +76,6 @@ final class EmployeesIndexRequest extends FormRequest } } - if ($this->filled('siteId')) { - $sites[] = new SiteId($this->string('siteId')->value()); - } - if ($establishment === null && empty($sites) && $service === null && $since === null) { return null; } diff --git a/tests/Feature/Api/V1/Employees/EmployeesIndexTest.php b/tests/Feature/Api/V1/Employees/EmployeesIndexTest.php index 1f78551..893402a 100644 --- a/tests/Feature/Api/V1/Employees/EmployeesIndexTest.php +++ b/tests/Feature/Api/V1/Employees/EmployeesIndexTest.php @@ -110,7 +110,7 @@ describe('Employees Index Feature API', function (): void { $test = $this; // WHEN - $response = $test->getJson('/api/v1/employees?establishment=01&siteId=LDCSER&serviceId=097'); + $response = $test->getJson('/api/v1/employees?establishment=01&siteIds=LDCSER&serviceId=097'); // THEN $response->assertStatus(200);