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

import lombok.Getter;

public enum BacklogEnum {
    //1出险 2违章 3事故 4维修 5_保养台账 6年检 7_保养计划, 8保险
    //出险
    INSURANCE("insurance:output:update","出险",0),
    //违章
    VIOLATION("Violation:handle","违章",0),
    //事故
    ACCIDENT("accident:update","事故",0),
    //年检
    INSPECTION("inspection:alarm:handle","年检",0),
    //维修_派单、报价、审核、审批、维修、确认
    REPAIR_SEND("VehiclesMaintain:send","维修",2),
    REPAIR_OFFER("VehiclesMaintain:offer","维修",3),
    REPAIR_CHECK_OFFER("VehiclesMaintain:checkOffer","维修",4),
    REPAIR_RECHECK_OFFER("VehiclesMaintain:recheckOffer","维修",10),
    REPAIR_LEADER_CHECK_OFFER("VehiclesMaintain:leaderCheckOffer","维修",5),
    REPAIR_SEND_REPAIRING("VehiclesMaintain:repairing","维修",6),
    REPAIR_SEND_CONFIRM_RESULT("VehiclesMaintain:confirmResult","维修",7),
    //保养台账_派单、报价、审核、保养、确认
    UPKEEP_BILL_SEND("UpkeepBill:send","保养台账",2),
    UPKEEP_BILL_OFFER("UpkeepBill:offer","保养台账",3),
    UPKEEP_BILL_CHECK_OFFER("UpkeepBill:checkOffer","保养台账",4),
    UPKEEP_BILL_RECHECK_OFFER("UpkeepBill:recheckOffer","保养台账",10),
    UPKEEP_BILL_REPAIRING("UpkeepBill:repairing","保养台账",6),
    UPKEEP_BILL_CONFIRM_RESULT("UpkeepBill:comfirmResult","保养台账",7),
    //保养计划_审批
    UPKEEP_PLAN_LEADER_CHECK_OFFER("UpkeepPlan:leaderCheckOffer","保养计划",1),
    //保险
    INSURANCE_LEDGER("insurance:alarm:handle","保险",0)
    ;

    /**
     * 菜单按钮、对应功能、数据状态
     */
    @Getter
    private String buttonAction;

    @Getter
    private String menu;

    @Getter
    private Integer dataStatus;

    BacklogEnum(String buttonAction, String menu,Integer dataStatus) {
        this.buttonAction = buttonAction;
        this.menu = menu;
        this.dataStatus = dataStatus;
    }

    public static BacklogEnum getEnum(String buttonAction){
        for (BacklogEnum backlogEnum : BacklogEnum.values()) {
            if (backlogEnum.getButtonAction().equals(buttonAction)) {
                return backlogEnum;
            }
        }
        return null;
    }
}
