package com.oqpo.api.enums;

import lombok.Getter;
import lombok.Setter;

public enum MediaDvsn {

    ACCOUNT("ACCT", "계좌"), //
    BANKING("BANK", "일반"), //
    CARD("CARD", "카드"), //
    SETTLMENT("STTL", "대체"), //
    VERTUAL("VRTL", "가상"), //
    RTNC("RTNC", "반품"), //
    ;

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

    @Getter
    @Setter
    private String cd;

    @Getter
    @Setter
    private String name;

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

}
