package com.prolog.rdc.tms.model.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 MessageTypeEnum {

    SELF_SUBMIT("1", "自有提交"),
    CARRIER_RECEIVE("2", "承运商接单"),
    CARRIER_SUBMIT("3", "承运商提交"),
    CARRIER_REJECT("4", "承运商拒绝"),
    SELF_AUDIT("5", "自有审核"),
    CARRIER_AUDIT("6", "承运商审核"),
    SELF_DISPATCH("7", "自有调度"),
    CARRIER_DISPATCH("8", "承运商调度"),
    SELF_DISPATCH_AUDIT("9", "自有调度审核"),
    CARRIER_DISPATCH_AUDIT("10", "承运商调度审核"),
    APPOINTMENT("11", "预约"),
    APPOINTMENT_AUDIT("12", "预约审核"),
    TAKE_NUMBER("13", "取号"),
    TALLY("14", "理货"),
    CALL_NUMBER("15", "叫号"),
    LOADING("16", "装卸"),
    START_SHIP("17", "启运"),
    DELIVERY("18", "送达"),
    SIGN("19", "签收"),
    RECEIPT("20", "电子回单"),
    ORIGINAL_RECEIPT("21", "正本回单"),
    SELF_VEHICLE_REGISTER("22", "自提车辆登记"),
    SELF_CONFIRM("23", "自提确认"),
    ;
    public static final String MESSAGE_TYPE = "MESSAGE_TYPE";
    private static Map<String, MessageTypeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

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

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

}
