feat(api): Вынес логику формирования расписания в сервис IEsppSchTypeConfigService. В респонс шаблона добавил отображение расписания. Получение шаблона по ИД.

This commit is contained in:
Mikhail Trubnikov
2023-10-12 12:06:47 +10:00
parent c2c381896b
commit b177c0cc27
10 changed files with 186 additions and 88 deletions

View File

@@ -2,6 +2,7 @@
using PARR.API.Contracts.V1.Responses;
using PARR.API.MappingProfiles.Resolvers;
using PARR.BLL.Helpers;
using PARR.DAL.DomainModels;
using PARR.DAL.Models;
using PARR.DAL.Models.V1;
@@ -42,7 +43,8 @@ namespace PARR.API.MappingProfiles
.ForMember(d => d.Initiator, o => o.MapFrom<TemplateInitiatorResolver>())
.ForMember(d => d.ClosingCode, o => o.MapFrom<TemplateClosingCodeResolver>())
.ForMember(d => d.Category, o => o.MapFrom<TemplateCategoryResolver>())
.ForMember(d => d.SyncStatus, o => o.MapFrom(s => s.RobotConfigurations));
.ForMember(d => d.SyncStatus, o => o.MapFrom(s => s.RobotConfigurations))
.ForMember(d => d.Schedule, o => o.MapFrom<TemplateScheduleResolver>());
// === Template ===
CreateMap<Template, TemplateScheduleEsppIdResponse>();
@@ -130,6 +132,19 @@ namespace PARR.API.MappingProfiles
.ForMember(d => d.RobotStatus, o => o.MapFrom(s => s.RobotStatus));
// --- EsppSch ---
CreateMap<EsppSchTypeSchedule, EsppScheduleTypeScheduleResponse>();
CreateMap<EsppSchType, EsppScheduleTypeResponse>();
CreateMap<EsppSchTypeValue, EsppScheduleTypeValueResponse>();
CreateMap<EsppScheduleValDto, EsppScheduleValResponse>()
.ForMember(d => d.Order, o => o.MapFrom(s => s.Order))
.ForMember(d => d.Value, o => o.MapFrom(s => s.Value))
.ForMember(d => d.Type, o => o.MapFrom(s => s.Type));
// === EsppSch ===
}
}
}