package cn.axzo.msg.center.service.pending.request;

import cn.axzo.msg.center.service.enums.BizFinalStateEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author haiyangjin
 * @date 2023/11/15
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CompletePendingMessageRequest implements Serializable {
    /**
     * 关联业务主键
     */
    @NotNull(message = "bizCode is required")
    private String bizCode;

    /**
     * 模版code
     */
    @NotNull(message = "templateCode is required")
    private String templateCode;

    /**
     * 整个流程是否完结，注：审批待办完结后传true
     */
    private Boolean finalStatus;

    /**
     * 业务终态的状态枚举
     */
    private BizFinalStateEnum bizFinalStateEnum;

    public boolean determineUpdateFinalBizState() {
        return finalStatus != null && finalStatus && bizFinalStateEnum != null;
    }
}
