<?php

namespace App\RelationModels;

use App\Casts\AmountCast;
use App\Enumerations\ParticipationFeeType;
use App\Enumerations\ParticipationType;
use App\Models\Tenant;
use App\Scopes\CommonModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class EventParticipationFee extends CommonModel
{
    protected $table = 'event_participation_fees';

    protected $fillable = ['tenant', 'type', 'name', 'description', 'amount_standard', 'amount_reduced', 'amount_solidarity', 'active'];
    protected $casts = [
        'amount_standard' => AmountCast::class,
        'amount_reduced' => AmountCast::class,
        'amount_solidarity' => AmountCast::class,

    ];

    public function tenant() : BelongsTo {
        return $this->belongsTo(Tenant::class, 'tenant', 'slug');
    }

    public function type() : BelongsTo {
        return $this->belongsTo(ParticipationType::class, 'type', 'slug');
    }
}
