< Summary

Information
Class: OzonOrdersWeb.WebServices.Journals.JournalGridDefinitions
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/WebServices/Journals/JournalGridDefinitions.cs
Line coverage
96%
Covered lines: 124
Uncovered lines: 5
Coverable lines: 129
Total lines: 158
Line coverage: 96.1%
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
.cctor()100%1196.12%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/WebServices/Journals/JournalGridDefinitions.cs

#LineLine coverage
 1using OzonDomains.Models;
 2using OzonDomains.Models.Partners;
 3using OzonOrdersWeb.WebServices.Grid;
 4
 5namespace OzonOrdersWeb.WebServices.Journals;
 6
 7/// <summary>
 8/// Серверные гриды журналов (сотни тысяч строк): whitelist колонок (colId → выражение EF), поиск и порядок по умолчанию
 9/// colId совпадают с колонками гридов на страницах журналов.
 10/// </summary>
 11public static class JournalGridDefinitions
 12{
 13    /// <summary>Журнал кабинета партнёров (PartnerAuditLogs): входы, отказы, действия партнёров и настройки владельца.<
 114    public static readonly ServerGridDefinition<PartnerAuditLog> PartnerAudit =
 115        new ServerGridDefinition<PartnerAuditLog>
 116            {
 117                DefaultOrder = q => q.OrderByDescending(x => x.OccurredAtUtc).ThenByDescending(x => x.Id),
 118                TieBreaker = x => x.Id
 119            }
 120            .Col("id", x => x.Id)
 121            .Col("occurredAtUtc", x => x.OccurredAtUtc)
 122            .Col("partnerId", x => x.PartnerId)
 123            .Col("actor", x => x.Actor)
 124            // Подписи те же, что показывает грид: фильтр и счётчики значений работают по тексту, а не по числу enum.
 125            .Col("actorKind", x => x.ActorKind == PartnerActorKind.Owner ? "Владелец" : x.ActorKind == PartnerActorKind.
 126            .Col("action", x => x.Action)
 127            .Col("orderNumber", x => x.OrderNumber)
 128            .Col("success", x => x.Success)
 129            .Col("details", x => x.Details)
 130            .Col("ipAddress", x => x.IpAddress)
 131            .Search(x => x.Actor, x => x.Action, x => x.OrderNumber, x => x.Details, x => x.IpAddress);
 32
 33    /// <summary>Аудит вызовов API-поставщиков (ApiSupplierRequestAudit). Поиск — без longtext запроса/ответа: они в «От
 134    public static readonly ServerGridDefinition<ApiSupplierRequestAuditEntry> ApiSupplierAudit =
 135        new ServerGridDefinition<ApiSupplierRequestAuditEntry>
 136            {
 037                DefaultOrder = q => q.OrderByDescending(x => x.OccurredAtUtc).ThenByDescending(x => x.Id),
 138                TieBreaker = x => x.Id
 139            }
 140            .Col("id", x => x.Id)
 141            .Col("occurredAtUtc", x => x.OccurredAtUtc)
 142            .Col("providerKey", x => x.ProviderKey)
 143            .Col("isSuccess", x => x.IsSuccess)
 144            .Col("statusCode", x => x.StatusCode)
 145            .Col("method", x => x.Method)
 146            .Col("endpoint", x => x.Endpoint)
 147            .Col("source", x => x.Source)
 148            .Col("actor", x => x.Actor)
 149            .Col("durationMs", x => x.DurationMs)
 150            .Search(x => x.ProviderKey, x => x.Source, x => x.Endpoint, x => x.Actor);
 51
 52    /// <summary>
 53    /// Остатки 1С из Google Sheet (WarehouseStockSnapshot, /Studio2/WarehouseStock): все числовые колонки листа,
 54    /// поиск по артикулу, производителю и наименованию. Порядок по умолчанию — по артикулу, как на прежней странице.
 55    /// </summary>
 156    public static readonly ServerGridDefinition<WarehouseStockSnapshot> WarehouseStock =
 157        new ServerGridDefinition<WarehouseStockSnapshot>
 158            {
 059                DefaultOrder = q => q.OrderBy(x => x.Article).ThenBy(x => x.Id),
 160                TieBreaker = x => x.Id
 161            }
 162            .Col("id", x => x.Id)
 163            .Col("sourceRowNumber", x => x.SourceRowNumber)
 164            .Col("manufacturer", x => x.Manufacturer)
 165            .Col("article", x => x.Article)
 166            .Col("productName", x => x.ProductName)
 167            .Col("saleFlag", x => x.SaleFlag)
 168            .Col("m2Qty", x => x.M2Qty)
 169            .Col("m1Qty", x => x.M1Qty)
 170            .Col("m3Qty", x => x.M3Qty)
 171            .Col("b1Qty", x => x.B1Qty)
 172            .Col("b2Qty", x => x.B2Qty)
 173            .Col("unitCost", x => x.UnitCost)
 174            .Col("totalCost", x => x.TotalCost)
 175            .Col("salePriceUnit", x => x.SalePriceUnit)
 176            .Col("accountingPriceUnit", x => x.AccountingPriceUnit)
 177            .Col("priceDiffAccountingMinusSale", x => x.PriceDiffAccountingMinusSale)
 178            .Col("c0", x => x.C0)
 179            .Col("stockAmountByC0", x => x.StockAmountByC0)
 180            .Col("existPrice", x => x.ExistPrice)
 181            .Col("c1ExistMinus5Percent", x => x.C1ExistMinus5Percent)
 182            .Col("c1PercentToC0", x => x.C1PercentToC0)
 183            .Col("warehouse", x => x.Warehouse)
 184            .Col("syncedAtUtc", x => x.SyncedAtUtc)
 185            .Search(x => x.Article, x => x.Manufacturer, x => x.ProductName);
 86
 87    /// <summary>Возвраты Ozon (OrderReturns). Параметр orderId (ссылка из заказа) накладывает контроллер.</summary>
 188    public static readonly ServerGridDefinition<OrderReturn> OrderReturns =
 189        new ServerGridDefinition<OrderReturn>
 190            {
 091                DefaultOrder = q => q.OrderByDescending(r => r.VisualStatusChangeMoment).ThenByDescending(r => r.Id),
 192                TieBreaker = r => r.Id
 193            }
 194            .Col("id", r => r.Id)
 195            .Col("postingNumber", r => r.PostingNumber)
 196            .Col("orderNumber", r => r.OrderNumber)
 197            .Col("clientName", r => r.OzonClient != null ? r.OzonClient.Name : null)
 198            .Col("productName", r => r.ProductName)
 199            .Col("productOfferId", r => r.ProductOfferId)
 1100            .Col("productQuantity", r => r.ProductQuantity)
 1101            .Col("productPrice", r => r.ProductPrice)
 1102            .Col("visualStatus", r => r.VisualStatusSysName)
 1103            .Col("returnReasonName", r => r.ReturnReasonName)
 1104            .Col("returnType", r => r.ReturnType)
 1105            .Col("schema", r => r.Schema)
 1106            .Col("placeName", r => r.PlaceName)
 1107            .Col("compensationStatus", r => r.CompensationStatusDisplayName)
 1108            .Col("orderId", r => r.OrderId)
 1109            .Col("visualStatusChangeMoment", r => r.VisualStatusChangeMoment)
 1110            .Col("returnDate", r => r.ReturnDate)
 1111            .Search(r => r.PostingNumber, r => r.OrderNumber, r => r.ProductName, r => r.ProductOfferId, r => r.ReturnRe
 112
 113    /// <summary>Архив заказов (OrderArchives + заказ): поля заказа — на момент архивации.</summary>
 1114    public static readonly ServerGridDefinition<OrderArchive> OrderArchive =
 1115        new ServerGridDefinition<OrderArchive>
 1116            {
 0117                DefaultOrder = q => q.OrderByDescending(a => a.ArchivedAt).ThenByDescending(a => a.Id),
 1118                TieBreaker = a => a.Id
 1119            }
 1120            .Col("archivedAt", a => a.ArchivedAt)
 1121            .Col("archivedBy", a => a.ArchivedBy)
 1122            .Col("archiveReason", a => a.ArchiveReason)
 1123            .Col("orderId", a => a.OrderId)
 1124            .Col("shipmentNumber", a => a.Order.ShipmentNumber)
 1125            .Col("processingDate", a => a.Order.ProcessingDate)
 1126            .Col("productName", a => a.Order.ProductName)
 1127            .Col("article", a => a.Order.Article)
 1128            .Col("quantity", a => a.Order.Quantity)
 1129            .Col("purchasePrice", a => a.Order.PurchasePrice)
 1130            .Col("appStatus", a => a.Order.AppStatus != null ? a.Order.AppStatus.Name : null)
 1131            .Col("clientStatus", a => a.Order.ClientStatus != null ? a.Order.ClientStatus.Name : null)
 1132            .Col("clientName", a => a.Order.OzonClient != null ? a.Order.OzonClient.Name : null)
 1133            .Search(a => a.Order.ShipmentNumber, a => a.Order.ProductName, a => a.Order.Article, a => a.ArchivedBy, a =>
 134
 135    /// <summary>
 136    /// Результаты обработки вложений почты (EmailRoutingResults). Дата — письма, а если IMAP её не отдал — обработки.
 137    /// </summary>
 1138    public static readonly ServerGridDefinition<EmailAttachmentProcessingResult> EmailResults =
 1139        new ServerGridDefinition<EmailAttachmentProcessingResult>
 1140            {
 0141                DefaultOrder = q => q.OrderByDescending(r => r.CreatedAt).ThenByDescending(r => r.Id),
 1142                TieBreaker = r => r.Id
 1143            }
 1144            .Col("id", r => r.Id)
 1145            .Col("date", r => r.EmailMessage != null && r.EmailMessage.ReceivedAtUtc != null ? r.EmailMessage.ReceivedAt
 1146            .Col("createdAt", r => r.CreatedAt)
 1147            .Col("status", r => r.Status)
 1148            .Col("ruleName", r => r.Rule != null ? r.Rule.Name : null)
 1149            .Col("sender", r => r.EmailMessage != null ? r.EmailMessage.SenderEmail : null)
 1150            .Col("subject", r => r.EmailMessage != null ? r.EmailMessage.Subject : null)
 1151            .Col("fileName", r => r.Attachment != null ? r.Attachment.FileName : r.DropboxFileName)
 1152            .Col("dropboxFolderPath", r => r.DropboxFolderPath)
 1153            .Col("reason", r => r.Error ?? r.Reason)
 1154            .Search(r => r.Attachment != null ? r.Attachment.FileName : r.DropboxFileName,
 1155                r => r.EmailMessage != null ? r.EmailMessage.SenderEmail : null,
 1156                r => r.EmailMessage != null ? r.EmailMessage.Subject : null,
 1157                r => r.Error, r => r.Reason, r => r.DropboxFolderPath);
 158}

Methods/Properties

.cctor()