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>
42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Api\V1;
|
|
|
|
use App\Models\Event;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
final class ImportFromEventRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/** @return array<string, mixed> */
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'source_event_id' => ['required', 'ulid', 'exists:events,id'],
|
|
];
|
|
}
|
|
|
|
public function withValidator($validator): void
|
|
{
|
|
$validator->after(function ($validator) {
|
|
$sourceEventId = $this->input('source_event_id');
|
|
if (!$sourceEventId) {
|
|
return;
|
|
}
|
|
|
|
$sourceEvent = Event::find($sourceEventId);
|
|
$targetEvent = $this->route('event');
|
|
|
|
if ($sourceEvent && $targetEvent && $sourceEvent->organisation_id !== $targetEvent->organisation_id) {
|
|
$validator->errors()->add('source_event_id', 'Source event must belong to the same organisation.');
|
|
}
|
|
});
|
|
}
|
|
}
|