using System;
namespace Svrnty.CQRS.Sagas.Abstractions.Messaging;
///
/// Response message from a saga step execution.
///
public record SagaStepResponse
{
///
/// Unique identifier for this response.
///
public Guid MessageId { get; init; } = Guid.NewGuid();
///
/// The saga instance ID.
///
public Guid SagaId { get; init; }
///
/// Correlation ID for tracing across services.
///
public Guid CorrelationId { get; init; }
///
/// Name of the saga step that this response is for.
///
public string StepName { get; init; } = string.Empty;
///
/// Whether the step executed successfully.
///
public bool Success { get; init; }
///
/// Fully qualified type name of the result (if any).
///
public string? ResultType { get; init; }
///
/// Serialized result payload (JSON).
///
public string? ResultPayload { get; init; }
///
/// Error message if the step failed.
///
public string? ErrorMessage { get; init; }
///
/// Stack trace if the step failed (for debugging).
///
public string? StackTrace { get; init; }
///
/// When the response was created.
///
public DateTimeOffset Timestamp { get; init; } = DateTimeOffset.UtcNow;
}