fix(Change Entities NameSpace )
parent
637070557b
commit
e918e8d3f7
|
@ -2,6 +2,7 @@
|
||||||
using Asp.Versioning;
|
using Asp.Versioning;
|
||||||
using AspNetCoreRateLimit;
|
using AspNetCoreRateLimit;
|
||||||
using AspNetCoreRateLimit.Redis;
|
using AspNetCoreRateLimit.Redis;
|
||||||
|
using Brizco.Domain.Entities.Users;
|
||||||
using Marten;
|
using Marten;
|
||||||
using Microsoft.AspNetCore.ResponseCompression;
|
using Microsoft.AspNetCore.ResponseCompression;
|
||||||
using StackExchange.Redis.Extensions.Core.Configuration;
|
using StackExchange.Redis.Extensions.Core.Configuration;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Core.CoreServices.Abstracts;
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
|
namespace Brizco.Core.CoreServices.Abstracts;
|
||||||
|
|
||||||
public interface IJwtService : IScopedDependency
|
public interface IJwtService : IScopedDependency
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
using Brizco.Domain.Entities.Shift;
|
using System.Threading;
|
||||||
using System.Threading;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
using Brizco.Domain.Entities.Users;
|
||||||
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.Functions;
|
||||||
|
|
||||||
namespace Brizco.Core.CoreServices;
|
namespace Brizco.Core.CoreServices;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using System.IdentityModel.Tokens.Jwt;
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
namespace Brizco.Core.CoreServices;
|
namespace Brizco.Core.CoreServices;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
using Brizco.Domain.Entities.Task;
|
using Task = Brizco.Domain.Entities.Tasks.Task;
|
||||||
using Brizco.Domain.Entities.Routine;
|
|
||||||
using Brizco.Domain.Entities.Shift;
|
|
||||||
using Task = Brizco.Domain.Entities.Task.Task;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
using Brizco.Domain.Entities.Routines;
|
||||||
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
using Brizco.Domain.Entities.Tasks;
|
||||||
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
namespace Brizco.Core.CoreServices;
|
namespace Brizco.Core.CoreServices;
|
||||||
|
|
||||||
|
@ -206,7 +208,7 @@ public class PageService : IPageService
|
||||||
.SelectMany(s=>s.Shifts).OrderBy(s=>s.StartAt).ToList().ForEach(s=>item.Shifts.Add(s.Clone()));
|
.SelectMany(s=>s.Shifts).OrderBy(s=>s.StartAt).ToList().ForEach(s=>item.Shifts.Add(s.Clone()));
|
||||||
foreach (var shift in item.Shifts)
|
foreach (var shift in item.Shifts)
|
||||||
{
|
{
|
||||||
var existedShiftPlan = await _repositoryWrapper.SetRepository<Domain.Entities.Shift.ShiftPlan>()
|
var existedShiftPlan = await _repositoryWrapper.SetRepository<ShiftPlan>()
|
||||||
.TableNoTracking
|
.TableNoTracking
|
||||||
.FirstOrDefaultAsync(s => s.ShiftId == shift.Id && s.PlanFor.Date == day.Date, cancellationToken);
|
.FirstOrDefaultAsync(s => s.ShiftId == shift.Id && s.PlanFor.Date == day.Date, cancellationToken);
|
||||||
shift.CurrentShiftPlanId = existedShiftPlan?.Id ?? default;
|
shift.CurrentShiftPlanId = existedShiftPlan?.Id ?? default;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
using Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
using MD.PersianDateTime.Standard;
|
using MD.PersianDateTime.Standard;
|
||||||
|
|
||||||
namespace Brizco.Core.CoreServices.ReportServices;
|
namespace Brizco.Core.CoreServices.ReportServices;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
using Task = System.Threading.Tasks.Task;
|
using Task = System.Threading.Tasks.Task;
|
||||||
|
|
||||||
namespace Brizco.Core.CoreServices.ReportServices;
|
namespace Brizco.Core.CoreServices.ReportServices;
|
||||||
|
@ -12,7 +12,7 @@ public class TaskReportCommandHandler : IRequestHandler<TaskReportCommand , byte
|
||||||
}
|
}
|
||||||
public async Task<byte[]> Handle(TaskReportCommand request, CancellationToken cancellationToken)
|
public async Task<byte[]> Handle(TaskReportCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var tasks = await _repositoryWrapper.SetRepository<Brizco.Domain.Entities.Task.Task>()
|
var tasks = await _repositoryWrapper.SetRepository<Domain.Entities.Tasks.Task>()
|
||||||
.TableNoTracking
|
.TableNoTracking
|
||||||
.Select(TaskMapper.ProjectToLDto)
|
.Select(TaskMapper.ProjectToLDto)
|
||||||
.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Core.EntityServices.Abstracts;
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
|
namespace Brizco.Core.EntityServices.Abstracts;
|
||||||
|
|
||||||
public interface IUserService : IScopedDependency
|
public interface IUserService : IScopedDependency
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
using Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
using Task = Brizco.Domain.Entities.Task.Task;
|
using Task = Brizco.Domain.Entities.Tasks.Task;
|
||||||
|
|
||||||
namespace Brizco.Core.EntityServices;
|
namespace Brizco.Core.EntityServices;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Core.EntityServices;
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
|
namespace Brizco.Core.EntityServices;
|
||||||
|
|
||||||
public class ComplexService : IComplexService
|
public class ComplexService : IComplexService
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
namespace Brizco.Core.EntityServices;
|
namespace Brizco.Core.EntityServices;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
namespace Brizco.Core.EntityServices;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
|
namespace Brizco.Core.EntityServices;
|
||||||
|
|
||||||
public class UserService : IUserService
|
public class UserService : IUserService
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Quartz;
|
using Quartz;
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,12 @@
|
||||||
<Using Include="Brizco.Domain.Dtos.ResponseDto" />
|
<Using Include="Brizco.Domain.Dtos.ResponseDto" />
|
||||||
<Using Include="Brizco.Domain.Dtos.SmallDtos" />
|
<Using Include="Brizco.Domain.Dtos.SmallDtos" />
|
||||||
<Using Include="Brizco.Domain.Entities.Complex" />
|
<Using Include="Brizco.Domain.Entities.Complex" />
|
||||||
|
<Using Include="Brizco.Domain.Entities.Complexes" />
|
||||||
<Using Include="Brizco.Domain.Entities.Routine" />
|
<Using Include="Brizco.Domain.Entities.Routine" />
|
||||||
<Using Include="Brizco.Domain.Entities.Shift" />
|
<Using Include="Brizco.Domain.Entities.Shift" />
|
||||||
|
<Using Include="Brizco.Domain.Entities.Shifts" />
|
||||||
<Using Include="Brizco.Domain.Entities.Task" />
|
<Using Include="Brizco.Domain.Entities.Task" />
|
||||||
|
<Using Include="Brizco.Domain.Entities.Users" />
|
||||||
<Using Include="Brizco.Domain.Enums" />
|
<Using Include="Brizco.Domain.Enums" />
|
||||||
<Using Include="Mapster" />
|
<Using Include="Mapster" />
|
||||||
<Using Include="Microsoft.AspNetCore.Identity" />
|
<Using Include="Microsoft.AspNetCore.Identity" />
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Shift;
|
namespace Brizco.Domain.CommandQueries.Commands;
|
||||||
|
|
||||||
namespace Brizco.Domain.CommandQueries.Commands;
|
|
||||||
|
|
||||||
public sealed record CreateShiftCommand(string Title, TimeSpan StartAt, TimeSpan EndAt, string Description, List<DayOfWeek> DayOfWeeks, List<Guid> Routines)
|
public sealed record CreateShiftCommand(string Title, TimeSpan StartAt, TimeSpan EndAt, string Description, List<DayOfWeek> DayOfWeeks, List<Guid> Routines)
|
||||||
: IRequest<ShiftSDto>;
|
: IRequest<ShiftSDto>;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||||
|
|
||||||
public class ActivityLDto : BaseDto<ActivityLDto , Activity>
|
public class ActivityLDto : BaseDto<ActivityLDto , Activity>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||||
|
|
||||||
public class ComplexLDto : BaseDto<ComplexLDto,Complex>
|
public class ComplexLDto : BaseDto<ComplexLDto,Complex>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||||
|
|
||||||
public class PositionLDto : BaseDto<PositionLDto, Position>
|
public class PositionLDto : BaseDto<PositionLDto, Position>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||||
|
|
||||||
public class SectionLDto : BaseDto<SectionLDto, Section>
|
public class SectionLDto : BaseDto<SectionLDto, Section>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||||
|
|
||||||
public class ShiftLDto : BaseDto<ShiftLDto,Shift>
|
public class ShiftLDto : BaseDto<ShiftLDto,Shift>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||||
|
|
||||||
public class ShiftPlanLDto : BaseDto<ShiftPlanLDto , ShiftPlan>
|
public class ShiftPlanLDto : BaseDto<ShiftPlanLDto , ShiftPlan>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
namespace Brizco.Domain.Dtos.LargeDtos;
|
using Task = Brizco.Domain.Entities.Tasks.Task;
|
||||||
|
|
||||||
public class TaskLDto : BaseDto<TaskLDto, Entities.Task.Task>
|
namespace Brizco.Domain.Dtos.LargeDtos;
|
||||||
|
|
||||||
|
public class TaskLDto : BaseDto<TaskLDto, Task>
|
||||||
{
|
{
|
||||||
public TaskType Type { get; set; }
|
public TaskType Type { get; set; }
|
||||||
public string Title { get; set; } = string.Empty;
|
public string Title { get; set; } = string.Empty;
|
||||||
|
@ -17,10 +19,7 @@ public class TaskLDto : BaseDto<TaskLDto, Entities.Task.Task>
|
||||||
|
|
||||||
|
|
||||||
public List<TaskShiftSDto> Shifts { get; set; } = new();
|
public List<TaskShiftSDto> Shifts { get; set; } = new();
|
||||||
|
|
||||||
public List<TaskPositionSDto> Positions { get; set; } = new();
|
public List<TaskPositionSDto> Positions { get; set; } = new();
|
||||||
|
public List<TaskDaySDto> Days { get; set; } = new();
|
||||||
public List<TaskDaySDto> Days { get; internal set; } = new();
|
public List<TaskRoutineSDto> Routines { get; set; } = new();
|
||||||
|
|
||||||
public List<TaskRoutineSDto> Routines { get; internal set; } = new();
|
|
||||||
}
|
}
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class ActivitySDto : BaseDto<ActivitySDto , Activity>
|
public class ActivitySDto : BaseDto<ActivitySDto , Activity>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class PositionSDto : BaseDto<PositionSDto, Position>
|
public class PositionSDto : BaseDto<PositionSDto, Position>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Routines;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class RoutineSDto : BaseDto<RoutineSDto,Routine>
|
public class RoutineSDto : BaseDto<RoutineSDto,Routine>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class SectionSDto : BaseDto<SectionSDto, Section>
|
public class SectionSDto : BaseDto<SectionSDto, Section>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class ShiftDaySDto : BaseDto<ShiftDaySDto,ShiftDay>
|
public class ShiftDaySDto : BaseDto<ShiftDaySDto,ShiftDay>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class ShiftPlanSDto : BaseDto<ShiftPlanSDto,ShiftPlan>
|
public class ShiftPlanSDto : BaseDto<ShiftPlanSDto,ShiftPlan>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class ShiftPlanUserSDto : BaseDto<ShiftPlanUserSDto,ShiftPlanUser>
|
public class ShiftPlanUserSDto : BaseDto<ShiftPlanUserSDto,ShiftPlanUser>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class ShiftRoutineSDto : BaseDto<ShiftRoutineSDto, ShiftRoutine>
|
public class ShiftRoutineSDto : BaseDto<ShiftRoutineSDto, ShiftRoutine>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class TaskDaySDto : BaseDto<TaskDaySDto, TaskDay>
|
public class TaskDaySDto : BaseDto<TaskDaySDto, TaskDay>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class TaskRoutineSDto : BaseDto<TaskRoutineSDto,TaskRoutine>
|
public class TaskRoutineSDto : BaseDto<TaskRoutineSDto,TaskRoutine>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Task = Brizco.Domain.Entities.Tasks.Task;
|
||||||
|
|
||||||
public class TaskSDto : BaseDto<TaskSDto,Entities.Task.Task>
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
|
public class TaskSDto : BaseDto<TaskSDto,Task>
|
||||||
{
|
{
|
||||||
public TaskType Type { get; set; }
|
public TaskType Type { get; set; }
|
||||||
public string Title { get; set; } = string.Empty;
|
public string Title { get; set; } = string.Empty;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
public class TaskShiftSDto : BaseDto<TaskShiftSDto,TaskShift>
|
public class TaskShiftSDto : BaseDto<TaskShiftSDto,TaskShift>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Brizco.Domain.Entities.Complex;
|
namespace Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
public partial class Complex
|
public partial class Complex
|
||||||
{
|
{
|
|
@ -1,6 +1,8 @@
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
using Brizco.Domain.Entities.Users;
|
||||||
|
using Task = Brizco.Domain.Entities.Tasks.Task;
|
||||||
|
|
||||||
namespace Brizco.Domain.Entities.Complex;
|
namespace Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||||
|
@ -23,9 +25,9 @@ public partial class Complex : ApiEntity
|
||||||
public string Address { get; internal set; } = string.Empty;
|
public string Address { get; internal set; } = string.Empty;
|
||||||
public string SupportPhone { get; internal set; } = string.Empty;
|
public string SupportPhone { get; internal set; } = string.Empty;
|
||||||
|
|
||||||
public List<ApplicationRole> Roles { get; set; } = new();
|
public List<ApplicationRole> Roles { get; internal set; } = new();
|
||||||
public List<Task.Task> Tasks { get; set; } = new();
|
public List<Task> Tasks { get; internal set; } = new();
|
||||||
public List<Shift.Shift> Shifts { get; set; } = new();
|
public List<Shift> Shifts { get; internal set; } = new();
|
||||||
public List<ComplexUser> Users { get; set; } = new();
|
public List<ComplexUser> Users { get; internal set; } = new();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
namespace Brizco.Domain.Entities.Complex;
|
namespace Brizco.Domain.Entities.Complexes;
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[GenerateMapper]
|
[GenerateMapper]
|
||||||
public partial class ComplexUser : ApiEntity
|
public partial class ComplexUser : ApiEntity
|
|
@ -1,6 +1,6 @@
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
namespace Brizco.Domain.Entities.Complex;
|
namespace Brizco.Domain.Entities.Complexes;
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[GenerateMapper]
|
[GenerateMapper]
|
||||||
public class ComplexUserRole : ApiEntity
|
public class ComplexUserRole : ApiEntity
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Brizco.Domain.Entities.Complex;
|
namespace Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||||
|
@ -23,11 +23,11 @@ public partial class Position : ApiEntity
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Guid ComplexId { get; set; }
|
public Guid ComplexId { get; internal set; }
|
||||||
public Complex? Complex { get; set; }
|
public Complex? Complex { get; internal set; }
|
||||||
|
|
||||||
public Guid SectionId { get; set; }
|
public Guid SectionId { get; internal set; }
|
||||||
public Section? Section { get; set; }
|
public Section? Section { get; internal set; }
|
||||||
|
|
||||||
public List<PositionPermission> Permissions { get; set; } = new();
|
public List<PositionPermission> Permissions { get; set; } = new();
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Brizco.Domain.Entities.Complex;
|
namespace Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||||
|
@ -15,7 +15,7 @@ public partial class PositionPermission : ApiEntity
|
||||||
PositionId = positionId;
|
PositionId = positionId;
|
||||||
Permission = permission;
|
Permission = permission;
|
||||||
}
|
}
|
||||||
public Guid PositionId { get; set; }
|
public Guid PositionId { get; internal set; }
|
||||||
public Position? Position { get; set; }
|
public Position? Position { get; internal set; }
|
||||||
public string Permission { get; set; } = string.Empty;
|
public string Permission { get; set; } = string.Empty;
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Brizco.Domain.Entities.Complex;
|
namespace Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||||
|
@ -19,8 +19,8 @@ public partial class Section : ApiEntity
|
||||||
public string Name { get; internal set; } = string.Empty;
|
public string Name { get; internal set; } = string.Empty;
|
||||||
public string Description { get; internal set; } = string.Empty;
|
public string Description { get; internal set; } = string.Empty;
|
||||||
|
|
||||||
public Guid ComplexId { get; set; }
|
public Guid ComplexId { get; internal set; }
|
||||||
public Complex? Complex { get; set; }
|
public Complex? Complex { get; internal set; }
|
||||||
|
|
||||||
public List<Position> Positions { get; internal set; } = new();
|
public List<Position> Positions { get; internal set; } = new();
|
||||||
}
|
}
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Entities.Routine;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Entities.Routines;
|
||||||
|
|
||||||
public partial class Routine
|
public partial class Routine
|
||||||
{
|
{
|
|
@ -1,4 +1,7 @@
|
||||||
namespace Brizco.Domain.Entities.Routine;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
using Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Entities.Routines;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
|
@ -19,7 +22,7 @@ public partial class Routine : ApiEntity
|
||||||
public string Description { get; internal set; } = string.Empty;
|
public string Description { get; internal set; } = string.Empty;
|
||||||
|
|
||||||
public Guid ComplexId { get; internal set; }
|
public Guid ComplexId { get; internal set; }
|
||||||
public Complex.Complex? Complex { get; internal set; }
|
public Complex? Complex { get; internal set; }
|
||||||
|
|
||||||
|
|
||||||
public List<TaskRoutine> Tasks { get; internal set; } = new();
|
public List<TaskRoutine> Tasks { get; internal set; } = new();
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
namespace Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
namespace Brizco.Domain.Entities.Shift;
|
|
||||||
public partial class Shift
|
public partial class Shift
|
||||||
{
|
{
|
||||||
public static Shift Create(string title, string description, TimeSpan startAt, TimeSpan endAt,Guid complexId)
|
public static Shift Create(string title, string description, TimeSpan startAt, TimeSpan endAt,Guid complexId)
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Brizco.Domain.Entities.Shift;
|
namespace Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||||
|
@ -22,8 +22,8 @@ public partial class Shift : ApiEntity
|
||||||
public TimeSpan EndAt { get; internal set; }
|
public TimeSpan EndAt { get; internal set; }
|
||||||
public string Description { get; internal set; } = string.Empty;
|
public string Description { get; internal set; } = string.Empty;
|
||||||
|
|
||||||
public Guid ComplexId { get; set; }
|
public Guid ComplexId { get; internal set; }
|
||||||
public Complex.Complex? Complex { get; set; }
|
public Complex? Complex { get; internal set; }
|
||||||
|
|
||||||
public List<ShiftDay> Days { get; internal set; } = new();
|
public List<ShiftDay> Days { get; internal set; } = new();
|
||||||
public List<ShiftPlan> Plans { get; internal set; } = new();
|
public List<ShiftPlan> Plans { get; internal set; } = new();
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Brizco.Domain.Entities.Shift;
|
namespace Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[GenerateMapper]
|
[GenerateMapper]
|
|
@ -1,6 +1,7 @@
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Routines;
|
||||||
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
namespace Brizco.Domain.Entities.Shift;
|
namespace Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||||
|
@ -31,10 +32,10 @@ public partial class ShiftPlan : ApiEntity
|
||||||
public virtual Shift? Shift { get; internal set; }
|
public virtual Shift? Shift { get; internal set; }
|
||||||
|
|
||||||
public Guid RoutineId { get; internal set; }
|
public Guid RoutineId { get; internal set; }
|
||||||
public virtual Routine.Routine? Routine { get; internal set; }
|
public virtual Routine? Routine { get; internal set; }
|
||||||
|
|
||||||
public Guid ComplexId { get; internal set; }
|
public Guid ComplexId { get; internal set; }
|
||||||
public Complex.Complex? Complex { get; internal set; }
|
public Complex? Complex { get; internal set; }
|
||||||
|
|
||||||
public Guid SupervisorId { get; internal set; }
|
public Guid SupervisorId { get; internal set; }
|
||||||
public ApplicationUser? Supervisor { get; internal set; }
|
public ApplicationUser? Supervisor { get; internal set; }
|
|
@ -1,6 +1,6 @@
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
namespace Brizco.Domain.Entities.Shift;
|
namespace Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[GenerateMapper]
|
[GenerateMapper]
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Routines;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[GenerateMapper]
|
[GenerateMapper]
|
||||||
|
@ -14,7 +16,7 @@ public class ShiftRoutine : ApiEntity
|
||||||
ShiftId = shiftId;
|
ShiftId = shiftId;
|
||||||
}
|
}
|
||||||
public Guid RoutineId { get; internal set; }
|
public Guid RoutineId { get; internal set; }
|
||||||
public Routine.Routine? Routine { get; internal set; }
|
public Routine? Routine { get; internal set; }
|
||||||
|
|
||||||
public Guid ShiftId { get; internal set; }
|
public Guid ShiftId { get; internal set; }
|
||||||
public Shift? Shift { get; internal set; }
|
public Shift? Shift { get; internal set; }
|
|
@ -1,6 +1,4 @@
|
||||||
using Brizco.Domain.Entities.User;
|
namespace Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
namespace Brizco.Domain.Entities.Task;
|
|
||||||
|
|
||||||
public partial class Activity : Task
|
public partial class Activity : Task
|
||||||
{
|
{
|
|
@ -1,7 +1,6 @@
|
||||||
using Brizco.Common.Models.Exception;
|
using Brizco.Common.Models.Exception;
|
||||||
using Brizco.Domain.Entities.Routine;
|
|
||||||
|
|
||||||
namespace Brizco.Domain.Entities.Task;
|
namespace Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
|
|
||||||
public partial class Task
|
public partial class Task
|
|
@ -1,6 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Shift;
|
namespace Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
namespace Brizco.Domain.Entities.Task;
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget )]
|
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget )]
|
||||||
[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||||
|
@ -41,11 +39,11 @@ public partial class Task : ApiEntity
|
||||||
public bool IsDisposable { get; internal set; }
|
public bool IsDisposable { get; internal set; }
|
||||||
public DateTime SetFor { get; internal set; }
|
public DateTime SetFor { get; internal set; }
|
||||||
public bool HasDisposed { get; internal set; }
|
public bool HasDisposed { get; internal set; }
|
||||||
public TaskScheduleType ScheduleType { get; set; }
|
public TaskScheduleType ScheduleType { get; internal set; }
|
||||||
|
|
||||||
public Guid ComplexId { get; set; }
|
public Guid ComplexId { get; internal set; }
|
||||||
public Complex.Complex? Complex { get; set; }
|
public Complex? Complex { get; internal set; }
|
||||||
public bool IsActivity { get; set; }
|
public bool IsActivity { get; internal set; }
|
||||||
|
|
||||||
|
|
||||||
public int Amount { get; internal set; }
|
public int Amount { get; internal set; }
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Brizco.Domain.Entities.Task;
|
namespace Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[GenerateMapper]
|
[GenerateMapper]
|
|
@ -1,6 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Complex;
|
namespace Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
namespace Brizco.Domain.Entities.Task;
|
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[GenerateMapper]
|
[GenerateMapper]
|
|
@ -1,4 +1,6 @@
|
||||||
namespace Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Routines;
|
||||||
|
|
||||||
|
namespace Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[GenerateMapper]
|
[GenerateMapper]
|
||||||
|
@ -20,5 +22,5 @@ public class TaskRoutine : ApiEntity
|
||||||
public Task? Task { get; internal set; }
|
public Task? Task { get; internal set; }
|
||||||
|
|
||||||
public Guid RoutineId { get; internal set; }
|
public Guid RoutineId { get; internal set; }
|
||||||
public Routine.Routine? Routine { get; internal set; }
|
public Routine? Routine { get; internal set; }
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Brizco.Domain.Entities.Task;
|
namespace Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[GenerateMapper]
|
[GenerateMapper]
|
||||||
|
@ -18,5 +18,5 @@ public class TaskShift : ApiEntity
|
||||||
public virtual Task? Task { get; internal set; }
|
public virtual Task? Task { get; internal set; }
|
||||||
|
|
||||||
public Guid ShiftId { get; internal set; }
|
public Guid ShiftId { get; internal set; }
|
||||||
public virtual Shift.Shift? Shift { get; internal set; }
|
public virtual Shift? Shift { get; internal set; }
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Brizco.Domain.Entities.User;
|
namespace Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
public class ApplicationRole : IdentityRole<Guid>
|
public class ApplicationRole : IdentityRole<Guid>
|
||||||
{
|
{
|
||||||
|
@ -7,5 +7,5 @@ public class ApplicationRole : IdentityRole<Guid>
|
||||||
public string PersianName { get; set; } = string.Empty;
|
public string PersianName { get; set; } = string.Empty;
|
||||||
|
|
||||||
public Guid? ComplexId { get; set; }
|
public Guid? ComplexId { get; set; }
|
||||||
public Complex.Complex? Complex { get; set; }
|
public Complex? Complex { get; set; }
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Brizco.Domain.Entities.User;
|
namespace Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
[GenerateMapper]
|
[GenerateMapper]
|
|
@ -2,9 +2,9 @@ using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Dtos.LargeDtos;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
using Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
using Mapster.Models;
|
using Mapster.Models;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,8 +4,8 @@ using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Dtos.LargeDtos;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
using Mapster.Models;
|
using Mapster.Models;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
using Mapster.Models;
|
using Mapster.Models;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Dtos.LargeDtos;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Mapster.Models;
|
using Mapster.Models;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Routine;
|
using Brizco.Domain.Entities.Routines;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Dtos.LargeDtos;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,8 +4,8 @@ using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Dtos.LargeDtos;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
using Mapster.Models;
|
using Mapster.Models;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
|
|
|
@ -4,10 +4,10 @@ using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Dtos.LargeDtos;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.Routine;
|
using Brizco.Domain.Entities.Routines;
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
using Mapster.Models;
|
using Mapster.Models;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
using Mapster.Models;
|
using Mapster.Models;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,11 +5,11 @@ using System.Linq.Expressions;
|
||||||
using Brizco.Common.Extensions;
|
using Brizco.Common.Extensions;
|
||||||
using Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Dtos.LargeDtos;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
using Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
using Mapster.Models;
|
using Mapster.Models;
|
||||||
using Task = Brizco.Domain.Entities.Task.Task;
|
using Task = Brizco.Domain.Entities.Tasks.Task;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
using Mapster.Models;
|
using Mapster.Models;
|
||||||
using Task = Brizco.Domain.Entities.Task.Task;
|
using Task = Brizco.Domain.Entities.Tasks.Task;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Brizco.Domain.Dtos.SmallDtos;
|
using Brizco.Domain.Dtos.SmallDtos;
|
||||||
using Brizco.Domain.Entities.Shift;
|
using Brizco.Domain.Entities.Shifts;
|
||||||
using Brizco.Domain.Entities.Task;
|
using Brizco.Domain.Entities.Tasks;
|
||||||
using Mapster.Models;
|
using Mapster.Models;
|
||||||
using Task = Brizco.Domain.Entities.Task.Task;
|
using Task = Brizco.Domain.Entities.Tasks.Task;
|
||||||
|
|
||||||
namespace Brizco.Domain.Mappers
|
namespace Brizco.Domain.Mappers
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
using Brizco.Domain.Dtos.LargeDtos;
|
using Brizco.Domain.Dtos.LargeDtos;
|
||||||
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
using Brizco.Domain.Entities.Shifts;
|
||||||
|
using Brizco.Domain.Entities.Tasks;
|
||||||
using MD.PersianDateTime.Standard;
|
using MD.PersianDateTime.Standard;
|
||||||
using Task = Brizco.Domain.Entities.Task.Task;
|
using Task = Brizco.Domain.Entities.Tasks.Task;
|
||||||
|
|
||||||
namespace Brizco.Domain;
|
namespace Brizco.Domain;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class CreateActivityCommandHandler : IRequestHandler<CreateActivityComman
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
||||||
var activity = Domain.Entities.Task.Activity
|
var activity = Domain.Entities.Tasks.Activity
|
||||||
.Create(
|
.Create(
|
||||||
ActivityStatus.Created,
|
ActivityStatus.Created,
|
||||||
DateTime.MinValue,
|
DateTime.MinValue,
|
||||||
|
@ -41,7 +41,7 @@ public class CreateActivityCommandHandler : IRequestHandler<CreateActivityComman
|
||||||
|
|
||||||
activity.SetShiftPlan(request.ShiftPlanId);
|
activity.SetShiftPlan(request.ShiftPlanId);
|
||||||
|
|
||||||
_repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>().Add(activity);
|
_repositoryWrapper.SetRepository<Domain.Entities.Tasks.Activity>().Add(activity);
|
||||||
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
await _repositoryWrapper.CommitAsync(cancellationToken);
|
await _repositoryWrapper.CommitAsync(cancellationToken);
|
||||||
return activity.AdaptToLDto();
|
return activity.AdaptToLDto();
|
||||||
|
|
|
@ -13,12 +13,12 @@ public class DeleteActivityCommandHandler : IRequestHandler<DeleteActivityComman
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
||||||
var task = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
|
var task = await _repositoryWrapper.SetRepository<Domain.Entities.Tasks.Activity>()
|
||||||
.TableNoTracking
|
.TableNoTracking
|
||||||
.FirstOrDefaultAsync(s => s.Id == request.Id, cancellationToken);
|
.FirstOrDefaultAsync(s => s.Id == request.Id, cancellationToken);
|
||||||
if (task == null)
|
if (task == null)
|
||||||
throw new AppException("Task not found", ApiResultStatusCode.NotFound);
|
throw new AppException("Task not found", ApiResultStatusCode.NotFound);
|
||||||
_repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
|
_repositoryWrapper.SetRepository<Domain.Entities.Tasks.Activity>()
|
||||||
.Delete(task);
|
.Delete(task);
|
||||||
|
|
||||||
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class GetActivitiesQueryHandler : IRequestHandler<GetActivitiesQuery, Lis
|
||||||
throw new AppException("UserId is wrong", ApiResultStatusCode.NotFound);
|
throw new AppException("UserId is wrong", ApiResultStatusCode.NotFound);
|
||||||
|
|
||||||
|
|
||||||
IQueryable<Domain.Entities.Task.Activity> activities = _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>().TableNoTracking
|
IQueryable<Domain.Entities.Tasks.Activity> activities = _repositoryWrapper.SetRepository<Domain.Entities.Tasks.Activity>().TableNoTracking
|
||||||
.Where(a=>a.IsActivity && a.ComplexId == complexId);
|
.Where(a=>a.IsActivity && a.ComplexId == complexId);
|
||||||
if (_currentUserService is { Permissions: not null, RoleName: not null })
|
if (_currentUserService is { Permissions: not null, RoleName: not null })
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@ public class GetActivityQueryHandler : IRequestHandler<GetActivityQuery, Activit
|
||||||
|
|
||||||
public async Task<ActivityLDto> Handle(GetActivityQuery request, CancellationToken cancellationToken)
|
public async Task<ActivityLDto> Handle(GetActivityQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var task = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
|
var task = await _repositoryWrapper.SetRepository<Domain.Entities.Tasks.Activity>()
|
||||||
.TableNoTracking
|
.TableNoTracking
|
||||||
.Where(s => s.Id == request.Id)
|
.Where(s => s.Id == request.Id)
|
||||||
.Select(ActivityMapper.ProjectToLDto)
|
.Select(ActivityMapper.ProjectToLDto)
|
||||||
|
|
|
@ -10,7 +10,7 @@ public class GetShiftPlanActivitiesQueryHandler : IRequestHandler<GetShiftPlanAc
|
||||||
|
|
||||||
public async Task<List<ActivitySDto>> Handle(GetShiftPlanActivitiesQuery request, CancellationToken cancellationToken)
|
public async Task<List<ActivitySDto>> Handle(GetShiftPlanActivitiesQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var activities = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
|
var activities = await _repositoryWrapper.SetRepository<Domain.Entities.Tasks.Activity>()
|
||||||
.TableNoTracking
|
.TableNoTracking
|
||||||
.Where(a => a.ShiftPlanId == request.ShiftPlanId)
|
.Where(a => a.ShiftPlanId == request.ShiftPlanId)
|
||||||
.Select(ActivityMapper.ProjectToSDto)
|
.Select(ActivityMapper.ProjectToSDto)
|
||||||
|
|
|
@ -13,7 +13,7 @@ public class UpdateActivityCommandHandler : IRequestHandler<UpdateActivityComman
|
||||||
|
|
||||||
public async Task<bool> Handle(UpdateActivityCommand request, CancellationToken cancellationToken)
|
public async Task<bool> Handle(UpdateActivityCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var task = await _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
|
var task = await _repositoryWrapper.SetRepository<Domain.Entities.Tasks.Activity>()
|
||||||
.TableNoTracking.FirstOrDefaultAsync(s => s.Id == request.Id,cancellationToken);
|
.TableNoTracking.FirstOrDefaultAsync(s => s.Id == request.Id,cancellationToken);
|
||||||
if (task == null)
|
if (task == null)
|
||||||
throw new AppException("Task not found", ApiResultStatusCode.NotFound);
|
throw new AppException("Task not found", ApiResultStatusCode.NotFound);
|
||||||
|
@ -25,7 +25,7 @@ public class UpdateActivityCommandHandler : IRequestHandler<UpdateActivityComman
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
||||||
var newTask = Domain.Entities.Task.Activity.Create(
|
var newTask = Domain.Entities.Tasks.Activity.Create(
|
||||||
request.Status,
|
request.Status,
|
||||||
request.DoneAt,
|
request.DoneAt,
|
||||||
request.PerformanceDescription,
|
request.PerformanceDescription,
|
||||||
|
@ -45,7 +45,7 @@ public class UpdateActivityCommandHandler : IRequestHandler<UpdateActivityComman
|
||||||
newTask.SetUser(request.UserId);
|
newTask.SetUser(request.UserId);
|
||||||
newTask.SetShiftPlan(request.ShiftPlanId);
|
newTask.SetShiftPlan(request.ShiftPlanId);
|
||||||
|
|
||||||
_repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>()
|
_repositoryWrapper.SetRepository<Domain.Entities.Tasks.Activity>()
|
||||||
.Update(newTask);
|
.Update(newTask);
|
||||||
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
await _repositoryWrapper.CommitAsync(cancellationToken);
|
await _repositoryWrapper.CommitAsync(cancellationToken);
|
||||||
|
|
|
@ -16,8 +16,8 @@ public class CreateComplexCommandHandler : IRequestHandler<CreateComplexCommand,
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
||||||
var complex = Domain.Entities.Complex.Complex.Create(request.Name, request.Address, request.SupportPhone);
|
var complex = Domain.Entities.Complexes.Complex.Create(request.Name, request.Address, request.SupportPhone);
|
||||||
_repositoryWrapper.SetRepository<Domain.Entities.Complex.Complex>().Add(complex);
|
_repositoryWrapper.SetRepository<Domain.Entities.Complexes.Complex>().Add(complex);
|
||||||
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
await _repositoryWrapper.CommitAsync(cancellationToken);
|
await _repositoryWrapper.CommitAsync(cancellationToken);
|
||||||
return complex.AdaptToSDto();
|
return complex.AdaptToSDto();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
|
||||||
namespace Brizco.Repository.Handlers.Complex;
|
namespace Brizco.Repository.Handlers.Complex;
|
||||||
|
@ -27,7 +27,7 @@ public class CreateComplexUserCommandHandler : IRequestHandler<CreateComplexUser
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//await _repositoryWrapper.BeginTransaction(cancellationToken);
|
//await _repositoryWrapper.BeginTransaction(cancellationToken);
|
||||||
var complex = await _repositoryWrapper.SetRepository<Domain.Entities.Complex.Complex>().TableNoTracking
|
var complex = await _repositoryWrapper.SetRepository<Domain.Entities.Complexes.Complex>().TableNoTracking
|
||||||
.FirstOrDefaultAsync(c => c.Id == request.ComplexId, cancellationToken);
|
.FirstOrDefaultAsync(c => c.Id == request.ComplexId, cancellationToken);
|
||||||
if (complex == null)
|
if (complex == null)
|
||||||
throw new AppException("Complex not found", ApiResultStatusCode.NotFound);
|
throw new AppException("Complex not found", ApiResultStatusCode.NotFound);
|
||||||
|
|
|
@ -13,12 +13,12 @@ public class DeleteComplexCommandHandler : IRequestHandler<DeleteComplexCommand,
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
||||||
var task = await _repositoryWrapper.SetRepository<Domain.Entities.Complex.Complex>()
|
var task = await _repositoryWrapper.SetRepository<Domain.Entities.Complexes.Complex>()
|
||||||
.TableNoTracking
|
.TableNoTracking
|
||||||
.FirstOrDefaultAsync(s => s.Id == request.Id, cancellationToken);
|
.FirstOrDefaultAsync(s => s.Id == request.Id, cancellationToken);
|
||||||
if (task == null)
|
if (task == null)
|
||||||
throw new AppException("Task not found", ApiResultStatusCode.NotFound);
|
throw new AppException("Task not found", ApiResultStatusCode.NotFound);
|
||||||
_repositoryWrapper.SetRepository<Domain.Entities.Complex.Complex>()
|
_repositoryWrapper.SetRepository<Domain.Entities.Complexes.Complex>()
|
||||||
.Delete(task);
|
.Delete(task);
|
||||||
|
|
||||||
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
|
|
||||||
namespace Brizco.Repository.Handlers.Complex;
|
namespace Brizco.Repository.Handlers.Complex;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ public class GetComplexQueryHandler : IRequestHandler<GetComplexQuery, ComplexSD
|
||||||
|
|
||||||
public async Task<ComplexSDto> Handle(GetComplexQuery request, CancellationToken cancellationToken)
|
public async Task<ComplexSDto> Handle(GetComplexQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var complex = await _repositoryWrapper.SetRepository<Domain.Entities.Complex.Complex>()
|
var complex = await _repositoryWrapper.SetRepository<Domain.Entities.Complexes.Complex>()
|
||||||
.TableNoTracking
|
.TableNoTracking
|
||||||
.Where(s => s.Id == request.Id)
|
.Where(s => s.Id == request.Id)
|
||||||
.Select(ComplexMapper.ProjectToSDto)
|
.Select(ComplexMapper.ProjectToSDto)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
|
||||||
namespace Brizco.Repository.Handlers.Complex;
|
namespace Brizco.Repository.Handlers.Complex;
|
||||||
|
|
|
@ -10,7 +10,7 @@ public class GetComplexesQueryHandler : IRequestHandler<GetComplexesQuery, List<
|
||||||
}
|
}
|
||||||
public async Task<List<ComplexSDto>> Handle(GetComplexesQuery request, CancellationToken cancellationToken)
|
public async Task<List<ComplexSDto>> Handle(GetComplexesQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var tasks = await _repositoryWrapper.SetRepository<Domain.Entities.Complex.Complex>().TableNoTracking
|
var tasks = await _repositoryWrapper.SetRepository<Domain.Entities.Complexes.Complex>().TableNoTracking
|
||||||
.OrderByDescending(s => s.CreatedAt)
|
.OrderByDescending(s => s.CreatedAt)
|
||||||
.Skip(request.Page * 15).Take(15)
|
.Skip(request.Page * 15).Take(15)
|
||||||
.Select(ComplexMapper.ProjectToSDto)
|
.Select(ComplexMapper.ProjectToSDto)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using Brizco.Domain.Entities.Complex;
|
using Brizco.Domain.Entities.Complexes;
|
||||||
using Brizco.Domain.Entities.User;
|
using Brizco.Domain.Entities.Users;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
||||||
namespace Brizco.Repository.Handlers.Complex;
|
namespace Brizco.Repository.Handlers.Complex;
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class CreatePositionCommandHandler : IRequestHandler<CreatePositionComman
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
await _repositoryWrapper.BeginTransaction(cancellationToken);
|
||||||
var entity = Domain.Entities.Complex.Position
|
var entity = Domain.Entities.Complexes.Position
|
||||||
.Create(request.Title,
|
.Create(request.Title,
|
||||||
request.Description,
|
request.Description,
|
||||||
complexId,
|
complexId,
|
||||||
|
@ -29,7 +29,7 @@ public class CreatePositionCommandHandler : IRequestHandler<CreatePositionComman
|
||||||
|
|
||||||
request.Permissions.ForEach(f=>entity.AddPermission(f));
|
request.Permissions.ForEach(f=>entity.AddPermission(f));
|
||||||
|
|
||||||
_repositoryWrapper.SetRepository<Domain.Entities.Complex.Position>().Add(entity);
|
_repositoryWrapper.SetRepository<Domain.Entities.Complexes.Position>().Add(entity);
|
||||||
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
await _repositoryWrapper.CommitAsync(cancellationToken);
|
await _repositoryWrapper.CommitAsync(cancellationToken);
|
||||||
return entity.AdaptToSDto();
|
return entity.AdaptToSDto();
|
||||||
|
|
|
@ -10,12 +10,12 @@ public class DeletePositionCommandHandler : IRequestHandler<DeletePositionComman
|
||||||
}
|
}
|
||||||
public async Task<bool> Handle(DeletePositionCommand request, CancellationToken cancellationToken)
|
public async Task<bool> Handle(DeletePositionCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var shift = await _repositoryWrapper.SetRepository<Domain.Entities.Complex.Position>()
|
var shift = await _repositoryWrapper.SetRepository<Domain.Entities.Complexes.Position>()
|
||||||
.TableNoTracking
|
.TableNoTracking
|
||||||
.FirstOrDefaultAsync(s => s.Id == request.Id, cancellationToken);
|
.FirstOrDefaultAsync(s => s.Id == request.Id, cancellationToken);
|
||||||
if (shift == null)
|
if (shift == null)
|
||||||
throw new AppException("Postion not found", ApiResultStatusCode.NotFound);
|
throw new AppException("Postion not found", ApiResultStatusCode.NotFound);
|
||||||
_repositoryWrapper.SetRepository<Domain.Entities.Complex.Position>()
|
_repositoryWrapper.SetRepository<Domain.Entities.Complexes.Position>()
|
||||||
.Delete(shift);
|
.Delete(shift);
|
||||||
|
|
||||||
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
|
|
|
@ -12,7 +12,7 @@ public class GetPositionQueryHandler : IRequestHandler<GetPositionQuery, Positio
|
||||||
}
|
}
|
||||||
public async Task<PositionLDto> Handle(GetPositionQuery request, CancellationToken cancellationToken)
|
public async Task<PositionLDto> Handle(GetPositionQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var shift = await _repositoryWrapper.SetRepository<Domain.Entities.Complex.Position>()
|
var shift = await _repositoryWrapper.SetRepository<Domain.Entities.Complexes.Position>()
|
||||||
.TableNoTracking
|
.TableNoTracking
|
||||||
.Where(s => s.Id == request.Id)
|
.Where(s => s.Id == request.Id)
|
||||||
.Select(PositionMapper.ProjectToLDto)
|
.Select(PositionMapper.ProjectToLDto)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue