<?php

namespace App\Models;

use App\Enums\DataChangeDecision;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

class DataChangeReview extends Model
{
    use SoftDeletes;

    protected $guarded = ['id'];

    protected function casts(): array
    {
        return [
            'decision' => DataChangeDecision::class,
            'data_change_request_id' => 'integer',
            'reviewer_id' => 'integer',
        ];
    }

    public function request(): BelongsTo
    {
        return $this->belongsTo(DataChangeRequest::class, 'data_change_request_id');
    }

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