add vesrion 0.7.12.12 , feat add shiftplanid to activites , fix issues

master
Amir Hossein Khademi 2024-05-20 22:51:01 +03:30
parent 1cac63112e
commit ab343077bd
37 changed files with 12570 additions and 5538 deletions

View File

@ -1 +1 @@
0.6.10.11 0.7.12.12

View File

@ -51,8 +51,8 @@ public class ActivityController : ICarterModule
// GET:Get All Entity // GET:Get All Entity
public async Task<IResult> GetAllAsync([FromQuery] int page, [FromQuery] DateQueryFilter? dateQueryFilter, [FromQuery] long? selectedDate, [FromQuery] Guid? selectedShift, ISender sender, CancellationToken cancellationToken) public async Task<IResult> GetAllAsync([FromQuery] int page, [FromQuery] DateQueryFilter? dateQueryFilter, [FromQuery] long? selectedDate, [FromQuery] Guid? selectedShiftPlanId, ISender sender, CancellationToken cancellationToken)
=> TypedResults.Ok(await sender.Send(new GetActivitiesQuery(Page: page, SelectedDate: selectedDate ?? 0 , SelectedShift: selectedShift ?? default , DateQueryFilter: dateQueryFilter ?? null), cancellationToken)); => TypedResults.Ok(await sender.Send(new GetActivitiesQuery(Page: page, SelectedDate: selectedDate ?? 0 , SelectedShiftPlanId: selectedShiftPlanId ?? default , DateQueryFilter: dateQueryFilter ?? null), cancellationToken));
// GET:Get An Entity By Id // GET:Get An Entity By Id
public async Task<IResult> GetAsync(Guid id, IActivityService activityService, CancellationToken cancellationToken) public async Task<IResult> GetAsync(Guid id, IActivityService activityService, CancellationToken cancellationToken)

View File

@ -10,12 +10,20 @@ public class PageController : ICarterModule
.MapGroup($"api/page") .MapGroup($"api/page")
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser()); .RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser());
group.MapGet("/dashboard/app", GetAppDashboardAsync) group.MapGet("/app/dashboard", GetAppDashboardAsync)
.WithDisplayName("GetAppDashboard") .WithDisplayName("GetAppDashboard")
.HasApiVersion(1.0); .HasApiVersion(1.0);
group.MapGet("/app/shifting", GetAppShiftingPageAsync)
.WithDisplayName("Get App Shifting Page")
.HasApiVersion(1.0);
} }
public async Task<IResult> GetAppDashboardAsync([FromServices] IPageService pageService, CancellationToken cancellationToken) public async Task<IResult> GetAppDashboardAsync([FromServices] IPageService pageService, CancellationToken cancellationToken)
=> TypedResults.Ok(await pageService.GetAppDashboardAsync(cancellationToken)); => TypedResults.Ok(await pageService.GetAppDashboardAsync(cancellationToken));
public async Task<IResult> GetAppShiftingPageAsync([FromQuery]Guid routineId,[FromServices] IPageService pageService, CancellationToken cancellationToken)
=> TypedResults.Ok(await pageService.GetShiftingPageAsync(routineId,cancellationToken));
} }

View File

@ -39,7 +39,7 @@ public class ShiftController : ICarterModule
// GET:Get An Entity By Id // GET:Get An Entity By Id
public async Task<IResult> GetAsync(Guid id, ISender sender, CancellationToken cancellationToken) public async Task<IResult> GetAsync(Guid id, ISender sender, CancellationToken cancellationToken)
=> TypedResults.Ok(await sender.Send(new GetShiftQuery(id))); => TypedResults.Ok(await sender.Send(new GetShiftQuery(id),cancellationToken));
// POST:Create Entity // POST:Create Entity
public async Task<IResult> Post([FromBody] CreateShiftCommand ent, ISender mediator, CancellationToken cancellationToken) public async Task<IResult> Post([FromBody] CreateShiftCommand ent, ISender mediator, CancellationToken cancellationToken)

View File

@ -26,6 +26,12 @@ public class ShiftPlanController : ICarterModule
.RequireAuthorization(builder => builder.RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageShiftPlans)) .RequireAuthorization(builder => builder.RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageShiftPlans))
.HasApiVersion(1.0); .HasApiVersion(1.0);
group.MapPost("{id:guid}/activity", GetShiftPlanActivitiesAsync)
.WithDisplayName("Get Shift Plan Activities")
.RequireAuthorization(builder => builder.RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageShiftPlans))
.HasApiVersion(1.0);
group.MapPost("", Post) group.MapPost("", Post)
.RequireAuthorization(builder => builder.RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageShiftPlans)) .RequireAuthorization(builder => builder.RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageShiftPlans))
.HasApiVersion(1.0); .HasApiVersion(1.0);
@ -42,6 +48,10 @@ public class ShiftPlanController : ICarterModule
public async Task<IResult> CompletePlanAsync(Guid id,[FromBody] CompleteShiftPlanRequestDto requestDtos, [FromServices] IShiftPlanService shiftPlanService, CancellationToken cancellationToken) public async Task<IResult> CompletePlanAsync(Guid id,[FromBody] CompleteShiftPlanRequestDto requestDtos, [FromServices] IShiftPlanService shiftPlanService, CancellationToken cancellationToken)
=> TypedResults.Ok(await shiftPlanService.CompleteShiftPlanAsync(id,requestDtos, cancellationToken)); => TypedResults.Ok(await shiftPlanService.CompleteShiftPlanAsync(id,requestDtos, cancellationToken));
// GET:Get All Entity
public async Task<IResult> GetShiftPlanActivitiesAsync([FromRoute]Guid id,ISender sender, CancellationToken cancellationToken)
=> TypedResults.Ok(await sender.Send(new GetShiftPlanActivitiesQuery(ShiftPlanId: id), cancellationToken));
// GET:Get All Entity // GET:Get All Entity
public async Task<IResult> GetAllAsync([FromQuery] int page, [FromQuery] long? selectedDate, [FromQuery] DateTimeQueryFilter? dateFilter , ISender sender, CancellationToken cancellationToken) public async Task<IResult> GetAllAsync([FromQuery] int page, [FromQuery] long? selectedDate, [FromQuery] DateTimeQueryFilter? dateFilter , ISender sender, CancellationToken cancellationToken)

