QueueJob - model and DB migration

This commit is contained in:
Michał Zieliski
2024-08-25 16:45:36 +02:00
parent adc3ba0c4b
commit ae266ed50e
9 changed files with 578 additions and 12 deletions

View File

@@ -11,7 +11,8 @@ public enum LogType {
Backup,
Process,
PowerBi,
DataInbox
DataInbox,
Queue
}
public class LogEntry
{

29
WebAPI/Models/QueueJob.cs Normal file
View File

@@ -0,0 +1,29 @@
using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography.X509Certificates;
namespace WebAPI.Models;
public enum JobStatus
{
New,
Failed,
Success
}
public enum JobType
{
ImportWorker,
ProcessWorker
}
public class QueueJob
{
[Key] public Guid Id { get; set; }
[Required] public Guid LayerId { get; set; }
[Required] public int Attempts { get; set; }
[Required] public JobStatus Status { get; set; } = JobStatus.New;
[Required] public JobType Type { get; set; } = JobType.ImportWorker;
public string Message { get; set; } = string.Empty;
[Required] public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
[Required] public DateTime ModifiedAt { get; set; } = DateTime.UtcNow;
}