This commit is contained in:
2026-03-20 11:57:16 +01:00
parent a10c8238f8
commit e02e1c5bc3
5 changed files with 46 additions and 46 deletions
+37
View File
@@ -0,0 +1,37 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Musify.Domain.Entities
{
#pragma warning disable CS8618
[Table("JobExecution")]
public class JobOperation
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
public required Guid JobId { get; set; }
[Required]
public JobState JobState { get; set; } = JobState.Pending;
[NotMapped]
public bool IsCompleted => JobState == JobState.Completed;
[NotMapped]
public bool IsFailed => JobState == JobState.Failed;
[NotMapped]
public bool IsPending => JobState == JobState.Pending;
[Required]
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
[Required]
public DateTime FinishedAt { get; set; }
[ForeignKey(nameof(JobId)) ]
public Job Job { get; set; }
}
}