| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace OzonDomains.Models; |
| | | 5 | | |
| | | 6 | | [Table("ArmtekCartItems")] |
| | | 7 | | public sealed class ArmtekCartItem |
| | | 8 | | { |
| | | 9 | | public long Id { get; set; } |
| | | 10 | | [Required, MaxLength(20)] public string ProviderKey { get; set; } = string.Empty; |
| | | 11 | | public int StudioOrderId { get; set; } |
| | | 12 | | /// <summary>Заполняется, пока строка может участвовать в корзине; уникальный индекс защищает от дубля.</summary> |
| | | 13 | | public int? ActiveStudioOrderId { get; set; } |
| | | 14 | | public Order? StudioOrder { get; set; } |
| | | 15 | | [Required, MaxLength(40)] public string ArtId { get; set; } = string.Empty; |
| | | 16 | | [Required, MaxLength(40)] public string Pin { get; set; } = string.Empty; |
| | | 17 | | [Required, MaxLength(80)] public string Brand { get; set; } = string.Empty; |
| | | 18 | | [MaxLength(40)] public string? Keyzak { get; set; } |
| | | 19 | | [MaxLength(80)] public string? WarehouseName { get; set; } |
| | | 20 | | [MaxLength(40)] public string? PartnerWarehouseCode { get; set; } |
| | | 21 | | [MaxLength(120)] public string? ProductName { get; set; } |
| | | 22 | | /// <summary>KUNRG заказа Armtek: покупатель, под которым выполнялась проценка (связь склада отгрузки).</summary> |
| | | 23 | | [MaxLength(10)] public string? BuyerKunnr { get; set; } |
| | | 24 | | /// <summary>KUNZA заказа Armtek: адрес доставки, под которым выполнялась проценка.</summary> |
| | | 25 | | [MaxLength(10)] public string? DeliveryAddressKunnr { get; set; } |
| | | 26 | | /// <summary>Человекочитаемый адрес на момент добавления: getUserInfo может не ответить при оформлении.</summary> |
| | | 27 | | [MaxLength(200)] public string? DeliveryAddressName { get; set; } |
| | | 28 | | public decimal Quantity { get; set; } |
| | | 29 | | public decimal? SourcePrice { get; set; } |
| | | 30 | | [MaxLength(8)] public string CurrencyCode { get; set; } = "RUB"; |
| | | 31 | | public DateTime? DeliveryAtUtc { get; set; } |
| | | 32 | | [Required, MaxLength(30)] public string Status { get; set; } = ArmtekCartItemStatus.Pending; |
| | | 33 | | public string? TestResultJson { get; set; } |
| | | 34 | | [MaxLength(1000)] public string? LastError { get; set; } |
| | | 35 | | public DateTime? TestedAtUtc { get; set; } |
| | | 36 | | [MaxLength(450)] public string? CreatedBy { get; set; } |
| | | 37 | | public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow; |
| | | 38 | | public DateTime UpdatedAtUtc { get; set; } = DateTime.UtcNow; |
| | | 39 | | } |
| | | 40 | | |
| | | 41 | | public static class ArmtekCartItemStatus |
| | | 42 | | { |
| | | 43 | | public const string Pending = "Pending"; |
| | | 44 | | public const string Ready = "Ready"; |
| | | 45 | | public const string Processing = "Processing"; |
| | | 46 | | public const string Ordered = "Ordered"; |
| | | 47 | | public const string Failed = "Failed"; |
| | | 48 | | public const string Removed = "Removed"; |
| | 1 | 49 | | public static readonly string[] Active = [Pending, Ready, Processing, Failed]; |
| | | 50 | | } |