Implement EAV system for dynamic event-specific registration fields with organisation-level templates, person section preferences with priority ranking, and TagSyncService for deferred tag_picker sync. New tables: registration_field_templates, registration_form_fields, person_field_values, person_section_preferences. New columns: persons.remarks, events.registration_show_section_preferences, events.registration_show_availability. 58 tests, 126 assertions — all 432 tests pass (zero regressions). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
34 lines
999 B
PHP
34 lines
999 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Resources\Api\V1;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
final class PersonSectionPreferenceResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
$section = $this->whenLoaded('festivalSection');
|
|
|
|
return [
|
|
'festival_section_id' => $this->festival_section_id,
|
|
'priority' => $this->priority,
|
|
'section_name' => $this->when(
|
|
$this->relationLoaded('festivalSection'),
|
|
fn () => $this->festivalSection?->name
|
|
),
|
|
'section_icon' => $this->when(
|
|
$this->relationLoaded('festivalSection'),
|
|
fn () => $this->festivalSection?->icon
|
|
),
|
|
'section_category' => $this->when(
|
|
$this->relationLoaded('festivalSection'),
|
|
fn () => $this->festivalSection?->category
|
|
),
|
|
];
|
|
}
|
|
}
|