<?php

namespace App\Models;

use App\Enums\RegistrationStatus;
use Illuminate\Database\Eloquent\Attributes\Guarded;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

#[Guarded(['id'])]
class CourseRegistrationSubmissionLog extends Model
{
    protected function casts(): array
    {
        return [
            'status' => RegistrationStatus::class,
        ];
    }

    public function submission(): BelongsTo
    {
        return $this->belongsTo(CourseRegistrationSubmission::class, 'submission_id');
    }

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