package org.wcs.constant.enums.database;

import lombok.Getter;

/**
 * 电子标签任务类型枚举类
 */
@Getter
public enum EtagTaskTypeEnum {

    PICK(1, "拣货"),
    PUT(2, "上架"),
    CHECK(3, "盘点"),
    CLEAN(4, "清点"),
    OTHER(5, "其他");

    private final Integer code;
    private final String message;

    EtagTaskTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 校验是否是正确的枚举值
     *
     * @param code code
     * @return 是否合法
     */
    public static boolean isValid(Integer code) {
        for (EtagTaskTypeEnum value : EtagTaskTypeEnum.values()) {
            if (value.code.equals(code)) {
                return true;
            }
        }
        return false;
    }
}
