completed story 1.1 with QA tests and fixes

This commit is contained in:
Naser Mansour
2025-12-26 13:46:39 +02:00
parent 028ce573b9
commit 84d9c2f66a
57 changed files with 2193 additions and 85 deletions
+46
View File
@@ -0,0 +1,46 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\WorkingHour>
*/
class WorkingHourFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'day_of_week' => fake()->numberBetween(0, 6),
'start_time' => '09:00:00',
'end_time' => '17:00:00',
'is_active' => true,
];
}
/**
* Create working hours for weekdays (Sunday-Thursday, 0-4).
*/
public function weekdays(): static
{
return $this->state(fn (array $attributes) => [
'day_of_week' => fake()->numberBetween(0, 4),
]);
}
/**
* Create inactive working hours.
*/
public function inactive(): static
{
return $this->state(fn (array $attributes) => [
'is_active' => false,
]);
}
}