feat(api): TemplateHistoryController
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using PARR.API.Authentication.Models;
|
||||
using PARR.API.Contracts.V1.Responses;
|
||||
using PARR.API.MappingProfiles.Resolvers;
|
||||
using PARR.Common.Domain;
|
||||
using PARR.Constants.Shortcode;
|
||||
using PARR.DAL.DomainModels;
|
||||
using PARR.DAL.Extensions;
|
||||
@@ -300,6 +301,29 @@ namespace PARR.API.MappingProfiles
|
||||
|
||||
|
||||
CreateMap<WeekendDay, WeekendResponse>();
|
||||
|
||||
#region TemplateHistory
|
||||
|
||||
CreateMap<TemplateHistory, TemplateHistoryResponse>()
|
||||
.ForMember(d => d.TemplateId, o => o.MapFrom(s => s.ParentId))
|
||||
.ForMember(d => d.Initiator, o => o.MapFrom(s => s));
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Initiator
|
||||
|
||||
CreateMap<IHistoryInitiator, HistoryInitiatorResponse>()
|
||||
.ForMember(d => d.Ip, o => o.MapFrom(s => s.InitiatorIp))
|
||||
.ForMember(d => d.Comment, o => o.MapFrom(s => s.InitiatorComment))
|
||||
.ForMember(d => d.ParrComponentId, o => o.MapFrom(s => s.InitiatorParrComponentId))
|
||||
.ForMember(d => d.ParrComponent, o => o.MapFrom<HistoryInitiatorParrComponentResolver>())
|
||||
.ForMember(d => d.User, o => o.MapFrom<HistoryInitiatorUserResolver>());
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user