package com.jwipc.api.constant;

import lombok.Getter;

@Getter
public enum SignActionStatus {
    //action 事件
    SIGN_FLOW_START(0, "签署流程开启通知"),
    SIGN_SIGNER_SIGNED(1, "签署方签署完成通知"),
    SIGN_FLOW_FINISH(2, "签署流程完成通知"),
    SIGN_FLOW_OVERTIME(3, "签署流程过期通知"),

    SIGN_FLOW_EXPIRE_REMIND(4, "签署截止前通知"),
    SIGN_FLOW_REFUSE(5, "签署方拒签通知"),
    SIGN_FLOW_CANCEL(6, "签署流程作废通知"),
    SIGNED_FLOW_SIGN_FAILED(9, "签署失败"),


    ;
    private final int status;
    private final String title;

    SignActionStatus(int status, String title) {
        this.status = status;
        this.title = title;
    }

    public static SignActionStatus forVal(int status) {
        for (SignActionStatus value : values()) {
            if (value.getStatus() == status) {
                return value;
            }
        }
        return null;
    }
}
