Files
git.stella-ops.org/src/Scheduler/__Libraries/StellaOps.Scheduler.Queue/Models/BatchSnapshotResult.cs
2026-01-06 19:07:48 +02:00

66 lines
1.8 KiB
C#

// -----------------------------------------------------------------------------
// BatchSnapshotResult.cs
// Sprint: SPRINT_20260105_002_002_SCHEDULER_hlc_queue_chain
// Task: SQC-013 - Implement BatchSnapshotService
// -----------------------------------------------------------------------------
using StellaOps.HybridLogicalClock;
namespace StellaOps.Scheduler.Queue.Models;
/// <summary>
/// Result of creating a batch snapshot.
/// </summary>
public sealed record BatchSnapshotResult
{
/// <summary>
/// Unique batch snapshot identifier.
/// </summary>
public required Guid BatchId { get; init; }
/// <summary>
/// Tenant this snapshot belongs to.
/// </summary>
public required string TenantId { get; init; }
/// <summary>
/// Start of the HLC range (inclusive).
/// </summary>
public required HlcTimestamp RangeStart { get; init; }
/// <summary>
/// End of the HLC range (inclusive).
/// </summary>
public required HlcTimestamp RangeEnd { get; init; }
/// <summary>
/// Chain head link at the end of this range.
/// </summary>
public required byte[] HeadLink { get; init; }
/// <summary>
/// Number of jobs included in this snapshot.
/// </summary>
public required int JobCount { get; init; }
/// <summary>
/// When the snapshot was created.
/// </summary>
public required DateTimeOffset CreatedAt { get; init; }
/// <summary>
/// Key ID of the signer (if signed).
/// </summary>
public string? SignedBy { get; init; }
/// <summary>
/// DSSE signature (if signed).
/// </summary>
public byte[]? Signature { get; init; }
/// <summary>
/// Whether this snapshot is signed.
/// </summary>
public bool IsSigned => SignedBy is not null && Signature is not null;
}