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
This commit is contained in:
52
api/database/factories/ShiftFactory.php
Normal file
52
api/database/factories/ShiftFactory.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?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]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user