using System; using System.Collections.Generic; namespace Svrnty.CQRS.Sagas.Abstractions.Messaging; /// /// Message envelope for saga commands sent to remote services. /// public record SagaMessage { /// /// Unique identifier for this message. /// 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 sent this message. /// public string StepName { get; init; } = string.Empty; /// /// Fully qualified type name of the command. /// public string CommandType { get; init; } = string.Empty; /// /// Serialized command payload (JSON). /// public string? Payload { get; init; } /// /// When the message was created. /// public DateTimeOffset Timestamp { get; init; } = DateTimeOffset.UtcNow; /// /// Additional headers for the message. /// public Dictionary Headers { get; init; } = new(); /// /// Whether this is a compensation command. /// public bool IsCompensation { get; init; } }