using Svrnty.CQRS.Events.Abstractions;
using Svrnty.Sample.Events;
using Svrnty.CQRS.Events.Abstractions.Models;
namespace Svrnty.Sample.Workflows;
///
/// Workflow for user lifecycle operations (add, remove, update).
/// Manages event emission for all user-related commands.
///
///
///
/// Workflow Pattern:
/// This workflow represents the lifecycle of user entities in the system.
/// Each workflow instance corresponds to operations on a specific user or user-related process.
///
///
/// Events Emitted:
/// - when a user is added
/// - when a user is removed
///
///
/// Phase 1 Behavior:
/// Currently, each command creates a new workflow instance with a unique ID.
/// Future phases will support workflow continuation for tracking user state over time.
///
///
public class UserWorkflow : Workflow
{
// No custom properties or methods needed for Phase 1
// Developers call the base Emit() method directly
// Or create helper methods for type safety:
///
/// Emits a UserAddedEvent within this workflow.
///
public void EmitAdded(UserAddedEvent @event) => Emit(@event);
///
/// Emits a UserRemovedEvent within this workflow.
///
public void EmitRemoved(UserRemovedEvent @event) => Emit(@event);
}