package cz.moneta.test.dsl.util.data.client;

import java.util.EnumSet;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

public enum OccupationStatus {
    FULL_TIME_EMPLOYEE("FULL_TIME_EMPLOYEE", "1", "Na dobu neurčitou", "doba neurčitá"),
    FULL_TIME_EMPLOYEE_FINITE("FULL_TIME_EMPLOYEE_FINITE", "2", "Na dobu určitou", "doba určitá"),
    ENTREPRENEUR("ENTREPRENEUR", "3", "Podnikatel", "TBD"),
    RENTIER("RENTIER", "TBD", "Rentier", "TBD"),
    RETIREE_DISABLED("RETIREE_DISABLED", "TBD","Důchodce - invalidní", "TBD"),
    RETIREE_OLD_AGE("RETIREE_OLD_AGE", "TBD", "Důchodce - starobní", "TBD");

    private final String apiValue;
    private final String hcisValue;
    private final String ufoValue;
    private final String ufoConfirmationOfReceiptValue;

    private static final Map<String, OccupationStatus> UFO_VALUES_LOOKUP = EnumSet.allOf(OccupationStatus.class).stream()
            .collect(Collectors.toMap(os -> os.ufoValue, Function.identity()));

    OccupationStatus(String apiValue, String hcisValue, String ufoValue, String ufoConfirmationOfReceiptValue) {
        this.apiValue = apiValue;
        this.hcisValue = hcisValue;
        this.ufoValue = ufoValue;
        this.ufoConfirmationOfReceiptValue = ufoConfirmationOfReceiptValue;
    }

    public String getApiValue() {
        return apiValue;
    }

    public String getHCisValue() { return hcisValue;}

    public String getUfoValue() {
        return ufoValue;
    }

    public String getUfoConfirmationOfReceiptValue() {
        return ufoConfirmationOfReceiptValue;
    }

    public static OccupationStatus getByUfoValue(String ufoValue) {
        return UFO_VALUES_LOOKUP.get(ufoValue);
    }
}
