<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class EvaluationCandidat extends Model
{
    use HasFactory;

    protected $fillable = [
        'mission_id', 'candidat_id', 'client_id', 'note_globale',
        'note_proprete', 'note_serieux', 'note_ponctualite',
        'commentaire', 'recommanderait',
    ];

    protected $casts = [
        'note_globale' => 'integer',
        'note_proprete' => 'integer',
        'note_serieux' => 'integer',
        'note_ponctualite' => 'integer',
        'recommanderait' => 'boolean',
    ];

    // Relations
    public function mission(): \Illuminate\Database\Eloquent\Relations\BelongsTo
    {
        return $this->belongsTo(Mission::class);
    }

    public function candidat(): \Illuminate\Database\Eloquent\Relations\BelongsTo
    {
        return $this->belongsTo(Candidat::class);
    }

    public function client(): \Illuminate\Database\Eloquent\Relations\BelongsTo
    {
        return $this->belongsTo(Client::class);
    }
}
