| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace OzonDomains.Models; |
| | | 5 | | |
| | | 6 | | [Table("TransactionTimeTrackingSessions")] |
| | | 7 | | public class TransactionTimeTrackingSession |
| | | 8 | | { |
| | | 9 | | [Key] |
| | | 10 | | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
| | | 11 | | public long Id { get; set; } |
| | | 12 | | |
| | | 13 | | [Required] |
| | | 14 | | [MaxLength(64)] |
| | | 15 | | public string TrackingKey { get; set; } = string.Empty; |
| | | 16 | | |
| | | 17 | | [Required] |
| | | 18 | | [MaxLength(256)] |
| | | 19 | | public string UserName { get; set; } = string.Empty; |
| | | 20 | | |
| | | 21 | | public int? AccessProfileId { get; set; } |
| | | 22 | | |
| | | 23 | | [Required] |
| | | 24 | | [MaxLength(64)] |
| | | 25 | | public string TransactionType { get; set; } = string.Empty; |
| | | 26 | | |
| | | 27 | | public int OrdersCountInitial { get; set; } |
| | | 28 | | |
| | | 29 | | [Column(TypeName = "longtext")] |
| | | 30 | | public string? OrderIdsJson { get; set; } |
| | | 31 | | |
| | | 32 | | public DateTime StartedAtUtc { get; set; } = DateTime.UtcNow; |
| | | 33 | | public DateTime? LastSeenAtUtc { get; set; } |
| | | 34 | | public bool IsCompleted { get; set; } |
| | | 35 | | public DateTime? CompletedAtUtc { get; set; } |
| | | 36 | | public bool IsAbandoned { get; set; } |
| | | 37 | | |
| | | 38 | | [MaxLength(1000)] |
| | | 39 | | public string? SourceUrl { get; set; } |
| | | 40 | | |
| | | 41 | | [MaxLength(64)] |
| | | 42 | | public string? ClientIp { get; set; } |
| | | 43 | | |
| | | 44 | | [MaxLength(512)] |
| | | 45 | | public string? UserAgent { get; set; } |
| | | 46 | | |
| | | 47 | | public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow; |
| | | 48 | | } |
| | | 49 | | |
| | | 50 | | [Table("TransactionTimeTrackingResults")] |
| | | 51 | | public class TransactionTimeTrackingResult |
| | | 52 | | { |
| | | 53 | | [Key] |
| | | 54 | | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
| | 9 | 55 | | public long Id { get; set; } |
| | | 56 | | |
| | 9 | 57 | | public long? TrackingSessionId { get; set; } |
| | | 58 | | |
| | | 59 | | [Required] |
| | | 60 | | [MaxLength(64)] |
| | 17 | 61 | | public string TrackingKey { get; set; } = string.Empty; |
| | | 62 | | |
| | | 63 | | [Required] |
| | | 64 | | [MaxLength(256)] |
| | 18 | 65 | | public string UserName { get; set; } = string.Empty; |
| | | 66 | | |
| | 9 | 67 | | public int? AccessProfileId { get; set; } |
| | | 68 | | |
| | | 69 | | [Required] |
| | | 70 | | [MaxLength(64)] |
| | 18 | 71 | | public string TransactionType { get; set; } = string.Empty; |
| | | 72 | | |
| | 11 | 73 | | public int OrdersCountFinal { get; set; } |
| | 9 | 74 | | public DateTime StartedAtUtc { get; set; } |
| | 9 | 75 | | public DateTime CompletedAtUtc { get; set; } |
| | 12 | 76 | | public int DurationSeconds { get; set; } |
| | 11 | 77 | | public long TransactionId { get; set; } |
| | | 78 | | |
| | | 79 | | [Required] |
| | | 80 | | [MaxLength(1000)] |
| | 17 | 81 | | public string TransactionUrl { get; set; } = string.Empty; |
| | | 82 | | |
| | | 83 | | [MaxLength(1000)] |
| | 11 | 84 | | public string? Comment { get; set; } |
| | | 85 | | |
| | 16 | 86 | | public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow; |
| | | 87 | | |
| | | 88 | | [ForeignKey(nameof(TrackingSessionId))] |
| | 0 | 89 | | public virtual TransactionTimeTrackingSession? TrackingSession { get; set; } |
| | | 90 | | } |