package com.sckw.core.model.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;

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

    /**
     * 已接单
     */
    PENDING_VEHICLE(1,  "已接单"),
    /**
     * 到达装货点
     */
    REFUSE_TRAFFIC(5, "到达装货点"),
    /**
     * 已装货
     */
    EXIT_COMPLETED(10,  "已装货"),
    /**
     * 已离场
     */
    WAIT_LOADING(15,  "已离场"),
    /**
     * 已卸货
     */
    COMPLETION_LOADING(20,  "已卸货"),
    /**
     * 已完成
     */
    WAIT_UNLOADING(25,  "已完成"),
    /**
     * 审核驳回
     */
    COMPLETION_UNLOADING(30,  "审核驳回"),
    /**
     * 已作废
     */
    APPROVAL_TREAT(99, "已取消"),

    ;

    private final Integer code;

    private final String destination;


    public static String geDesc(Integer status) {
        if (status == null) {
            return null;
        }
        for (CarWaybillV1Enum carWaybillV1Enum : EnumSet.allOf(CarWaybillV1Enum.class)) {
            if (carWaybillV1Enum.code.equals(status)) {
                return carWaybillV1Enum.destination;
            }
        }
        return null;
    }

}
