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

import com.qqchen.deploy.backend.workflow.enums.ApprovalResultEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 审批节点输出
 *
 * @author qqchen
 * @date 2025-10-23
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ApprovalOutputs extends BaseNodeOutputs {

    /**
     * 审批结果
     */
    private ApprovalResultEnum approvalResult;

    /**
     * 审批人姓名
     */
    private String approver;

    /**
     * 审批人ID
     */
    private Long approverUserId;

    /**
     * 审批时间
     */
    private LocalDateTime approvalTime;

    /**
     * 审批意见
     */
    private String approvalComment;

    /**
     * 审批用时（秒）
     */
    private Long approvalDuration;

    /**
     * 所有审批人列表（会签/或签时）
     */
    private List<ApproverInfo> allApprovers;

    /**
     * 审批人信息
     */
    @Data
    public static class ApproverInfo {

        private Long userId;

        private String userName;

        private String result;

        private String comment;

        private LocalDateTime time;
    }
}
