using JSMR.Domain.Enums;

namespace JSMR.Domain.Entities;

public sealed class Job
{
    public int Id { get; set; }

    public string Code { get; set; } = null!;
    public JobStatus Status { get; set; }

    public string? RequestedByUserId { get; set; }
    public string RequestedSource { get; set; } = "Manual";

    public string? ParametersJson { get; set; }

    public DateTime CreatedUtc { get; set; }
    public DateTime? StartedUtc { get; set; }
    public DateTime? CompletedUtc { get; set; }
    public DateTime? HeartbeatUtc { get; set; }

    public string? WorkerName { get; set; }
    public string? CurrentStep { get; set; }

    public int? ProgressCurrent { get; set; }
    public int? ProgressTotal { get; set; }

    public string? ResultSummary { get; set; }
    public string? Error { get; set; }

    public bool CancellationRequested { get; set; }
    public int AttemptCount { get; set; }
}