< Summary

Information
Class: OzonOrdersWeb.Areas.Studio2.Controllers.Directories.AvdController
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Studio2/Controllers/Directories/AvdController.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 14
Coverable lines: 14
Total lines: 31
Line coverage: 0%
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
.ctor(...)100%210%
Index()100%210%
Logs()100%210%
Catalogs()100%210%
OriginalPrice()100%210%
FastCrossesPrice()100%210%
XmlAsync()100%210%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Studio2/Controllers/Directories/AvdController.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Authorization;
 2using Microsoft.AspNetCore.Mvc;
 3using Services.ApiServices.ApiSupplierRequestLog;
 4using Services.ApiServices.AvdApi;
 5
 6namespace OzonOrdersWeb.Areas.Studio2.Controllers.Directories;
 7
 8[Area("Studio2")]
 9[Authorize(Roles = "User,Admin")]
 10[Route("Avd/[action]")]
 11public sealed class AvdController : Controller
 12{
 13    private readonly AvdDataManager _avd;
 14    private readonly ApiSupplierRequestLogStore _logs;
 015    public AvdController(AvdDataManager avd, ApiSupplierRequestLogStore logs) { _avd = avd; _logs = logs; }
 016    [HttpGet, Route("~/Avd")] public IActionResult Index() => View();
 017    [HttpGet] public IActionResult Logs() => Json(_logs.Get("Avd"));
 018    [HttpGet] public async Task<IActionResult> UserStatus(CancellationToken ct) => await XmlAsync(() => _avd.GetUserStat
 019    [HttpGet] public async Task<IActionResult> Basket(CancellationToken ct) => await XmlAsync(() => _avd.GetBasketItemAs
 020    [HttpGet] public async Task<IActionResult> Balance(CancellationToken ct) => await XmlAsync(() => _avd.GetBalanceAsyn
 021    [HttpGet] public async Task<IActionResult> Orders(string? dateBegin, string? dateEnd, int status = 0, string? number
 022    [HttpGet] public async Task<IActionResult> Catalogs(string number, CancellationToken ct) => Json(await _avd.GetCatal
 023    [HttpGet] public async Task<IActionResult> OriginalPrice(string number, string? catalog, string? supplier, Cancellat
 024    [HttpGet] public async Task<IActionResult> FastCrossesPrice(string number, string catalog, string? supplier, Cancell
 025    [HttpGet] public async Task<IActionResult> CrossesPrice(string number, string? catalog, string? supplier, Cancellati
 26    private async Task<IActionResult> XmlAsync(Func<Task<System.Xml.Linq.XElement>> call)
 27    {
 028        try { return Content((await call()).ToString(), "application/xml"); }
 029        catch (AvdApiException ex) { return BadRequest(new { error = true, message = ex.Message }); }
 030    }
 31}