From 48523274e26673febe07f30ad063ba7b151dcddb Mon Sep 17 00:00:00 2001 From: "Amir.H Khademi" Date: Tue, 12 Dec 2023 14:54:19 +0330 Subject: [PATCH] add version 0.2.1.0 complete activity and shifting --- .version | 2 +- Brizco.Api/Brizco.Api.csproj | 4 +- Brizco.Common/Brizco.Common.csproj | 30 +-- Brizco.Domain/Brizco.Domain.csproj | 21 +- Brizco.Domain/Dtos/SmallDtos/ActivitySDto.cs | 1 + Brizco.Domain/Dtos/SmallDtos/ShiftSDto.cs | 2 + Brizco.Domain/Entities/Complex/Complex.cs | 3 +- Brizco.Domain/Entities/Complex/Position.cs | 3 +- Brizco.Domain/Entities/Complex/Section.cs | 3 +- Brizco.Domain/Entities/Shift/Shift.cs | 3 +- Brizco.Domain/Entities/Shift/ShiftPlan.cs | 3 +- Brizco.Domain/Entities/Task/Task.cs | 3 +- Brizco.Domain/Mappers/ActivityMapper.g.cs | 122 +++++---- Brizco.Domain/Mappers/ComplexMapper.g.cs | 95 +++---- Brizco.Domain/Mappers/PositionMapper.g.cs | 62 ++--- Brizco.Domain/Mappers/SectionMapper.g.cs | 87 +++---- Brizco.Domain/Mappers/ShiftMapper.g.cs | 123 ++++----- Brizco.Domain/Mappers/ShiftPlanMapper.g.cs | 111 ++++----- Brizco.Domain/Mappers/TaskMapper.g.cs | 234 ++++++++---------- Brizco.Domain/MapsterRegister.cs | 1 + .../Handlers/Shift/GetShiftsQueryHandler.cs | 4 +- 21 files changed, 406 insertions(+), 511 deletions(-) diff --git a/.version b/.version index f56b265..ec34431 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.1.4.0 \ No newline at end of file +0.2.1.0 \ No newline at end of file diff --git a/Brizco.Api/Brizco.Api.csproj b/Brizco.Api/Brizco.Api.csproj index 1dfd29d..05141b4 100644 --- a/Brizco.Api/Brizco.Api.csproj +++ b/Brizco.Api/Brizco.Api.csproj @@ -6,8 +6,8 @@ enable Linux ..\docker-compose.dcproj - 0.1.4.0 - 0.1.4.0 + 0.2.1.0 + 0.2.1.0 diff --git a/Brizco.Common/Brizco.Common.csproj b/Brizco.Common/Brizco.Common.csproj index 3a22881..75f79cb 100644 --- a/Brizco.Common/Brizco.Common.csproj +++ b/Brizco.Common/Brizco.Common.csproj @@ -1,26 +1,12 @@  - + + + net5.0 + 10 + enable + enable + + + + + + + + + diff --git a/Brizco.Domain/Brizco.Domain.csproj b/Brizco.Domain/Brizco.Domain.csproj index 9d80ecb..a5e938a 100644 --- a/Brizco.Domain/Brizco.Domain.csproj +++ b/Brizco.Domain/Brizco.Domain.csproj @@ -1,6 +1,6 @@  - + - + - - - - - - + + + + + + @@ -73,7 +73,6 @@ - diff --git a/Brizco.Domain/Dtos/SmallDtos/ActivitySDto.cs b/Brizco.Domain/Dtos/SmallDtos/ActivitySDto.cs index fe8501f..bf23146 100644 --- a/Brizco.Domain/Dtos/SmallDtos/ActivitySDto.cs +++ b/Brizco.Domain/Dtos/SmallDtos/ActivitySDto.cs @@ -15,6 +15,7 @@ public class ActivitySDto : BaseDto public ActivityStatus Status { get; internal set; } public DateTime DoneAt { get; internal set; } public bool IsDone { get; set; } + public string ShiftTitle { get; set; } = string.Empty; public string PerformanceDescription { get; internal set; } = string.Empty; public string UserFirstName { get; set; } = string.Empty; public string UserLastName { get; set; } = string.Empty; diff --git a/Brizco.Domain/Dtos/SmallDtos/ShiftSDto.cs b/Brizco.Domain/Dtos/SmallDtos/ShiftSDto.cs index a1ca515..8a8fdb0 100644 --- a/Brizco.Domain/Dtos/SmallDtos/ShiftSDto.cs +++ b/Brizco.Domain/Dtos/SmallDtos/ShiftSDto.cs @@ -8,6 +8,8 @@ public class ShiftSDto : BaseDto public int UndoneActivitiesCount { get; set; } public int DoneActivitiesCount { get; set; } public int TotalActivitiesCount { get; set; } + public Guid CurrentShiftPlanId { get; set; } + public bool HasCurrentShiftPlan { get; set; } public bool IsCompleted { get; set; } public TimeSpan StartAt { get; set; } public TimeSpan EndAt { get; set; } diff --git a/Brizco.Domain/Entities/Complex/Complex.cs b/Brizco.Domain/Entities/Complex/Complex.cs index f947d12..77d19a4 100644 --- a/Brizco.Domain/Entities/Complex/Complex.cs +++ b/Brizco.Domain/Entities/Complex/Complex.cs @@ -3,7 +3,8 @@ namespace Brizco.Domain.Entities.Complex; [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] -[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] +[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)] +[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)] [GenerateMapper] public partial class Complex : ApiEntity { diff --git a/Brizco.Domain/Entities/Complex/Position.cs b/Brizco.Domain/Entities/Complex/Position.cs index 8398392..9866008 100644 --- a/Brizco.Domain/Entities/Complex/Position.cs +++ b/Brizco.Domain/Entities/Complex/Position.cs @@ -1,7 +1,8 @@ namespace Brizco.Domain.Entities.Complex; [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] -[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] +[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)] +[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)] [GenerateMapper] public partial class Position : ApiEntity { diff --git a/Brizco.Domain/Entities/Complex/Section.cs b/Brizco.Domain/Entities/Complex/Section.cs index e9eb926..f9c2e40 100644 --- a/Brizco.Domain/Entities/Complex/Section.cs +++ b/Brizco.Domain/Entities/Complex/Section.cs @@ -1,7 +1,8 @@ namespace Brizco.Domain.Entities.Complex; [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] -[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] +[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)] +[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)] [GenerateMapper] public partial class Section : ApiEntity { diff --git a/Brizco.Domain/Entities/Shift/Shift.cs b/Brizco.Domain/Entities/Shift/Shift.cs index 937d4fb..e419fc1 100644 --- a/Brizco.Domain/Entities/Shift/Shift.cs +++ b/Brizco.Domain/Entities/Shift/Shift.cs @@ -1,7 +1,8 @@ namespace Brizco.Domain.Entities.Shift; [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] -[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] +[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)] +[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)] [GenerateMapper] public partial class Shift : ApiEntity { diff --git a/Brizco.Domain/Entities/Shift/ShiftPlan.cs b/Brizco.Domain/Entities/Shift/ShiftPlan.cs index ed7ea38..a159c93 100644 --- a/Brizco.Domain/Entities/Shift/ShiftPlan.cs +++ b/Brizco.Domain/Entities/Shift/ShiftPlan.cs @@ -1,7 +1,8 @@ namespace Brizco.Domain.Entities.Shift; [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] -[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] +[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)] +[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)] [GenerateMapper] public partial class ShiftPlan : ApiEntity { diff --git a/Brizco.Domain/Entities/Task/Task.cs b/Brizco.Domain/Entities/Task/Task.cs index 36fba05..22da8df 100644 --- a/Brizco.Domain/Entities/Task/Task.cs +++ b/Brizco.Domain/Entities/Task/Task.cs @@ -2,7 +2,8 @@ namespace Brizco.Domain.Entities.Task; [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] -[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] +[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget )] +[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)] [GenerateMapper] public partial class Task : ApiEntity { diff --git a/Brizco.Domain/Mappers/ActivityMapper.g.cs b/Brizco.Domain/Mappers/ActivityMapper.g.cs index b74482f..7bc777b 100644 --- a/Brizco.Domain/Mappers/ActivityMapper.g.cs +++ b/Brizco.Domain/Mappers/ActivityMapper.g.cs @@ -26,7 +26,11 @@ namespace Brizco.Domain.Mappers LastName = p1.UserLastName }, ShiftId = p1.ShiftId, - Shift = new Shift() {Id = p1.ShiftId}, + Shift = new Shift() + { + Title = p1.ShiftTitle, + Id = p1.ShiftId + }, Type = p1.Type, Title = p1.Title, Description = p1.Description, @@ -81,7 +85,11 @@ namespace Brizco.Domain.Mappers LastName = p8.UserLastName }, ShiftId = p8.ShiftId, - Shift = new Shift() {Id = p8.ShiftId}, + Shift = new Shift() + { + Title = p8.ShiftTitle, + Id = p8.ShiftId + }, Type = p8.Type, Title = p8.Title, Description = p8.Description, @@ -108,6 +116,7 @@ namespace Brizco.Domain.Mappers Status = p9.Status, DoneAt = p9.DoneAt, IsDone = p9.IsDone, + ShiftTitle = p9.Shift != null ? p9.Shift.Title : string.Empty, PerformanceDescription = p9.PerformanceDescription, UserFirstName = p9.User != null ? p9.User.FirstName : string.Empty, UserLastName = p9.User != null ? p9.User.LastName : string.Empty, @@ -136,6 +145,7 @@ namespace Brizco.Domain.Mappers result.Status = p10.Status; result.DoneAt = p10.DoneAt; result.IsDone = p10.IsDone; + result.ShiftTitle = p10.Shift != null ? p10.Shift.Title : string.Empty; result.PerformanceDescription = p10.PerformanceDescription; result.UserFirstName = p10.User != null ? p10.User.FirstName : string.Empty; result.UserLastName = p10.User != null ? p10.User.LastName : string.Empty; @@ -159,6 +169,7 @@ namespace Brizco.Domain.Mappers Status = p12.Status, DoneAt = p12.DoneAt, IsDone = p12.IsDone, + ShiftTitle = p12.Shift != null ? p12.Shift.Title : string.Empty, PerformanceDescription = p12.PerformanceDescription, UserFirstName = p12.User != null ? p12.User.FirstName : string.Empty, UserLastName = p12.User != null ? p12.User.LastName : string.Empty, @@ -210,80 +221,64 @@ namespace Brizco.Domain.Mappers return result; } - public static Expression> ProjectLDtoToActivity => p16 => new Activity() + public static ActivityLDto AdaptToLDto(this Activity p16) { - Status = p16.Status, - DoneAt = p16.DoneAt, - IsDone = p16.IsDone, - PerformanceDescription = p16.PerformanceDescription, - Type = p16.Type, - Title = p16.Title, - Description = p16.Description, - IsDisposable = p16.IsDisposable, - SetFor = p16.SetFor, - HasDisposed = p16.HasDisposed, - Amount = p16.Amount, - AmountType = p16.AmountType, - Id = p16.Id - }; - public static ActivityLDto AdaptToLDto(this Activity p17) - { - return p17 == null ? null : new ActivityLDto() + return p16 == null ? null : new ActivityLDto() { - Type = p17.Type, - Title = p17.Title, - Description = p17.Description, - IsDisposable = p17.IsDisposable, - SetFor = p17.SetFor, - HasDisposed = p17.HasDisposed, - Status = p17.Status, - DoneAt = p17.DoneAt, - IsDone = p17.IsDone, - PerformanceDescription = p17.PerformanceDescription, - Amount = p17.Amount, - AmountType = p17.AmountType, - Id = p17.Id + Type = p16.Type, + Title = p16.Title, + Description = p16.Description, + IsDisposable = p16.IsDisposable, + SetFor = p16.SetFor, + HasDisposed = p16.HasDisposed, + Status = p16.Status, + DoneAt = p16.DoneAt, + IsDone = p16.IsDone, + PerformanceDescription = p16.PerformanceDescription, + Amount = p16.Amount, + AmountType = p16.AmountType, + Id = p16.Id }; } - public static ActivityLDto AdaptTo(this Activity p18, ActivityLDto p19) + public static ActivityLDto AdaptTo(this Activity p17, ActivityLDto p18) { - if (p18 == null) + if (p17 == null) { return null; } - ActivityLDto result = p19 ?? new ActivityLDto(); + ActivityLDto result = p18 ?? new ActivityLDto(); - result.Type = p18.Type; - result.Title = p18.Title; - result.Description = p18.Description; - result.IsDisposable = p18.IsDisposable; - result.SetFor = p18.SetFor; - result.HasDisposed = p18.HasDisposed; - result.Status = p18.Status; - result.DoneAt = p18.DoneAt; - result.IsDone = p18.IsDone; - result.PerformanceDescription = p18.PerformanceDescription; - result.Amount = p18.Amount; - result.AmountType = p18.AmountType; - result.Id = p18.Id; + result.Type = p17.Type; + result.Title = p17.Title; + result.Description = p17.Description; + result.IsDisposable = p17.IsDisposable; + result.SetFor = p17.SetFor; + result.HasDisposed = p17.HasDisposed; + result.Status = p17.Status; + result.DoneAt = p17.DoneAt; + result.IsDone = p17.IsDone; + result.PerformanceDescription = p17.PerformanceDescription; + result.Amount = p17.Amount; + result.AmountType = p17.AmountType; + result.Id = p17.Id; return result; } - public static Expression> ProjectToLDto => p20 => new ActivityLDto() + public static Expression> ProjectToLDto => p19 => new ActivityLDto() { - Type = p20.Type, - Title = p20.Title, - Description = p20.Description, - IsDisposable = p20.IsDisposable, - SetFor = p20.SetFor, - HasDisposed = p20.HasDisposed, - Status = p20.Status, - DoneAt = p20.DoneAt, - IsDone = p20.IsDone, - PerformanceDescription = p20.PerformanceDescription, - Amount = p20.Amount, - AmountType = p20.AmountType, - Id = p20.Id + Type = p19.Type, + Title = p19.Title, + Description = p19.Description, + IsDisposable = p19.IsDisposable, + SetFor = p19.SetFor, + HasDisposed = p19.HasDisposed, + Status = p19.Status, + DoneAt = p19.DoneAt, + IsDone = p19.IsDone, + PerformanceDescription = p19.PerformanceDescription, + Amount = p19.Amount, + AmountType = p19.AmountType, + Id = p19.Id }; private static ApplicationUser funcMain1(Never p4, ApplicationUser p5, ActivitySDto p2) @@ -300,6 +295,7 @@ namespace Brizco.Domain.Mappers { Shift result = p7 ?? new Shift(); + result.Title = p2.ShiftTitle; result.Id = p2.ShiftId; return result; diff --git a/Brizco.Domain/Mappers/ComplexMapper.g.cs b/Brizco.Domain/Mappers/ComplexMapper.g.cs index a3b3c94..9637a34 100644 --- a/Brizco.Domain/Mappers/ComplexMapper.g.cs +++ b/Brizco.Domain/Mappers/ComplexMapper.g.cs @@ -102,68 +102,49 @@ namespace Brizco.Domain.Mappers return result; } - public static Expression> ProjectLDtoToComplex => p15 => new Complex() + public static ComplexLDto AdaptToLDto(this Complex p15) { - Name = p15.Name, - Address = p15.Address, - SupportPhone = p15.SupportPhone, - Users = p15.Users.Select(p16 => new ComplexUser() + return p15 == null ? null : new ComplexLDto() { - UserId = p16.UserId, - ComplexId = p16.ComplexId, - User = new ApplicationUser() {Id = p16.UserId}, - Complex = new Complex() - { - Name = p16.ComplexName, - Id = p16.ComplexId - }, - Id = p16.Id - }).ToList(), - Id = p15.Id - }; - public static ComplexLDto AdaptToLDto(this Complex p17) - { - return p17 == null ? null : new ComplexLDto() - { - Name = p17.Name, - Address = p17.Address, - SupportPhone = p17.SupportPhone, - Users = funcMain3(p17.Users), - Id = p17.Id + Name = p15.Name, + Address = p15.Address, + SupportPhone = p15.SupportPhone, + Users = funcMain3(p15.Users), + Id = p15.Id }; } - public static ComplexLDto AdaptTo(this Complex p19, ComplexLDto p20) + public static ComplexLDto AdaptTo(this Complex p17, ComplexLDto p18) { - if (p19 == null) + if (p17 == null) { return null; } - ComplexLDto result = p20 ?? new ComplexLDto(); + ComplexLDto result = p18 ?? new ComplexLDto(); - result.Name = p19.Name; - result.Address = p19.Address; - result.SupportPhone = p19.SupportPhone; - result.Users = funcMain4(p19.Users, result.Users); - result.Id = p19.Id; + result.Name = p17.Name; + result.Address = p17.Address; + result.SupportPhone = p17.SupportPhone; + result.Users = funcMain4(p17.Users, result.Users); + result.Id = p17.Id; return result; } - public static Expression> ProjectToLDto => p23 => new ComplexLDto() + public static Expression> ProjectToLDto => p21 => new ComplexLDto() { - Name = p23.Name, - Address = p23.Address, - SupportPhone = p23.SupportPhone, - Users = p23.Users.Select(p24 => new ComplexUserSDto() + Name = p21.Name, + Address = p21.Address, + SupportPhone = p21.SupportPhone, + Users = p21.Users.Select(p22 => new ComplexUserSDto() { - FirstName = p24.User != null ? p24.User.FirstName : string.Empty, - LastName = p24.User != null ? p24.User.LastName : string.Empty, - NationalId = p24.User != null ? p24.User.NationalId : string.Empty, - ComplexName = p24.Complex != null ? p24.Complex.Name : string.Empty, - UserId = p24.UserId, - ComplexId = p24.ComplexId, - Id = p24.Id + FirstName = p22.User != null ? p22.User.FirstName : string.Empty, + LastName = p22.User != null ? p22.User.LastName : string.Empty, + NationalId = p22.User != null ? p22.User.NationalId : string.Empty, + ComplexName = p22.Complex != null ? p22.Complex.Name : string.Empty, + UserId = p22.UserId, + ComplexId = p22.ComplexId, + Id = p22.Id }).ToList(), - Id = p23.Id + Id = p21.Id }; private static List funcMain1(List p10) @@ -230,20 +211,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain3(List p18) + private static List funcMain3(List p16) { - if (p18 == null) + if (p16 == null) { return null; } - List result = new List(p18.Count); + List result = new List(p16.Count); int i = 0; - int len = p18.Count; + int len = p16.Count; while (i < len) { - ComplexUser item = p18[i]; + ComplexUser item = p16[i]; result.Add(item == null ? null : new ComplexUserSDto() { FirstName = item.User != null ? item.User.FirstName : string.Empty, @@ -260,20 +241,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain4(List p21, List p22) + private static List funcMain4(List p19, List p20) { - if (p21 == null) + if (p19 == null) { return null; } - List result = new List(p21.Count); + List result = new List(p19.Count); int i = 0; - int len = p21.Count; + int len = p19.Count; while (i < len) { - ComplexUser item = p21[i]; + ComplexUser item = p19[i]; result.Add(item == null ? null : new ComplexUserSDto() { FirstName = item.User != null ? item.User.FirstName : string.Empty, diff --git a/Brizco.Domain/Mappers/PositionMapper.g.cs b/Brizco.Domain/Mappers/PositionMapper.g.cs index 2e97e7c..d1d25b5 100644 --- a/Brizco.Domain/Mappers/PositionMapper.g.cs +++ b/Brizco.Domain/Mappers/PositionMapper.g.cs @@ -114,57 +114,43 @@ namespace Brizco.Domain.Mappers return result; } - public static Expression> ProjectLDtoToPosition => p16 => new Position() + public static PositionLDto AdaptToLDto(this Position p16) { - Name = p16.Name, - Description = p16.Description, - ComplexId = p16.ComplexId, - Complex = new Complex() {Id = p16.ComplexId}, - SectionId = p16.SectionId, - Section = new Section() + return p16 == null ? null : new PositionLDto() { - Name = p16.SectionName, - Id = p16.SectionId - }, - Id = p16.Id - }; - public static PositionLDto AdaptToLDto(this Position p17) - { - return p17 == null ? null : new PositionLDto() - { - Name = p17.Name, - Description = p17.Description, - ComplexId = p17.ComplexId, - SectionId = p17.SectionId, - SectionName = p17.Section != null ? p17.Section.Name : string.Empty, - Id = p17.Id + Name = p16.Name, + Description = p16.Description, + ComplexId = p16.ComplexId, + SectionId = p16.SectionId, + SectionName = p16.Section != null ? p16.Section.Name : string.Empty, + Id = p16.Id }; } - public static PositionLDto AdaptTo(this Position p18, PositionLDto p19) + public static PositionLDto AdaptTo(this Position p17, PositionLDto p18) { - if (p18 == null) + if (p17 == null) { return null; } - PositionLDto result = p19 ?? new PositionLDto(); + PositionLDto result = p18 ?? new PositionLDto(); - result.Name = p18.Name; - result.Description = p18.Description; - result.ComplexId = p18.ComplexId; - result.SectionId = p18.SectionId; - result.SectionName = p18.Section != null ? p18.Section.Name : string.Empty; - result.Id = p18.Id; + result.Name = p17.Name; + result.Description = p17.Description; + result.ComplexId = p17.ComplexId; + result.SectionId = p17.SectionId; + result.SectionName = p17.Section != null ? p17.Section.Name : string.Empty; + result.Id = p17.Id; return result; } - public static Expression> ProjectToLDto => p20 => new PositionLDto() + public static Expression> ProjectToLDto => p19 => new PositionLDto() { - Name = p20.Name, - Description = p20.Description, - ComplexId = p20.ComplexId, - SectionId = p20.SectionId, - SectionName = p20.Section != null ? p20.Section.Name : string.Empty, - Id = p20.Id + Name = p19.Name, + Description = p19.Description, + ComplexId = p19.ComplexId, + SectionId = p19.SectionId, + SectionName = p19.Section != null ? p19.Section.Name : string.Empty, + Id = p19.Id }; private static Complex funcMain1(Never p12, Complex p13, PositionLDto p10) diff --git a/Brizco.Domain/Mappers/SectionMapper.g.cs b/Brizco.Domain/Mappers/SectionMapper.g.cs index 4a57786..f557842 100644 --- a/Brizco.Domain/Mappers/SectionMapper.g.cs +++ b/Brizco.Domain/Mappers/SectionMapper.g.cs @@ -101,62 +101,47 @@ namespace Brizco.Domain.Mappers return result; } - public static Expression> ProjectLDtoToSection => p15 => new Section() + public static SectionLDto AdaptToLDto(this Section p15) { - Name = p15.Name, - Description = p15.Description, - ComplexId = p15.ComplexId, - Positions = p15.Positions.Select(p16 => new Position() + return p15 == null ? null : new SectionLDto() { - Name = p16.Name, - Description = p16.Description, - ComplexId = p16.ComplexId, - SectionId = p16.SectionId, - Id = p16.Id - }).ToList(), - Id = p15.Id - }; - public static SectionLDto AdaptToLDto(this Section p17) - { - return p17 == null ? null : new SectionLDto() - { - Name = p17.Name, - Description = p17.Description, - ComplexId = p17.ComplexId, - Positions = funcMain3(p17.Positions), - Id = p17.Id + Name = p15.Name, + Description = p15.Description, + ComplexId = p15.ComplexId, + Positions = funcMain3(p15.Positions), + Id = p15.Id }; } - public static SectionLDto AdaptTo(this Section p19, SectionLDto p20) + public static SectionLDto AdaptTo(this Section p17, SectionLDto p18) { - if (p19 == null) + if (p17 == null) { return null; } - SectionLDto result = p20 ?? new SectionLDto(); + SectionLDto result = p18 ?? new SectionLDto(); - result.Name = p19.Name; - result.Description = p19.Description; - result.ComplexId = p19.ComplexId; - result.Positions = funcMain4(p19.Positions, result.Positions); - result.Id = p19.Id; + result.Name = p17.Name; + result.Description = p17.Description; + result.ComplexId = p17.ComplexId; + result.Positions = funcMain4(p17.Positions, result.Positions); + result.Id = p17.Id; return result; } - public static Expression> ProjectToLDto => p23 => new SectionLDto() + public static Expression> ProjectToLDto => p21 => new SectionLDto() { - Name = p23.Name, - Description = p23.Description, - ComplexId = p23.ComplexId, - Positions = p23.Positions.Select(p24 => new PositionSDto() + Name = p21.Name, + Description = p21.Description, + ComplexId = p21.ComplexId, + Positions = p21.Positions.Select(p22 => new PositionSDto() { - Name = p24.Name, - Description = p24.Description, - ComplexId = p24.ComplexId, - SectionId = p24.SectionId, - Id = p24.Id + Name = p22.Name, + Description = p22.Description, + ComplexId = p22.ComplexId, + SectionId = p22.SectionId, + Id = p22.Id }).ToList(), - Id = p23.Id + Id = p21.Id }; private static List funcMain1(List p10) @@ -215,20 +200,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain3(List p18) + private static List funcMain3(List p16) { - if (p18 == null) + if (p16 == null) { return null; } - List result = new List(p18.Count); + List result = new List(p16.Count); int i = 0; - int len = p18.Count; + int len = p16.Count; while (i < len) { - Position item = p18[i]; + Position item = p16[i]; result.Add(item == null ? null : new PositionSDto() { Name = item.Name, @@ -243,20 +228,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain4(List p21, List p22) + private static List funcMain4(List p19, List p20) { - if (p21 == null) + if (p19 == null) { return null; } - List result = new List(p21.Count); + List result = new List(p19.Count); int i = 0; - int len = p21.Count; + int len = p19.Count; while (i < len) { - Position item = p21[i]; + Position item = p19[i]; result.Add(item == null ? null : new PositionSDto() { Name = item.Name, diff --git a/Brizco.Domain/Mappers/ShiftMapper.g.cs b/Brizco.Domain/Mappers/ShiftMapper.g.cs index f9e8923..6c103cc 100644 --- a/Brizco.Domain/Mappers/ShiftMapper.g.cs +++ b/Brizco.Domain/Mappers/ShiftMapper.g.cs @@ -132,71 +132,54 @@ namespace Brizco.Domain.Mappers return result; } - public static Expression> ProjectLDtoToShift => p29 => new Shift() + public static ShiftLDto AdaptToLDto(this Shift p29) { - Title = p29.Title, - StartAt = p29.StartAt, - EndAt = p29.EndAt, - Description = p29.Description, - ComplexId = p29.ComplexId, - Complex = new Complex() {Id = p29.ComplexId}, - Days = p29.Days.Select(p30 => new ShiftDay() {}).ToList(), - Routines = p29.Routines.Select(p31 => new ShiftRoutine() + return p29 == null ? null : new ShiftLDto() { - RoutineId = p31.RoutineId, - ShiftId = p31.ShiftId, - Id = p31.Id - }).ToList(), - Id = p29.Id - }; - public static ShiftLDto AdaptToLDto(this Shift p32) - { - return p32 == null ? null : new ShiftLDto() - { - Title = p32.Title, - Description = p32.Description, - StartAt = p32.StartAt, - EndAt = p32.EndAt, - ComplexId = p32.ComplexId, - Days = funcMain12(p32.Days.Select(funcMain13).ToList()), - Routines = funcMain14(p32.Routines), - Id = p32.Id + Title = p29.Title, + Description = p29.Description, + StartAt = p29.StartAt, + EndAt = p29.EndAt, + ComplexId = p29.ComplexId, + Days = funcMain12(p29.Days.Select(funcMain13).ToList()), + Routines = funcMain14(p29.Routines), + Id = p29.Id }; } - public static ShiftLDto AdaptTo(this Shift p35, ShiftLDto p36) + public static ShiftLDto AdaptTo(this Shift p32, ShiftLDto p33) { - if (p35 == null) + if (p32 == null) { return null; } - ShiftLDto result = p36 ?? new ShiftLDto(); + ShiftLDto result = p33 ?? new ShiftLDto(); - result.Title = p35.Title; - result.Description = p35.Description; - result.StartAt = p35.StartAt; - result.EndAt = p35.EndAt; - result.ComplexId = p35.ComplexId; - result.Days = funcMain15(p35.Days.Select(funcMain13).ToList(), result.Days); - result.Routines = funcMain16(p35.Routines, result.Routines); - result.Id = p35.Id; + result.Title = p32.Title; + result.Description = p32.Description; + result.StartAt = p32.StartAt; + result.EndAt = p32.EndAt; + result.ComplexId = p32.ComplexId; + result.Days = funcMain15(p32.Days.Select(funcMain13).ToList(), result.Days); + result.Routines = funcMain16(p32.Routines, result.Routines); + result.Id = p32.Id; return result; } - public static Expression> ProjectToLDto => p41 => new ShiftLDto() + public static Expression> ProjectToLDto => p38 => new ShiftLDto() { - Title = p41.Title, - Description = p41.Description, - StartAt = p41.StartAt, - EndAt = p41.EndAt, - ComplexId = p41.ComplexId, - Days = p41.Days.Select(d => d.DayOfWeek).ToList(), - Routines = p41.Routines.Select(p42 => new ShiftRoutineSDto() + Title = p38.Title, + Description = p38.Description, + StartAt = p38.StartAt, + EndAt = p38.EndAt, + ComplexId = p38.ComplexId, + Days = p38.Days.Select(d => d.DayOfWeek).ToList(), + Routines = p38.Routines.Select(p39 => new ShiftRoutineSDto() { - RoutineId = p42.RoutineId, - ShiftId = p42.ShiftId, - Id = p42.Id + RoutineId = p39.RoutineId, + ShiftId = p39.ShiftId, + Id = p39.Id }).ToList(), - Id = p41.Id + Id = p38.Id }; private static List funcMain1(List p2) @@ -400,20 +383,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain12(List p33) + private static List funcMain12(List p30) { - if (p33 == null) + if (p30 == null) { return null; } - List result = new List(p33.Count); + List result = new List(p30.Count); int i = 0; - int len = p33.Count; + int len = p30.Count; while (i < len) { - DayOfWeek item = p33[i]; + DayOfWeek item = p30[i]; result.Add(item); i++; } @@ -426,20 +409,20 @@ namespace Brizco.Domain.Mappers return d.DayOfWeek; } - private static List funcMain14(List p34) + private static List funcMain14(List p31) { - if (p34 == null) + if (p31 == null) { return null; } - List result = new List(p34.Count); + List result = new List(p31.Count); int i = 0; - int len = p34.Count; + int len = p31.Count; while (i < len) { - ShiftRoutine item = p34[i]; + ShiftRoutine item = p31[i]; result.Add(item == null ? null : new ShiftRoutineSDto() { RoutineId = item.RoutineId, @@ -452,20 +435,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain15(List p37, List p38) + private static List funcMain15(List p34, List p35) { - if (p37 == null) + if (p34 == null) { return null; } - List result = new List(p37.Count); + List result = new List(p34.Count); int i = 0; - int len = p37.Count; + int len = p34.Count; while (i < len) { - DayOfWeek item = p37[i]; + DayOfWeek item = p34[i]; result.Add(item); i++; } @@ -473,20 +456,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain16(List p39, List p40) + private static List funcMain16(List p36, List p37) { - if (p39 == null) + if (p36 == null) { return null; } - List result = new List(p39.Count); + List result = new List(p36.Count); int i = 0; - int len = p39.Count; + int len = p36.Count; while (i < len) { - ShiftRoutine item = p39[i]; + ShiftRoutine item = p36[i]; result.Add(item == null ? null : new ShiftRoutineSDto() { RoutineId = item.RoutineId, diff --git a/Brizco.Domain/Mappers/ShiftPlanMapper.g.cs b/Brizco.Domain/Mappers/ShiftPlanMapper.g.cs index b28615d..bff8cf5 100644 --- a/Brizco.Domain/Mappers/ShiftPlanMapper.g.cs +++ b/Brizco.Domain/Mappers/ShiftPlanMapper.g.cs @@ -14,6 +14,7 @@ namespace Brizco.Domain.Mappers { return p1 == null ? null : new ShiftPlan() { + PlanFor = p1.PlanFor, IsCompleted = p1.IsCompleted, CompletePercent = p1.CompletePercent, CompleteDescription = p1.CompleteDescription, @@ -29,6 +30,7 @@ namespace Brizco.Domain.Mappers } ShiftPlan result = p3 ?? new ShiftPlan(); + result.PlanFor = p2.PlanFor; result.IsCompleted = p2.IsCompleted; result.CompletePercent = p2.CompletePercent; result.CompleteDescription = p2.CompleteDescription; @@ -39,6 +41,7 @@ namespace Brizco.Domain.Mappers } public static Expression> ProjectToShiftPlan => p4 => new ShiftPlan() { + PlanFor = p4.PlanFor, IsCompleted = p4.IsCompleted, CompletePercent = p4.CompletePercent, CompleteDescription = p4.CompleteDescription, @@ -49,6 +52,7 @@ namespace Brizco.Domain.Mappers { return p5 == null ? null : new ShiftPlanSDto() { + PlanFor = p5.PlanFor, IsCompleted = p5.IsCompleted, CompletePercent = p5.CompletePercent, CompleteDescription = p5.CompleteDescription, @@ -65,6 +69,7 @@ namespace Brizco.Domain.Mappers } ShiftPlanSDto result = p7 ?? new ShiftPlanSDto(); + result.PlanFor = p6.PlanFor; result.IsCompleted = p6.IsCompleted; result.CompletePercent = p6.CompletePercent; result.CompleteDescription = p6.CompleteDescription; @@ -76,6 +81,7 @@ namespace Brizco.Domain.Mappers } public static Expression> ProjectToSDto => p8 => new ShiftPlanSDto() { + PlanFor = p8.PlanFor, IsCompleted = p8.IsCompleted, CompletePercent = p8.CompletePercent, CompleteDescription = p8.CompleteDescription, @@ -116,72 +122,55 @@ namespace Brizco.Domain.Mappers return result; } - public static Expression> ProjectLDtoToShiftPlan => p15 => new ShiftPlan() + public static ShiftPlanLDto AdaptToLDto(this ShiftPlan p15) { - PlanFor = p15.PlanFor, - IsCompleted = p15.IsCompleted, - CompletePercent = p15.CompletePercent, - CompleteDescription = p15.CompleteDescription, - ShiftId = p15.ShiftId, - RoutineId = p15.RoutineId, - Users = p15.Users.Select(p16 => new ShiftPlanUser() + return p15 == null ? null : new ShiftPlanLDto() { - ShiftPlanId = p16.ShiftPlanId, - PositionId = p16.PositionId, - UserId = p16.UserId, - Id = p16.Id - }).ToList(), - Id = p15.Id - }; - public static ShiftPlanLDto AdaptToLDto(this ShiftPlan p17) - { - return p17 == null ? null : new ShiftPlanLDto() - { - PlanFor = p17.PlanFor, - RoutineId = p17.RoutineId, - IsCompleted = p17.IsCompleted, - CompletePercent = p17.CompletePercent, - CompleteDescription = p17.CompleteDescription, - ShiftId = p17.ShiftId, - Users = funcMain3(p17.Users), - Id = p17.Id + PlanFor = p15.PlanFor, + RoutineId = p15.RoutineId, + IsCompleted = p15.IsCompleted, + CompletePercent = p15.CompletePercent, + CompleteDescription = p15.CompleteDescription, + ShiftId = p15.ShiftId, + Users = funcMain3(p15.Users), + Id = p15.Id }; } - public static ShiftPlanLDto AdaptTo(this ShiftPlan p19, ShiftPlanLDto p20) + public static ShiftPlanLDto AdaptTo(this ShiftPlan p17, ShiftPlanLDto p18) { - if (p19 == null) + if (p17 == null) { return null; } - ShiftPlanLDto result = p20 ?? new ShiftPlanLDto(); + ShiftPlanLDto result = p18 ?? new ShiftPlanLDto(); - result.PlanFor = p19.PlanFor; - result.RoutineId = p19.RoutineId; - result.IsCompleted = p19.IsCompleted; - result.CompletePercent = p19.CompletePercent; - result.CompleteDescription = p19.CompleteDescription; - result.ShiftId = p19.ShiftId; - result.Users = funcMain4(p19.Users, result.Users); - result.Id = p19.Id; + result.PlanFor = p17.PlanFor; + result.RoutineId = p17.RoutineId; + result.IsCompleted = p17.IsCompleted; + result.CompletePercent = p17.CompletePercent; + result.CompleteDescription = p17.CompleteDescription; + result.ShiftId = p17.ShiftId; + result.Users = funcMain4(p17.Users, result.Users); + result.Id = p17.Id; return result; } - public static Expression> ProjectToLDto => p23 => new ShiftPlanLDto() + public static Expression> ProjectToLDto => p21 => new ShiftPlanLDto() { - PlanFor = p23.PlanFor, - RoutineId = p23.RoutineId, - IsCompleted = p23.IsCompleted, - CompletePercent = p23.CompletePercent, - CompleteDescription = p23.CompleteDescription, - ShiftId = p23.ShiftId, - Users = p23.Users.Select(p24 => new ShiftPlanUserSDto() + PlanFor = p21.PlanFor, + RoutineId = p21.RoutineId, + IsCompleted = p21.IsCompleted, + CompletePercent = p21.CompletePercent, + CompleteDescription = p21.CompleteDescription, + ShiftId = p21.ShiftId, + Users = p21.Users.Select(p22 => new ShiftPlanUserSDto() { - ShiftPlanId = p24.ShiftPlanId, - UserId = p24.UserId, - PositionId = p24.PositionId, - Id = p24.Id + ShiftPlanId = p22.ShiftPlanId, + UserId = p22.UserId, + PositionId = p22.PositionId, + Id = p22.Id }).ToList(), - Id = p23.Id + Id = p21.Id }; private static List funcMain1(List p10) @@ -238,20 +227,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain3(List p18) + private static List funcMain3(List p16) { - if (p18 == null) + if (p16 == null) { return null; } - List result = new List(p18.Count); + List result = new List(p16.Count); int i = 0; - int len = p18.Count; + int len = p16.Count; while (i < len) { - ShiftPlanUser item = p18[i]; + ShiftPlanUser item = p16[i]; result.Add(item == null ? null : new ShiftPlanUserSDto() { ShiftPlanId = item.ShiftPlanId, @@ -265,20 +254,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain4(List p21, List p22) + private static List funcMain4(List p19, List p20) { - if (p21 == null) + if (p19 == null) { return null; } - List result = new List(p21.Count); + List result = new List(p19.Count); int i = 0; - int len = p21.Count; + int len = p19.Count; while (i < len) { - ShiftPlanUser item = p21[i]; + ShiftPlanUser item = p19[i]; result.Add(item == null ? null : new ShiftPlanUserSDto() { ShiftPlanId = item.ShiftPlanId, diff --git a/Brizco.Domain/Mappers/TaskMapper.g.cs b/Brizco.Domain/Mappers/TaskMapper.g.cs index a39e3c3..b51c4a8 100644 --- a/Brizco.Domain/Mappers/TaskMapper.g.cs +++ b/Brizco.Domain/Mappers/TaskMapper.g.cs @@ -186,122 +186,86 @@ namespace Brizco.Domain.Mappers return result; } - public static Expression> ProjectLDtoToTask => p47 => new Task() + public static TaskLDto AdaptToLDto(this Task p47) { - Type = p47.Type, - Title = p47.Title, - Description = p47.Description, - IsDisposable = p47.IsDisposable, - SetFor = Convert.ToDateTime(p47.SetFor), - HasDisposed = p47.HasDisposed, - ScheduleType = p47.ScheduleType, - Amount = p47.Amount, - AmountType = p47.AmountType, - Shifts = p47.Shifts.Select(p48 => new TaskShift() + return p47 == null ? null : new TaskLDto() { - TaskId = p48.TaskId, - ShiftId = p48.ShiftId - }).ToList(), - Days = p47.Days.Select(p49 => new TaskDay() - { - DayOfWeek = p49.DayOfWeek, - TaskId = p49.TaskId, - Id = p49.Id - }).ToList(), - Routines = p47.Routines.Select(p50 => new TaskRoutine() - { - TaskId = p50.TaskId, - RoutineId = p50.RoutineId, - Id = p50.Id - }).ToList(), - Positions = p47.Positions.Select(p51 => new TaskPosition() - { - PositionId = p51.PositionId, - TaskId = p51.TaskId, - Id = p51.Id - }).ToList(), - Id = p47.Id - }; - public static TaskLDto AdaptToLDto(this Task p52) - { - return p52 == null ? null : new TaskLDto() - { - Type = p52.Type, - Title = p52.Title, - Description = p52.Description, - IsDisposable = p52.IsDisposable, - SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p52.SetFor), - HasDisposed = p52.HasDisposed, - ScheduleType = p52.ScheduleType, - Amount = p52.Amount, - AmountType = p52.AmountType, - Shifts = funcMain25(p52.Shifts), - Positions = funcMain26(p52.Positions), - Days = funcMain27(p52.Days), - Routines = funcMain28(p52.Routines), - Id = p52.Id + Type = p47.Type, + Title = p47.Title, + Description = p47.Description, + IsDisposable = p47.IsDisposable, + SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p47.SetFor), + HasDisposed = p47.HasDisposed, + ScheduleType = p47.ScheduleType, + Amount = p47.Amount, + AmountType = p47.AmountType, + Shifts = funcMain25(p47.Shifts), + Positions = funcMain26(p47.Positions), + Days = funcMain27(p47.Days), + Routines = funcMain28(p47.Routines), + Id = p47.Id }; } - public static TaskLDto AdaptTo(this Task p57, TaskLDto p58) + public static TaskLDto AdaptTo(this Task p52, TaskLDto p53) { - if (p57 == null) + if (p52 == null) { return null; } - TaskLDto result = p58 ?? new TaskLDto(); + TaskLDto result = p53 ?? new TaskLDto(); - result.Type = p57.Type; - result.Title = p57.Title; - result.Description = p57.Description; - result.IsDisposable = p57.IsDisposable; - result.SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p57.SetFor); - result.HasDisposed = p57.HasDisposed; - result.ScheduleType = p57.ScheduleType; - result.Amount = p57.Amount; - result.AmountType = p57.AmountType; - result.Shifts = funcMain29(p57.Shifts, result.Shifts); - result.Positions = funcMain30(p57.Positions, result.Positions); - result.Days = funcMain31(p57.Days, result.Days); - result.Routines = funcMain32(p57.Routines, result.Routines); - result.Id = p57.Id; + result.Type = p52.Type; + result.Title = p52.Title; + result.Description = p52.Description; + result.IsDisposable = p52.IsDisposable; + result.SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p52.SetFor); + result.HasDisposed = p52.HasDisposed; + result.ScheduleType = p52.ScheduleType; + result.Amount = p52.Amount; + result.AmountType = p52.AmountType; + result.Shifts = funcMain29(p52.Shifts, result.Shifts); + result.Positions = funcMain30(p52.Positions, result.Positions); + result.Days = funcMain31(p52.Days, result.Days); + result.Routines = funcMain32(p52.Routines, result.Routines); + result.Id = p52.Id; return result; } - public static Expression> ProjectToLDto => p67 => new TaskLDto() + public static Expression> ProjectToLDto => p62 => new TaskLDto() { - Type = p67.Type, - Title = p67.Title, - Description = p67.Description, - IsDisposable = p67.IsDisposable, - SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p67.SetFor), - HasDisposed = p67.HasDisposed, - ScheduleType = p67.ScheduleType, - Amount = p67.Amount, - AmountType = p67.AmountType, - Shifts = p67.Shifts.Select(p68 => new TaskShiftSDto() + Type = p62.Type, + Title = p62.Title, + Description = p62.Description, + IsDisposable = p62.IsDisposable, + SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p62.SetFor), + HasDisposed = p62.HasDisposed, + ScheduleType = p62.ScheduleType, + Amount = p62.Amount, + AmountType = p62.AmountType, + Shifts = p62.Shifts.Select(p63 => new TaskShiftSDto() { - ShiftId = p68.ShiftId, - TaskId = p68.TaskId + ShiftId = p63.ShiftId, + TaskId = p63.TaskId }).ToList(), - Positions = p67.Positions.Select(p69 => new TaskPositionSDto() + Positions = p62.Positions.Select(p64 => new TaskPositionSDto() { - PositionId = p69.PositionId, - TaskId = p69.TaskId, - Id = p69.Id + PositionId = p64.PositionId, + TaskId = p64.TaskId, + Id = p64.Id }).ToList(), - Days = p67.Days.Select(p70 => new TaskDaySDto() + Days = p62.Days.Select(p65 => new TaskDaySDto() { - DayOfWeek = p70.DayOfWeek, - TaskId = p70.TaskId, - Id = p70.Id + DayOfWeek = p65.DayOfWeek, + TaskId = p65.TaskId, + Id = p65.Id }).ToList(), - Routines = p67.Routines.Select(p71 => new TaskRoutineSDto() + Routines = p62.Routines.Select(p66 => new TaskRoutineSDto() { - TaskId = p71.TaskId, - RoutineId = p71.RoutineId, - Id = p71.Id + TaskId = p66.TaskId, + RoutineId = p66.RoutineId, + Id = p66.Id }).ToList(), - Id = p67.Id + Id = p62.Id }; private static List funcMain1(List p2) @@ -774,20 +738,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain25(List p53) + private static List funcMain25(List p48) { - if (p53 == null) + if (p48 == null) { return null; } - List result = new List(p53.Count); + List result = new List(p48.Count); int i = 0; - int len = p53.Count; + int len = p48.Count; while (i < len) { - TaskShift item = p53[i]; + TaskShift item = p48[i]; result.Add(item == null ? null : new TaskShiftSDto() { ShiftId = item.ShiftId, @@ -799,20 +763,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain26(List p54) + private static List funcMain26(List p49) { - if (p54 == null) + if (p49 == null) { return null; } - List result = new List(p54.Count); + List result = new List(p49.Count); int i = 0; - int len = p54.Count; + int len = p49.Count; while (i < len) { - TaskPosition item = p54[i]; + TaskPosition item = p49[i]; result.Add(item == null ? null : new TaskPositionSDto() { PositionId = item.PositionId, @@ -825,20 +789,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain27(List p55) + private static List funcMain27(List p50) { - if (p55 == null) + if (p50 == null) { return null; } - List result = new List(p55.Count); + List result = new List(p50.Count); int i = 0; - int len = p55.Count; + int len = p50.Count; while (i < len) { - TaskDay item = p55[i]; + TaskDay item = p50[i]; result.Add(item == null ? null : new TaskDaySDto() { DayOfWeek = item.DayOfWeek, @@ -851,20 +815,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain28(List p56) + private static List funcMain28(List p51) { - if (p56 == null) + if (p51 == null) { return null; } - List result = new List(p56.Count); + List result = new List(p51.Count); int i = 0; - int len = p56.Count; + int len = p51.Count; while (i < len) { - TaskRoutine item = p56[i]; + TaskRoutine item = p51[i]; result.Add(item == null ? null : new TaskRoutineSDto() { TaskId = item.TaskId, @@ -877,20 +841,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain29(List p59, List p60) + private static List funcMain29(List p54, List p55) { - if (p59 == null) + if (p54 == null) { return null; } - List result = new List(p59.Count); + List result = new List(p54.Count); int i = 0; - int len = p59.Count; + int len = p54.Count; while (i < len) { - TaskShift item = p59[i]; + TaskShift item = p54[i]; result.Add(item == null ? null : new TaskShiftSDto() { ShiftId = item.ShiftId, @@ -902,20 +866,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain30(List p61, List p62) + private static List funcMain30(List p56, List p57) { - if (p61 == null) + if (p56 == null) { return null; } - List result = new List(p61.Count); + List result = new List(p56.Count); int i = 0; - int len = p61.Count; + int len = p56.Count; while (i < len) { - TaskPosition item = p61[i]; + TaskPosition item = p56[i]; result.Add(item == null ? null : new TaskPositionSDto() { PositionId = item.PositionId, @@ -928,20 +892,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain31(List p63, List p64) + private static List funcMain31(List p58, List p59) { - if (p63 == null) + if (p58 == null) { return null; } - List result = new List(p63.Count); + List result = new List(p58.Count); int i = 0; - int len = p63.Count; + int len = p58.Count; while (i < len) { - TaskDay item = p63[i]; + TaskDay item = p58[i]; result.Add(item == null ? null : new TaskDaySDto() { DayOfWeek = item.DayOfWeek, @@ -954,20 +918,20 @@ namespace Brizco.Domain.Mappers } - private static List funcMain32(List p65, List p66) + private static List funcMain32(List p60, List p61) { - if (p65 == null) + if (p60 == null) { return null; } - List result = new List(p65.Count); + List result = new List(p60.Count); int i = 0; - int len = p65.Count; + int len = p60.Count; while (i < len) { - TaskRoutine item = p65[i]; + TaskRoutine item = p60[i]; result.Add(item == null ? null : new TaskRoutineSDto() { TaskId = item.TaskId, diff --git a/Brizco.Domain/MapsterRegister.cs b/Brizco.Domain/MapsterRegister.cs index 0cb1f9e..f86a754 100644 --- a/Brizco.Domain/MapsterRegister.cs +++ b/Brizco.Domain/MapsterRegister.cs @@ -16,6 +16,7 @@ public class MapsterRegister : IRegister config.NewConfig() .Map("UserFirstName", o => o.User !=null ? o.User.FirstName : string.Empty) .Map("UserLastName", o => o.User != null ? o.User.LastName : string.Empty) + .Map("ShiftTitle",o=>o.Shift != null ? o.Shift.Title : string.Empty) .TwoWays(); config.NewConfig() diff --git a/Brizco.Repository/Handlers/Shift/GetShiftsQueryHandler.cs b/Brizco.Repository/Handlers/Shift/GetShiftsQueryHandler.cs index 90da826..6d4aef7 100644 --- a/Brizco.Repository/Handlers/Shift/GetShiftsQueryHandler.cs +++ b/Brizco.Repository/Handlers/Shift/GetShiftsQueryHandler.cs @@ -47,7 +47,9 @@ public class GetShiftPlansQueryHandler : IRequestHandler() .TableNoTracking .FirstOrDefaultAsync(s => s.ShiftId == shift.Id && s.PlanFor.Date == selectedDate.Date, cancellationToken); - shift.IsCompleted = existedShiftPlan is { IsCompleted : true }; + shift.IsCompleted = existedShiftPlan?.IsCompleted ?? false; + shift.CurrentShiftPlanId = existedShiftPlan?.Id ?? default; + shift.HasCurrentShiftPlan = existedShiftPlan != null; } } else