<?php

namespace App\Models;

use App\Enums\AcceptatieStatus;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Acceptatie extends Model
{
    protected $table = 'acceptaties';

    protected $fillable = [
        'overdrachtsplan_id',
        'datum',
        'door_id',
        'opmerkingen',
        'status',
    ];

    protected function casts(): array
    {
        return [
            'status' => AcceptatieStatus::class,
            'datum'  => 'date',
        ];
    }

    public function overdrachtsplan(): BelongsTo
    {
        return $this->belongsTo(Overdrachtsplan::class);
    }

    public function door(): BelongsTo
    {
        return $this->belongsTo(User::class, 'door_id');
    }
}
