package com.prolog.rdc.tms.config.enums;

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

import java.util.Map;

/**
 * 消息策略条件类型枚举
 * @author hongbo.pan
 * @date 2022/11/16
 */
@AllArgsConstructor
@Getter
public enum MessageConfigConditionEnum {

    DELIVERY_METHOD_TYPE("1", "配送方式"),
    SHIPPER_TYPE("2", "发货方类型"),
    CONSIGNEE_TYPE("3", "收货方类型"),
    ORDER_TYPE("4", "订单类型"),
    ORDER_BUSINESS_TYPE("5", "业务类型"),
    TRANSPORT_TYPE("6", "运输模式"),
    TEMPERATURE_REQUIREMENT("7", "温度要求"),
    CARGO_OWNER("8", "货主"),
    DEPARTMENT("9", "部门"),
    ;
    public static final String MESSAGE_CONDITION_TYPE = "MESSAGE_CONDITION_TYPE";
    private static Map<String, MessageConfigConditionEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

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

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

}
