| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace OzonDomains.Models; |
| | | 5 | | |
| | | 6 | | [Table("BitrixStockUnarchiveExecutions")] |
| | | 7 | | public class BitrixStockUnarchiveExecution |
| | | 8 | | { |
| | | 9 | | [Key] |
| | | 10 | | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
| | 0 | 11 | | public long Id { get; set; } |
| | | 12 | | |
| | | 13 | | [Required] |
| | | 14 | | [MaxLength(64)] |
| | 0 | 15 | | public string JobId { get; set; } = string.Empty; |
| | | 16 | | |
| | | 17 | | [MaxLength(100)] |
| | 0 | 18 | | public string? HangfireJobId { get; set; } |
| | | 19 | | |
| | | 20 | | [Required] |
| | | 21 | | [MaxLength(50)] |
| | 0 | 22 | | public string Status { get; set; } = BitrixStockUnarchiveExecutionStatus.Running; |
| | | 23 | | |
| | | 24 | | [Required] |
| | | 25 | | [MaxLength(50)] |
| | 0 | 26 | | public string TriggerType { get; set; } = "Manual"; |
| | | 27 | | |
| | 0 | 28 | | public DateTime StartedAt { get; set; } = DateTime.UtcNow; |
| | | 29 | | |
| | 0 | 30 | | public DateTime? CompletedAt { get; set; } |
| | | 31 | | |
| | 0 | 32 | | public long? DurationMs { get; set; } |
| | | 33 | | |
| | 0 | 34 | | public int TotalItems { get; set; } |
| | | 35 | | |
| | 0 | 36 | | public int SuccessCount { get; set; } |
| | | 37 | | |
| | 0 | 38 | | public int FailedCount { get; set; } |
| | | 39 | | |
| | | 40 | | [MaxLength(450)] |
| | 0 | 41 | | public string? TriggeredByUserId { get; set; } |
| | | 42 | | |
| | | 43 | | [MaxLength(256)] |
| | 0 | 44 | | public string? TriggeredByUserName { get; set; } |
| | | 45 | | |
| | 0 | 46 | | public string? ErrorMessage { get; set; } |
| | | 47 | | |
| | 0 | 48 | | public virtual ICollection<BitrixStockUnarchiveItem> Items { get; set; } = new List<BitrixStockUnarchiveItem>(); |
| | | 49 | | } |
| | | 50 | | |
| | | 51 | | public static class BitrixStockUnarchiveExecutionStatus |
| | | 52 | | { |
| | | 53 | | public const string Running = "Running"; |
| | | 54 | | public const string Success = "Success"; |
| | | 55 | | public const string Failed = "Failed"; |
| | | 56 | | public const string PartialSuccess = "PartialSuccess"; |
| | | 57 | | } |
| | | 58 | | |
| | | 59 | | public static class BitrixStockUnarchiveItemStatus |
| | | 60 | | { |
| | | 61 | | public const string Pending = "Pending"; |
| | | 62 | | public const string Success = "Success"; |
| | | 63 | | public const string Failed = "Failed"; |
| | | 64 | | public const string Skipped = "Skipped"; |
| | | 65 | | } |