<?php

namespace App\Models;

use App\Models\Concerns\BelongsToCompany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class ApplicantStageEvent extends Model
{
    use BelongsToCompany;

    protected $table = 'applicant_stage_events';

    protected $fillable = [
        'company_id',
        'applicant_id',
        'from_stage',
        'to_stage',
        'changed_by_user_id',
        'note_internal',
        'note_referrer',
    ];

    public function applicant(): BelongsTo
    {
        return $this->belongsTo(Applicant::class);
    }

    public function changedBy(): BelongsTo
    {
        return $this->belongsTo(User::class, 'changed_by_user_id');
    }
}
