package com.oqpo.api.enums;

import lombok.Getter;
import lombok.Setter;

public enum LoanDvsn {

    PRE_PAYMENT("LD01", "선불(충전)"), //
    POST_PAYMENT("LD02", "후불(신용)"), //
    NO_STTL("LD03", "무정산"), //
    ;

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

}
