completed story 1.1 with QA tests and fixes
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\BlockedTime>
|
||||
*/
|
||||
class BlockedTimeFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'block_date' => fake()->dateTimeBetween('now', '+30 days'),
|
||||
'start_time' => null,
|
||||
'end_time' => null,
|
||||
'reason' => fake()->optional()->sentence(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a full day block.
|
||||
*/
|
||||
public function fullDay(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'start_time' => null,
|
||||
'end_time' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a partial day block with specific times.
|
||||
*/
|
||||
public function partialDay(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'start_time' => '09:00:00',
|
||||
'end_time' => '12:00:00',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user