| | | 1 | | using Newtonsoft.Json; |
| | | 2 | | |
| | | 3 | | namespace Services.ApiServices._1CApi.Models; |
| | | 4 | | |
| | | 5 | | public class GetStockByArticleResponse |
| | | 6 | | { |
| | | 7 | | [JsonProperty("success")] |
| | | 8 | | public bool Success { get; set; } |
| | | 9 | | |
| | | 10 | | [JsonProperty("error")] |
| | | 11 | | public string? Error { get; set; } |
| | | 12 | | |
| | | 13 | | [JsonProperty("items")] |
| | | 14 | | public List<GetStockByArticleItem>? Items { get; set; } = new(); |
| | | 15 | | } |
| | | 16 | | |
| | | 17 | | public class GetStockByArticleItem |
| | | 18 | | { |
| | | 19 | | [JsonProperty("Article")] |
| | | 20 | | public string? Article { get; set; } |
| | | 21 | | |
| | | 22 | | [JsonProperty("Name")] |
| | | 23 | | public string? Name { get; set; } |
| | | 24 | | |
| | | 25 | | [JsonProperty("Success")] |
| | | 26 | | public bool Success { get; set; } |
| | | 27 | | |
| | | 28 | | [JsonProperty("Message")] |
| | | 29 | | public string? Message { get; set; } |
| | | 30 | | |
| | | 31 | | [JsonProperty("TotalQuantity")] |
| | | 32 | | public decimal? TotalQuantity { get; set; } |
| | | 33 | | |
| | | 34 | | [JsonProperty("Stocks")] |
| | | 35 | | public List<OneCStockLine>? Stocks { get; set; } = new(); |
| | | 36 | | } |
| | | 37 | | |
| | | 38 | | public class OneCStockLine |
| | | 39 | | { |
| | | 40 | | [JsonProperty("Warehouse")] |
| | 33 | 41 | | public string? Warehouse { get; set; } |
| | | 42 | | |
| | | 43 | | [JsonProperty("Quantity")] |
| | 29 | 44 | | public decimal Quantity { get; set; } |
| | | 45 | | |
| | | 46 | | /// <summary>Учётная стоимость остатка (ресурс регистра). Null, если регистр количественный.</summary> |
| | | 47 | | [JsonProperty("Cost")] |
| | 1 | 48 | | public decimal? Cost { get; set; } |
| | | 49 | | |
| | | 50 | | /// <summary>Учётная цена за единицу: стоимость, делённая на количество.</summary> |
| | | 51 | | [JsonIgnore] |
| | 0 | 52 | | public decimal? UnitCost => Cost is > 0 && Quantity > 0 ? Cost / Quantity : null; |
| | | 53 | | } |