package com.gci.boot.modules.msg.enums;

import lombok.Getter;

public enum WorkOrderType {

    REPAIR("维修","1","/vehicles/VehiclesMaintain"),
    UPKEEP_BILL("保养台账","2","/vehicles/UpkeepBill"),
    UPKEEP_PLAN("保养计划","3","/vehicles/UpkeepPlan"),
    VIOLATION("违章","4","/vehicles/Violation"),
    ACCIDENT("事故","5","/vehicles/accident"),
    INSPECTION("年检","6","/vehicles/inspection"),
    INSURANCE("保险","7","/vehicle/insurance"),
    NOT_FIND("没找到对应菜单的","0","xxx")
    ;

    /**
     * 工单类型不能超过5个字
     */
    @Getter
    private String type;

    @Getter
    private String typeNum;

    @Getter
    private String menuUrl;


    WorkOrderType(String type, String typeNum, String menuUrl) {
        this.type = type;
        this.typeNum = typeNum;
        this.menuUrl = menuUrl;
    }

    public static WorkOrderType getEnumByType(String type){
        for (WorkOrderType typeEnum : WorkOrderType.values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return NOT_FIND;
    }
}
