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

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

import java.util.Map;

/**
 * 预约单创建模式枚举
 * @author hongbo.pan
 * @date 2022/10/8
 */
@AllArgsConstructor
@Getter
public enum UserTypeEnum {

    I("I", "内部员工"),
    S("S", "承运商"),
    V("V", "供应商"),
    H("H", "货主"),
    C("C", "客户"),
    D("D", "司机"),
    M("H", "送货员"),
    ;

    private static Map<String, UserTypeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

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

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

}
