package com.prolog.rdc.tms.constant.enums.intelligent;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * 智能调度限制条件枚举
 * @author hongbo.pan
 * @date 2023/8/23
 */
@AllArgsConstructor
@Getter
public enum IntelligentRestrictionEnum {

    MAX_VOLUME("1", "车辆体积(M3)"),
    MAX_WEIGHT("2", "车辆载重(KG)"),
    TIME_WINDOW("3", "参考收货时间窗口"),
    MAX_MILEAGE("4", "最长行驶里程"),
    MAX_CUSTOMER_NUM("5", "最多配送客户数量"),
    MAX_SHIP_BILL_NUM("6", "最多运单数量"),
    ;

    public static final String NAME = "INTELLIGENT_RESTRICTION";
    private static Map<String, IntelligentRestrictionEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

    static {
        for(IntelligentRestrictionEnum as : IntelligentRestrictionEnum.values()) {
            enumMap.put(as.code, as);
        }
    }

    public static IntelligentRestrictionEnum getByCode(String code) {
        return  enumMap.get(code);
    }

}
