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

import lombok.Getter;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 19/10/2023
 */
public enum HubunganPasien {
    DIRI_SENDIRI(1, "Diri Sendiri"),
    ORANG_TUA(2, "Orang Tua"),
    ANAK(3, "Anak"),
    SUAMI_ATAU_ISTRI(4, "Suami/Istri"),
    KERABAT_ATAU_SAUDARA(5, "Kerabat/Saudara"),
    LAIN_LAIN(6, "Lain-lain");

    private final long id;

    @Getter
    private final String name;

    HubunganPasien(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 HubunganPasien valueOf(long id) {
        for (HubunganPasien hubunganPasien : values()) {
            if (hubunganPasien.id == id) {
                return hubunganPasien;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + id + "]");
    }
}
