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

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 合同审批状态枚举
 *
 * @author 芋道源码
 */
@Getter
@AllArgsConstructor
public enum ContractApprovalStatusEnum {

    DRAFT(0, "草稿"),
    APPROVING(1, "审批中"),
    APPROVED(2, "审批通过"),
    REJECTED(3, "审批拒绝"),
    WITHDRAWN(4, "已撤回");

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

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

}
