package com.sckw.fleet.model.enums;

import lombok.Getter;

/**
 * @author zk
 * @desc 车辆状态
 * @date 2024/3/8 0008
 */
@Getter
public enum TruckStatusEnum {
    /**
     * 正常
     */
    NORMAL(0, "正常"),

    /**
     * 停用
     */
    DISABLED(1, "停用"),

    /**
     * 待审核
     */
    PENDING_REVIEW(2, "待审核"),

    /**
     * 审核驳回
     */
    REVIEW_REJECTED(3, "审核驳回");


    private final Integer code;
    private final String name;

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

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