<?php

namespace App\Models;

use App\Enums\Prioriteit;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class Thema extends Model
{
    use SoftDeletes;

    protected $table = 'themas';

    protected $fillable = [
        'naam',
        'beschrijving',
        'prioriteit',
        'periode_start',
        'periode_eind',
    ];

    protected function casts(): array
    {
        return [
            'prioriteit'   => Prioriteit::class,
            'periode_start' => 'date',
            'periode_eind'  => 'date',
        ];
    }

    public function speerpunten(): HasMany
    {
        return $this->hasMany(Speerpunt::class);
    }

    public function roadmapItems(): HasMany
    {
        return $this->hasMany(RoadmapItem::class);
    }
}
