package com.jasamedika.medifirst2000.etl.pasien.constant;

import lombok.Getter;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 19/10/2023
 */
public enum Negara {
    INDONESIA(0, "Indonesia", 62),
    THAILAND(1, "Thailand", 66),
    FILIPINA(2, "Filipina", 63),
    SINGAPURA(3, "Singapura", 65),
    BRUNEI_DARUSSALAM(4, "Brunei Darussalam", 673),
    VIETNAM(5, "Vietnam", 84),
    LAOS(6, "Laos", 856),
    MYANMAR(7, "Myanmar", 95),
    KAMBOJA(8, "Kamboja", 855),
    MALAYSIA(9, "Malaysia", 60),
    TIMOR_LESTE(10, "Timor Leste", 670),
    PAPUA_NUGINI(11, "Papua Nugini", 675);

    private final long id;

    @Getter
    private final String name;

    @Getter
    private final Integer phoneCode;

    Negara(long id, String name, Integer phoneCode) {
        this.id = id;
        this.name = name;
        this.phoneCode = phoneCode;
    }

    public long id() {
        return this.id;
    }

    @Override
    public String toString() {
        return Long.toString(id);
    }

    public static Negara valueOf(long id) {
        for (Negara negara : values()) {
            if (negara.id == id) {
                return negara;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + id + "]");
    }
}
