44 lines
1.5 KiB
PHP
44 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Technician>
|
|
*/
|
|
class TechnicianFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$specializations = [
|
|
['engine', 'transmission'],
|
|
['electrical', 'air_conditioning'],
|
|
['brakes', 'suspension'],
|
|
['diagnostic', 'computer_systems'],
|
|
['bodywork', 'paint'],
|
|
['general_maintenance'],
|
|
];
|
|
|
|
return [
|
|
'first_name' => $this->faker->firstName(),
|
|
'last_name' => $this->faker->lastName(),
|
|
'email' => $this->faker->unique()->safeEmail(),
|
|
'phone' => $this->faker->phoneNumber(),
|
|
'employee_id' => 'EMP-' . $this->faker->unique()->numberBetween(1000, 9999),
|
|
'hourly_rate' => $this->faker->randomFloat(2, 25, 65),
|
|
'specializations' => $this->faker->randomElement($specializations),
|
|
'skill_level' => $this->faker->randomElement(['apprentice', 'journeyman', 'master']),
|
|
'certifications' => $this->faker->optional(0.7)->text(100),
|
|
'status' => $this->faker->randomElement(['active', 'inactive', 'on_break']),
|
|
'shift_start' => $this->faker->time('H:i', '09:00'),
|
|
'shift_end' => $this->faker->time('H:i', '18:00'),
|
|
];
|
|
}
|
|
}
|