Files
crewli/api/database/factories/ShiftFactory.php
bert.hausmans 9acb27af3a feat: fase 2 backend — crowd types, persons, sections, shifts, invite flow
- 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
2026-04-08 01:34:46 +02:00

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]);
}
}