using System; using System.Collections.Generic; namespace Svrnty.CQRS.Sagas.Abstractions; /// /// Provides context information during saga step execution. /// public interface ISagaContext { /// /// Unique identifier for this saga instance. /// Guid SagaId { get; } /// /// Correlation ID for tracing across services. /// Guid CorrelationId { get; } /// /// The fully qualified type name of the saga. /// string SagaType { get; } /// /// Index of the current step being executed. /// int CurrentStepIndex { get; } /// /// Name of the current step being executed. /// string CurrentStepName { get; } /// /// Results from completed steps, keyed by step name. /// IReadOnlyDictionary StepResults { get; } /// /// Gets a result from a previous step. /// /// The expected result type. /// The name of the step. /// The result, or default if not found. T? GetStepResult(string stepName); /// /// Sets a result for the current step (available to subsequent steps). /// /// The result type. /// The result value. void SetStepResult(T result); }