View File

@ -8,7 +8,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport"> <meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>iGarson API</title> <title>BrizCo API</title>
<meta content="" name="description"> <meta content="" name="description">
<meta content="" name="keywords"> <meta content="" name="keywords">

View File

@ -20,9 +20,9 @@ public static class SwaggerConfiguration
new OpenApiInfo new OpenApiInfo
{ {
Version = "v1", Version = "v1",
Title = "iGarson Api Dacument", Title = "BrizCo Api Document",
Description = "iGarson api for clients that wana use", Description = "BrizCo api document OpenApi based",
License = new OpenApiLicense { Name = "Vira Safir Fanavar " }, License = new OpenApiLicense { Name = "Briz Corp" },
Contact = new OpenApiContact Contact = new OpenApiContact
{ {
Name = "Amir Hossein Khademi", Name = "Amir Hossein Khademi",

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -3,4 +3,5 @@
public interface IPageService : IScopedDependency public interface IPageService : IScopedDependency
{ {
Task<AppDashboardPageDto> GetAppDashboardAsync(CancellationToken cancellationToken); Task<AppDashboardPageDto> GetAppDashboardAsync(CancellationToken cancellationToken);
Task<List<AppShiftingPageDayDto>> GetShiftingPageAsync(Guid routineId,CancellationToken cancellationToken);
} }

View File

@ -1,9 +1,4 @@
using Brizco.Domain.Entities.Complex; namespace Brizco.Core.CoreServices;
using Brizco.Domain.Mappers;
using System.Linq;
using Mapster;
namespace Brizco.Core.CoreServices;
public class AccountService : IAccountService public class AccountService : IAccountService
{ {

View File

@ -1,5 +1,4 @@
using Brizco.Domain.Entities.Task; using Brizco.Domain.Entities.Task;
using System.Linq;
using Brizco.Domain.Entities.Routine; using Brizco.Domain.Entities.Routine;
using Brizco.Domain.Entities.Shift; using Brizco.Domain.Entities.Shift;
using Task = Brizco.Domain.Entities.Task.Task; using Task = Brizco.Domain.Entities.Task.Task;
@ -11,15 +10,18 @@ public class PageService : IPageService
private readonly ICurrentUserService _currentUserService; private readonly ICurrentUserService _currentUserService;
private readonly IRepositoryWrapper _repositoryWrapper; private readonly IRepositoryWrapper _repositoryWrapper;
private readonly RoleManager<ApplicationRole> _roleManager; private readonly RoleManager<ApplicationRole> _roleManager;
private readonly IMediator _mediator;
public PageService( public PageService(
ICurrentUserService currentUserService, ICurrentUserService currentUserService,
IRepositoryWrapper repositoryWrapper, IRepositoryWrapper repositoryWrapper,
RoleManager<ApplicationRole> roleManager) RoleManager<ApplicationRole> roleManager,
IMediator mediator)
{ {
_currentUserService = currentUserService; _currentUserService = currentUserService;
_repositoryWrapper = repositoryWrapper; _repositoryWrapper = repositoryWrapper;
_roleManager = roleManager; _roleManager = roleManager;
_mediator = mediator;
} }
public async Task<AppDashboardPageDto> GetAppDashboardAsync(CancellationToken cancellationToken) public async Task<AppDashboardPageDto> GetAppDashboardAsync(CancellationToken cancellationToken)
{ {
@ -169,4 +171,40 @@ public class PageService : IPageService
return page; return page;
} }
public async Task<List<AppShiftingPageDayDto>> GetShiftingPageAsync(Guid routineId,CancellationToken cancellationToken)
{
if (_currentUserService.ComplexId == null)
throw new AppException("ComplexId is null", ApiResultStatusCode.NotFound);
if (!Guid.TryParse(_currentUserService.ComplexId, out Guid complexId))
throw new AppException("ComplexId is wrong", ApiResultStatusCode.NotFound);
var days = new List<AppShiftingPageDayDto>();
DateTime day = DateTime.Today;
var shifts = await _mediator.Send(new GetRoutineShiftsQuery(routineId, 0),
cancellationToken);
for (int i = 0 ; i < 15; i++ , day = day.AddDays(i))
{
var item = new AppShiftingPageDayDto
{
DateTime = DateTimeExtensions.DateTimeToUnixTimeStamp(day)
};
shifts.Where(s=>s.Day == day.DayOfWeek).SelectMany(s=>s.Shifts).ToList().ForEach(s=>item.Shifts.Add(s.Clone()));
foreach (var shift in item.Shifts)
{
var existedShiftPlan = await _repositoryWrapper.SetRepository<Domain.Entities.Shift.ShiftPlan>()
.TableNoTracking
.FirstOrDefaultAsync(s => s.ShiftId == shift.Id && s.PlanFor.Date == day.Date, cancellationToken);
shift.CurrentShiftPlanId = existedShiftPlan?.Id ?? default;
shift.HasCurrentShiftPlan = shift.CurrentShiftPlanId != default;
}
item.TotalShifts = item.Shifts.Count;
item.TotalShiftPlans = item.Shifts.Count(s => s.CurrentShiftPlanId != default);
days.Add(item);
}
return days;
}
} }

View File

@ -22,7 +22,7 @@ public class ShiftPlanReportCommandHandler : IRequestHandler<ShiftPlanReportComm
throw new AppException("ShiftPlan not found", ApiResultStatusCode.NotFound); throw new AppException("ShiftPlan not found", ApiResultStatusCode.NotFound);
var activities = await _repositoryWrapper.SetRepository<Activity>() var activities = await _repositoryWrapper.SetRepository<Activity>()
.TableNoTracking .TableNoTracking
.Where(sp => sp.ShiftId == shiftPlan.ShiftId && sp.SetFor.Date == shiftPlan.PlanFor.Date) .Where(sp => sp.ShiftPlanId == shiftPlan.ShiftId && sp.SetFor.Date == shiftPlan.PlanFor.Date)
.Select(ActivityMapper.ProjectToSDto) .Select(ActivityMapper.ProjectToSDto)
.ToListAsync(cancellationToken); .ToListAsync(cancellationToken);

View File

@ -1,8 +1,5 @@
using Brizco.Domain.CommandQueries.Queries; using Brizco.Domain.Entities.Shift;
using Brizco.Domain.Entities.Shift;
using Brizco.Domain.Entities.Task; using Brizco.Domain.Entities.Task;
using System.Threading.Tasks;
using Brizco.Domain.Mappers;
using Task = Brizco.Domain.Entities.Task.Task; using Task = Brizco.Domain.Entities.Task.Task;
namespace Brizco.Core.EntityServices; namespace Brizco.Core.EntityServices;
@ -25,7 +22,7 @@ public class ActivityService : IActivityService
.TableNoTracking .TableNoTracking
.FirstOrDefaultAsync(a => a.Id == activityId, cancellationToken); .FirstOrDefaultAsync(a => a.Id == activityId, cancellationToken);
if (activity == null) if (activity == null)
throw new AppException("Activity not found ", ApiResultStatusCode.NotFound); throw new AppException("Activity not found", ApiResultStatusCode.NotFound);
activity.DoneActivity(); activity.DoneActivity();
_repositoryWrapper.SetRepository<Activity>() _repositoryWrapper.SetRepository<Activity>()
.Update(activity); .Update(activity);
@ -109,7 +106,7 @@ public class ActivityService : IActivityService
var activities = await _repositoryWrapper.SetRepository<Activity>() var activities = await _repositoryWrapper.SetRepository<Activity>()
.TableNoTracking .TableNoTracking
.Where(a => a.ShiftId == shiftPlan.ShiftId && a.SetFor.Date == shiftPlan.PlanFor.Date) .Where(a => a.ShiftPlanId == shiftPlan.ShiftId && a.SetFor.Date == shiftPlan.PlanFor.Date)
.Select(ActivityMapper.ProjectToLDto) .Select(ActivityMapper.ProjectToLDto)
.ToListAsync(cancellationToken); .ToListAsync(cancellationToken);
foreach (var activity in activities) foreach (var activity in activities)
@ -133,7 +130,7 @@ public class ActivityService : IActivityService
await _mediator.Send(new UpdateActivityCommand(activity.Id, activity.Status, activity.DoneAt, activity.PerformanceDescription, await _mediator.Send(new UpdateActivityCommand(activity.Id, activity.Status, activity.DoneAt, activity.PerformanceDescription,
activity.Type, activity.Title, activity.Description, activity.IsDisposable, activity.SetFor, activity.HasDisposed, activity.Amount activity.Type, activity.Title, activity.Description, activity.IsDisposable, activity.SetFor, activity.HasDisposed, activity.Amount
, activity.AmountType, activity.ScheduleType, shiftPlan.ShiftId, foundedUser.UserId), cancellationToken); , activity.AmountType, activity.ScheduleType, shiftPlan.Id, foundedUser.UserId), cancellationToken);
} }
} }
} }
@ -195,7 +192,7 @@ public class ActivityService : IActivityService
{ {
await _mediator.Send(new CreateActivityCommand(task.Type, task.Title, task.Description, task.IsDisposable, await _mediator.Send(new CreateActivityCommand(task.Type, task.Title, task.Description, task.IsDisposable,
shiftPlan.PlanFor, task.HasDisposed, task.Amount, task.AmountType, shiftPlan.PlanFor, task.HasDisposed, task.Amount, task.AmountType,
task.ScheduleType, shiftPlan.ShiftId, fundedUser.UserId), cancellationToken); task.ScheduleType, shiftPlan.Id, fundedUser.UserId), cancellationToken);
} }
} }
} }

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<!--<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
@ -13,10 +13,10 @@
<PackageReference Include="MediatR" Version="12.2.0" /> <PackageReference Include="MediatR" Version="12.2.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="8.0.4" /> <PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="8.0.4" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" /> <PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
</ItemGroup>--> </ItemGroup>
<PropertyGroup> <!--<PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>10</LangVersion> <LangVersion>10</LangVersion>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
@ -32,7 +32,7 @@
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" /> <PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
</ItemGroup> </ItemGroup>-->
<Target Name="Mapster"> <Target Name="Mapster">
@ -69,10 +69,4 @@
<Using Include="MediatR" /> <Using Include="MediatR" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Dtos\PageDto\" />
</ItemGroup>
</Project> </Project>

