<?php

namespace App\Enums;

use BenSampo\Enum\Enum;

final class DeclarationStatus extends Enum
{
    const Created = 'created';

    const EnCours = 'en_cours';

    const EnAttenteClient = 'en_attente_client';

    const Termine = 'termine';

    const MiseEnDemeure = 'mise_en_demeure';

    const Ferme = 'ferme';

    /**
     * Get French display labels for each status.
     *
     * @return array<string, string>
     */
    public static function labels(): array
    {
        return [
            self::Created => 'Créé',
            self::EnCours => 'En cours',
            self::EnAttenteClient => 'En attente client',
            self::Termine => 'Terminé',
            self::MiseEnDemeure => 'Mise en demeure',
            self::Ferme => 'Fermé',
        ];
    }

    /**
     * Get the valid next statuses for each status per the architecture status flow.
     *
     * @return array<string, list<string>>
     */
    public static function allowedTransitions(): array
    {
        return [
            self::Created => [self::EnCours],
            self::EnCours => [self::EnAttenteClient, self::Termine],
            self::EnAttenteClient => [self::EnCours, self::MiseEnDemeure],
            self::Termine => [self::Ferme],
            self::MiseEnDemeure => [self::EnCours, self::Ferme],
            self::Ferme => [],
        ];
    }
}
