using Svrnty.CQRS.Events.Abstractions;
using Svrnty.CQRS.Events.Abstractions.Models;
namespace Svrnty.Sample.Workflows;
///
/// Workflow for user invitation process (invite → accept/decline).
/// Manages event emission for multi-step invitation commands.
///
///
///
/// Multi-Step Workflow:
/// This workflow demonstrates a multi-step business process:
/// 1. InviteUserCommand → UserInvitedEvent
/// 2. AcceptInviteCommand → UserInviteAcceptedEvent (OR)
/// DeclineInviteCommand → UserInviteDeclinedEvent
///
///
/// Correlation:
/// In Phase 1, each command creates a new workflow instance.
/// Future phases will support workflow continuation where multiple commands
/// can participate in the same workflow instance using the workflow ID.
///
///
/// Events Emitted:
/// - when invitation is sent
/// - when invitation is accepted
/// - when invitation is declined
///
///
public class InvitationWorkflow : Workflow
{
// Helper methods for type-safe event emission
///
/// Emits a UserInvitedEvent within this workflow.
///
public void EmitInvited(UserInvitedEvent @event) => Emit(@event);
///
/// Emits a UserInviteAcceptedEvent within this workflow.
///
public void EmitAccepted(UserInviteAcceptedEvent @event) => Emit(@event);
///
/// Emits a UserInviteDeclinedEvent within this workflow.
///
public void EmitDeclined(UserInviteDeclinedEvent @event) => Emit(@event);
}