| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace OzonDomains.Models; |
| | | 5 | | |
| | | 6 | | [Table("EmailRoutingJobExecutions")] |
| | | 7 | | public class EmailRoutingJobExecution |
| | | 8 | | { |
| | | 9 | | [Key] |
| | | 10 | | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
| | 0 | 11 | | public long Id { get; set; } |
| | | 12 | | |
| | | 13 | | [Required] |
| | | 14 | | [MaxLength(32)] |
| | 7 | 15 | | public string TriggerType { get; set; } = EmailRoutingJobTriggerType.Scheduled; |
| | | 16 | | |
| | | 17 | | [Required] |
| | | 18 | | [MaxLength(32)] |
| | 14 | 19 | | public string Status { get; set; } = EmailRoutingJobExecutionStatus.Running; |
| | | 20 | | |
| | 14 | 21 | | public DateTime StartedAtUtc { get; set; } = DateTime.UtcNow; |
| | | 22 | | |
| | 0 | 23 | | public DateTime? CompletedAtUtc { get; set; } |
| | | 24 | | |
| | 0 | 25 | | public int BatchesProcessed { get; set; } |
| | | 26 | | |
| | 0 | 27 | | public int MessagesProcessed { get; set; } |
| | | 28 | | |
| | 0 | 29 | | public int AttachmentsUploaded { get; set; } |
| | | 30 | | |
| | 0 | 31 | | public int AttachmentsRejected { get; set; } |
| | | 32 | | |
| | 0 | 33 | | public int AttachmentsDuplicate { get; set; } |
| | | 34 | | |
| | 0 | 35 | | public int AttachmentsFailed { get; set; } |
| | | 36 | | |
| | 0 | 37 | | public int AttachmentsPending { get; set; } |
| | | 38 | | |
| | | 39 | | [MaxLength(64)] |
| | 0 | 40 | | public string? HangfireJobId { get; set; } |
| | | 41 | | |
| | | 42 | | [MaxLength(2000)] |
| | 0 | 43 | | public string? Summary { get; set; } |
| | | 44 | | |
| | | 45 | | [MaxLength(2000)] |
| | 0 | 46 | | public string? ErrorMessage { get; set; } |
| | | 47 | | } |
| | | 48 | | |
| | | 49 | | public static class EmailRoutingJobExecutionStatus |
| | | 50 | | { |
| | | 51 | | public const string Running = "Running"; |
| | | 52 | | public const string Success = "Success"; |
| | | 53 | | public const string Failed = "Failed"; |
| | | 54 | | public const string Skipped = "Skipped"; |
| | | 55 | | } |
| | | 56 | | |
| | | 57 | | public static class EmailRoutingJobTriggerType |
| | | 58 | | { |
| | | 59 | | public const string Scheduled = "Scheduled"; |
| | | 60 | | public const string Manual = "Manual"; |
| | | 61 | | } |