View File

@ -10,7 +10,7 @@ public sealed record CreateActivityCommand(
int Amount, int Amount,
PurchaseAmountType AmountType, PurchaseAmountType AmountType,
TaskScheduleType ScheduleType, TaskScheduleType ScheduleType,
Guid ShiftId, Guid ShiftPlanId,
Guid UserId) : IRequest<ActivityLDto>; Guid UserId) : IRequest<ActivityLDto>;
public sealed record UpdateActivityCommand(Guid Id, public sealed record UpdateActivityCommand(Guid Id,
@ -26,7 +26,7 @@ public sealed record UpdateActivityCommand(Guid Id,
int Amount, int Amount,
PurchaseAmountType AmountType, PurchaseAmountType AmountType,
TaskScheduleType ScheduleType, TaskScheduleType ScheduleType,
Guid ShiftId, Guid ShiftPlanId,
Guid UserId) : IRequest<bool>; Guid UserId) : IRequest<bool>;

View File

@ -1,7 +1,7 @@
namespace Brizco.Domain.CommandQueries.Queries; namespace Brizco.Domain.CommandQueries.Queries;
public sealed record GetActivitiesQuery(int Page = 0 , long SelectedDate = 0 , Guid SelectedShift = default , DateQueryFilter? DateQueryFilter = null) : public sealed record GetActivitiesQuery(int Page = 0 , long SelectedDate = 0 , Guid SelectedShiftPlanId = default , DateQueryFilter? DateQueryFilter = null) : IRequest<List<ActivitySDto>>;
IRequest<List<ActivitySDto>>;
public sealed record GetActivityQuery(Guid Id) : public sealed record GetActivityQuery(Guid Id) : IRequest<ActivityLDto>;
IRequest<ActivityLDto>;
public sealed record GetShiftPlanActivitiesQuery(Guid ShiftPlanId) : IRequest<List<ActivitySDto>>;

View File

@ -0,0 +1,15 @@
namespace Brizco.Domain.Dtos.PageDto;
public class AppShiftingPageDto
{
public List<RoutineSDto> Routines { get; set; } = new List<RoutineSDto>();
public List<AppShiftingPageDayDto> Days { get; set; } = new List<AppShiftingPageDayDto>();
}
public class AppShiftingPageDayDto
{
public long DateTime { get; set; }
public int TotalShifts { get; set; }
public int TotalShiftPlans { get; set; }
public List<ShiftSDto> Shifts { get; set; } = new List<ShiftSDto>();
}

View File

@ -2,25 +2,25 @@
public class ActivitySDto : BaseDto<ActivitySDto , Activity> public class ActivitySDto : BaseDto<ActivitySDto , Activity>
{ {
public TaskType Type { get; internal set; } public TaskType Type { get; set; }
public string Title { get; internal set; } = string.Empty; public string Title { get; set; } = string.Empty;
public string Description { get; internal set; } = string.Empty; public string Description { get; set; } = string.Empty;
public bool IsDisposable { get; internal set; } public bool IsDisposable { get; set; }
public DateTime SetFor { get; internal set; } public DateTime SetFor { get; set; }
public bool HasDisposed { get; internal set; } public bool HasDisposed { get; set; }
public TaskScheduleType ScheduleType { get; set; } public TaskScheduleType ScheduleType { get; set; }
public string UnDoneReason { get; set; } = string.Empty; public string UnDoneReason { get; set; } = string.Empty;
public ActivityStatus Status { get; internal set; } public ActivityStatus Status { get; set; }
public DateTime DoneAt { get; internal set; } public DateTime DoneAt { get; set; }
public bool IsDone { get; set; } public bool IsDone { get; set; }
public string ShiftTitle { get; set; } = string.Empty; public string ShiftTitle { get; set; } = string.Empty;
public string PerformanceDescription { get; internal set; } = string.Empty; public string PerformanceDescription { get; set; } = string.Empty;
public string UserFirstName { get; set; } = string.Empty; public string UserFirstName { get; set; } = string.Empty;
public string UserLastName { get; set; } = string.Empty; public string UserLastName { get; set; } = string.Empty;
public string UserFullName => UserFirstName + " " + UserLastName; public string UserFullName => UserFirstName + " " + UserLastName;
public int Amount { get; internal set; } public int Amount { get; set; }
public Guid ShiftId { get; internal set; } public Guid ShiftPlanId { get; set; }
public PurchaseAmountType AmountType { get; internal set; } public PurchaseAmountType AmountType { get; set; }
} }

View File

@ -1,6 +1,4 @@
using Brizco.Domain.Entities.Shift; namespace Brizco.Domain.Dtos.SmallDtos;
namespace Brizco.Domain.Dtos.SmallDtos;
public class ShiftSDto : BaseDto<ShiftSDto,Shift> public class ShiftSDto : BaseDto<ShiftSDto,Shift>
{ {
public string Title { get; set; } = string.Empty; public string Title { get; set; } = string.Empty;
@ -15,4 +13,5 @@ public class ShiftSDto : BaseDto<ShiftSDto,Shift>
public TimeSpan EndAt { get; set; } public TimeSpan EndAt { get; set; }
public Guid ComplexId { get; set; } public Guid ComplexId { get; set; }
public List<DayOfWeek> Days { get; set; } = new(); public List<DayOfWeek> Days { get; set; } = new();
public string CurrentSupervisorFullName { get; set; } = string.Empty;
} }

View File

@ -38,6 +38,6 @@ public partial class Activity : Task
public Guid UserId { get; internal set; } public Guid UserId { get; internal set; }
public ApplicationUser? User { get; internal set; } public ApplicationUser? User { get; internal set; }
public Guid ShiftId { get; internal set; } public Guid ShiftPlanId { get; internal set; }
public Shift.Shift? Shift { get; internal set; } public ShiftPlan? ShiftPlan { get; internal set; }
} }

