Fix: Add complete validation rules for internal driver creation #199
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The internal was incomplete and missing validation for required fields like , , and . This caused two issues:
The controller extracts data from
$request->input('driver')but the validation rules didn't properly validate this nested data.Solution
Updated
server/src/Http/Requests/Internal/CreateDriverRequest.phpwith:Required Fields (for creation)
name- Driver name (required, max 255 chars)email- Email address (required, must be valid email, unique)phone- Phone number (required, unique)Optional Fields
password- Minimum 8 charactersdrivers_license_number- Driver's license numberinternal_id- Internal identifiercountry- 2-letter country codecity- City namevehicle- Vehicle assignmentstatus- active/inactivevendor- Vendor assignmentjob- Order assignmentlocation,latitude,longitude- Location dataphoto_uuid,avatar_uuid- Photo uploadsImprovements
Testing
Impact
Related Issues
Fixes driver creation failures in onboarding flow where users could submit empty forms.