< Summary

Information
Class: Services.FeedPriceServices.FeedExplanation
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/FeedPriceServices/FeedExplanationModels.cs
Line coverage
100%
Covered lines: 21
Uncovered lines: 0
Coverable lines: 21
Total lines: 68
Line coverage: 100%
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_Cabinet()100%11100%
get_CabinetName()100%11100%
get_RunId()100%11100%
get_AssembledAt()100%11100%
get_AssembledBy()100%11100%
get_HasFullPlan()100%11100%
get_Found()100%11100%
get_Outcome()100%11100%
get_Decision()100%11100%
get_Reason()100%11100%
get_FinalPrice()100%11100%
get_OldPrice()100%11100%
get_MinPrice()100%11100%
get_PriceWarehouse()100%11100%
get_PriceSupplier()100%11100%
get_PurchasePrice()100%11100%
get_Multiplicity()100%11100%
get_ZeroedWarehouses()100%11100%
get_Formula()100%11100%
get_Ozon()100%11100%
get_Correction()100%11100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/FeedPriceServices/FeedExplanationModels.cs

#LineLine coverage
 1using Services.ApiServices.FidApi.Models;
 2
 3namespace Services.FeedPriceServices;
 4
 5/// <summary>Расшифровка цены позиции в одной сборке кабинета (план цен, сохранённый вместе со сборкой).</summary>
 6public sealed class FeedExplanation
 7{
 368    public string Cabinet { get; init; } = string.Empty;
 19    public string CabinetName => FeedCabinets.DisplayName(Cabinet);
 1710    public long RunId { get; init; }
 911    public DateTimeOffset AssembledAt { get; init; }
 2312    public string AssembledBy { get; init; } = string.Empty;
 13
 14    /// <summary>В плане сборки все позиции; у старых сборок только отправленные цены, позиции может не быть.</summary>
 815    public bool HasFullPlan { get; init; }
 16
 17    /// <summary>Позиция есть в плане этой сборки.</summary>
 2018    public bool Found { get; init; }
 19
 20    /// <summary>priced, annul-only, invalid, external, below-min.</summary>
 821    public string? Outcome { get; init; }
 22
 23    /// <summary>send, unchanged, skipped-no-price, skipped-invalid, skipped-external, skipped-below-min.</summary>
 924    public string? Decision { get; init; }
 25
 926    public string? Reason { get; init; }
 827    public decimal? FinalPrice { get; init; }
 828    public decimal? OldPrice { get; init; }
 829    public decimal? MinPrice { get; init; }
 930    public string? PriceWarehouse { get; init; }
 831    public string? PriceSupplier { get; init; }
 932    public decimal? PurchasePrice { get; init; }
 933    public int? Multiplicity { get; init; }
 34
 35    /// <summary>Склады, обнулённые у позиции минимальной ценой склада.</summary>
 2536    public IReadOnlyList<string> ZeroedWarehouses { get; init; } = Array.Empty<string>();
 37
 1238    public FidPriceFormula? Formula { get; init; }
 939    public FidPriceOzon? Ozon { get; init; }
 40
 41    /// <summary>Правки цен под правила Озона через «; »; null — правок не было.</summary>
 1042    public string? Correction { get; init; }
 43}
 44
 45/// <summary>Расшифровки позиции по сборкам кабинетов; ошибка возвращается в модели, чтобы окно не падало.</summary>
 46public sealed class FeedExplanationResult
 47{
 48    public string Key { get; init; } = string.Empty;
 49    public bool Found { get; init; }
 50    public IReadOnlyList<FeedExplanation> Explanations { get; init; } = Array.Empty<FeedExplanation>();
 51    public string? Error { get; init; }
 52}
 53
 54/// <summary>Расшифровка цены заказа: все кабинеты и выбранный по клиенту заказа.</summary>
 55public sealed class FeedOrderExplanation
 56{
 57    public FeedOrderState State { get; init; }
 58    public string? Key { get; init; }
 59    public string? Client { get; init; }
 60    public string? Cabinet { get; init; }
 61    public string? CabinetName => Cabinet is null ? null : FeedCabinets.DisplayName(Cabinet);
 62
 63    /// <summary>Сборка кабинета клиента заказа, в плане которой есть позиция; null — выбирать не из чего.</summary>
 64    public FeedExplanation? Selected { get; init; }
 65
 66    public IReadOnlyList<FeedExplanation> Explanations { get; init; } = Array.Empty<FeedExplanation>();
 67    public string? Error { get; init; }
 68}