Update MappingProfiles with AddedWhen and AddedWho mappings

Reordered `using` directives for clarity and added `ReC.Domain.Entities`.
Added a `TODO` comment to indicate that `AddedWho` should be injected from the current host/user context.
Updated `CreateMap` in `MappingProfiles` to set `AddedWhen` to `DateTime.UtcNow` and `AddedWho` to the hardcoded value `"ReC.API"`.
This commit is contained in:
tekh 2025-12-03 13:57:13 +01:00
parent bf02cc80d1
commit d27c3f3fc7

View File

@ -1,13 +1,15 @@
using AutoMapper;
using ReC.Application.OutResults.Commands;
using ReC.Application.OutResults.Commands;
using ReC.Domain.Entities;
namespace ReC.Application.OutResults;
// TODO: update to inject AddedWho from the current host/user contex
public class MappingProfiles : AutoMapper.Profile
{
public MappingProfiles()
{
CreateMap<CreateOutResCommand, OutRes>();
CreateMap<CreateOutResCommand, OutRes>()
.ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow))
.ForMember(e => e.AddedWho, exp => exp.MapFrom(cmd => "ReC.API"));
}
}