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

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 替换车状态枚举
 *
 * @author 芋道源码
 */
@Getter
@AllArgsConstructor
public enum ReplacementStatusEnum {

    DRAFT(0, "草稿"),
    APPROVING(1, "审批中"),
    APPROVED(2, "审批通过"),
    EXECUTING(3, "执行中"),
    COMPLETED(4, "已完成"),
    REJECTED(5, "审批驳回"),
    WITHDRAWN(6, "已撤回");

    /**
     * 状态
     */
    private final Integer status;
    /**
     * 名称
     */
    private final String name;

    public static ReplacementStatusEnum valueOf(Integer status) {
        return Arrays.stream(values())
                .filter(item -> item.getStatus().equals(status))
                .findFirst()
                .orElse(null);
    }

}
