Switched all audit and creation timestamps from UTC to local time by replacing DateTime.UtcNow with DateTime.Now across the codebase. This affects audit fields, object creation, and default values for date/time properties.
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using AutoMapper;
|
|
using EnvelopeGenerator.Application.Common.Extensions;
|
|
using EnvelopeGenerator.Application.DocStatus.Commands;
|
|
using EnvelopeGenerator.Domain.Entities;
|
|
|
|
namespace EnvelopeGenerator.Application.DocStatus;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class MappingProfile : Profile
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public MappingProfile()
|
|
{
|
|
CreateMap<CreateDocStatusCommand, DocumentStatus>()
|
|
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
|
.ForMember(dest => dest.Receiver, opt => opt.Ignore())
|
|
.ForMember(dest => dest.Status, opt => opt.MapFrom(
|
|
src => src.Value == null
|
|
? Domain.Constants.DocumentStatus.Created
|
|
: Domain.Constants.DocumentStatus.Signed))
|
|
.MapAddedWhen();
|
|
|
|
CreateMap<UpdateDocStatusCommand, DocumentStatus>()
|
|
.ForMember(dest => dest.Envelope, opt => opt.Ignore())
|
|
.ForMember(dest => dest.Receiver, opt => opt.Ignore())
|
|
.ForMember(dest => dest.StatusChangedWhen, opt => opt.MapFrom(src => DateTime.Now))
|
|
.MapChangedWhen();
|
|
}
|
|
} |