using KArtSell.BuildingBlocks.Versioning;

namespace KArtSell.BuildingBlocks.Reliability;

public enum JobRunStatus
{
    Requested,
    Running,
    Succeeded,
    BusinessHold,
    Quarantined,
    Failed,
    DeadLettered
}

public sealed record JobRunStart(
    Guid JobRunId,
    string JobType,
    int JobVersion,
    string ScopeKey,
    string IdempotencyKey,
    string? Watermark,
    VersionSet VersionSet,
    string? InputHash,
    string TraceId,
    DateTimeOffset RequestedAt);

public sealed record JobRunCompletion(
    Guid JobRunId,
    JobRunStatus Status,
    string? OutputHash,
    string? Watermark,
    string? ErrorCode,
    DateTimeOffset FinishedAt);
