package jnpf.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 合同签署状态，500-未发起 501-待签署 502-已到期 503-已签署
 */
@Getter
@AllArgsConstructor
public enum FContractSignStatus {
    NOT_INITIATED(500, "未发起"),
    PENDING_SIGNATURE(501, "待签署"),
    EXPIRED(502, "已到期"),
    SIGNED(503, "已签署");

    private Integer code;
    private String description;


    public static FContractSignStatus fromCode(Integer code) {
        for (FContractSignStatus item : FContractSignStatus.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null; // 或者您可以选择抛出异常，根据实际需求而定
    }
}
