// // Copyright (c) StellaOps. Licensed under AGPL-3.0-or-later. // using StellaOps.HybridLogicalClock; namespace StellaOps.AirGap.Sync.Models; /// /// Result of merging job logs from multiple offline nodes. /// public sealed record MergeResult { /// /// Gets the merged entries in HLC total order. /// public required IReadOnlyList MergedEntries { get; init; } /// /// Gets duplicate entries that were dropped during merge. /// public required IReadOnlyList Duplicates { get; init; } /// /// Gets the merged chain head (final link after merge). /// public byte[]? MergedChainHead { get; init; } /// /// Gets the source node IDs that contributed to this merge. /// public required IReadOnlyList SourceNodes { get; init; } } /// /// A job entry after merge with unified chain link. /// public sealed class MergedJobEntry { /// /// Gets or sets the source node ID that created this entry. /// public required string SourceNodeId { get; set; } /// /// Gets or sets the HLC timestamp. /// public required HlcTimestamp THlc { get; set; } /// /// Gets or sets the job ID. /// public required Guid JobId { get; set; } /// /// Gets or sets the partition key. /// public string? PartitionKey { get; set; } /// /// Gets or sets the serialized payload. /// public required string Payload { get; set; } /// /// Gets or sets the payload hash. /// public required byte[] PayloadHash { get; set; } /// /// Gets or sets the original chain link from the source node. /// public required byte[] OriginalLink { get; set; } /// /// Gets or sets the merged chain link (computed during merge). /// public byte[]? MergedLink { get; set; } } /// /// Represents a duplicate entry dropped during merge. /// public sealed record DuplicateEntry( Guid JobId, string NodeId, HlcTimestamp THlc);