package fr.titionfire.ffsaf.utils;

import fr.titionfire.ffsaf.domain.service.TradService;
import io.quarkus.runtime.annotations.RegisterForReflection;

import java.util.ResourceBundle;

@RegisterForReflection
public enum Categorie {
    SUPER_MINI,
    MINI_POUSSIN,
    POUSSIN,
    BENJAMIN,
    MINIME,
    CADET,
    JUNIOR,
    SENIOR1,
    SENIOR2,
    VETERAN1,
    VETERAN2;

    public String getName(ResourceBundle BUNDLE) {
        return switch (this) {
            case SUPER_MINI -> BUNDLE.getString("Cat.SUPER_MINI");
            case MINI_POUSSIN -> BUNDLE.getString("Cat.MINI_POUSSIN");
            case POUSSIN -> BUNDLE.getString("Cat.POUSSIN");
            case BENJAMIN -> BUNDLE.getString("Cat.BENJAMIN");
            case MINIME -> BUNDLE.getString("Cat.MINIME");
            case CADET -> BUNDLE.getString("Cat.CADET");
            case JUNIOR -> BUNDLE.getString("Cat.JUNIOR");
            case SENIOR1 -> BUNDLE.getString("Cat.SENIOR1");
            case SENIOR2 -> BUNDLE.getString("Cat.SENIOR2");
            case VETERAN1 -> BUNDLE.getString("Cat.VETERAN1");
            case VETERAN2 -> BUNDLE.getString("Cat.VETERAN2");
        };
    }

    public String getName(TradService tradService) {
        return switch (this) {
            case SUPER_MINI -> tradService.translate("Cat.SUPER_MINI");
            case MINI_POUSSIN -> tradService.translate("Cat.MINI_POUSSIN");
            case POUSSIN -> tradService.translate("Cat.POUSSIN");
            case BENJAMIN -> tradService.translate("Cat.BENJAMIN");
            case MINIME -> tradService.translate("Cat.MINIME");
            case CADET -> tradService.translate("Cat.CADET");
            case JUNIOR -> tradService.translate("Cat.JUNIOR");
            case SENIOR1 -> tradService.translate("Cat.SENIOR1");
            case SENIOR2 -> tradService.translate("Cat.SENIOR2");
            case VETERAN1 -> tradService.translate("Cat.VETERAN1");
            case VETERAN2 -> tradService.translate("Cat.VETERAN2");
        };
    }

    public String getName() {
        return switch (this) {
            case SUPER_MINI -> "Super Mini";
            case MINI_POUSSIN -> "Mini Poussin";
            case POUSSIN -> "Poussin";
            case BENJAMIN -> "Benjamin";
            case MINIME -> "Minime";
            case CADET -> "Cadet";
            case JUNIOR -> "Junior";
            case SENIOR1 -> "Senior 1";
            case SENIOR2 -> "Senior 2";
            case VETERAN1 -> "Vétéran 1";
            case VETERAN2 -> "Vétéran 2";
        };
    }
}
