2023-12-11 14:32:29 +03:30
|
|
|
|
using Task = Brizco.Domain.Entities.Task.Task;
|
2023-09-18 09:45:02 +03:30
|
|
|
|
|
|
|
|
|
|
namespace Brizco.Domain;
|
|
|
|
|
|
|
|
|
|
|
|
public class MapsterRegister : IRegister
|
|
|
|
|
|
{
|
|
|
|
|
|
public void Register(TypeAdapterConfig config)
|
|
|
|
|
|
{
|
2023-11-19 22:06:49 +03:30
|
|
|
|
config.NewConfig<Task, TaskSDto>()
|
|
|
|
|
|
.Map("SetFor",o=>DateTimeExtensions.DateTimeToUnixTimeStamp(o.SetFor))
|
|
|
|
|
|
.Map("Shifts", o => o.Shifts.Select(d => d.Shift != null ? d.Shift.Title : string.Empty))
|
|
|
|
|
|
.Map("Routines", o => o.Routines.Select(d => d.Routine != null ? d.Routine.Name : string.Empty))
|
|
|
|
|
|
.Map("Positions", o => o.Positions.Select(d => d.Position != null ? d.Position.Name : string.Empty))
|
|
|
|
|
|
.TwoWays();
|
|
|
|
|
|
|
2024-02-21 02:07:41 +03:30
|
|
|
|
config.NewConfig<TaskShift, TaskShiftSDto>()
|
|
|
|
|
|
.Map("ShiftName", o => o.Shift != null ? o.Shift.Title : string.Empty)
|
|
|
|
|
|
.Map("TaskTitle", o => o.Task != null ? o.Task.Title : string.Empty)
|
|
|
|
|
|
.TwoWays();
|
|
|
|
|
|
|
|
|
|
|
|
config.NewConfig<TaskPosition, TaskPositionSDto>()
|
|
|
|
|
|
.Map("PositionName", o => o.Position != null ? o.Position.Name : string.Empty)
|
|
|
|
|
|
.TwoWays();
|
|
|
|
|
|
|
2023-12-11 14:32:29 +03:30
|
|
|
|
config.NewConfig<Activity, ActivitySDto>()
|
|
|
|
|
|
.Map("UserFirstName", o => o.User !=null ? o.User.FirstName : string.Empty)
|
|
|
|
|
|
.Map("UserLastName", o => o.User != null ? o.User.LastName : string.Empty)
|
2023-12-12 14:54:19 +03:30
|
|
|
|
.Map("ShiftTitle",o=>o.Shift != null ? o.Shift.Title : string.Empty)
|
2023-12-11 14:32:29 +03:30
|
|
|
|
.TwoWays();
|
2023-11-19 22:06:49 +03:30
|
|
|
|
|
|
|
|
|
|
config.NewConfig<Task, TaskLDto>()
|
|
|
|
|
|
.Map("SetFor", o => DateTimeExtensions.DateTimeToUnixTimeStamp(o.SetFor))
|
|
|
|
|
|
.TwoWays();
|
|
|
|
|
|
|
2023-09-18 09:45:02 +03:30
|
|
|
|
config.NewConfig<Shift, ShiftSDto>()
|
2023-11-14 16:21:49 +03:30
|
|
|
|
.Map("Days",o=>o.Days.Select(d=>d.DayOfWeek).ToList())
|
2023-10-26 01:24:04 +03:30
|
|
|
|
.TwoWays();
|
|
|
|
|
|
|
2023-11-18 22:23:23 +03:30
|
|
|
|
config.NewConfig<Shift, ShiftLDto>()
|
|
|
|
|
|
.Map("Days", o => o.Days.Select(d => d.DayOfWeek).ToList())
|
|
|
|
|
|
.TwoWays();
|
2023-10-26 01:24:04 +03:30
|
|
|
|
|
2024-02-21 02:07:41 +03:30
|
|
|
|
config.NewConfig<ShiftPlan, ShiftPlanLDto>()
|
|
|
|
|
|
.Map("SupervisorFullName", o => o.Supervisor != null ? o.Supervisor.FirstName + " " + o.Supervisor.LastName : string.Empty)
|
|
|
|
|
|
.TwoWays();
|
|
|
|
|
|
|
2023-10-26 01:24:04 +03:30
|
|
|
|
config.NewConfig<ComplexUserRole, ComplexUserRoleSDto>()
|
|
|
|
|
|
.Map("RoleName", org => org.Role!.PersianName)
|
2023-10-13 16:25:34 +03:30
|
|
|
|
.TwoWays();
|
|
|
|
|
|
|
2023-11-14 16:21:49 +03:30
|
|
|
|
config.NewConfig<Position, PositionLDto>()
|
|
|
|
|
|
.Map("SectionName", org => org.Section != null ? org.Section.Name : string.Empty)
|
|
|
|
|
|
.TwoWays();
|
|
|
|
|
|
|
2023-10-13 16:25:34 +03:30
|
|
|
|
config.NewConfig<ComplexUser, ComplexUserSDto>()
|
2023-10-24 15:36:09 +03:30
|
|
|
|
.Map("ComplexName", o=>o.Complex!=null ? o.Complex.Name : string.Empty)
|
|
|
|
|
|
.Map("FirstName", o=>o.User!=null ? o.User.FirstName : string.Empty)
|
|
|
|
|
|
.Map("LastName", o=>o.User!=null ? o.User.LastName : string.Empty)
|
|
|
|
|
|
.Map("NationalId", o=>o.User!=null ? o.User.NationalId : string.Empty)
|
2023-09-18 09:45:02 +03:30
|
|
|
|
.TwoWays();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|