package com.qqchen.deploy.backend.workflow.dto;

import com.qqchen.deploy.backend.framework.dto.BaseDTO;
import com.qqchen.deploy.backend.workflow.enums.WorkflowNodeInstanceStatusEnums;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Map;

@Data
public class WorkflowNodeInstanceDTO extends BaseDTO {

    // 注意：id, createTime, updateTime 继承自 BaseDTO

    private String processInstanceId;

    private String executionId;

    private String nodeId;

    private String nodeName;

    private String nodeType;

    private WorkflowNodeInstanceStatusEnums status;

    private LocalDateTime startTime;

    private LocalDateTime endTime;

    /**
     * 执行时长（毫秒）
     * 如果节点未执行或正在执行，则为null
     */
    private Long duration;

    /**
     * 错误信息
     * 当节点执行失败时，记录失败原因
     */
    private String errorMessage;

    /**
     * 节点执行结果（outputs）
     * 从流程变量中获取，格式：{nodeId: {outputs: {...}}}
     * 例如：审批节点的 outputs 包含 approvalResult、approver、approvalTime 等
     */
    private Map<String, Object> outputs;
}
