<?php

namespace App\Models;

use App\Models\Concerns\BelongsToCompany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Interview extends Model
{
    use BelongsToCompany;

    protected $table = 'interviews';

    protected $fillable = [
        'company_id',
        'applicant_id',
        'interviewer_id',
        'interview_type',
        'scheduled_at',
        'status',
        'feedback',
        'follow_up_at',
        'follow_up_notes',
    ];

    protected $casts = [
        'scheduled_at' => 'datetime',
        'follow_up_at' => 'datetime',
    ];

    public function applicant(): BelongsTo
    {
        return $this->belongsTo(Applicant::class);
    }

    public function interviewer(): BelongsTo
    {
        return $this->belongsTo(User::class, 'interviewer_id');
    }
}
