package com.oqpo.api.enums;

import lombok.Getter;
import lombok.Setter;

public enum StoreDvsn {

    DIRECT("S01", "직영", "1"), //
    FRANCHISEE("S02", "가맹", "2"), //
    SINGLE("S03", "단독", "3"), //
    ;
    // 1:체인직영,2:체인가맹,3:단독매장

    StoreDvsn(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) {
        StoreDvsn[] values = StoreDvsn.values();
        for (StoreDvsn icd : values) {
            if (icd.cd.equals(ccd)) {
                return icd.oqValue;
            }
        }
        return ccd;
    }

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

}
