Refactor ResultView logic under OutResults namespace

Moved ReadResultViewQuery and its handler from ResultViews to OutResults namespace. Merged ResultView mapping profile into OutResults.MappingProfiles and removed the old MappingProfile class. Updated controller references accordingly for improved organization.
This commit is contained in:
2026-01-12 11:32:39 +01:00
parent 2635bfb223
commit fb12cb6c98
4 changed files with 6 additions and 15 deletions

View File

@@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Mvc;
using ReC.API.Extensions;
using ReC.API.Models;
using ReC.Application.OutResults.Commands;
using ReC.Application.ResultViews.Queries;
using ReC.Application.OutResults.Queries;
namespace ReC.API.Controllers;

View File

@@ -1,5 +1,6 @@
using ReC.Application.OutResults.Commands;
using ReC.Domain.Entities;
using ReC.Domain.Views;
namespace ReC.Application.OutResults;
@@ -12,5 +13,8 @@ public class MappingProfiles : AutoMapper.Profile
CreateMap<CreateOutResCommand, OutRes>()
.ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow))
.ForMember(e => e.AddedWho, exp => exp.MapFrom(cmd => "ReC.API"));
CreateMap<CreateResultViewCommand, ResultView>()
.ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow));
}
}

View File

@@ -7,7 +7,7 @@ using ReC.Application.Common.Dto;
using ReC.Domain.Views;
using System.Text.Json;
namespace ReC.Application.ResultViews.Queries;
namespace ReC.Application.OutResults.Queries;
public record ReadResultViewQuery : IRequest<IEnumerable<ResultViewDto>>
{

View File

@@ -1,13 +0,0 @@
using ReC.Application.OutResults.Commands;
using ReC.Domain.Views;
namespace ReC.Application.ResultViews;
public class MappingProfile : AutoMapper.Profile
{
public MappingProfile()
{
CreateMap<CreateResultViewCommand, ResultView>()
.ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow));
}
}