using Hotline.FlowEngine.Definitions;
using Hotline.FlowEngine.Workflows;
using Hotline.Share.Dtos.FlowEngine;
using Hotline.Share.Dtos.FlowEngine.Workflow;
using Hotline.Share.Enums.FlowEngine;
using MediatR;
using XF.Domain.Entities;

namespace Hotline.FlowEngine.Notifications;

public record WorkflowNotify(Workflow Workflow, BasicWorkflowDto Dto) : INotification;

public record StartWorkflowNotify(Workflow Workflow, BasicWorkflowDto Dto, WorkflowTrace Trace) : WorkflowNotify(Workflow, Dto);

public record NextStepNotify(Workflow Workflow, BasicWorkflowDto Dto, WorkflowTrace Trace,
    StepDefine NextStepDefine, string HandlerOrgId, bool ExpiredTimeChanged) : WorkflowNotify(Workflow, Dto);

public record AcceptWorkflowNotify(Workflow Workflow) : INotification;

/// <summary>
/// 会签汇总节点已指派（该汇总节点可以被接办/办理）
/// </summary>
/// <param name="Workflow"></param>
public record CountersignEndAssigned(Workflow Workflow) : INotification;

public record CountersignStartAssigned(Workflow Workflow) : INotification;

public record PreviousNotify(Workflow Workflow, WorkflowStep TargetStep, PreviousWorkflowDto Dto, bool IsOrgToCenter) : INotification;

public record RecallNotify(Workflow Workflow, WorkflowStep TargetStep, BasicWorkflowDto Dto, bool IsOrgToCenter) : INotification;

public record JumpNotify(Workflow Workflow, WorkflowStep TargetStep, RecallDto Dto, FlowAssignInfo FlowAssignInfo, bool IsCenterToOrg, bool IsOrgToCenter) : INotification;

public record RedoNotify(Workflow Workflow, RecallDto Dto, bool IsOrgToCenter) : INotification;

///// <summary>
///// 否决（审批不通过）
///// </summary>
//public record RejectNotify(Workflow Workflow, BasicWorkflowDto Dto) : INotification;

public record EndWorkflowNotify(Workflow Workflow, WorkflowTrace Trace, BasicWorkflowDto Dto) : INotification;

public record TerminalWorkflowNotify(Workflow Workflow) : INotification;

/// <summary>
/// 撤销
/// </summary>
public record CancelWorkflowNotify(Workflow Workflow) : INotification;


