package com.oqpo.api.enums;

import lombok.Getter;
import lombok.Setter;

public enum ChgDvsn {

    STOCK_CDD("CDD", "재고실사"), //
    STOCK_MOVE("MV", "재고이동"), //
	PURCHASE_IN("PIN", "구매입고"), //
	PURCHASE_OUT("POUT", "구매출고"), //
    RETURN_IN("RIN", "반품입고"), //
    RETURN_OUT("ROUT", "반품출고"), //
    SALE_OUT("SOUT", "판매출고"), //
    ;

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

}
