< Summary

Information
Class: Services.ApiServices.ArmtekApi.Models.Envelope.ArmtekResponse<T>
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/ArmtekApi/Models/Envelope/ArmtekResponse.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 18
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Status()100%11100%
get_Messages()100%11100%
get_Resp()100%11100%
get_HasErrors()100%44100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/ApiServices/ArmtekApi/Models/Envelope/ArmtekResponse.cs

#LineLine coverage
 1using Newtonsoft.Json;
 2
 3namespace Services.ApiServices.ArmtekApi.Models.Envelope;
 4
 5/// <summary>
 6/// Обёртка ответа Armtek Web-Services: {"STATUS":200,"MESSAGES":[...],"RESP":...}.
 7/// Бизнес-ошибки (например, "заказ типа Возврат не обрабатывается этим методом") приходят
 8/// с STATUS 200 — ошибка видна только в MESSAGES[].TYPE. RESP может быть null (пустая выборка)
 9/// либо частично заполнен вместе с MESSAGES[E] (например, таймаут getOrder2?STATUS=1).
 10/// </summary>
 11public class ArmtekResponse<T>
 12{
 15113    [JsonProperty("STATUS")] public int Status { get; set; }
 38914    [JsonProperty("MESSAGES")] public List<ArmtekMessage> Messages { get; set; } = new();
 34815    [JsonProperty("RESP")] public T? Resp { get; set; }
 16
 11617    [JsonIgnore] public bool HasErrors => Messages.Any(m => m.Type is "E" or "A");
 18}