< Summary

Information
Class: OzonOrdersWeb.WebServices.ArmtekEtp.ArmtekEtpGridDefinitions
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/WebServices/ArmtekEtp/ArmtekEtpGridDefinitions.cs
Line coverage
96%
Covered lines: 101
Uncovered lines: 4
Coverable lines: 105
Total lines: 119
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.19%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/WebServices/ArmtekEtp/ArmtekEtpGridDefinitions.cs

#LineLine coverage
 1using OzonDomains.Models.ArmtekEtp;
 2using OzonOrdersWeb.WebServices.Grid;
 3
 4namespace OzonOrdersWeb.WebServices.ArmtekEtp;
 5
 6/// <summary>
 7/// Whitelist колонок серверных гридов раздела «Взаиморасчёты Armtek» (/Settlements/Armtek):
 8/// colId грида → EF-выражение. Фильтры, сортировка и счётчики значений считаются по всему набору в БД.
 9/// </summary>
 10public static class ArmtekEtpGridDefinitions
 11{
 112    public static readonly ServerGridDefinition<ArmtekSettlement> Settlements =
 113        new ServerGridDefinition<ArmtekSettlement>
 114            {
 015                DefaultOrder = q => q.OrderByDescending(x => x.DocDate).ThenByDescending(x => x.Id),
 116                TieBreaker = x => x.Id
 117            }
 118            .Col("id", x => x.Id)
 119            .Col("kunnr", x => x.Kunnr)
 120            .Col("clientName", x => x.ClientName)
 121            .Col("docDate", x => x.DocDate)
 122            .Col("vbeln", x => x.Vbeln)
 123            .Col("docType", x => x.DocType)
 124            .Col("docTypeName", x => x.DocTypeName)
 125            .Col("docNumber", x => x.DocNumber)
 126            .Col("printNumber", x => x.PrintNumber)
 127            .Col("paymentMethodName", x => x.PaymentMethodName)
 128            .Col("amount", x => x.Amount)
 129            .Col("payUntil", x => x.PayUntil)
 130            .Col("returnAmount", x => x.ReturnAmount)
 131            .Col("paymentAmount", x => x.PaymentAmount)
 132            .Col("remainderAmount", x => x.RemainderAmount)
 133            .Col("balance", x => x.Balance)
 134            .Col("contract", x => x.Contract)
 135            .Col("currency", x => x.Currency)
 136            .Col("divisionName", x => x.DivisionName)
 137            .Col("companyName", x => x.CompanyName)
 138            .Col("updatedAtUtc", x => x.UpdatedAtUtc)
 139            .Search(x => x.Vbeln, x => x.DocNumber, x => x.PrintNumber, x => x.DocTypeName, x => x.ClientName,
 140                x => x.Contract, x => x.Kunnr);
 41
 142    public static readonly ServerGridDefinition<ArmtekInvoice> Invoices =
 143        new ServerGridDefinition<ArmtekInvoice>
 144            {
 045                DefaultOrder = q => q.OrderByDescending(x => x.InvoiceDate).ThenByDescending(x => x.Id),
 146                TieBreaker = x => x.Id
 147            }
 148            .Col("id", x => x.Id)
 149            .Col("kunnr", x => x.Kunnr)
 150            .Col("vbeln", x => x.Vbeln)
 151            .Col("invoiceDate", x => x.InvoiceDate)
 152            .Col("createdAt", x => x.CreatedAt)
 153            .Col("createdBy", x => x.CreatedBy)
 154            .Col("buyerName", x => x.BuyerName)
 155            .Col("unloadingPointName", x => x.UnloadingPointName)
 156            .Col("deliveryAddress", x => x.DeliveryAddress)
 157            .Col("contact", x => x.Contact)
 158            .Col("receiveMethod", x => x.ReceiveMethod)
 159            .Col("deliveryStatus", x => x.DeliveryStatus)
 160            .Col("updNumber", x => x.UpdNumber)
 161            .Col("ttnNumber", x => x.TtnNumber)
 162            .Col("totalAmount", x => x.TotalAmount)
 163            .Col("totalQuantity", x => x.TotalQuantity)
 164            .Col("returnedQuantity", x => x.ReturnedQuantity)
 165            .Col("orderNumber", x => x.OrderNumber)
 166            .Col("orderType", x => x.OrderType)
 167            .Col("orderStatus", x => x.OrderStatus)
 168            .Col("returnReason", x => x.ReturnReason)
 169            .Col("pickupPointName", x => x.PickupPointName)
 170            .Col("payment", x => x.Payment)
 171            .Col("contract", x => x.Contract)
 172            .Col("maxReturnSum", x => x.MaxReturnSum)
 173            .Col("source", x => x.Source == "api" ? "API" : "Кабинет")
 174            .Col("loadedAtUtc", x => x.LoadedAtUtc)
 175            .Search(x => x.Vbeln, x => x.UpdNumber, x => x.TtnNumber, x => x.BuyerName, x => x.CreatedBy,
 176                x => x.DeliveryAddress, x => x.Contact, x => x.OrderNumber, x => x.ReturnReason);
 77
 178    public static readonly ServerGridDefinition<ArmtekInvoiceItem> Items =
 179        new ServerGridDefinition<ArmtekInvoiceItem>
 180            {
 081                DefaultOrder = q => q.OrderByDescending(x => x.Invoice!.InvoiceDate).ThenByDescending(x => x.InvoiceId)
 082                    .ThenBy(x => x.Position),
 183                TieBreaker = x => x.Id
 184            }
 185            .Col("id", x => x.Id)
 186            .Col("invoiceId", x => x.InvoiceId)
 187            .Col("vbeln", x => x.Invoice!.Vbeln)
 188            .Col("kunnr", x => x.Invoice!.Kunnr)
 189            .Col("invoiceDate", x => x.Invoice!.InvoiceDate)
 190            .Col("position", x => x.Position)
 191            .Col("armtekCode", x => x.ArmtekCode, normalizeText: true)
 192            .Col("article", x => x.Article, normalizeText: true)
 193            .Col("brand", x => x.Brand)
 194            .Col("name", x => x.Name)
 195            .Col("fullName", x => x.FullName)
 196            .Col("price", x => x.Price)
 197            .Col("quantity", x => x.Quantity)
 198            .Col("returned", x => x.Returned)
 199            .Col("amount", x => x.Amount)
 1100            .Col("orderNumber", x => x.OrderNumber)
 1101            .Col("orderPosition", x => x.OrderPosition)
 1102            .Col("note", x => x.Note)
 1103            .Col("gtd", x => x.Gtd)
 1104            .Col("country", x => x.Country)
 1105            .Col("maxReturnDate", x => x.MaxReturnDate)
 1106            .Col("noReturn", x => x.NoReturn)
 1107            .Col("returnDays", x => x.ReturnDays)
 1108            .Col("vatRate", x => x.VatRate)
 1109            .Col("vatAmount", x => x.VatAmount)
 1110            .Col("ean", x => x.Ean)
 1111            .Col("tnved", x => x.Tnved)
 1112            .Col("weight", x => x.Weight)
 1113            .Col("orderType", x => x.Invoice!.OrderType)
 1114            .Col("returnReason", x => x.Invoice!.ReturnReason)
 1115            .Search(x => x.Article, x => x.ArmtekCode, x => x.Brand, x => x.Name, x => x.FullName, x => x.OrderNumber,
 1116                x => x.Gtd, x => x.Invoice!.Vbeln, x => x.Ean, x => x.Tnved, x => x.Note)
 1117            // Артикул ищем без разделителей: «1020479SX» = «10-20479-SX» = код Армтек «1020479_SX».
 1118            .SearchNormalized(x => x.Article, x => x.ArmtekCode);
 119}

Methods/Properties

.cctor()