Additional event informations can be added
This commit is contained in:
@@ -87,6 +87,7 @@ class Event extends InstancedModel
|
||||
'vat_pricing_mode',
|
||||
'tax_exemption_reason',
|
||||
'tax_exemption_note',
|
||||
'participation_options',
|
||||
|
||||
];
|
||||
|
||||
@@ -114,6 +115,8 @@ class Event extends InstancedModel
|
||||
|
||||
'tax_liable' => 'boolean',
|
||||
'vat_rate' => 'integer',
|
||||
|
||||
'participation_options' => 'array',
|
||||
];
|
||||
|
||||
public function tenant(): BelongsTo
|
||||
|
||||
@@ -14,6 +14,7 @@ use App\EventPaymentModules\DTO\RegistrationSummaryResponse;
|
||||
use App\EventPaymentModules\EventPaymentModule;
|
||||
use App\EventPaymentModules\EventPaymentModuleRegistry;
|
||||
use App\Scopes\InstancedModel;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
|
||||
class EventParticipant extends InstancedModel
|
||||
@@ -103,6 +104,12 @@ class EventParticipant extends InstancedModel
|
||||
return $this->belongsTo(Event::class);
|
||||
}
|
||||
|
||||
/** Gewählte Teilnahmeoptionen (event-spezifische Pflicht-Auswahl) dieser Anmeldung. */
|
||||
public function selectedOptions(): HasMany
|
||||
{
|
||||
return $this->hasMany(EventParticipantOption::class, 'event_participant_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Scopes\InstancedModel;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class EventParticipantOption extends InstancedModel
|
||||
{
|
||||
protected $table = 'event_participant_options';
|
||||
|
||||
protected $fillable = [
|
||||
'tenant',
|
||||
'event_id',
|
||||
'event_participant_id',
|
||||
'question_key',
|
||||
'question_label',
|
||||
'value',
|
||||
'value_label',
|
||||
];
|
||||
|
||||
public function event(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
}
|
||||
|
||||
public function participant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(EventParticipant::class, 'event_participant_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user