package com.sckw.core.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.EnumSet;

/**
 * @author lfdc
 * @desc 铲车司机运单状态枚举
 * @date 2023-07-14 14:07:23
 */
@Getter
@AllArgsConstructor
public enum ForkliftStatusEnum {

    /**
     * 待接单
     */
    PENDING_ORDERS(1,  "待接单"),

    /**
     * 已接单
     */
    ORDER_TAKING(5,  "已接单"),

    /**
     * 已完成
     */
    COMPLETED(10, "已装载"),

    /**
     * 已取消
     */
    CANCEL(99, "已装载"),

    ;

    private final Integer code;

    private final String destination;


    public static String getDesc(Integer status) {
        if (status == null) {
            return null;
        }
        for (ForkliftStatusEnum forkliftStatusEnum : EnumSet.allOf(ForkliftStatusEnum.class)) {
            if (forkliftStatusEnum.code.equals(status)) {
                return forkliftStatusEnum.destination;
            }
        }
        return null;
    }

}
