using System;
using System.Threading;

namespace StellaOps.Scanner.Worker.Processing;

public sealed class ScanJobContext
{
    public ScanJobContext(IScanJobLease lease, TimeProvider timeProvider, DateTimeOffset startUtc, CancellationToken cancellationToken)
    {
        Lease = lease ?? throw new ArgumentNullException(nameof(lease));
        TimeProvider = timeProvider ?? throw new ArgumentNullException(nameof(timeProvider));
        StartUtc = startUtc;
        CancellationToken = cancellationToken;
    }

    public IScanJobLease Lease { get; }

    public TimeProvider TimeProvider { get; }

    public DateTimeOffset StartUtc { get; }

    public CancellationToken CancellationToken { get; }

    public string JobId => Lease.JobId;

    public string ScanId => Lease.ScanId;
}
