package digital.laboratory.platform.entrustment.enums;

import lombok.Getter;

@Getter
public enum EntrustAlterApplyStatus {

    WAIT_SUBMIT_APPLY(0, "待提交申请"),
    SUBMITTED_WAIT_APPROVE(1,"提交申请待审核"),
    APPLY_SUCCESS(2, "申请通过"),
    APPLY_FAIL(-1, "申请不通过"),
    FINISHED(9, "已完成"),
    ;


    private final Integer status;

    private final String desc;

    EntrustAlterApplyStatus(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    // 根据名称获取指纹类型
    public static EntrustAlterApplyStatus fromStatus(Integer status) {
        for (EntrustAlterApplyStatus entrustAlterApplyStatus : values()) {
            if (entrustAlterApplyStatus.getStatus().equals(status)) {
                return entrustAlterApplyStatus;
            }
        }
        throw new IllegalArgumentException("No enum constant with status: " + status);
    }
}
