package cn.iocoder.yudao.module.asset.enums.inspection;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 验车来源类型枚举
 *
 * @author 芋道源码
 */
@Getter
@AllArgsConstructor
public enum InspectionSourceTypeEnum {

    PREPARE(1, "备车"),
    DELIVERY(2, "交车"),
    RETURN(3, "还车");

    /**
     * 类型
     */
    private final Integer type;
    /**
     * 名称
     */
    private final String name;

    public static InspectionSourceTypeEnum valueOf(Integer type) {
        return Arrays.stream(values())
                .filter(item -> item.getType().equals(type))
                .findFirst()
                .orElse(null);
    }

}