View File

@ -128,9 +128,9 @@ public partial class Activity
scheduleType); scheduleType);
} }
public void SetShift(Guid shiftId) public void SetShiftPlan(Guid shiftPlanId)
{ {
this.ShiftId = shiftId; this.ShiftPlanId = shiftPlanId;
} }

View File

@ -5,4 +5,5 @@ public enum DateQueryFilter
Today = 0, Today = 0,
Tomorrow = 1, Tomorrow = 1,
ThisWeek = 2, ThisWeek = 2,
Yesterday = 3,
} }

View File

@ -25,12 +25,8 @@ namespace Brizco.Domain.Mappers
FirstName = p1.UserFirstName, FirstName = p1.UserFirstName,
LastName = p1.UserLastName LastName = p1.UserLastName
}, },
ShiftId = p1.ShiftId, ShiftPlanId = p1.ShiftPlanId,
Shift = new Shift() ShiftPlan = new ShiftPlan() {Id = p1.ShiftPlanId},
{
Title = p1.ShiftTitle,
Id = p1.ShiftId
},
Type = p1.Type, Type = p1.Type,
Title = p1.Title, Title = p1.Title,
Description = p1.Description, Description = p1.Description,
@ -57,8 +53,8 @@ namespace Brizco.Domain.Mappers
result.UnDoneReason = p2.UnDoneReason; result.UnDoneReason = p2.UnDoneReason;
result.PerformanceDescription = p2.PerformanceDescription; result.PerformanceDescription = p2.PerformanceDescription;
result.User = funcMain1(new Never(), result.User, p2); result.User = funcMain1(new Never(), result.User, p2);
result.ShiftId = p2.ShiftId; result.ShiftPlanId = p2.ShiftPlanId;
result.Shift = funcMain2(new Never(), result.Shift, p2); result.ShiftPlan = funcMain2(new Never(), result.ShiftPlan, p2);
result.Type = p2.Type; result.Type = p2.Type;
result.Title = p2.Title; result.Title = p2.Title;
result.Description = p2.Description; result.Description = p2.Description;
@ -84,12 +80,8 @@ namespace Brizco.Domain.Mappers
FirstName = p8.UserFirstName, FirstName = p8.UserFirstName,
LastName = p8.UserLastName LastName = p8.UserLastName
}, },
ShiftId = p8.ShiftId, ShiftPlanId = p8.ShiftPlanId,
Shift = new Shift() ShiftPlan = new ShiftPlan() {Id = p8.ShiftPlanId},
{
Title = p8.ShiftTitle,
Id = p8.ShiftId
},
Type = p8.Type, Type = p8.Type,
Title = p8.Title, Title = p8.Title,
Description = p8.Description, Description = p8.Description,
@ -116,12 +108,12 @@ namespace Brizco.Domain.Mappers
Status = p9.Status, Status = p9.Status,
DoneAt = p9.DoneAt, DoneAt = p9.DoneAt,
IsDone = p9.IsDone, IsDone = p9.IsDone,
ShiftTitle = p9.Shift != null ? p9.Shift.Title : string.Empty, ShiftTitle = p9.ShiftPlan != null ? (p9.ShiftPlan.Shift != null ? p9.ShiftPlan.Shift.Title : string.Empty) : string.Empty,
PerformanceDescription = p9.PerformanceDescription, PerformanceDescription = p9.PerformanceDescription,
UserFirstName = p9.User != null ? p9.User.FirstName : string.Empty, UserFirstName = p9.User != null ? p9.User.FirstName : string.Empty,
UserLastName = p9.User != null ? p9.User.LastName : string.Empty, UserLastName = p9.User != null ? p9.User.LastName : string.Empty,
Amount = p9.Amount, Amount = p9.Amount,
ShiftId = p9.ShiftId, ShiftPlanId = p9.ShiftPlanId,
AmountType = p9.AmountType, AmountType = p9.AmountType,
Id = p9.Id Id = p9.Id
}; };
@ -145,12 +137,12 @@ namespace Brizco.Domain.Mappers
result.Status = p10.Status; result.Status = p10.Status;
result.DoneAt = p10.DoneAt; result.DoneAt = p10.DoneAt;
result.IsDone = p10.IsDone; result.IsDone = p10.IsDone;
result.ShiftTitle = p10.Shift != null ? p10.Shift.Title : string.Empty; result.ShiftTitle = p10.ShiftPlan != null ? (p10.ShiftPlan.Shift != null ? p10.ShiftPlan.Shift.Title : string.Empty) : string.Empty;
result.PerformanceDescription = p10.PerformanceDescription; result.PerformanceDescription = p10.PerformanceDescription;
result.UserFirstName = p10.User != null ? p10.User.FirstName : string.Empty; result.UserFirstName = p10.User != null ? p10.User.FirstName : string.Empty;
result.UserLastName = p10.User != null ? p10.User.LastName : string.Empty; result.UserLastName = p10.User != null ? p10.User.LastName : string.Empty;
result.Amount = p10.Amount; result.Amount = p10.Amount;
result.ShiftId = p10.ShiftId; result.ShiftPlanId = p10.ShiftPlanId;
result.AmountType = p10.AmountType; result.AmountType = p10.AmountType;
result.Id = p10.Id; result.Id = p10.Id;
return result; return result;
@ -169,12 +161,12 @@ namespace Brizco.Domain.Mappers
Status = p12.Status, Status = p12.Status,
DoneAt = p12.DoneAt, DoneAt = p12.DoneAt,
IsDone = p12.IsDone, IsDone = p12.IsDone,
ShiftTitle = p12.Shift != null ? p12.Shift.Title : string.Empty, ShiftTitle = p12.ShiftPlan != null ? (p12.ShiftPlan.Shift != null ? p12.ShiftPlan.Shift.Title : string.Empty) : string.Empty,
PerformanceDescription = p12.PerformanceDescription, PerformanceDescription = p12.PerformanceDescription,
UserFirstName = p12.User != null ? p12.User.FirstName : string.Empty, UserFirstName = p12.User != null ? p12.User.FirstName : string.Empty,
UserLastName = p12.User != null ? p12.User.LastName : string.Empty, UserLastName = p12.User != null ? p12.User.LastName : string.Empty,
Amount = p12.Amount, Amount = p12.Amount,
ShiftId = p12.ShiftId, ShiftPlanId = p12.ShiftPlanId,
AmountType = p12.AmountType, AmountType = p12.AmountType,
Id = p12.Id Id = p12.Id
}; };
@ -301,12 +293,11 @@ namespace Brizco.Domain.Mappers
} }
private static Shift funcMain2(Never p6, Shift p7, ActivitySDto p2) private static ShiftPlan funcMain2(Never p6, ShiftPlan p7, ActivitySDto p2)
{ {
Shift result = p7 ?? new Shift(); ShiftPlan result = p7 ?? new ShiftPlan();
result.Title = p2.ShiftTitle; result.Id = p2.ShiftPlanId;
result.Id = p2.ShiftId;
return result; return result;
} }

