<?php

namespace App\Models;

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

class Parrain extends Model
{
    use HasFactory;

    protected $fillable = [
        'candidat_id', 'nom_complet', 'lien_avec_candidat',
        'telephone_principal', 'telephone_secondaire', 'email',
        'quartier_id', 'adresse_domicile', 'a_signe_contrat',
        'contrat_signe_at',
    ];

    protected $casts = [
        'a_signe_contrat' => 'boolean',
        'contrat_signe_at' => 'datetime',
    ];

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

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