package com.hotwj.platform.flow.event;

import lombok.Getter;
import org.springframework.context.ApplicationEvent;

/**
 * 启动流程事件
 *
 * @author shihongwei
 * @date 2026-01-26
 */
@Getter
public class StartFlowEvent extends ApplicationEvent {
    private final String flowCode;
    private final String businessId;
    private final Long companyId;
    private final String initiatorId;
    private final String approverId;

    /**
     * 流程实例ID (事件处理完成后回写)
     */
    private String instanceId;

    public void setInstanceId(String instanceId) {
        this.instanceId = instanceId;
    }

    public StartFlowEvent(Object source, String flowCode, String businessId, Long companyId, String initiatorId, String approverId) {
        super(source);
        this.flowCode = flowCode;
        this.businessId = businessId;
        this.companyId = companyId;
        this.initiatorId = initiatorId;
        this.approverId = approverId;
    }
}
