<?php

namespace App\Models\Interview;

use App\Models\User;
use App\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;

class InterviewAttachment extends Model
{
    use BelongsToTenant;

    protected $fillable = [
        'tenant_id',
        'interview_project_id',
        'file_type',
        'file_name',
        'file_path',
        'file_size',
        'mime_type',
        'ai_analysis',
        'ai_analysis_status',
        'description',
        'created_by',
    ];

    protected $casts = [
        'ai_analysis' => 'array',
        'file_size' => 'integer',
    ];

    public function project()
    {
        return $this->belongsTo(InterviewProject::class, 'interview_project_id');
    }

    public function creator()
    {
        return $this->belongsTo(User::class, 'created_by');
    }
}
