diff --git a/.version b/.version
index 57d102a..963409b 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-0.1.2.0
\ No newline at end of file
+0.1.3.1
\ No newline at end of file
diff --git a/Brizco.Api/Brizco.Api.csproj b/Brizco.Api/Brizco.Api.csproj
index ecbbf87..c17515f 100644
--- a/Brizco.Api/Brizco.Api.csproj
+++ b/Brizco.Api/Brizco.Api.csproj
@@ -6,8 +6,8 @@
enable
Linux
..\docker-compose.dcproj
- 0.1.2.0
- 0.1.2.0
+ 0.1.3.1
+ 0.1.3.1
diff --git a/Brizco.Api/Controllers/ComplexController.cs b/Brizco.Api/Controllers/ComplexController.cs
index cf7f85d..97b5e18 100644
--- a/Brizco.Api/Controllers/ComplexController.cs
+++ b/Brizco.Api/Controllers/ComplexController.cs
@@ -23,7 +23,7 @@ public class ComplexController : ICarterModule
group.MapPut("", Put)
.HasApiVersion(1.0);
- group.MapDelete("", Delete)
+ group.MapDelete("{id}", Delete)
.HasApiVersion(1.0);
}
diff --git a/Brizco.Api/Controllers/RoutineController.cs b/Brizco.Api/Controllers/RoutineController.cs
index 25b2a70..65b3893 100644
--- a/Brizco.Api/Controllers/RoutineController.cs
+++ b/Brizco.Api/Controllers/RoutineController.cs
@@ -12,6 +12,10 @@ public class RoutineController : ICarterModule
.WithDisplayName("GetAllRoutines")
.HasApiVersion(1.0);
+ group.MapGet("{id}/shift", GetShiftsAsync)
+ .WithDisplayName("GetRoutineShifts")
+ .HasApiVersion(1.0);
+
group.MapGet("{id}", GetAsync)
.WithDisplayName("GetRoutine")
.HasApiVersion(1.0);
@@ -34,6 +38,10 @@ public class RoutineController : ICarterModule
public async Task GetAsync(Guid id, ISender sender, CancellationToken cancellationToken)
=> TypedResults.Ok(await sender.Send(new GetRoutineQuery(id), cancellationToken));
+ // GET:Get Shifts By Id
+ public async Task GetShiftsAsync(Guid id, ISender sender, CancellationToken cancellationToken)
+ => TypedResults.Ok(await sender.Send(new GetRoutineShiftsQuery(id), cancellationToken));
+
// POST:Create Entity
public async Task Post([FromBody] CreateRoutineCommand ent, ISender mediator, CancellationToken cancellationToken)
=> TypedResults.Ok(await mediator.Send(ent, cancellationToken));
diff --git a/Brizco.Api/Controllers/ShiftPlanController.cs b/Brizco.Api/Controllers/ShiftPlanController.cs
index e0f0b9f..f297741 100644
--- a/Brizco.Api/Controllers/ShiftPlanController.cs
+++ b/Brizco.Api/Controllers/ShiftPlanController.cs
@@ -34,7 +34,7 @@ public class ShiftPlanController : ICarterModule
// GET:Get An Entity By Id
public async Task GetAsync(Guid id, ISender sender, CancellationToken cancellationToken)
- => TypedResults.Ok(await sender.Send(new GetShiftPlanQuery(id)));
+ => TypedResults.Ok(await sender.Send(new GetShiftPlanQuery(id),cancellationToken));
// POST:Create Entity
public async Task Post([FromBody] CreateShiftPlanCommand ent, ISender mediator, CancellationToken cancellationToken)
diff --git a/Brizco.Api/Controllers/TaskController.cs b/Brizco.Api/Controllers/TaskController.cs
index f379916..4a0871d 100644
--- a/Brizco.Api/Controllers/TaskController.cs
+++ b/Brizco.Api/Controllers/TaskController.cs
@@ -25,7 +25,7 @@ public class TaskController : ICarterModule
group.MapPut("", Put)
.HasApiVersion(1.0);
- group.MapDelete("", Delete)
+ group.MapDelete("{id}", Delete)
.HasApiVersion(1.0);
}
@@ -35,7 +35,7 @@ public class TaskController : ICarterModule
// GET:Get An Entity By Id
public async Task GetAsync(Guid id, ISender sender, CancellationToken cancellationToken)
- => TypedResults.Ok(await sender.Send(new GetTaskQuery(id)));
+ => TypedResults.Ok(await sender.Send(new GetTaskQuery(id),cancellationToken));
// POST:Create Entity
public async Task Post([FromBody] CreateTaskCommand ent, ISender mediator, CancellationToken cancellationToken)
diff --git a/Brizco.Domain/Brizco.Domain.csproj b/Brizco.Domain/Brizco.Domain.csproj
index 2bab5f5..e6ccecf 100644
--- a/Brizco.Domain/Brizco.Domain.csproj
+++ b/Brizco.Domain/Brizco.Domain.csproj
@@ -52,6 +52,7 @@
+
diff --git a/Brizco.Domain/CommandQueries/Commands/PositionCommands.cs b/Brizco.Domain/CommandQueries/Commands/PositionCommands.cs
index 27c763e..65a2671 100644
--- a/Brizco.Domain/CommandQueries/Commands/PositionCommands.cs
+++ b/Brizco.Domain/CommandQueries/Commands/PositionCommands.cs
@@ -8,12 +8,3 @@ public sealed record UpdatePositionCommand(Guid Id, string Title, string Descrip
public sealed record DeletePositionCommand(Guid Id)
: IRequest;
-
-public sealed record CreatePositionUserCommand(Guid PositionId,Guid UserId, Guid ShiftPlanId)
- : IRequest;
-
-public sealed record UpdatePositionUserCommand(Guid PositionId, Guid UserId, Guid ShiftPlanId)
- : IRequest;
-
-public sealed record DeletePositionUserCommand(Guid PositionId, Guid UserId, Guid ShiftPlanId)
- : IRequest;
\ No newline at end of file
diff --git a/Brizco.Domain/CommandQueries/Commands/RoutineCommands.cs b/Brizco.Domain/CommandQueries/Commands/RoutineCommands.cs
index 6257490..81ff02e 100644
--- a/Brizco.Domain/CommandQueries/Commands/RoutineCommands.cs
+++ b/Brizco.Domain/CommandQueries/Commands/RoutineCommands.cs
@@ -1,10 +1,10 @@
namespace Brizco.Domain.CommandQueries.Commands;
-public sealed record CreateRoutineCommand(string Title, string Description)
+public sealed record CreateRoutineCommand(string Name, string Description)
: IRequest;
-public sealed record UpdateRoutineCommand(Guid Id, string Title, string Description)
+public sealed record UpdateRoutineCommand(Guid Id, string Name, string Description)
: IRequest;
public sealed record DeleteRoutineCommand(Guid Id)
diff --git a/Brizco.Domain/CommandQueries/Commands/ShiftPlanCommands.cs b/Brizco.Domain/CommandQueries/Commands/ShiftPlanCommands.cs
index aad000b..2fe64c5 100644
--- a/Brizco.Domain/CommandQueries/Commands/ShiftPlanCommands.cs
+++ b/Brizco.Domain/CommandQueries/Commands/ShiftPlanCommands.cs
@@ -1,9 +1,9 @@
namespace Brizco.Domain.CommandQueries.Commands;
-public record CreateShiftPlanCommand(DateTime PlanDate,Guid ShiftId,List UserIds)
+public record CreateShiftPlanCommand(DateTime PlanDate,Guid ShiftId,Guid RoutineId, List> UserAndPositionIds)
:IRequest;
-public record UpdateShiftPlanCommand(Guid Id,DateTime PlanDate, Guid ShiftId, List UserIds)
+public record UpdateShiftPlanCommand(Guid Id,DateTime PlanDate, Guid ShiftId, Guid RoutineId, List> UserAndPositionIds)
: IRequest;
public record DeleteShiftPlanCommand(Guid Id)
diff --git a/Brizco.Domain/CommandQueries/Queries/RoutineQueries.cs b/Brizco.Domain/CommandQueries/Queries/RoutineQueries.cs
index 7d5e24e..f888925 100644
--- a/Brizco.Domain/CommandQueries/Queries/RoutineQueries.cs
+++ b/Brizco.Domain/CommandQueries/Queries/RoutineQueries.cs
@@ -4,4 +4,7 @@ public sealed record GetRoutinesQuery(int Page = 0) :
IRequest>;
public sealed record GetRoutineQuery(Guid Id) :
- IRequest;
\ No newline at end of file
+ IRequest;
+
+public sealed record GetRoutineShiftsQuery(Guid Id):
+ IRequest>;
\ No newline at end of file
diff --git a/Brizco.Domain/Dtos/LargDtos/PositionLDto.cs b/Brizco.Domain/Dtos/LargDtos/PositionLDto.cs
index db3cf06..a131c6f 100644
--- a/Brizco.Domain/Dtos/LargDtos/PositionLDto.cs
+++ b/Brizco.Domain/Dtos/LargDtos/PositionLDto.cs
@@ -10,6 +10,4 @@ public class PositionLDto : BaseDto
public Guid SectionId { get; set; }
public string SectionName { get; set; } = string.Empty;
-
- public List Users { get; set; } = new();
}
\ No newline at end of file
diff --git a/Brizco.Domain/Dtos/LargDtos/TaskLDto.cs b/Brizco.Domain/Dtos/LargDtos/TaskLDto.cs
index 537579a..c1bfd0f 100644
--- a/Brizco.Domain/Dtos/LargDtos/TaskLDto.cs
+++ b/Brizco.Domain/Dtos/LargDtos/TaskLDto.cs
@@ -8,7 +8,7 @@ public class TaskLDto : BaseDto
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public bool IsDisposable { get; set; }
- public DateTime SetFor { get; set; }
+ public long SetFor { get; set; }
public bool HasDisposed { get; set; }
public TaskScheduleType ScheduleType { get; set; }
diff --git a/Brizco.Domain/Dtos/ResponseDto/RoutineShiftResponseDto.cs b/Brizco.Domain/Dtos/ResponseDto/RoutineShiftResponseDto.cs
new file mode 100644
index 0000000..9b4d2b4
--- /dev/null
+++ b/Brizco.Domain/Dtos/ResponseDto/RoutineShiftResponseDto.cs
@@ -0,0 +1,7 @@
+namespace Brizco.Domain.Dtos.ResponseDto;
+
+public class RoutineShiftResponseDto
+{
+ public DayOfWeek Day { get; set; }
+ public List Shifts { get; set; } = new();
+}
\ No newline at end of file
diff --git a/Brizco.Domain/Dtos/SmallDtos/PositionUserSDto.cs b/Brizco.Domain/Dtos/SmallDtos/PositionUserSDto.cs
deleted file mode 100644
index cd278c5..0000000
--- a/Brizco.Domain/Dtos/SmallDtos/PositionUserSDto.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace Brizco.Domain.Dtos.SmallDtos;
-
-public class PositionUserSDto : BaseDto
-{
- public Guid ApplicationUserId { get; set; }
- public Guid PositionId { get; set; }
-}
\ No newline at end of file
diff --git a/Brizco.Domain/Dtos/SmallDtos/ShiftPlanUserSDto.cs b/Brizco.Domain/Dtos/SmallDtos/ShiftPlanUserSDto.cs
index d77fa54..7f5fd1f 100644
--- a/Brizco.Domain/Dtos/SmallDtos/ShiftPlanUserSDto.cs
+++ b/Brizco.Domain/Dtos/SmallDtos/ShiftPlanUserSDto.cs
@@ -5,5 +5,6 @@ namespace Brizco.Domain.Dtos.SmallDtos;
public class ShiftPlanUserSDto : BaseDto
{
public Guid ShiftPlanId { get; set; }
- public Guid ApplicationUserId { get; set; }
+ public Guid UserId { get; set; }
+ public Guid PositionId { get; set; }
}
\ No newline at end of file
diff --git a/Brizco.Domain/Dtos/SmallDtos/TaskSDto.cs b/Brizco.Domain/Dtos/SmallDtos/TaskSDto.cs
index c0bf67e..96d5042 100644
--- a/Brizco.Domain/Dtos/SmallDtos/TaskSDto.cs
+++ b/Brizco.Domain/Dtos/SmallDtos/TaskSDto.cs
@@ -6,11 +6,14 @@ public class TaskSDto : BaseDto
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public bool IsDisposable { get; set; }
- public DateTime SetFor { get; set; }
+ public long SetFor { get; set; }
public bool HasDisposed { get; set; }
public Guid ComplexId { get; set; }
public TaskScheduleType ScheduleType { get; set; }
+ public List Shifts { get; set; } = new();
+ public List Routines { get; set; } = new();
+ public List Positions { get; set; } = new();
public int Amount { get; set; }
public PurchaseAmountType AmountType { get; set; }
diff --git a/Brizco.Domain/Entities/Complex/Aggregate.Complex.cs b/Brizco.Domain/Entities/Complex/Aggregate.Complex.cs
index 7d512ba..09ae82e 100644
--- a/Brizco.Domain/Entities/Complex/Aggregate.Complex.cs
+++ b/Brizco.Domain/Entities/Complex/Aggregate.Complex.cs
@@ -50,19 +50,5 @@ public partial class Position
{
return new Position(name, description, complexId, sectionId);
}
-
- public PositionUser AddUser(Guid userId , Guid shiftPlanId)
- {
- var positionUser = PositionUser.Create(this.Id, userId, shiftPlanId);
- this.Users.Add(positionUser);
- return positionUser;
- }
}
-public partial class PositionUser
-{
- public static PositionUser Create(Guid positionId, Guid userId, Guid shiftPlanId)
- {
- return new PositionUser(positionId, userId, shiftPlanId);
- }
-}
diff --git a/Brizco.Domain/Entities/Complex/Position.cs b/Brizco.Domain/Entities/Complex/Position.cs
index fdd8998..8398392 100644
--- a/Brizco.Domain/Entities/Complex/Position.cs
+++ b/Brizco.Domain/Entities/Complex/Position.cs
@@ -24,6 +24,4 @@ public partial class Position : ApiEntity
public Guid SectionId { get; set; }
public Section? Section { get; set; }
-
- public List Users { get; internal set; } = new();
}
\ No newline at end of file
diff --git a/Brizco.Domain/Entities/Complex/PositionUser.cs b/Brizco.Domain/Entities/Complex/PositionUser.cs
deleted file mode 100644
index 0ff135f..0000000
--- a/Brizco.Domain/Entities/Complex/PositionUser.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using Brizco.Domain.Entities.User;
-
-namespace Brizco.Domain.Entities.Complex;
-[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
-[GenerateMapper]
-public partial class PositionUser : ApiEntity
-{
- public PositionUser()
- {
-
- }
- public PositionUser(Guid positionId,Guid applicationUserId ,Guid shiftPlanId)
- {
- ApplicationUserId = applicationUserId;
- ShiftPlanId = shiftPlanId;
- PositionId = positionId;
- }
-
- public Guid ApplicationUserId { get; set; }
- public ApplicationUser? ApplicationUser { get; set; }
-
- public Guid PositionId { get; set; }
- public Position? Position { get; set; }
-
- public Guid ShiftPlanId { get; set; }
- public ShiftPlan? ShiftPlan { get; set; }
-}
\ No newline at end of file
diff --git a/Brizco.Domain/Entities/Shift/Aggregate.Shift.cs b/Brizco.Domain/Entities/Shift/Aggregate.Shift.cs
index c3997a5..562e9ca 100644
--- a/Brizco.Domain/Entities/Shift/Aggregate.Shift.cs
+++ b/Brizco.Domain/Entities/Shift/Aggregate.Shift.cs
@@ -14,9 +14,9 @@ public partial class Shift
this.Days.Add(shiftDay);
return shiftDay;
}
- public ShiftPlan AddPlan(DateTime planDate)
+ public ShiftPlan AddPlan(DateTime planDate,Guid routineId)
{
- var plan = new ShiftPlan(planDate , Id);
+ var plan = new ShiftPlan(planDate , routineId, Id);
Plans.Add(plan);
return plan;
}
@@ -31,9 +31,9 @@ public partial class Shift
public partial class ShiftPlan
{
- public ShiftPlanUser AddUser(Guid userId)
+ public ShiftPlanUser AddUser(Guid positionId,Guid userId)
{
- var planUser = new ShiftPlanUser(Id , userId);
+ var planUser = new ShiftPlanUser(Id , positionId, userId);
Users.Add(planUser);
return planUser;
}
diff --git a/Brizco.Domain/Entities/Shift/ShiftPlan.cs b/Brizco.Domain/Entities/Shift/ShiftPlan.cs
index 21f6c53..308e1d4 100644
--- a/Brizco.Domain/Entities/Shift/ShiftPlan.cs
+++ b/Brizco.Domain/Entities/Shift/ShiftPlan.cs
@@ -10,15 +10,19 @@ public partial class ShiftPlan : ApiEntity
}
- internal ShiftPlan(DateTime planDate,Guid shiftId)
+ internal ShiftPlan(DateTime planFor, Guid routineId,Guid shiftId)
{
- PlanDate = planDate;
+ PlanFor = planFor;
+ RoutineId = routineId;
ShiftId = shiftId;
}
- public DateTime PlanDate { get; internal set; }
+ public DateTime PlanFor { get; internal set; }
public Guid ShiftId { get; internal set; }
public virtual Shift? Shift { get; internal set; }
+ public Guid RoutineId { get; internal set; }
+ public virtual Routine.Routine? Routine { get; internal set; }
+
public List Users { get; internal set; } = new();
}
\ No newline at end of file
diff --git a/Brizco.Domain/Entities/Shift/ShiftPlanUser.cs b/Brizco.Domain/Entities/Shift/ShiftPlanUser.cs
index 0ef78b0..8382f30 100644
--- a/Brizco.Domain/Entities/Shift/ShiftPlanUser.cs
+++ b/Brizco.Domain/Entities/Shift/ShiftPlanUser.cs
@@ -11,14 +11,18 @@ public class ShiftPlanUser : ApiEntity
}
- public ShiftPlanUser(Guid shiftPlanId, Guid applicationUserId)
+ public ShiftPlanUser(Guid shiftPlanId,Guid positionId, Guid userId)
{
ShiftPlanId = shiftPlanId;
- ApplicationUserId = applicationUserId;
+ PositionId = positionId;
+ UserId = userId;
}
public Guid ShiftPlanId { get; internal set; }
public ShiftPlan? ShiftPlan { get; internal set; }
- public Guid ApplicationUserId { get; internal set; }
- public ApplicationUser? ApplicationUser { get; internal set; }
+ public Guid PositionId { get; internal set; }
+ public Position? Position { get; internal set; }
+
+ public Guid UserId { get; internal set; }
+ public ApplicationUser? User { get; internal set; }
}
\ No newline at end of file
diff --git a/Brizco.Domain/Entities/Task/TaskPosition.cs b/Brizco.Domain/Entities/Task/TaskPosition.cs
index 73edae2..89f7043 100644
--- a/Brizco.Domain/Entities/Task/TaskPosition.cs
+++ b/Brizco.Domain/Entities/Task/TaskPosition.cs
@@ -17,7 +17,7 @@ public class TaskPosition : ApiEntity
TaskId = taskId;
}
public Guid PositionId { get; internal set; }
- public virtual Position? Role { get; internal set; }
+ public virtual Position? Position { get; internal set; }
public Guid TaskId { get; internal set; }
public virtual Task? Task { get; internal set; }
diff --git a/Brizco.Domain/Mappers/PositionMapper.g.cs b/Brizco.Domain/Mappers/PositionMapper.g.cs
index 1dffcbf..2e97e7c 100644
--- a/Brizco.Domain/Mappers/PositionMapper.g.cs
+++ b/Brizco.Domain/Mappers/PositionMapper.g.cs
@@ -1,6 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Linq.Expressions;
using Brizco.Domain.Dtos.LargDtos;
using Brizco.Domain.Dtos.SmallDtos;
@@ -95,215 +93,95 @@ namespace Brizco.Domain.Mappers
Name = p9.SectionName,
Id = p9.SectionId
},
- Users = funcMain1(p9.Users),
Id = p9.Id
};
}
- public static Position AdaptTo(this PositionLDto p11, Position p12)
- {
- if (p11 == null)
- {
- return null;
- }
- Position result = p12 ?? new Position();
-
- result.Name = p11.Name;
- result.Description = p11.Description;
- result.ComplexId = p11.ComplexId;
- result.Complex = funcMain2(new Never(), result.Complex, p11);
- result.SectionId = p11.SectionId;
- result.Section = funcMain3(new Never(), result.Section, p11);
- result.Users = funcMain4(p11.Users, result.Users);
- result.Id = p11.Id;
- return result;
-
- }
- public static Expression> ProjectLDtoToPosition => p19 => new Position()
- {
- Name = p19.Name,
- Description = p19.Description,
- ComplexId = p19.ComplexId,
- Complex = new Complex() {Id = p19.ComplexId},
- SectionId = p19.SectionId,
- Section = new Section()
- {
- Name = p19.SectionName,
- Id = p19.SectionId
- },
- Users = p19.Users.Select(p20 => new PositionUser()
- {
- ApplicationUserId = p20.ApplicationUserId,
- PositionId = p20.PositionId,
- Id = p20.Id
- }).ToList(),
- Id = p19.Id
- };
- public static PositionLDto AdaptToLDto(this Position p21)
- {
- return p21 == null ? null : new PositionLDto()
- {
- Name = p21.Name,
- Description = p21.Description,
- ComplexId = p21.ComplexId,
- SectionId = p21.SectionId,
- SectionName = p21.Section != null ? p21.Section.Name : string.Empty,
- Users = funcMain5(p21.Users),
- Id = p21.Id
- };
- }
- public static PositionLDto AdaptTo(this Position p23, PositionLDto p24)
- {
- if (p23 == null)
- {
- return null;
- }
- PositionLDto result = p24 ?? new PositionLDto();
-
- result.Name = p23.Name;
- result.Description = p23.Description;
- result.ComplexId = p23.ComplexId;
- result.SectionId = p23.SectionId;
- result.SectionName = p23.Section != null ? p23.Section.Name : string.Empty;
- result.Users = funcMain6(p23.Users, result.Users);
- result.Id = p23.Id;
- return result;
-
- }
- public static Expression> ProjectToLDto => p27 => new PositionLDto()
- {
- Name = p27.Name,
- Description = p27.Description,
- ComplexId = p27.ComplexId,
- SectionId = p27.SectionId,
- SectionName = p27.Section != null ? p27.Section.Name : string.Empty,
- Users = p27.Users.Select(p28 => new PositionUserSDto()
- {
- ApplicationUserId = p28.ApplicationUserId,
- PositionId = p28.PositionId,
- Id = p28.Id
- }).ToList(),
- Id = p27.Id
- };
-
- private static List funcMain1(List p10)
+ public static Position AdaptTo(this PositionLDto p10, Position p11)
{
if (p10 == null)
{
return null;
}
- List result = new List(p10.Count);
+ Position result = p11 ?? new Position();
- int i = 0;
- int len = p10.Count;
+ result.Name = p10.Name;
+ result.Description = p10.Description;
+ result.ComplexId = p10.ComplexId;
+ result.Complex = funcMain1(new Never(), result.Complex, p10);
+ result.SectionId = p10.SectionId;
+ result.Section = funcMain2(new Never(), result.Section, p10);
+ result.Id = p10.Id;
+ return result;
- while (i < len)
+ }
+ public static Expression> ProjectLDtoToPosition => p16 => new Position()
+ {
+ Name = p16.Name,
+ Description = p16.Description,
+ ComplexId = p16.ComplexId,
+ Complex = new Complex() {Id = p16.ComplexId},
+ SectionId = p16.SectionId,
+ Section = new Section()
{
- PositionUserSDto item = p10[i];
- result.Add(item == null ? null : new PositionUser()
- {
- ApplicationUserId = item.ApplicationUserId,
- PositionId = item.PositionId,
- Id = item.Id
- });
- i++;
- }
- return result;
-
- }
-
- private static Complex funcMain2(Never p13, Complex p14, PositionLDto p11)
+ Name = p16.SectionName,
+ Id = p16.SectionId
+ },
+ Id = p16.Id
+ };
+ public static PositionLDto AdaptToLDto(this Position p17)
{
- Complex result = p14 ?? new Complex();
-
- result.Id = p11.ComplexId;
- return result;
-
+ 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
+ };
}
-
- private static Section funcMain3(Never p15, Section p16, PositionLDto p11)
+ public static PositionLDto AdaptTo(this Position p18, PositionLDto p19)
{
- Section result = p16 ?? new Section();
-
- result.Name = p11.SectionName;
- result.Id = p11.SectionId;
- return result;
-
- }
-
- private static List funcMain4(List p17, List p18)
- {
- if (p17 == null)
+ if (p18 == null)
{
return null;
}
- List result = new List(p17.Count);
+ PositionLDto result = p19 ?? new PositionLDto();
- int i = 0;
- int len = p17.Count;
+ 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;
+ return result;
- while (i < len)
- {
- PositionUserSDto item = p17[i];
- result.Add(item == null ? null : new PositionUser()
- {
- ApplicationUserId = item.ApplicationUserId,
- PositionId = item.PositionId,
- Id = item.Id
- });
- i++;
- }
+ }
+ public static Expression> ProjectToLDto => p20 => 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
+ };
+
+ private static Complex funcMain1(Never p12, Complex p13, PositionLDto p10)
+ {
+ Complex result = p13 ?? new Complex();
+
+ result.Id = p10.ComplexId;
return result;
}
- private static List funcMain5(List p22)
+ private static Section funcMain2(Never p14, Section p15, PositionLDto p10)
{
- if (p22 == null)
- {
- return null;
- }
- List result = new List(p22.Count);
+ Section result = p15 ?? new Section();
- int i = 0;
- int len = p22.Count;
-
- while (i < len)
- {
- PositionUser item = p22[i];
- result.Add(item == null ? null : new PositionUserSDto()
- {
- ApplicationUserId = item.ApplicationUserId,
- PositionId = item.PositionId,
- Id = item.Id
- });
- i++;
- }
- return result;
-
- }
-
- private static List funcMain6(List p25, List p26)
- {
- if (p25 == null)
- {
- return null;
- }
- List result = new List(p25.Count);
-
- int i = 0;
- int len = p25.Count;
-
- while (i < len)
- {
- PositionUser item = p25[i];
- result.Add(item == null ? null : new PositionUserSDto()
- {
- ApplicationUserId = item.ApplicationUserId,
- PositionId = item.PositionId,
- Id = item.Id
- });
- i++;
- }
+ result.Name = p10.SectionName;
+ result.Id = p10.SectionId;
return result;
}
diff --git a/Brizco.Domain/Mappers/PositionUserMapper.g.cs b/Brizco.Domain/Mappers/PositionUserMapper.g.cs
deleted file mode 100644
index 9e54d73..0000000
--- a/Brizco.Domain/Mappers/PositionUserMapper.g.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Linq.Expressions;
-using Brizco.Domain.Dtos.SmallDtos;
-using Brizco.Domain.Entities.Complex;
-
-namespace Brizco.Domain.Mappers
-{
- public static partial class PositionUserMapper
- {
- public static PositionUser AdaptToPositionUser(this PositionUserSDto p1)
- {
- return p1 == null ? null : new PositionUser()
- {
- ApplicationUserId = p1.ApplicationUserId,
- PositionId = p1.PositionId,
- Id = p1.Id
- };
- }
- public static PositionUser AdaptTo(this PositionUserSDto p2, PositionUser p3)
- {
- if (p2 == null)
- {
- return null;
- }
- PositionUser result = p3 ?? new PositionUser();
-
- result.ApplicationUserId = p2.ApplicationUserId;
- result.PositionId = p2.PositionId;
- result.Id = p2.Id;
- return result;
-
- }
- public static Expression> ProjectToPositionUser => p4 => new PositionUser()
- {
- ApplicationUserId = p4.ApplicationUserId,
- PositionId = p4.PositionId,
- Id = p4.Id
- };
- public static PositionUserSDto AdaptToSDto(this PositionUser p5)
- {
- return p5 == null ? null : new PositionUserSDto()
- {
- ApplicationUserId = p5.ApplicationUserId,
- PositionId = p5.PositionId,
- Id = p5.Id
- };
- }
- public static PositionUserSDto AdaptTo(this PositionUser p6, PositionUserSDto p7)
- {
- if (p6 == null)
- {
- return null;
- }
- PositionUserSDto result = p7 ?? new PositionUserSDto();
-
- result.ApplicationUserId = p6.ApplicationUserId;
- result.PositionId = p6.PositionId;
- result.Id = p6.Id;
- return result;
-
- }
- public static Expression> ProjectToSDto => p8 => new PositionUserSDto()
- {
- ApplicationUserId = p8.ApplicationUserId,
- PositionId = p8.PositionId,
- Id = p8.Id
- };
- }
-}
\ No newline at end of file
diff --git a/Brizco.Domain/Mappers/ShiftPlanMapper.g.cs b/Brizco.Domain/Mappers/ShiftPlanMapper.g.cs
index bd092ec..509bd40 100644
--- a/Brizco.Domain/Mappers/ShiftPlanMapper.g.cs
+++ b/Brizco.Domain/Mappers/ShiftPlanMapper.g.cs
@@ -94,7 +94,8 @@ namespace Brizco.Domain.Mappers
Users = p15.Users.Select(p16 => new ShiftPlanUser()
{
ShiftPlanId = p16.ShiftPlanId,
- ApplicationUserId = p16.ApplicationUserId,
+ PositionId = p16.PositionId,
+ UserId = p16.UserId,
Id = p16.Id
}).ToList(),
Id = p15.Id
@@ -128,7 +129,8 @@ namespace Brizco.Domain.Mappers
Users = p23.Users.Select(p24 => new ShiftPlanUserSDto()
{
ShiftPlanId = p24.ShiftPlanId,
- ApplicationUserId = p24.ApplicationUserId,
+ UserId = p24.UserId,
+ PositionId = p24.PositionId,
Id = p24.Id
}).ToList(),
Id = p23.Id
@@ -151,7 +153,8 @@ namespace Brizco.Domain.Mappers
result.Add(item == null ? null : new ShiftPlanUser()
{
ShiftPlanId = item.ShiftPlanId,
- ApplicationUserId = item.ApplicationUserId,
+ PositionId = item.PositionId,
+ UserId = item.UserId,
Id = item.Id
});
i++;
@@ -177,7 +180,8 @@ namespace Brizco.Domain.Mappers
result.Add(item == null ? null : new ShiftPlanUser()
{
ShiftPlanId = item.ShiftPlanId,
- ApplicationUserId = item.ApplicationUserId,
+ PositionId = item.PositionId,
+ UserId = item.UserId,
Id = item.Id
});
i++;
@@ -203,7 +207,8 @@ namespace Brizco.Domain.Mappers
result.Add(item == null ? null : new ShiftPlanUserSDto()
{
ShiftPlanId = item.ShiftPlanId,
- ApplicationUserId = item.ApplicationUserId,
+ UserId = item.UserId,
+ PositionId = item.PositionId,
Id = item.Id
});
i++;
@@ -229,7 +234,8 @@ namespace Brizco.Domain.Mappers
result.Add(item == null ? null : new ShiftPlanUserSDto()
{
ShiftPlanId = item.ShiftPlanId,
- ApplicationUserId = item.ApplicationUserId,
+ UserId = item.UserId,
+ PositionId = item.PositionId,
Id = item.Id
});
i++;
diff --git a/Brizco.Domain/Mappers/ShiftPlanUserMapper.g.cs b/Brizco.Domain/Mappers/ShiftPlanUserMapper.g.cs
index 1b45ad6..b29219a 100644
--- a/Brizco.Domain/Mappers/ShiftPlanUserMapper.g.cs
+++ b/Brizco.Domain/Mappers/ShiftPlanUserMapper.g.cs
@@ -12,7 +12,8 @@ namespace Brizco.Domain.Mappers
return p1 == null ? null : new ShiftPlanUser()
{
ShiftPlanId = p1.ShiftPlanId,
- ApplicationUserId = p1.ApplicationUserId,
+ PositionId = p1.PositionId,
+ UserId = p1.UserId,
Id = p1.Id
};
}
@@ -25,7 +26,8 @@ namespace Brizco.Domain.Mappers
ShiftPlanUser result = p3 ?? new ShiftPlanUser();
result.ShiftPlanId = p2.ShiftPlanId;
- result.ApplicationUserId = p2.ApplicationUserId;
+ result.PositionId = p2.PositionId;
+ result.UserId = p2.UserId;
result.Id = p2.Id;
return result;
@@ -33,7 +35,8 @@ namespace Brizco.Domain.Mappers
public static Expression> ProjectToShiftPlanUser => p4 => new ShiftPlanUser()
{
ShiftPlanId = p4.ShiftPlanId,
- ApplicationUserId = p4.ApplicationUserId,
+ PositionId = p4.PositionId,
+ UserId = p4.UserId,
Id = p4.Id
};
public static ShiftPlanUserSDto AdaptToSDto(this ShiftPlanUser p5)
@@ -41,7 +44,8 @@ namespace Brizco.Domain.Mappers
return p5 == null ? null : new ShiftPlanUserSDto()
{
ShiftPlanId = p5.ShiftPlanId,
- ApplicationUserId = p5.ApplicationUserId,
+ UserId = p5.UserId,
+ PositionId = p5.PositionId,
Id = p5.Id
};
}
@@ -54,7 +58,8 @@ namespace Brizco.Domain.Mappers
ShiftPlanUserSDto result = p7 ?? new ShiftPlanUserSDto();
result.ShiftPlanId = p6.ShiftPlanId;
- result.ApplicationUserId = p6.ApplicationUserId;
+ result.UserId = p6.UserId;
+ result.PositionId = p6.PositionId;
result.Id = p6.Id;
return result;
@@ -62,7 +67,8 @@ namespace Brizco.Domain.Mappers
public static Expression> ProjectToSDto => p8 => new ShiftPlanUserSDto()
{
ShiftPlanId = p8.ShiftPlanId,
- ApplicationUserId = p8.ApplicationUserId,
+ UserId = p8.UserId,
+ PositionId = p8.PositionId,
Id = p8.Id
};
}
diff --git a/Brizco.Domain/Mappers/TaskMapper.g.cs b/Brizco.Domain/Mappers/TaskMapper.g.cs
index b89d5d2..a39e3c3 100644
--- a/Brizco.Domain/Mappers/TaskMapper.g.cs
+++ b/Brizco.Domain/Mappers/TaskMapper.g.cs
@@ -2,9 +2,12 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
+using Brizco.Common.Extensions;
using Brizco.Domain.Dtos.LargDtos;
using Brizco.Domain.Dtos.SmallDtos;
+using Brizco.Domain.Entities.Complex;
using Brizco.Domain.Entities.Task;
+using Mapster.Models;
using Task = Brizco.Domain.Entities.Task.Task;
namespace Brizco.Domain.Mappers
@@ -19,345 +22,403 @@ namespace Brizco.Domain.Mappers
Title = p1.Title,
Description = p1.Description,
IsDisposable = p1.IsDisposable,
- SetFor = p1.SetFor,
+ SetFor = Convert.ToDateTime(p1.SetFor),
HasDisposed = p1.HasDisposed,
ScheduleType = p1.ScheduleType,
ComplexId = p1.ComplexId,
+ Complex = new Complex() {Id = p1.ComplexId},
Amount = p1.Amount,
AmountType = p1.AmountType,
+ Shifts = funcMain1(p1.Shifts),
+ Routines = funcMain2(p1.Routines),
+ Positions = funcMain3(p1.Positions),
Id = p1.Id
};
}
- public static Task AdaptTo(this TaskSDto p2, Task p3)
+ public static Task AdaptTo(this TaskSDto p5, Task p6)
+ {
+ if (p5 == null)
+ {
+ return null;
+ }
+ Task result = p6 ?? new Task();
+
+ result.Type = p5.Type;
+ result.Title = p5.Title;
+ result.Description = p5.Description;
+ result.IsDisposable = p5.IsDisposable;
+ result.SetFor = Convert.ToDateTime(p5.SetFor);
+ result.HasDisposed = p5.HasDisposed;
+ result.ScheduleType = p5.ScheduleType;
+ result.ComplexId = p5.ComplexId;
+ result.Complex = funcMain4(new Never(), result.Complex, p5);
+ result.Amount = p5.Amount;
+ result.AmountType = p5.AmountType;
+ result.Shifts = funcMain5(p5.Shifts, result.Shifts);
+ result.Routines = funcMain6(p5.Routines, result.Routines);
+ result.Positions = funcMain7(p5.Positions, result.Positions);
+ result.Id = p5.Id;
+ return result;
+
+ }
+ public static Expression> ProjectToTask => p15 => new Task()
+ {
+ Type = p15.Type,
+ Title = p15.Title,
+ Description = p15.Description,
+ IsDisposable = p15.IsDisposable,
+ SetFor = Convert.ToDateTime(p15.SetFor),
+ HasDisposed = p15.HasDisposed,
+ ScheduleType = p15.ScheduleType,
+ ComplexId = p15.ComplexId,
+ Complex = new Complex() {Id = p15.ComplexId},
+ Amount = p15.Amount,
+ AmountType = p15.AmountType,
+ Shifts = p15.Shifts.Select(p16 => (TaskShift)Convert.ChangeType((object)p16, typeof(TaskShift))).ToList(),
+ Routines = p15.Routines.Select(p17 => (TaskRoutine)Convert.ChangeType((object)p17, typeof(TaskRoutine))).ToList(),
+ Positions = p15.Positions.Select(p18 => (TaskPosition)Convert.ChangeType((object)p18, typeof(TaskPosition))).ToList(),
+ Id = p15.Id
+ };
+ public static TaskSDto AdaptToSDto(this Task p19)
+ {
+ return p19 == null ? null : new TaskSDto()
+ {
+ Type = p19.Type,
+ Title = p19.Title,
+ Description = p19.Description,
+ IsDisposable = p19.IsDisposable,
+ SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p19.SetFor),
+ HasDisposed = p19.HasDisposed,
+ ComplexId = p19.ComplexId,
+ ScheduleType = p19.ScheduleType,
+ Shifts = funcMain8(p19.Shifts.Select(funcMain9)),
+ Routines = funcMain10(p19.Routines.Select(funcMain11)),
+ Positions = funcMain12(p19.Positions.Select(funcMain13)),
+ Amount = p19.Amount,
+ AmountType = p19.AmountType,
+ Id = p19.Id
+ };
+ }
+ public static TaskSDto AdaptTo(this Task p23, TaskSDto p24)
+ {
+ if (p23 == null)
+ {
+ return null;
+ }
+ TaskSDto result = p24 ?? new TaskSDto();
+
+ result.Type = p23.Type;
+ result.Title = p23.Title;
+ result.Description = p23.Description;
+ result.IsDisposable = p23.IsDisposable;
+ result.SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p23.SetFor);
+ result.HasDisposed = p23.HasDisposed;
+ result.ComplexId = p23.ComplexId;
+ result.ScheduleType = p23.ScheduleType;
+ result.Shifts = funcMain14(p23.Shifts.Select(funcMain9), result.Shifts);
+ result.Routines = funcMain15(p23.Routines.Select(funcMain11), result.Routines);
+ result.Positions = funcMain16(p23.Positions.Select(funcMain13), result.Positions);
+ result.Amount = p23.Amount;
+ result.AmountType = p23.AmountType;
+ result.Id = p23.Id;
+ return result;
+
+ }
+ public static Expression> ProjectToSDto => p31 => new TaskSDto()
+ {
+ Type = p31.Type,
+ Title = p31.Title,
+ Description = p31.Description,
+ IsDisposable = p31.IsDisposable,
+ SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p31.SetFor),
+ HasDisposed = p31.HasDisposed,
+ ComplexId = p31.ComplexId,
+ ScheduleType = p31.ScheduleType,
+ Shifts = (List)p31.Shifts.Select(d => d.Shift != null ? d.Shift.Title : string.Empty),
+ Routines = (List)p31.Routines.Select(d => d.Routine != null ? d.Routine.Name : string.Empty),
+ Positions = (List)p31.Positions.Select(d => d.Position != null ? d.Position.Name : string.Empty),
+ Amount = p31.Amount,
+ AmountType = p31.AmountType,
+ Id = p31.Id
+ };
+ public static Task AdaptToTask(this TaskLDto p32)
+ {
+ return p32 == null ? null : new Task()
+ {
+ Type = p32.Type,
+ Title = p32.Title,
+ Description = p32.Description,
+ IsDisposable = p32.IsDisposable,
+ SetFor = Convert.ToDateTime(p32.SetFor),
+ HasDisposed = p32.HasDisposed,
+ ScheduleType = p32.ScheduleType,
+ Amount = p32.Amount,
+ AmountType = p32.AmountType,
+ Shifts = funcMain17(p32.Shifts),
+ Days = funcMain18(p32.Days),
+ Routines = funcMain19(p32.Routines),
+ Positions = funcMain20(p32.Positions),
+ Id = p32.Id
+ };
+ }
+ public static Task AdaptTo(this TaskLDto p37, Task p38)
+ {
+ if (p37 == null)
+ {
+ return null;
+ }
+ Task result = p38 ?? new Task();
+
+ result.Type = p37.Type;
+ result.Title = p37.Title;
+ result.Description = p37.Description;
+ result.IsDisposable = p37.IsDisposable;
+ result.SetFor = Convert.ToDateTime(p37.SetFor);
+ result.HasDisposed = p37.HasDisposed;
+ result.ScheduleType = p37.ScheduleType;
+ result.Amount = p37.Amount;
+ result.AmountType = p37.AmountType;
+ result.Shifts = funcMain21(p37.Shifts, result.Shifts);
+ result.Days = funcMain22(p37.Days, result.Days);
+ result.Routines = funcMain23(p37.Routines, result.Routines);
+ result.Positions = funcMain24(p37.Positions, result.Positions);
+ result.Id = p37.Id;
+ return result;
+
+ }
+ public static Expression> ProjectLDtoToTask => p47 => new Task()
+ {
+ 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()
+ {
+ 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
+ };
+ }
+ public static TaskLDto AdaptTo(this Task p57, TaskLDto p58)
+ {
+ if (p57 == null)
+ {
+ return null;
+ }
+ TaskLDto result = p58 ?? 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;
+ return result;
+
+ }
+ public static Expression> ProjectToLDto => p67 => 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()
+ {
+ ShiftId = p68.ShiftId,
+ TaskId = p68.TaskId
+ }).ToList(),
+ Positions = p67.Positions.Select(p69 => new TaskPositionSDto()
+ {
+ PositionId = p69.PositionId,
+ TaskId = p69.TaskId,
+ Id = p69.Id
+ }).ToList(),
+ Days = p67.Days.Select(p70 => new TaskDaySDto()
+ {
+ DayOfWeek = p70.DayOfWeek,
+ TaskId = p70.TaskId,
+ Id = p70.Id
+ }).ToList(),
+ Routines = p67.Routines.Select(p71 => new TaskRoutineSDto()
+ {
+ TaskId = p71.TaskId,
+ RoutineId = p71.RoutineId,
+ Id = p71.Id
+ }).ToList(),
+ Id = p67.Id
+ };
+
+ private static List funcMain1(List p2)
{
if (p2 == null)
{
return null;
}
- Task result = p3 ?? new Task();
-
- result.Type = p2.Type;
- result.Title = p2.Title;
- result.Description = p2.Description;
- result.IsDisposable = p2.IsDisposable;
- result.SetFor = p2.SetFor;
- result.HasDisposed = p2.HasDisposed;
- result.ScheduleType = p2.ScheduleType;
- result.ComplexId = p2.ComplexId;
- result.Amount = p2.Amount;
- result.AmountType = p2.AmountType;
- result.Id = p2.Id;
- return result;
-
- }
- public static Expression> ProjectToTask => p4 => new Task()
- {
- Type = p4.Type,
- Title = p4.Title,
- Description = p4.Description,
- IsDisposable = p4.IsDisposable,
- SetFor = p4.SetFor,
- HasDisposed = p4.HasDisposed,
- ScheduleType = p4.ScheduleType,
- ComplexId = p4.ComplexId,
- Amount = p4.Amount,
- AmountType = p4.AmountType,
- Id = p4.Id
- };
- public static TaskSDto AdaptToSDto(this Task p5)
- {
- return p5 == null ? null : new TaskSDto()
- {
- Type = p5.Type,
- Title = p5.Title,
- Description = p5.Description,
- IsDisposable = p5.IsDisposable,
- SetFor = p5.SetFor,
- HasDisposed = p5.HasDisposed,
- ComplexId = p5.ComplexId,
- ScheduleType = p5.ScheduleType,
- Amount = p5.Amount,
- AmountType = p5.AmountType,
- Id = p5.Id
- };
- }
- public static TaskSDto AdaptTo(this Task p6, TaskSDto p7)
- {
- if (p6 == null)
- {
- return null;
- }
- TaskSDto result = p7 ?? new TaskSDto();
-
- result.Type = p6.Type;
- result.Title = p6.Title;
- result.Description = p6.Description;
- result.IsDisposable = p6.IsDisposable;
- result.SetFor = p6.SetFor;
- result.HasDisposed = p6.HasDisposed;
- result.ComplexId = p6.ComplexId;
- result.ScheduleType = p6.ScheduleType;
- result.Amount = p6.Amount;
- result.AmountType = p6.AmountType;
- result.Id = p6.Id;
- return result;
-
- }
- public static Expression> ProjectToSDto => p8 => new TaskSDto()
- {
- Type = p8.Type,
- Title = p8.Title,
- Description = p8.Description,
- IsDisposable = p8.IsDisposable,
- SetFor = p8.SetFor,
- HasDisposed = p8.HasDisposed,
- ComplexId = p8.ComplexId,
- ScheduleType = p8.ScheduleType,
- Amount = p8.Amount,
- AmountType = p8.AmountType,
- Id = p8.Id
- };
- public static Task AdaptToTask(this TaskLDto p9)
- {
- return p9 == null ? null : new Task()
- {
- Type = p9.Type,
- Title = p9.Title,
- Description = p9.Description,
- IsDisposable = p9.IsDisposable,
- SetFor = p9.SetFor,
- HasDisposed = p9.HasDisposed,
- ScheduleType = p9.ScheduleType,
- Amount = p9.Amount,
- AmountType = p9.AmountType,
- Shifts = funcMain1(p9.Shifts),
- Days = funcMain2(p9.Days),
- Routines = funcMain3(p9.Routines),
- Positions = funcMain4(p9.Positions),
- Id = p9.Id
- };
- }
- public static Task AdaptTo(this TaskLDto p14, Task p15)
- {
- if (p14 == null)
- {
- return null;
- }
- Task result = p15 ?? new Task();
-
- result.Type = p14.Type;
- result.Title = p14.Title;
- result.Description = p14.Description;
- result.IsDisposable = p14.IsDisposable;
- result.SetFor = p14.SetFor;
- result.HasDisposed = p14.HasDisposed;
- result.ScheduleType = p14.ScheduleType;
- result.Amount = p14.Amount;
- result.AmountType = p14.AmountType;
- result.Shifts = funcMain5(p14.Shifts, result.Shifts);
- result.Days = funcMain6(p14.Days, result.Days);
- result.Routines = funcMain7(p14.Routines, result.Routines);
- result.Positions = funcMain8(p14.Positions, result.Positions);
- result.Id = p14.Id;
- return result;
-
- }
- public static Expression> ProjectLDtoToTask => p24 => new Task()
- {
- Type = p24.Type,
- Title = p24.Title,
- Description = p24.Description,
- IsDisposable = p24.IsDisposable,
- SetFor = p24.SetFor,
- HasDisposed = p24.HasDisposed,
- ScheduleType = p24.ScheduleType,
- Amount = p24.Amount,
- AmountType = p24.AmountType,
- Shifts = p24.Shifts.Select(p25 => new TaskShift()
- {
- TaskId = p25.TaskId,
- ShiftId = p25.ShiftId
- }).ToList(),
- Days = p24.Days.Select(p26 => new TaskDay()
- {
- DayOfWeek = p26.DayOfWeek,
- TaskId = p26.TaskId,
- Id = p26.Id
- }).ToList(),
- Routines = p24.Routines.Select(p27 => new TaskRoutine()
- {
- TaskId = p27.TaskId,
- RoutineId = p27.RoutineId,
- Id = p27.Id
- }).ToList(),
- Positions = p24.Positions.Select(p28 => new TaskPosition()
- {
- PositionId = p28.PositionId,
- TaskId = p28.TaskId,
- Id = p28.Id
- }).ToList(),
- Id = p24.Id
- };
- public static TaskLDto AdaptToLDto(this Task p29)
- {
- return p29 == null ? null : new TaskLDto()
- {
- Type = p29.Type,
- Title = p29.Title,
- Description = p29.Description,
- IsDisposable = p29.IsDisposable,
- SetFor = p29.SetFor,
- HasDisposed = p29.HasDisposed,
- ScheduleType = p29.ScheduleType,
- Amount = p29.Amount,
- AmountType = p29.AmountType,
- Shifts = funcMain9(p29.Shifts),
- Positions = funcMain10(p29.Positions),
- Days = funcMain11(p29.Days),
- Routines = funcMain12(p29.Routines),
- Id = p29.Id
- };
- }
- public static TaskLDto AdaptTo(this Task p34, TaskLDto p35)
- {
- if (p34 == null)
- {
- return null;
- }
- TaskLDto result = p35 ?? new TaskLDto();
-
- result.Type = p34.Type;
- result.Title = p34.Title;
- result.Description = p34.Description;
- result.IsDisposable = p34.IsDisposable;
- result.SetFor = p34.SetFor;
- result.HasDisposed = p34.HasDisposed;
- result.ScheduleType = p34.ScheduleType;
- result.Amount = p34.Amount;
- result.AmountType = p34.AmountType;
- result.Shifts = funcMain13(p34.Shifts, result.Shifts);
- result.Positions = funcMain14(p34.Positions, result.Positions);
- result.Days = funcMain15(p34.Days, result.Days);
- result.Routines = funcMain16(p34.Routines, result.Routines);
- result.Id = p34.Id;
- return result;
-
- }
- public static Expression> ProjectToLDto => p44 => new TaskLDto()
- {
- Type = p44.Type,
- Title = p44.Title,
- Description = p44.Description,
- IsDisposable = p44.IsDisposable,
- SetFor = p44.SetFor,
- HasDisposed = p44.HasDisposed,
- ScheduleType = p44.ScheduleType,
- Amount = p44.Amount,
- AmountType = p44.AmountType,
- Shifts = p44.Shifts.Select(p45 => new TaskShiftSDto()
- {
- ShiftId = p45.ShiftId,
- TaskId = p45.TaskId
- }).ToList(),
- Positions = p44.Positions.Select(p46 => new TaskPositionSDto()
- {
- PositionId = p46.PositionId,
- TaskId = p46.TaskId,
- Id = p46.Id
- }).ToList(),
- Days = p44.Days.Select(p47 => new TaskDaySDto()
- {
- DayOfWeek = p47.DayOfWeek,
- TaskId = p47.TaskId,
- Id = p47.Id
- }).ToList(),
- Routines = p44.Routines.Select(p48 => new TaskRoutineSDto()
- {
- TaskId = p48.TaskId,
- RoutineId = p48.RoutineId,
- Id = p48.Id
- }).ToList(),
- Id = p44.Id
- };
-
- private static List funcMain1(List p10)
- {
- if (p10 == null)
- {
- return null;
- }
- List result = new List(p10.Count);
+ List result = new List(p2.Count);
int i = 0;
- int len = p10.Count;
+ int len = p2.Count;
while (i < len)
{
- TaskShiftSDto item = p10[i];
- result.Add(item == null ? null : new TaskShift()
- {
- TaskId = item.TaskId,
- ShiftId = item.ShiftId
- });
+ string item = p2[i];
+ result.Add(item == null ? null : (TaskShift)Convert.ChangeType((object)item, typeof(TaskShift)));
i++;
}
return result;
}
- private static List funcMain2(List p11)
+ private static List funcMain2(List p3)
+ {
+ if (p3 == null)
+ {
+ return null;
+ }
+ List result = new List(p3.Count);
+
+ int i = 0;
+ int len = p3.Count;
+
+ while (i < len)
+ {
+ string item = p3[i];
+ result.Add(item == null ? null : (TaskRoutine)Convert.ChangeType((object)item, typeof(TaskRoutine)));
+ i++;
+ }
+ return result;
+
+ }
+
+ private static List funcMain3(List p4)
+ {
+ if (p4 == null)
+ {
+ return null;
+ }
+ List result = new List(p4.Count);
+
+ int i = 0;
+ int len = p4.Count;
+
+ while (i < len)
+ {
+ string item = p4[i];
+ result.Add(item == null ? null : (TaskPosition)Convert.ChangeType((object)item, typeof(TaskPosition)));
+ i++;
+ }
+ return result;
+
+ }
+
+ private static Complex funcMain4(Never p7, Complex p8, TaskSDto p5)
+ {
+ Complex result = p8 ?? new Complex();
+
+ result.Id = p5.ComplexId;
+ return result;
+
+ }
+
+ private static List funcMain5(List p9, List p10)
+ {
+ if (p9 == null)
+ {
+ return null;
+ }
+ List result = new List(p9.Count);
+
+ int i = 0;
+ int len = p9.Count;
+
+ while (i < len)
+ {
+ string item = p9[i];
+ result.Add(item == null ? null : (TaskShift)Convert.ChangeType((object)item, typeof(TaskShift)));
+ i++;
+ }
+ return result;
+
+ }
+
+ private static List funcMain6(List p11, List p12)
{
if (p11 == null)
{
return null;
}
- List result = new List(p11.Count);
+ List result = new List(p11.Count);
int i = 0;
int len = p11.Count;
while (i < len)
{
- TaskDaySDto item = p11[i];
- result.Add(item == null ? null : new TaskDay()
- {
- DayOfWeek = item.DayOfWeek,
- TaskId = item.TaskId,
- Id = item.Id
- });
+ string item = p11[i];
+ result.Add(item == null ? null : (TaskRoutine)Convert.ChangeType((object)item, typeof(TaskRoutine)));
i++;
}
return result;
}
- private static List funcMain3(List p12)
- {
- if (p12 == null)
- {
- return null;
- }
- List result = new List(p12.Count);
-
- int i = 0;
- int len = p12.Count;
-
- while (i < len)
- {
- TaskRoutineSDto item = p12[i];
- result.Add(item == null ? null : new TaskRoutine()
- {
- TaskId = item.TaskId,
- RoutineId = item.RoutineId,
- Id = item.Id
- });
- i++;
- }
- return result;
-
- }
-
- private static List funcMain4(List p13)
+ private static List funcMain7(List p13, List p14)
{
if (p13 == null)
{
@@ -370,33 +431,157 @@ namespace Brizco.Domain.Mappers
while (i < len)
{
- TaskPositionSDto item = p13[i];
- result.Add(item == null ? null : new TaskPosition()
- {
- PositionId = item.PositionId,
- TaskId = item.TaskId,
- Id = item.Id
- });
+ string item = p13[i];
+ result.Add(item == null ? null : (TaskPosition)Convert.ChangeType((object)item, typeof(TaskPosition)));
i++;
}
return result;
}
- private static List funcMain5(List p16, List p17)
+ private static List funcMain8(IEnumerable p20)
{
- if (p16 == null)
+ if (p20 == null)
{
return null;
}
- List result = new List(p16.Count);
+ List result = new List();
+
+ IEnumerator enumerator = p20.GetEnumerator();
+
+ while (enumerator.MoveNext())
+ {
+ string item = enumerator.Current;
+ result.Add(item);
+ }
+ return result;
+
+ }
+
+ private static string funcMain9(TaskShift d)
+ {
+ return d.Shift != null ? d.Shift.Title : string.Empty;
+ }
+
+ private static List funcMain10(IEnumerable p21)
+ {
+ if (p21 == null)
+ {
+ return null;
+ }
+ List result = new List();
+
+ IEnumerator enumerator = p21.GetEnumerator();
+
+ while (enumerator.MoveNext())
+ {
+ string item = enumerator.Current;
+ result.Add(item);
+ }
+ return result;
+
+ }
+
+ private static string funcMain11(TaskRoutine d)
+ {
+ return d.Routine != null ? d.Routine.Name : string.Empty;
+ }
+
+ private static List funcMain12(IEnumerable p22)
+ {
+ if (p22 == null)
+ {
+ return null;
+ }
+ List result = new List();
+
+ IEnumerator enumerator = p22.GetEnumerator();
+
+ while (enumerator.MoveNext())
+ {
+ string item = enumerator.Current;
+ result.Add(item);
+ }
+ return result;
+
+ }
+
+ private static string funcMain13(TaskPosition d)
+ {
+ return d.Position != null ? d.Position.Name : string.Empty;
+ }
+
+ private static List funcMain14(IEnumerable p25, List p26)
+ {
+ if (p25 == null)
+ {
+ return null;
+ }
+ List result = new List();
+
+ IEnumerator enumerator = p25.GetEnumerator();
+
+ while (enumerator.MoveNext())
+ {
+ string item = enumerator.Current;
+ result.Add(item);
+ }
+ return result;
+
+ }
+
+ private static List funcMain15(IEnumerable p27, List p28)
+ {
+ if (p27 == null)
+ {
+ return null;
+ }
+ List result = new List();
+
+ IEnumerator enumerator = p27.GetEnumerator();
+
+ while (enumerator.MoveNext())
+ {
+ string item = enumerator.Current;
+ result.Add(item);
+ }
+ return result;
+
+ }
+
+ private static List funcMain16(IEnumerable p29, List p30)
+ {
+ if (p29 == null)
+ {
+ return null;
+ }
+ List result = new List();
+
+ IEnumerator enumerator = p29.GetEnumerator();
+
+ while (enumerator.MoveNext())
+ {
+ string item = enumerator.Current;
+ result.Add(item);
+ }
+ return result;
+
+ }
+
+ private static List funcMain17(List p33)
+ {
+ if (p33 == null)
+ {
+ return null;
+ }
+ List result = new List(p33.Count);
int i = 0;
- int len = p16.Count;
+ int len = p33.Count;
while (i < len)
{
- TaskShiftSDto item = p16[i];
+ TaskShiftSDto item = p33[i];
result.Add(item == null ? null : new TaskShift()
{
TaskId = item.TaskId,
@@ -408,20 +593,20 @@ namespace Brizco.Domain.Mappers
}
- private static List funcMain6(List p18, List p19)
+ private static List funcMain18(List p34)
{
- if (p18 == null)
+ if (p34 == null)
{
return null;
}
- List result = new List(p18.Count);
+ List result = new List(p34.Count);
int i = 0;
- int len = p18.Count;
+ int len = p34.Count;
while (i < len)
{
- TaskDaySDto item = p18[i];
+ TaskDaySDto item = p34[i];
result.Add(item == null ? null : new TaskDay()
{
DayOfWeek = item.DayOfWeek,
@@ -434,20 +619,20 @@ namespace Brizco.Domain.Mappers
}
- private static List funcMain7(List p20, List p21)
+ private static List funcMain19(List p35)
{
- if (p20 == null)
+ if (p35 == null)
{
return null;
}
- List result = new List(p20.Count);
+ List result = new List(p35.Count);
int i = 0;
- int len = p20.Count;
+ int len = p35.Count;
while (i < len)
{
- TaskRoutineSDto item = p20[i];
+ TaskRoutineSDto item = p35[i];
result.Add(item == null ? null : new TaskRoutine()
{
TaskId = item.TaskId,
@@ -460,20 +645,20 @@ namespace Brizco.Domain.Mappers
}
- private static List funcMain8(List p22, List p23)
+ private static List funcMain20(List p36)
{
- if (p22 == null)
+ if (p36 == null)
{
return null;
}
- List result = new List(p22.Count);
+ List result = new List(p36.Count);
int i = 0;
- int len = p22.Count;
+ int len = p36.Count;
while (i < len)
{
- TaskPositionSDto item = p22[i];
+ TaskPositionSDto item = p36[i];
result.Add(item == null ? null : new TaskPosition()
{
PositionId = item.PositionId,
@@ -486,20 +671,123 @@ namespace Brizco.Domain.Mappers
}
- private static List funcMain9(List p30)
+ private static List funcMain21(List p39, List p40)
{
- if (p30 == null)
+ if (p39 == null)
{
return null;
}
- List result = new List(p30.Count);
+ List result = new List(p39.Count);
int i = 0;
- int len = p30.Count;
+ int len = p39.Count;
while (i < len)
{
- TaskShift item = p30[i];
+ TaskShiftSDto item = p39[i];
+ result.Add(item == null ? null : new TaskShift()
+ {
+ TaskId = item.TaskId,
+ ShiftId = item.ShiftId
+ });
+ i++;
+ }
+ return result;
+
+ }
+
+ private static List funcMain22(List p41, List p42)
+ {
+ if (p41 == null)
+ {
+ return null;
+ }
+ List result = new List(p41.Count);
+
+ int i = 0;
+ int len = p41.Count;
+
+ while (i < len)
+ {
+ TaskDaySDto item = p41[i];
+ result.Add(item == null ? null : new TaskDay()
+ {
+ DayOfWeek = item.DayOfWeek,
+ TaskId = item.TaskId,
+ Id = item.Id
+ });
+ i++;
+ }
+ return result;
+
+ }
+
+ private static List funcMain23(List p43, List p44)
+ {
+ if (p43 == null)
+ {
+ return null;
+ }
+ List result = new List