- Crowd Types + Persons CRUD (73 tests) - Festival Sections + Time Slots + Shifts CRUD met assign/claim flow (84 tests) - Invite Flow + Member Management met InvitationService (109 tests) - Schema v1.6 migraties volledig uitgevoerd - DevSeeder bijgewerkt met crowd types voor testorganisatie
53 lines
1.3 KiB
PHP
53 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\FestivalSection;
|
|
use App\Models\Shift;
|
|
use App\Models\TimeSlot;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/** @extends Factory<Shift> */
|
|
final class ShiftFactory extends Factory
|
|
{
|
|
/** @return array<string, mixed> */
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'festival_section_id' => FestivalSection::factory(),
|
|
'time_slot_id' => TimeSlot::factory(),
|
|
'title' => fake()->randomElement([
|
|
'Tapper',
|
|
'Tussenbuffet',
|
|
'Barhoofd',
|
|
'Stage Manager',
|
|
'Stagehand',
|
|
'Coördinator',
|
|
'Runner',
|
|
]),
|
|
'slots_total' => fake()->numberBetween(1, 10),
|
|
'slots_open_for_claiming' => 0,
|
|
'status' => 'draft',
|
|
'is_lead_role' => false,
|
|
'allow_overlap' => false,
|
|
];
|
|
}
|
|
|
|
public function open(): static
|
|
{
|
|
return $this->state(fn () => ['status' => 'open']);
|
|
}
|
|
|
|
public function withClaiming(int $slots): static
|
|
{
|
|
return $this->state(fn () => ['slots_open_for_claiming' => $slots]);
|
|
}
|
|
|
|
public function allowOverlap(): static
|
|
{
|
|
return $this->state(fn () => ['allow_overlap' => true]);
|
|
}
|
|
}
|