complete story 3.2 with qa tests

This commit is contained in:
Naser Mansour
2025-12-26 18:43:26 +02:00
parent e679a45933
commit 43df24c7cd
18 changed files with 1483 additions and 74 deletions
+45 -5
View File
@@ -25,9 +25,9 @@ class BlockedTimeFactory extends Factory
}
/**
* Create a full day block.
* Create a full day block (all-day event).
*/
public function fullDay(): static
public function allDay(): static
{
return $this->state(fn (array $attributes) => [
'start_time' => null,
@@ -38,11 +38,51 @@ class BlockedTimeFactory extends Factory
/**
* Create a partial day block with specific times.
*/
public function partialDay(): static
public function timeRange(string $start = '09:00', string $end = '12:00'): static
{
return $this->state(fn (array $attributes) => [
'start_time' => '09:00:00',
'end_time' => '12:00:00',
'start_time' => $start,
'end_time' => $end,
]);
}
/**
* Create an upcoming blocked time.
*/
public function upcoming(): static
{
return $this->state(fn (array $attributes) => [
'block_date' => fake()->dateTimeBetween('tomorrow', '+30 days'),
]);
}
/**
* Create a past blocked time.
*/
public function past(): static
{
return $this->state(fn (array $attributes) => [
'block_date' => fake()->dateTimeBetween('-30 days', 'yesterday'),
]);
}
/**
* Create a blocked time for today.
*/
public function today(): static
{
return $this->state(fn (array $attributes) => [
'block_date' => today(),
]);
}
/**
* Create a blocked time with a specific reason.
*/
public function withReason(?string $reason = null): static
{
return $this->state(fn (array $attributes) => [
'reason' => $reason ?? fake()->sentence(),
]);
}
}