< Summary

Information
Class: Services.FeedPriceServices.FeedExplanationResult
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/FeedPriceServices/FeedExplanationModels.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
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_Key()100%11100%
get_Found()100%11100%
get_Explanations()100%11100%
get_Error()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{
 8    public string Cabinet { get; init; } = string.Empty;
 9    public string CabinetName => FeedCabinets.DisplayName(Cabinet);
 10    public long RunId { get; init; }
 11    public DateTimeOffset AssembledAt { get; init; }
 12    public string AssembledBy { get; init; } = string.Empty;
 13
 14    /// <summary>В плане сборки все позиции; у старых сборок только отправленные цены, позиции может не быть.</summary>
 15    public bool HasFullPlan { get; init; }
 16
 17    /// <summary>Позиция есть в плане этой сборки.</summary>
 18    public bool Found { get; init; }
 19
 20    /// <summary>priced, annul-only, invalid, external, below-min.</summary>
 21    public string? Outcome { get; init; }
 22
 23    /// <summary>send, unchanged, skipped-no-price, skipped-invalid, skipped-external, skipped-below-min.</summary>
 24    public string? Decision { get; init; }
 25
 26    public string? Reason { get; init; }
 27    public decimal? FinalPrice { get; init; }
 28    public decimal? OldPrice { get; init; }
 29    public decimal? MinPrice { get; init; }
 30    public string? PriceWarehouse { get; init; }
 31    public string? PriceSupplier { get; init; }
 32    public decimal? PurchasePrice { get; init; }
 33    public int? Multiplicity { get; init; }
 34
 35    /// <summary>Склады, обнулённые у позиции минимальной ценой склада.</summary>
 36    public IReadOnlyList<string> ZeroedWarehouses { get; init; } = Array.Empty<string>();
 37
 38    public FidPriceFormula? Formula { get; init; }
 39    public FidPriceOzon? Ozon { get; init; }
 40
 41    /// <summary>Правки цен под правила Озона через «; »; null — правок не было.</summary>
 42    public string? Correction { get; init; }
 43}
 44
 45/// <summary>Расшифровки позиции по сборкам кабинетов; ошибка возвращается в модели, чтобы окно не падало.</summary>
 46public sealed class FeedExplanationResult
 47{
 3748    public string Key { get; init; } = string.Empty;
 2149    public bool Found { get; init; }
 3950    public IReadOnlyList<FeedExplanation> Explanations { get; init; } = Array.Empty<FeedExplanation>();
 2651    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}