package com.sckw.transport.model.enuma;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zk
 * @desc 车辆运单详情状态查询枚举
 * @date 2024/3/8 0008
 */
@Getter
public enum ApproveStatusEnum {
    /**
     * 待审核
     */
    TREAT_APPROVE(0, "待审核"),
    /**
     * 审核驳回
     */
    TREAT_REJECTION(1, "审核驳回"),
    /**
     * 审核成功
     */
    TREAT_SUCCESSFUL(2, "审核成功");

    private final Integer code;
    private final String name;

    ApproveStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(Integer code) {
        for (ApproveStatusEnum entity : ApproveStatusEnum.values()) {
            if (entity.getCode().equals(code)) {
                return entity.getName();
            }
        }
        return null;
    }
}
