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

import lombok.Getter;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 19/10/2023
 */
public enum JenisIdentitas {
    KTP(1, "KTP"),
    KK(2, "SIM"),
    SIM(3, "KK"),
    PASPOR(4, "Paspor"),
    KITAS(5, "KITAS"),
    AKTA_LAHIR(6, "Akta Lahir");

    private final long id;

    @Getter
    private final String name;

    JenisIdentitas(long id, String name) {
        this.id = id;
        this.name = name;
    }

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

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

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