feat: festival/series model with sub-events, cross-event sections, tab navigation, SectionsShiftsPanel extraction
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,7 @@ final class Shift extends Model
|
||||
return [
|
||||
'is_lead_role' => 'boolean',
|
||||
'allow_overlap' => 'boolean',
|
||||
'end_date' => 'date',
|
||||
'events_during_shift' => 'array',
|
||||
'slots_total' => 'integer',
|
||||
'slots_open_for_claiming' => 'integer',
|
||||
@@ -93,7 +94,13 @@ final class Shift extends Model
|
||||
|
||||
protected function filledSlots(): Attribute
|
||||
{
|
||||
return Attribute::get(fn () => $this->shiftAssignments()->where('status', 'approved')->count());
|
||||
return Attribute::get(function () {
|
||||
if (array_key_exists('filled_slots', $this->attributes)) {
|
||||
return (int) $this->attributes['filled_slots'];
|
||||
}
|
||||
|
||||
return $this->shiftAssignments()->where('status', 'approved')->count();
|
||||
});
|
||||
}
|
||||
|
||||
protected function fillRate(): Attribute
|
||||
|
||||
Reference in New Issue
Block a user