namespace ZB.MOM.WW.CBDDC.Persistence.Snapshot; /// /// Root DTO for CBDDC snapshots (JSON format). /// public class SnapshotDto { /// /// Gets or sets the snapshot format version. /// public string Version { get; set; } = "1.0"; /// /// Gets or sets the snapshot creation timestamp. /// public string CreatedAt { get; set; } = ""; /// /// Gets or sets the source node identifier. /// public string NodeId { get; set; } = ""; /// /// Gets or sets the dataset identifier represented by this snapshot payload. /// public string DatasetId { get; set; } = "primary"; /// /// Gets or sets the serialized document records. /// public List Documents { get; set; } = new(); /// /// Gets or sets the serialized oplog entries. /// public List Oplog { get; set; } = new(); /// /// Gets or sets the snapshot metadata entries. /// public List SnapshotMetadata { get; set; } = new(); /// /// Gets or sets the remote peer configurations in the snapshot. /// public List RemotePeers { get; set; } = new(); /// /// Gets or sets peer oplog confirmation records in the snapshot. /// public List PeerConfirmations { get; set; } = new(); } public class DocumentDto { /// /// Gets or sets the dataset identifier. /// public string DatasetId { get; set; } = "primary"; /// /// Gets or sets the document collection name. /// public string Collection { get; set; } = ""; /// /// Gets or sets the document key. /// public string Key { get; set; } = ""; /// /// Gets or sets the serialized document payload. /// public string? JsonData { get; set; } /// /// Gets or sets a value indicating whether the document is deleted. /// public bool IsDeleted { get; set; } /// /// Gets or sets the HLC wall-clock component. /// public long HlcWall { get; set; } /// /// Gets or sets the HLC logical counter component. /// public int HlcLogic { get; set; } /// /// Gets or sets the HLC node component. /// public string HlcNode { get; set; } = ""; } public class OplogDto { /// /// Gets or sets the dataset identifier. /// public string DatasetId { get; set; } = "primary"; /// /// Gets or sets the collection associated with the operation. /// public string Collection { get; set; } = ""; /// /// Gets or sets the key associated with the operation. /// public string Key { get; set; } = ""; /// /// Gets or sets the operation code. /// public int Operation { get; set; } /// /// Gets or sets the serialized operation payload. /// public string? JsonData { get; set; } /// /// Gets or sets the HLC wall-clock component. /// public long HlcWall { get; set; } /// /// Gets or sets the HLC logical counter component. /// public int HlcLogic { get; set; } /// /// Gets or sets the HLC node component. /// public string HlcNode { get; set; } = ""; /// /// Gets or sets the current entry hash. /// public string Hash { get; set; } = ""; /// /// Gets or sets the previous entry hash. /// public string? PreviousHash { get; set; } } public class SnapshotMetadataDto { /// /// Gets or sets the dataset identifier. /// public string DatasetId { get; set; } = "primary"; /// /// Gets or sets the node identifier. /// public string NodeId { get; set; } = ""; /// /// Gets or sets the HLC wall-clock component. /// public long HlcWall { get; set; } /// /// Gets or sets the HLC logical counter component. /// public int HlcLogic { get; set; } /// /// Gets or sets the metadata hash. /// public string Hash { get; set; } = ""; } public class RemotePeerDto { /// /// Gets or sets the remote node identifier. /// public string NodeId { get; set; } = ""; /// /// Gets or sets the remote peer address. /// public string Address { get; set; } = ""; /// /// Gets or sets the peer type. /// public int Type { get; set; } /// /// Gets or sets a value indicating whether the peer is enabled. /// public bool IsEnabled { get; set; } } public class PeerOplogConfirmationDto { /// /// Gets or sets the dataset identifier. /// public string DatasetId { get; set; } = "primary"; /// /// Gets or sets the tracked peer node identifier. /// public string PeerNodeId { get; set; } = ""; /// /// Gets or sets the source node identifier. /// public string SourceNodeId { get; set; } = ""; /// /// Gets or sets the confirmed HLC wall-clock component. /// public long ConfirmedWall { get; set; } /// /// Gets or sets the confirmed HLC logical counter component. /// public int ConfirmedLogic { get; set; } /// /// Gets or sets the confirmed oplog hash. /// public string ConfirmedHash { get; set; } = ""; /// /// Gets or sets the last-confirmed timestamp in Unix milliseconds. /// public long LastConfirmedUtcMs { get; set; } /// /// Gets or sets a value indicating whether the tracked peer is active. /// public bool IsActive { get; set; } }