< Summary

Information
Class: Services.ApiServices._1CApi.Models.GetStockByArticleItem
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/1CApi/Models/GetStockByArticleModels.cs
Line coverage
83%
Covered lines: 5
Uncovered lines: 1
Coverable lines: 6
Total lines: 53
Line coverage: 83.3%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Article()100%11100%
get_Name()100%210%
get_Success()100%11100%
get_Message()100%11100%
get_TotalQuantity()100%11100%
get_Stocks()100%11100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/1CApi/Models/GetStockByArticleModels.cs

#LineLine coverage
 1using Newtonsoft.Json;
 2
 3namespace Services.ApiServices._1CApi.Models;
 4
 5public 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
 17public class GetStockByArticleItem
 18{
 19    [JsonProperty("Article")]
 1920    public string? Article { get; set; }
 21
 22    [JsonProperty("Name")]
 023    public string? Name { get; set; }
 24
 25    [JsonProperty("Success")]
 1926    public bool Success { get; set; }
 27
 28    [JsonProperty("Message")]
 229    public string? Message { get; set; }
 30
 31    [JsonProperty("TotalQuantity")]
 1732    public decimal? TotalQuantity { get; set; }
 33
 34    [JsonProperty("Stocks")]
 3235    public List<OneCStockLine>? Stocks { get; set; } = new();
 36}
 37
 38public class OneCStockLine
 39{
 40    [JsonProperty("Warehouse")]
 41    public string? Warehouse { get; set; }
 42
 43    [JsonProperty("Quantity")]
 44    public decimal Quantity { get; set; }
 45
 46    /// <summary>Учётная стоимость остатка (ресурс регистра). Null, если регистр количественный.</summary>
 47    [JsonProperty("Cost")]
 48    public decimal? Cost { get; set; }
 49
 50    /// <summary>Учётная цена за единицу: стоимость, делённая на количество.</summary>
 51    [JsonIgnore]
 52    public decimal? UnitCost => Cost is > 0 && Quantity > 0 ? Cost / Quantity : null;
 53}