| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace OzonDomains.Models; |
| | | 5 | | |
| | | 6 | | [Table("ForumAutoCartItems")] |
| | | 7 | | public sealed class ForumAutoCartItem |
| | | 8 | | { |
| | 17 | 9 | | public long Id { get; set; } |
| | 25 | 10 | | [Required, MaxLength(20)] public string ProviderKey { get; set; } = string.Empty; |
| | 19 | 11 | | public int StudioOrderId { get; set; } |
| | | 12 | | /// <summary>Заполняется, пока строка может участвовать в корзине; уникальный индекс защищает от дубля.</summary> |
| | 15 | 13 | | public int? ActiveStudioOrderId { get; set; } |
| | 2 | 14 | | public Order? StudioOrder { get; set; } |
| | | 15 | | /// <summary>tid для addGoodsToOrder = gid из ответа listGoods.</summary> |
| | 29 | 16 | | [Required, MaxLength(60)] public string Tid { get; set; } = string.Empty; |
| | 31 | 17 | | [Required, MaxLength(40)] public string Article { get; set; } = string.Empty; |
| | 30 | 18 | | [Required, MaxLength(80)] public string Brand { get; set; } = string.Empty; |
| | 7 | 19 | | [MaxLength(160)] public string? ProductName { get; set; } |
| | 18 | 20 | | public decimal Quantity { get; set; } |
| | 15 | 21 | | public decimal? SourcePrice { get; set; } |
| | 28 | 22 | | [MaxLength(8)] public string CurrencyCode { get; set; } = "RUB"; |
| | 4 | 23 | | public DateTime? DeliveryAtUtc { get; set; } |
| | 42 | 24 | | [Required, MaxLength(30)] public string Status { get; set; } = ForumAutoCartItemStatus.Pending; |
| | 0 | 25 | | public string? TestResultJson { get; set; } |
| | 8 | 26 | | [MaxLength(1000)] public string? LastError { get; set; } |
| | 12 | 27 | | public DateTime? TestedAtUtc { get; set; } |
| | 2 | 28 | | [MaxLength(450)] public string? CreatedBy { get; set; } |
| | 11 | 29 | | public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow; |
| | 17 | 30 | | public DateTime UpdatedAtUtc { get; set; } = DateTime.UtcNow; |
| | | 31 | | } |
| | | 32 | | |
| | | 33 | | public static class ForumAutoCartItemStatus |
| | | 34 | | { |
| | | 35 | | public const string Pending = "Pending"; |
| | | 36 | | public const string Ready = "Ready"; |
| | | 37 | | public const string Processing = "Processing"; |
| | | 38 | | public const string Ordered = "Ordered"; |
| | | 39 | | public const string Failed = "Failed"; |
| | | 40 | | public const string Removed = "Removed"; |
| | | 41 | | public static readonly string[] Active = [Pending, Ready, Processing, Failed]; |
| | | 42 | | } |