2023-05-17 16:00:50 +10:00
|
|
|
|
using AutoMapper;
|
2023-06-16 15:00:11 +10:00
|
|
|
|
using PARR.API.Contracts.V1.Responses;
|
2023-08-10 10:14:41 +10:00
|
|
|
|
using PARR.DAL.Models.V1;
|
2023-05-17 16:00:50 +10:00
|
|
|
|
|
2023-05-17 16:30:13 +10:00
|
|
|
|
namespace PARR.API.MappingProfiles
|
2023-05-17 16:00:50 +10:00
|
|
|
|
{
|
|
|
|
|
|
public class DomainToResponseProfile : Profile
|
|
|
|
|
|
{
|
|
|
|
|
|
public DomainToResponseProfile()
|
|
|
|
|
|
{
|
2023-06-20 12:29:58 +10:00
|
|
|
|
// --- Job ---
|
2023-08-10 10:14:41 +10:00
|
|
|
|
CreateMap<V1_Job, JobBaseResponse>()
|
|
|
|
|
|
.Include<V1_Job, JobGetAllResponse>()
|
2023-07-26 10:09:25 +10:00
|
|
|
|
.ForMember(d => d.FrequencyMinute, o => o.MapFrom(s => s.Frequency))
|
|
|
|
|
|
.ForMember(d => d.Script, o => o.MapFrom(s => s.ScriptName));
|
|
|
|
|
|
|
2023-08-10 10:14:41 +10:00
|
|
|
|
CreateMap<V1_Job, JobGetAllResponse>();
|
2023-06-20 12:29:58 +10:00
|
|
|
|
|
2023-08-10 10:14:41 +10:00
|
|
|
|
CreateMap<List<V1_Job>, JobMinResponse>()
|
2023-07-27 08:40:03 +10:00
|
|
|
|
.ForMember(d => d.Scheduled, o => o.MapFrom(s => s));
|
|
|
|
|
|
|
2023-08-10 10:14:41 +10:00
|
|
|
|
CreateMap<V1_Job, JobMinScheduleResponse>()
|
2023-07-26 10:09:25 +10:00
|
|
|
|
.ForMember(d => d.Script, o => o.MapFrom(s => s.ScriptName));
|
|
|
|
|
|
// === Job ===
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-20 12:29:58 +10:00
|
|
|
|
|
2023-08-10 10:14:41 +10:00
|
|
|
|
CreateMap<V1_JobMode, JobModeResponse>();
|
2023-05-17 16:00:50 +10:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|