trucks (with optional last_known_coordinates POINT 4326), collection_teams, team_members. Admin CRUD for both. TeamConflictDetector flags double-assignment of driver/scanner/truck/helper across active teams; override_conflicts: true bypasses for emergencies. Promotes routes.default_team_id to a real FK now that collection_teams exists. 144 feature tests passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
24 lines
751 B
PHP
24 lines
751 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Team;
|
|
|
|
use App\Models\Truck;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class StoreTruckRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool { return true; }
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'plate_number' => ['required', 'string', 'max:16', Rule::unique('trucks', 'plate_number')->whereNull('deleted_at')],
|
|
'model' => ['nullable', 'string', 'max:100'],
|
|
'capacity_kg' => ['nullable', 'integer', 'min:0'],
|
|
'status' => ['nullable', Rule::in([Truck::STATUS_ACTIVE, Truck::STATUS_MAINTENANCE, Truck::STATUS_RETIRED])],
|
|
'notes' => ['nullable', 'string', 'max:1000'],
|
|
];
|
|
}
|
|
}
|