From 3100643eac393b2fcc0af272ac07d789685254fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 12 Aug 2026 17:00:01 +0200 Subject: [PATCH] refactor(employees): simplify validation rules for employee requests Removed regex patterns from validation rules for employeeId, establishment, siteId, and serviceId to streamline input handling. --- .../Api/V1/Http/Requests/Employees/EmployeeShowRequest.php | 2 +- .../V1/Http/Requests/Employees/EmployeesIndexRequest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Presentation/Api/V1/Http/Requests/Employees/EmployeeShowRequest.php b/src/Presentation/Api/V1/Http/Requests/Employees/EmployeeShowRequest.php index a2ab2eb..124be11 100644 --- a/src/Presentation/Api/V1/Http/Requests/Employees/EmployeeShowRequest.php +++ b/src/Presentation/Api/V1/Http/Requests/Employees/EmployeeShowRequest.php @@ -14,7 +14,7 @@ final class EmployeeShowRequest extends FormRequest public function rules(): array { return [ - 'employeeId' => ['required', 'string', 'regex:/^\d{7,8}$/'], + 'employeeId' => ['required', 'string'], ]; } diff --git a/src/Presentation/Api/V1/Http/Requests/Employees/EmployeesIndexRequest.php b/src/Presentation/Api/V1/Http/Requests/Employees/EmployeesIndexRequest.php index d43fff9..66c930b 100644 --- a/src/Presentation/Api/V1/Http/Requests/Employees/EmployeesIndexRequest.php +++ b/src/Presentation/Api/V1/Http/Requests/Employees/EmployeesIndexRequest.php @@ -33,9 +33,9 @@ final class EmployeesIndexRequest extends FormRequest 'sortDirection' => ['sometimes', Rule::in(['Ascending', 'Descending'])], 'direction' => ['sometimes', Rule::in(['Ascending', 'Descending'])], 'since' => ['sometimes', 'date'], - 'establishment' => ['sometimes', 'string', 'regex:/^[\dA-Z]{2,}$/'], - 'siteId' => ['sometimes', 'string', 'regex:/^[A-Z]{2,}$/'], - 'serviceId' => ['sometimes', 'string', 'regex:/^\d{1,}$/'], + 'establishment' => ['sometimes', 'string'], + 'siteId' => ['sometimes', 'string'], + 'serviceId' => ['sometimes', 'string'], ]; }