-
Notifications
You must be signed in to change notification settings - Fork 38
v0.6.33 #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
v0.6.33 #200
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add required validation for name, email, and phone fields - Add validation for drivers_license_number and internal_id - Add validation for photo_uuid and avatar_uuid - Add validation for location fields (latitude, longitude) - Add custom error messages for better UX - Add custom attribute names for clearer validation errors - Ensure email and phone uniqueness checks - Add password minimum length validation (8 characters) This fixes the issue where drivers could be created without required fields through the internal API, and improves the validation error messages shown to users. Resolves issue where onboarding driver creation was failing silently due to incomplete validation rules.
- Check if user exists before calling methods on it - Create new user if user_uuid is provided but user doesn't exist - Prevents 'Call to a member function companies() on null' error - Fixes driver creation failure when invalid user_uuid is provided This resolves the error: Error: Call to a member function companies() on null in DriverController.php on line 172
- Changed closure from function($input) to function() - Use $this->input() to access request data instead - Fixes ArgumentCountError when Rule::requiredIf evaluates closure
Issue: Users created via driver API were not being tracked in billing system Root cause: company_uuid was set AFTER user creation via assignCompany() Solution: Set company_uuid in userDetails BEFORE User::create() This ensures ResourceCreatedListener can properly track the resource creation since it requires company_uuid to log usage to billing_resource_usage table. Without company_uuid at creation time, the listener logs a warning and exits: 'Could not determine company UUID for resource' Now the flow is: 1. Set company_uuid in userDetails 2. User::create() fires eloquent.created event 3. ResourceCreatedListener receives event with company_uuid 4. Resource usage tracked successfully
…+ fill + save Issue: Vehicles created via API were not being tracked in billing system Root cause: Using new Vehicle() + fill() + save() doesn't fire 'created' event Solution: Replace with Vehicle::create() which properly fires the event The problem: - new Vehicle() creates instance - fill() populates attributes - save() fires 'updated' event, NOT 'created' event - ResourceCreatedListener only listens for 'created' event The fix: - Vehicle::create($input) fires 'created' event properly - ResourceCreatedListener receives event with company_uuid - Resource usage tracked successfully This is cleaner and more idiomatic Laravel code, and ensures billing resource tracking works correctly.
Fix: Add complete validation rules for internal driver creation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.