| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace OzonDomains.Models; |
| | | 5 | | |
| | | 6 | | /// <summary>Зеркало позиции реальной корзины Nikei, добавленной из Studio2.</summary> |
| | | 7 | | [Table("NikeiCartItems")] |
| | | 8 | | public sealed class NikeiCartItem |
| | | 9 | | { |
| | 45 | 10 | | public long Id { get; set; } |
| | 69 | 11 | | public int StudioOrderId { get; set; } |
| | 75 | 12 | | public int? ActiveStudioOrderId { get; set; } |
| | 3 | 13 | | public Order? StudioOrder { get; set; } |
| | | 14 | | |
| | | 15 | | /// <summary>Токен из проценки, допустимый только для POST /account/cart/add.</summary> |
| | 105 | 16 | | [Required] public string ToCart { get; set; } = string.Empty; |
| | | 17 | | /// <summary>Токен позиции внешней корзины, используемый в /account/order/create.</summary> |
| | 64 | 18 | | [MaxLength(128)] public string? ToOrder { get; set; } |
| | 13 | 19 | | [MaxLength(128)] public string? ProductKey { get; set; } |
| | 105 | 20 | | [Required, MaxLength(60)] public string Article { get; set; } = string.Empty; |
| | 105 | 21 | | [Required, MaxLength(120)] public string Brand { get; set; } = string.Empty; |
| | 13 | 22 | | [MaxLength(250)] public string? ProductName { get; set; } |
| | 27 | 23 | | [MaxLength(250)] public string? WarehouseName { get; set; } |
| | 13 | 24 | | public int Quantity { get; set; } |
| | 68 | 25 | | public int Multiplicity { get; set; } = 1; |
| | 13 | 26 | | public int? Stock { get; set; } |
| | 13 | 27 | | public decimal? SourcePrice { get; set; } |
| | 23 | 28 | | public int? DeliveryDaysMin { get; set; } |
| | 23 | 29 | | public int? DeliveryDaysMax { get; set; } |
| | 13 | 30 | | [MaxLength(1000)] public string? Comment { get; set; } |
| | 122 | 31 | | [Required, MaxLength(30)] public string Status { get; set; } = NikeiCartItemStatus.Pending; |
| | 11 | 32 | | [MaxLength(80)] public string? ExternalOrderNumber { get; set; } |
| | 10 | 33 | | [MaxLength(1000)] public string? LastError { get; set; } |
| | 13 | 34 | | [MaxLength(450)] public string? CreatedBy { get; set; } |
| | 58 | 35 | | public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow; |
| | 70 | 36 | | public DateTime UpdatedAtUtc { get; set; } = DateTime.UtcNow; |
| | | 37 | | } |
| | | 38 | | |
| | | 39 | | public static class NikeiCartItemStatus |
| | | 40 | | { |
| | | 41 | | public const string Pending = "Pending"; |
| | | 42 | | public const string Ordered = "Ordered"; |
| | | 43 | | public const string Failed = "Failed"; |
| | | 44 | | public const string Removed = "Removed"; |
| | | 45 | | public static readonly string[] Active = [Pending, Failed]; |
| | | 46 | | } |