| | | 1 | | using Microsoft.AspNetCore.Authorization; |
| | | 2 | | using Microsoft.AspNetCore.Mvc; |
| | | 3 | | using OzonOrdersWeb.WebServices.TransactionTimeTracking; |
| | | 4 | | |
| | | 5 | | namespace OzonOrdersWeb.Areas.Studio2.Controllers; |
| | | 6 | | |
| | | 7 | | [Area("Studio2")] |
| | | 8 | | [Authorize(Roles = "User,Admin")] |
| | | 9 | | public class TransactionTimeTrackingReportController : Controller |
| | | 10 | | { |
| | | 11 | | private readonly ITransactionTimeTrackingReportQueryService _reportQueryService; |
| | | 12 | | |
| | 0 | 13 | | public TransactionTimeTrackingReportController(ITransactionTimeTrackingReportQueryService reportQueryService) |
| | | 14 | | { |
| | 0 | 15 | | _reportQueryService = reportQueryService; |
| | 0 | 16 | | } |
| | | 17 | | |
| | | 18 | | [HttpGet("/TransactionTimeTrackingReport")] |
| | | 19 | | [HttpGet("/TransactionTimeTrackingReport/Index")] |
| | | 20 | | [HttpGet("/Studio2/TransactionTimeTrackingReport")] |
| | | 21 | | [HttpGet("/Studio2/TransactionTimeTrackingReport/Index")] |
| | | 22 | | public async Task<IActionResult> Index( |
| | | 23 | | DateTime? dateFromUtc = null, |
| | | 24 | | DateTime? dateToUtc = null, |
| | | 25 | | string? userName = null, |
| | | 26 | | string? transactionType = null, |
| | | 27 | | CancellationToken cancellationToken = default) |
| | | 28 | | { |
| | 0 | 29 | | var viewModel = await _reportQueryService.GetAsync( |
| | 0 | 30 | | dateFromUtc, dateToUtc, userName, transactionType, cancellationToken); |
| | 0 | 31 | | return View(viewModel); |
| | 0 | 32 | | } |
| | | 33 | | } |