package com.oqpo.api.enums;

import lombok.Getter;
import lombok.Setter;

public enum StoreStCd {

    OPEN("ST01", "오픈", "1"), //
    HOLD("ST02", "보류", "2"), //
    CLOSE("ST03", "폐점", "9"), //
    ;

    StoreStCd(String cd, String nm, String oqValue) {
        this.cd = cd;
        this.name = nm;
        this.oqValue = oqValue;
    }

    @Getter
    @Setter
    private String cd;

    @Getter
    @Setter
    private String name;

    @Getter
    @Setter
    private String oqValue;

    public static String getOqValue(String ccd) {
        StoreStCd[] values = StoreStCd.values();
        for (StoreStCd icd : values) {
            if (icd.cd.equals(ccd)) {
                return icd.oqValue;
            }
        }
        return ccd;
    }

    public static String getName(String ccd) {
        StoreStCd[] values = StoreStCd.values();
        for (StoreStCd icd : values) {
            if (icd.cd.equals(ccd)) {
                return icd.name;
            }
        }
        return ccd;
    }

}