View File

@ -27,7 +27,7 @@ public class MapsterRegister : IRegister
config.NewConfig<Activity, ActivitySDto>() config.NewConfig<Activity, ActivitySDto>()
.Map("UserFirstName", o => o.User !=null ? o.User.FirstName : string.Empty) .Map("UserFirstName", o => o.User !=null ? o.User.FirstName : string.Empty)
.Map("UserLastName", o => o.User != null ? o.User.LastName : string.Empty) .Map("UserLastName", o => o.User != null ? o.User.LastName : string.Empty)
.Map("ShiftTitle",o=>o.Shift != null ? o.Shift.Title : string.Empty) .Map("ShiftTitle",o=>o.ShiftPlan != null ? o.ShiftPlan.Shift != null ? o.ShiftPlan.Shift.Title : string.Empty : string.Empty)
.TwoWays(); .TwoWays();
config.NewConfig<Task, TaskLDto>() config.NewConfig<Task, TaskLDto>()

View File

@ -37,7 +37,7 @@ public class CreateActivityCommandHandler : IRequestHandler<CreateActivityComman
request.ScheduleType); request.ScheduleType);
activity.SetUser(request.UserId); activity.SetUser(request.UserId);
activity.SetShift(request.ShiftId); activity.SetShiftPlan(request.ShiftPlanId);
_repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>().Add(activity); _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>().Add(activity);
await _repositoryWrapper.SaveChangesAsync(cancellationToken); await _repositoryWrapper.SaveChangesAsync(cancellationToken);

