namespace KArtSell.BuildingBlocks.ReadModels;

public sealed record ProjectionCheckpoint(
    string ProjectionName,
    int ProjectionVersion,
    string SourceWatermark,
    Guid? LastEventId,
    string ContentHash,
    DateTimeOffset BuiltAt)
{
    public bool IsStale(DateTimeOffset now, TimeSpan maximumAge) => now - BuiltAt > maximumAge;
}

public sealed record ProjectionRebuildRequest(
    Guid RebuildId,
    string ProjectionName,
    int TargetVersion,
    string ThroughWatermark,
    bool DryRun,
    string RequestedBy,
    DateTimeOffset RequestedAt);
