package com.bonus.canteen.core.kitchen.domain.constants;

public enum SampleDishesSaveStatusEnum {
    NOT_IN_CABINET(1, "未入柜"),
    IN_CABINET(2, "在柜"),
    LEAVE_CABINET(3, "离柜"),
    OVERTIME_LEAVE_CABINET(4, "超时自动离柜");

    private final Integer key;
    private final String desc;

    private SampleDishesSaveStatusEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }
    public Integer getKey() {
        return this.key;
    }

    public String getDesc() {
        return this.desc;
    }

    public static String getDescByKey(Integer targetKey) {
        for (SampleDishesSaveStatusEnum dishesSaveStatusEnum : SampleDishesSaveStatusEnum.values()) {
            if (dishesSaveStatusEnum.getKey().equals(targetKey)) {
                return dishesSaveStatusEnum.getDesc();
            }
        }
        return "";
    }
}