View File

@ -35,6 +35,9 @@ public class GetActivitiesQueryHandler : IRequestHandler<GetActivitiesQuery, Lis
{ {
switch (request.DateQueryFilter) switch (request.DateQueryFilter)
{ {
case DateQueryFilter.Yesterday:
activities = activities.Where(a => a.SetFor.Date == DateTime.Today.Date.AddDays(-1).Date);
break;
case DateQueryFilter.Today: case DateQueryFilter.Today:
activities = activities.Where(a => a.SetFor.Date == DateTime.Today.Date); activities = activities.Where(a => a.SetFor.Date == DateTime.Today.Date);
break; break;
@ -55,8 +58,8 @@ public class GetActivitiesQueryHandler : IRequestHandler<GetActivitiesQuery, Lis
activities = activities.Where(a => a.SetFor.Date == selectedDate.Date); activities = activities.Where(a => a.SetFor.Date == selectedDate.Date);
} }
if (request.SelectedShift != default) if (request.SelectedShiftPlanId != default)
activities = activities.Where(a => a.ShiftId == request.SelectedShift); activities = activities.Where(a => a.ShiftPlanId == request.SelectedShiftPlanId);
var response= await activities.OrderByDescending(s => s.UserId) var response= await activities.OrderByDescending(s => s.UserId)

View File

@ -0,0 +1,21 @@
namespace Brizco.Repository.Handlers.Activity;
public class GetShiftPlanActivitiesQueryHandler : IRequestHandler<GetShiftPlanActivitiesQuery, List<ActivitySDto>>
{
private IRepositoryWrapper _repositoryWrapper;
public GetShiftPlanActivitiesQueryHandler(IRepositoryWrapper repositoryWrapper)
{
_repositoryWrapper = repositoryWrapper;
}
public async Task<List<ActivitySDto>> Handle(GetShiftPlanActivitiesQuery request, CancellationToken cancellationToken)
{
var activities = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
.TableNoTracking
.Where(a => a.ShiftPlanId == request.ShiftPlanId)
.Select(ActivityMapper.ProjectToSDto)
.ToListAsync(cancellationToken);
return activities;
}
}

View File

@ -43,7 +43,7 @@ public class UpdateActivityCommandHandler : IRequestHandler<UpdateActivityComman
newTask.Id = request.Id; newTask.Id = request.Id;
newTask.SetUser(request.UserId); newTask.SetUser(request.UserId);
newTask.SetShift(request.ShiftId); newTask.SetShiftPlan(request.ShiftPlanId);
_repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>() _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
.Update(newTask); .Update(newTask);

View File

@ -1,4 +1,5 @@
using Brizco.Domain.Entities.Shift; using Brizco.Domain.Entities.Shift;
using Brizco.Domain.Entities.User;
using Guid = System.Guid; using Guid = System.Guid;
namespace Brizco.Repository.Handlers.Shift; namespace Brizco.Repository.Handlers.Shift;
@ -6,11 +7,13 @@ namespace Brizco.Repository.Handlers.Shift;
public class GetShiftPlansQueryHandler : IRequestHandler<GetShiftsQuery, List<ShiftSDto>> public class GetShiftPlansQueryHandler : IRequestHandler<GetShiftsQuery, List<ShiftSDto>>
{ {
private readonly IRepositoryWrapper _repositoryWrapper; private readonly IRepositoryWrapper _repositoryWrapper;
private readonly UserManager<ApplicationUser> _userManager;
private readonly ICurrentUserService _currentUserService; private readonly ICurrentUserService _currentUserService;
public GetShiftPlansQueryHandler(IRepositoryWrapper repositoryWrapper, ICurrentUserService currentUserService) public GetShiftPlansQueryHandler(IRepositoryWrapper repositoryWrapper,UserManager<ApplicationUser> userManager, ICurrentUserService currentUserService)
{ {
_repositoryWrapper = repositoryWrapper; _repositoryWrapper = repositoryWrapper;
_userManager = userManager;
_currentUserService = currentUserService; _currentUserService = currentUserService;
} }
public async Task<List<ShiftSDto>> Handle(GetShiftsQuery request, CancellationToken cancellationToken) public async Task<List<ShiftSDto>> Handle(GetShiftsQuery request, CancellationToken cancellationToken)
@ -20,6 +23,7 @@ public class GetShiftPlansQueryHandler : IRequestHandler<GetShiftsQuery, List<Sh
if (!Guid.TryParse(_currentUserService.ComplexId, out Guid complexId)) if (!Guid.TryParse(_currentUserService.ComplexId, out Guid complexId))
throw new AppException("ComplexId is wrong", ApiResultStatusCode.NotFound); throw new AppException("ComplexId is wrong", ApiResultStatusCode.NotFound);
List<ShiftSDto> shifts; List<ShiftSDto> shifts;
if (request.SelectedDate > 0) if (request.SelectedDate > 0)
{ {
var selectedDate = DateTimeExtensions.UnixTimeStampToDateTime(request.SelectedDate); var selectedDate = DateTimeExtensions.UnixTimeStampToDateTime(request.SelectedDate);
@ -32,15 +36,24 @@ public class GetShiftPlansQueryHandler : IRequestHandler<GetShiftsQuery, List<Sh
shifts = await originalShifts.AsNoTracking().Select(ShiftMapper.ProjectToSDto).ToListAsync(cancellationToken); shifts = await originalShifts.AsNoTracking().Select(ShiftMapper.ProjectToSDto).ToListAsync(cancellationToken);
foreach (var shift in shifts) foreach (var shift in shifts)
{ {
var existedShiftPlan = await _repositoryWrapper.SetRepository<Domain.Entities.Shift.ShiftPlan>()
.TableNoTracking
.FirstOrDefaultAsync(s => s.ShiftId == shift.Id && s.PlanFor.Date == selectedDate.Date, cancellationToken);
if(existedShiftPlan == null)
continue;
var supervisor = await _userManager.FindByIdAsync(existedShiftPlan.SupervisorId.ToString());
if (supervisor != null)
shift.CurrentSupervisorFullName = supervisor.FirstName + " " + supervisor.LastName;
var activitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>() var activitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
.TableNoTracking .TableNoTracking
.CountAsync(a => a.SetFor.Date == selectedDate.Date && a.ShiftId == shift.Id, cancellationToken); .CountAsync(a => a.SetFor.Date == selectedDate.Date && a.ShiftPlanId == existedShiftPlan.Id, cancellationToken);
var doneActivitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>() var doneActivitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
.TableNoTracking .TableNoTracking
.CountAsync(a => a.Status == ActivityStatus.Done && a.SetFor.Date == selectedDate.Date && a.ShiftId == shift.Id, cancellationToken); .CountAsync(a => a.Status == ActivityStatus.Done && a.SetFor.Date == selectedDate.Date && a.ShiftPlanId == existedShiftPlan.Id, cancellationToken);
var undoneActivitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>() var undoneActivitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
.TableNoTracking .TableNoTracking
.CountAsync(a => a.Status == ActivityStatus.UnDone && a.SetFor.Date == selectedDate.Date && a.ShiftId == shift.Id, cancellationToken); .CountAsync(a => a.Status == ActivityStatus.UnDone && a.SetFor.Date == selectedDate.Date && a.ShiftPlanId == existedShiftPlan.Id, cancellationToken);
shift.UndoneActivitiesCount = undoneActivitiesCount; shift.UndoneActivitiesCount = undoneActivitiesCount;
shift.DoneActivitiesCount = doneActivitiesCount; shift.DoneActivitiesCount = doneActivitiesCount;
shift.TotalActivitiesCount = activitiesCount; shift.TotalActivitiesCount = activitiesCount;
@ -53,19 +66,16 @@ public class GetShiftPlansQueryHandler : IRequestHandler<GetShiftsQuery, List<Sh
{ {
if (!Guid.TryParse(_currentUserService.UserId, out Guid userId)) if (!Guid.TryParse(_currentUserService.UserId, out Guid userId))
throw new AppException("User id is wrong"); throw new AppException("User id is wrong");
var existedShiftPlan = await _repositoryWrapper.SetRepository<Domain.Entities.Shift.ShiftPlan>() var existedSupervisorShiftPlan = await _repositoryWrapper.SetRepository<Domain.Entities.Shift.ShiftPlan>()
.TableNoTracking .TableNoTracking
.FirstOrDefaultAsync(s => s.ShiftId == shift.Id && s.PlanFor.Date == selectedDate.Date && s.SupervisorId == userId, cancellationToken); .FirstOrDefaultAsync(s => s.ShiftId == shift.Id && s.PlanFor.Date == selectedDate.Date && s.SupervisorId == userId, cancellationToken);
shift.IsCompleted = existedShiftPlan?.IsCompleted ?? false; shift.IsCompleted = existedSupervisorShiftPlan?.IsCompleted ?? false;
shift.CurrentShiftPlanId = existedShiftPlan?.Id ?? default; shift.CurrentShiftPlanId = existedSupervisorShiftPlan?.Id ?? default;
shift.HasCurrentShiftPlan = existedShiftPlan != null; shift.HasCurrentShiftPlan = existedSupervisorShiftPlan != null;
break; break;
} }
case ApplicationRoles.Manager: case ApplicationRoles.Manager:
{ {
var existedShiftPlan = await _repositoryWrapper.SetRepository<Domain.Entities.Shift.ShiftPlan>()
.TableNoTracking
.FirstOrDefaultAsync(s => s.ShiftId == shift.Id && s.PlanFor.Date == selectedDate.Date, cancellationToken);
shift.IsCompleted = existedShiftPlan?.IsCompleted ?? false; shift.IsCompleted = existedShiftPlan?.IsCompleted ?? false;
shift.CurrentShiftPlanId = existedShiftPlan?.Id ?? default; shift.CurrentShiftPlanId = existedShiftPlan?.Id ?? default;
shift.HasCurrentShiftPlan = existedShiftPlan != null; shift.HasCurrentShiftPlan = existedShiftPlan != null;
@ -94,10 +104,7 @@ public class GetShiftPlansQueryHandler : IRequestHandler<GetShiftsQuery, List<Sh
if (d == DayOfWeek.Saturday) if (d == DayOfWeek.Saturday)
shiftDays.Insert(0, d); shiftDays.Insert(0, d);
else else
{
shiftDays.Add(d); shiftDays.Add(d);
}
}); });
shift.Days = shiftDays; shift.Days = shiftDays;
} }

View File

@ -141,13 +141,13 @@ public class GetShiftPlansQueryHandler : IRequestHandler<GetShiftPlansQuery, Lis
{ {
var activitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>() var activitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
.TableNoTracking .TableNoTracking
.CountAsync(a => a.SetFor.Date == shiftPlan.PlanFor.Date && a.ShiftId == shiftPlan.Id, cancellationToken); .CountAsync(a => a.SetFor.Date == shiftPlan.PlanFor.Date && a.ShiftPlanId == shiftPlan.Id, cancellationToken);
var doneActivitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>() var doneActivitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
.TableNoTracking .TableNoTracking
.CountAsync(a => a.Status == ActivityStatus.Done && a.SetFor.Date == shiftPlan.PlanFor.Date && a.ShiftId == shiftPlan.Id, cancellationToken); .CountAsync(a => a.Status == ActivityStatus.Done && a.SetFor.Date == shiftPlan.PlanFor.Date && a.ShiftPlanId == shiftPlan.Id, cancellationToken);
var undoneActivitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>() var undoneActivitiesCount = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
.TableNoTracking .TableNoTracking
.CountAsync(a => a.Status == ActivityStatus.UnDone && a.SetFor.Date == shiftPlan.PlanFor.Date && a.ShiftId == shiftPlan.Id, cancellationToken); .CountAsync(a => a.Status == ActivityStatus.UnDone && a.SetFor.Date == shiftPlan.PlanFor.Date && a.ShiftPlanId == shiftPlan.Id, cancellationToken);
shiftPlan.UndoneActivitiesCount = undoneActivitiesCount; shiftPlan.UndoneActivitiesCount = undoneActivitiesCount;
shiftPlan.DoneActivitiesCount = doneActivitiesCount; shiftPlan.DoneActivitiesCount = doneActivitiesCount;
shiftPlan.TotalActivitiesCount = activitiesCount; shiftPlan.TotalActivitiesCount = activitiesCount;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,72 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Brizco.Repository.Migrations
{
/// <inheritdoc />
public partial class editActivityAddShiftPlanId : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Tasks_Shifts_ShiftId",
schema: "public",
table: "Tasks");
migrationBuilder.RenameColumn(
name: "ShiftId",
schema: "public",
table: "Tasks",
newName: "ShiftPlanId");
migrationBuilder.RenameIndex(
name: "IX_Tasks_ShiftId",
schema: "public",
table: "Tasks",
newName: "IX_Tasks_ShiftPlanId");
migrationBuilder.AddForeignKey(
name: "FK_Tasks_ShiftPlans_ShiftPlanId",
schema: "public",
table: "Tasks",
column: "ShiftPlanId",
principalSchema: "public",
principalTable: "ShiftPlans",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Tasks_ShiftPlans_ShiftPlanId",
schema: "public",
table: "Tasks");
migrationBuilder.RenameColumn(
name: "ShiftPlanId",
schema: "public",
table: "Tasks",
newName: "ShiftId");
migrationBuilder.RenameIndex(
name: "IX_Tasks_ShiftPlanId",
schema: "public",
table: "Tasks",
newName: "IX_Tasks_ShiftId");
migrationBuilder.AddForeignKey(
name: "FK_Tasks_Shifts_ShiftId",
schema: "public",
table: "Tasks",
column: "ShiftId",
principalSchema: "public",
principalTable: "Shifts",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}

View File

@ -18,7 +18,7 @@ namespace Brizco.Repository.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasDefaultSchema("public") .HasDefaultSchema("public")
.HasAnnotation("ProductVersion", "8.0.0") .HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 63); .HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@ -1030,7 +1030,7 @@ namespace Brizco.Repository.Migrations
.IsRequired() .IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<Guid>("ShiftId") b.Property<Guid>("ShiftPlanId")
.HasColumnType("uuid"); .HasColumnType("uuid");
b.Property<int>("Status") b.Property<int>("Status")
@ -1043,7 +1043,7 @@ namespace Brizco.Repository.Migrations
b.Property<Guid>("UserId") b.Property<Guid>("UserId")
.HasColumnType("uuid"); .HasColumnType("uuid");
b.HasIndex("ShiftId"); b.HasIndex("ShiftPlanId");
b.HasIndex("UserId"); b.HasIndex("UserId");
@ -1340,9 +1340,9 @@ namespace Brizco.Repository.Migrations
modelBuilder.Entity("Brizco.Domain.Entities.Task.Activity", b => modelBuilder.Entity("Brizco.Domain.Entities.Task.Activity", b =>
{ {
b.HasOne("Brizco.Domain.Entities.Shift.Shift", "Shift") b.HasOne("Brizco.Domain.Entities.Shift.ShiftPlan", "ShiftPlan")
.WithMany() .WithMany()
.HasForeignKey("ShiftId") .HasForeignKey("ShiftPlanId")
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);
b.HasOne("Brizco.Domain.Entities.User.ApplicationUser", "User") b.HasOne("Brizco.Domain.Entities.User.ApplicationUser", "User")
@ -1350,7 +1350,7 @@ namespace Brizco.Repository.Migrations
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict); .OnDelete(DeleteBehavior.Restrict);
b.Navigation("Shift"); b.Navigation("ShiftPlan");
b.Navigation("User"); b.Navigation("User");
}); });