0.2.0 #4

Merged
mfnefd merged 15 commits from dev into main 2024-12-11 04:42:35 +04:00
3 changed files with 6 additions and 6 deletions
Showing only changes of commit e97902084f - Show all commits

View File

@ -4,5 +4,5 @@ namespace Contracts.Services;
public interface IReportPeriodService
{
Task<IEnumerable<ChangeRecordViewModel>> GetReportData(DateTime from, DateTime to);
Task<IEnumerable<ChangeRecordViewModel>> GetReportData(DateTime from, DateTime to, Guid userId);
}

View File

@ -19,13 +19,13 @@ public class ReportController : ControllerBase
_reportOffsetFromPlanService = reportOffsetFromPlanService;
}
[HttpGet("period")]
[HttpGet("period/{id}")]
public async Task<ActionResult<IEnumerable<ChangeRecordViewModel>>> GetReportData(
[FromQuery] DateTime from, [FromQuery] DateTime to)
[FromQuery] DateTime from, [FromQuery] DateTime to, Guid id)
{
try
{
var periodData = await _reportPeriodService.GetReportData(from, to);
var periodData = await _reportPeriodService.GetReportData(from, to, id);
return Ok(periodData);
}
catch (ReportDataNotFoundException ex)

View File

@ -16,9 +16,9 @@ public class ReportPeriodService : IReportPeriodService
_changeRecordRepo = changeRecordRepo;
}
public async Task<IEnumerable<ChangeRecordViewModel>> GetReportData(DateTime from, DateTime to)
public async Task<IEnumerable<ChangeRecordViewModel>> GetReportData(DateTime from, DateTime to, Guid userId)
{
var records = await _changeRecordRepo.GetList(new ChangeRecordSearch() { From = from, To = to });
var records = await _changeRecordRepo.GetList(new ChangeRecordSearch() { From = from, To = to, UserId = userId });
if (!records.Any())
{