using System.ComponentModel; using System.ComponentModel.DataAnnotations; using API.Workers; namespace API.Controllers.DTOs; /// /// DTO /// public record Worker(string Key, IEnumerable Dependencies, IEnumerable MissingDependencies, bool DependenciesFulfilled, WorkerExecutionState State) : Identifiable(Key) { /// /// Workers this worker depends on having ran. /// [Required] [Description("Workers this worker depends on having ran.")] public IEnumerable Dependencies { get; init; } = Dependencies; /// /// Workers that have not yet ran, that need to run for this Worker to run. /// [Required] [Description("Workers that have not yet ran, that need to run for this Worker to run.")] public IEnumerable MissingDependencies { get; init; } = MissingDependencies; /// /// Worker can run. /// [Required] [Description("Worker can run.")] public bool DependenciesFulfilled { get; init; } = DependenciesFulfilled; /// /// Execution state of the Worker. /// [Required] [Description("Execution state of the Worker.")] public WorkerExecutionState State { get; init; } = State; }