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

import lombok.Getter;

public enum RepairStatusEnumEmployee {

    //待提交 - 待派单 - 待报价 - 待审核报价 - 待审批报价 - 维修中 - 待确认结果 - 已归档
    //    提交->   派单->   报价->  审核(员工)->  审批(领导)->完成维修-> 结果完成
    //                            审核不通过    审核不通过             结果未完成
    //                            超过两千

    /**
     * 待提交
     */
    WAIT_SUBMIT(1,"提交",1),

    /**
     * 待派单
     */
    WAIT_SEND(2,"派单",1),

    /**
     * 待报价
     */
    WAIT_OFFER(3,"报价",1),

    /**
     * 待审核报价
     */
    WAIT_CHECK_OFFER(4,"审核",1),

    /**
     * 待审批报价
     */
    WAIT_LEADER_CHECK_OFFER(5,"查看",1),

    /**
     * 维修中
     */
    REPAIRING(6,"维修",1),

    /**
     * 待确认结果
     */
    WAIT_CONFIRM_RESULT(7,"确认",1),

    /**
     * 已归档
     */
    FINISH(8,"查看",2),
    /**
     * 已作废
     */
    CANCEL(9,"查看",2)
    ;
    /**
     * 维修状态
     */
    @Getter
    private Integer flowStatus;

    @Getter
    private String checkButton;

    @Getter
    private Integer deleteButton;


    RepairStatusEnumEmployee(Integer flowStatus, String checkButton,Integer deleteButton) {
        this.flowStatus = flowStatus;
        this.checkButton = checkButton;
        this.deleteButton = deleteButton;
    }

    public static RepairStatusEnumEmployee getEnum(Integer flowStatus){
        for (RepairStatusEnumEmployee statusEnum : RepairStatusEnumEmployee.values()) {
            if (statusEnum.getFlowStatus().equals(flowStatus)) {
                return statusEnum;
            }
        }
        return null;
    }

}
