- 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
62 lines
1.5 KiB
PHP
62 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Concerns\HasUlids;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
final class FestivalSection extends Model
|
|
{
|
|
use HasFactory;
|
|
use HasUlids;
|
|
use SoftDeletes;
|
|
|
|
protected $fillable = [
|
|
'event_id',
|
|
'name',
|
|
'type',
|
|
'sort_order',
|
|
'crew_need',
|
|
'crew_auto_accepts',
|
|
'crew_invited_to_events',
|
|
'added_to_timeline',
|
|
'responder_self_checkin',
|
|
'crew_accreditation_level',
|
|
'public_form_accreditation_level',
|
|
'timed_accreditations',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'crew_auto_accepts' => 'boolean',
|
|
'crew_invited_to_events' => 'boolean',
|
|
'added_to_timeline' => 'boolean',
|
|
'responder_self_checkin' => 'boolean',
|
|
'timed_accreditations' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function event(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Event::class);
|
|
}
|
|
|
|
public function shifts(): HasMany
|
|
{
|
|
return $this->hasMany(Shift::class);
|
|
}
|
|
|
|
public function scopeOrdered(Builder $query): Builder
|
|
{
|
|
return $query->orderBy('sort_order');
|
|
}
|
|
}
|