<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Soumission extends Model
{
    protected $table = 'soumission';

    protected $primaryKey = 'sub_id';

    const CREATED_AT = 'sub_created_at';

    const UPDATED_AT = 'sub_updated_at';

    protected $fillable = [
        'sub_prenom', 'sub_nom', 'sub_email', 'sub_tel', 'sub_profil',
        'sub_projet', 'sub_statut', 'sub_locale',
    ];

    /** Libellés français des statuts, utilisés dans tout le CMS. */
    const STATUTS = [
        'new' => 'Nouvelle',
        'read' => 'Lue',
        'replied' => 'Répondue',
    ];

    public function statutLabel(): string
    {
        return self::STATUTS[$this->sub_statut] ?? $this->sub_statut;
    }
}
