diff --git a/AccountManagement.Application.Contracts/CameraAccount/ICameraAccountApplication.cs b/AccountManagement.Application.Contracts/CameraAccount/ICameraAccountApplication.cs index 9d65bcf7..451c3fa0 100644 --- a/AccountManagement.Application.Contracts/CameraAccount/ICameraAccountApplication.cs +++ b/AccountManagement.Application.Contracts/CameraAccount/ICameraAccountApplication.cs @@ -17,4 +17,6 @@ public interface ICameraAccountApplication OperationResult Active(long id); OperationResult DeActive(long id); OperationResult ChangePass(ChangePassword command); + bool HasCameraAccount(long workshopId, long accountId); + OperationResult CheckUsername(string username); } \ No newline at end of file diff --git a/AccountManagement.Application/CameraAccountApplication.cs b/AccountManagement.Application/CameraAccountApplication.cs index 22d5d977..15ff44d6 100644 --- a/AccountManagement.Application/CameraAccountApplication.cs +++ b/AccountManagement.Application/CameraAccountApplication.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using _0_Framework.Application; using AccountManagement.Application.Contracts.Account; using AccountManagement.Application.Contracts.CameraAccount; +using AccountManagement.Domain.AccountAgg; using AccountManagement.Domain.CameraAccountAgg; namespace AccountManagement.Application; @@ -14,11 +15,13 @@ public class CameraAccountApplication : ICameraAccountApplication { private readonly ICameraAccountRepository _cameraAccountRepository; private readonly IPasswordHasher _passwordHasher; + private readonly IAccountRepository _accountRepository; - public CameraAccountApplication(ICameraAccountRepository cameraAccountRepository, IPasswordHasher passwordHasher) + public CameraAccountApplication(ICameraAccountRepository cameraAccountRepository, IPasswordHasher passwordHasher, IAccountRepository accountRepository) { _cameraAccountRepository = cameraAccountRepository; _passwordHasher = passwordHasher; + _accountRepository = accountRepository; } public OperationResult Create(CreateCameraAccount command) @@ -51,6 +54,19 @@ public class CameraAccountApplication : ICameraAccountApplication return _cameraAccountRepository.GetDetails(id); } + public bool HasCameraAccount(long workshopId, long accountId) + { + return _cameraAccountRepository.Exists(x => x.WorkshopId == workshopId && x.AccountId == accountId); + } + + public OperationResult CheckUsername(string username) + { + var operation = new OperationResult(); + if (_cameraAccountRepository.Exists(x => x.Username == username) || _accountRepository.Exists(x => x.Username == username)) + return operation.Failed("نام کاربری تکراری است"); + return operation.Succcedded(); + } + public OperationResult Active(long id) { var opration = new OperationResult(); diff --git a/Company.Domain/RollCallAgg/IRollCallRepository.cs b/Company.Domain/RollCallAgg/IRollCallRepository.cs index 42ff6bc4..bd105942 100644 --- a/Company.Domain/RollCallAgg/IRollCallRepository.cs +++ b/Company.Domain/RollCallAgg/IRollCallRepository.cs @@ -13,7 +13,11 @@ namespace Company.Domain.RollCallAgg { EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId); EditRollCall GetById(long id); + List GetCurrentDay(RollCallSearchModel searchModel); + RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel); List Search(RollCallSearchModel searchModel); + CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId); + List GetEmployeeRollCallsForDuration(long employeeId, long workshopId, DateTime startDate, DateTime endDate); long Flag(long employeeId, long workshopId); diff --git a/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs b/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs index ad4ecce2..42035647 100644 --- a/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs +++ b/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs @@ -10,6 +10,7 @@ public interface IRollCallEmployeeRepository : IRepository GetPersonnelRollCallList(long workshopId); - + //rollcallEmployeeIncludeStatus + RollCallEmployee GetWithRollCallStatus(long id); int activedPerson(long workshopId); } \ No newline at end of file diff --git a/Company.Domain/RollCallEmployeeAgg/RollCallEmployee.cs b/Company.Domain/RollCallEmployeeAgg/RollCallEmployee.cs index ff256b4e..ee77f043 100644 --- a/Company.Domain/RollCallEmployeeAgg/RollCallEmployee.cs +++ b/Company.Domain/RollCallEmployeeAgg/RollCallEmployee.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using _0_Framework.Domain; +using Company.Domain.RollCallEmployeeStatusAgg; namespace Company.Domain.RollCallEmployeeAgg; @@ -24,7 +25,7 @@ public class RollCallEmployee : EntityBaseWithoutCreationDate public string EmployeeFullName { get; private set; } public string IsActiveString { get; private set; } public string HasUploadedImage { get; private set; } - + public List EmployeesStatus { get; private set; } public void HasImage() { diff --git a/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs b/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs new file mode 100644 index 00000000..bc2bd54c --- /dev/null +++ b/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs @@ -0,0 +1,11 @@ +using _0_Framework.Domain; +using CompanyManagment.App.Contracts.RollCallEmployeeStatus; +using System.Collections.Generic; + +namespace Company.Domain.RollCallEmployeeStatusAgg +{ + public interface IRollCallEmployeeStatusRepository : IRepository + { + List GetAll(); + } +} diff --git a/Company.Domain/RollCallEmployeeStatusAgg/RollCallEmployeeStatus.cs b/Company.Domain/RollCallEmployeeStatusAgg/RollCallEmployeeStatus.cs new file mode 100644 index 00000000..82429f5e --- /dev/null +++ b/Company.Domain/RollCallEmployeeStatusAgg/RollCallEmployeeStatus.cs @@ -0,0 +1,40 @@ +using _0_Framework.Application; +using _0_Framework.Domain; +using Company.Domain.RollCallEmployeeAgg; +using System; + +namespace Company.Domain.RollCallEmployeeStatusAgg +{ + public class RollCallEmployeeStatus : EntityBaseWithoutCreationDate + { + public long RollCallEmployeeId { get; private set; } + public RollCallEmployee RollCallEmployee { get; private set; } + + public DateTime StartDate { get; private set; } + public DateTime EndDate { get; private set; } + + + public RollCallEmployeeStatus(long rollCallEmployeeId, DateTime startDate, DateTime endDate) + { + RollCallEmployeeId = rollCallEmployeeId; + StartDate = startDate; + EndDate = endDate; + } + public RollCallEmployeeStatus(long rollCallEmployeeId, DateTime startDate) + { + RollCallEmployeeId = rollCallEmployeeId; + StartDate = startDate; + EndDate = Tools.GetUndefinedDateTime(); + } + public void Edit(DateTime startDate, DateTime endDate) + { + StartDate = startDate; + EndDate = endDate; + } + + public void Deactivate(DateTime endDate) + { + EndDate = endDate; + } + } +} diff --git a/CompanyManagment.App.Contracts/RollCall/AbsentEmployeeViewModel.cs b/CompanyManagment.App.Contracts/RollCall/AbsentEmployeeViewModel.cs new file mode 100644 index 00000000..227976ac --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCall/AbsentEmployeeViewModel.cs @@ -0,0 +1,10 @@ +namespace CompanyManagment.App.Contracts.RollCall; + +public class AbsentEmployeeViewModel +{ + public long EmployeeId { get; set; } + public string EmployeeFullName { get; set; } + public string PersonnelCode { get; set; } + public string Reason { get; set; } + +} \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCall/CheckoutDailyRollCallViewModel.cs b/CompanyManagment.App.Contracts/RollCall/CheckoutDailyRollCallViewModel.cs new file mode 100644 index 00000000..04195ebd --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCall/CheckoutDailyRollCallViewModel.cs @@ -0,0 +1,24 @@ +using System; + +namespace CompanyManagment.App.Contracts.RollCall +{ + #region Pooya + + + public class CheckoutDailyRollCallViewModel + { + public string RollCallDateFa { get; set; } + public string StartDate { get; set; } + public string EndDate { get; set; } + public DateTime DateTimeGr { get; set; } + //منقطع بودن شیفت کاری + public bool IsSliced { get; set; } + + public string TotalWorkingHours { get; set; } + + public string DayOfWeek { get; set; } + + } + #endregion + +} diff --git a/CompanyManagment.App.Contracts/RollCall/CurrentDayRollCall.cs b/CompanyManagment.App.Contracts/RollCall/CurrentDayRollCall.cs new file mode 100644 index 00000000..6e4b3798 --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCall/CurrentDayRollCall.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; + +namespace CompanyManagment.App.Contracts.RollCall +{ + public class CurrentDayRollCall + { + public List PresentEmployees { get; set; } + public List AbsentEmployees { get; set; } + } +} diff --git a/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs b/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs index 244127c5..b704d152 100644 --- a/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs +++ b/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs @@ -13,8 +13,15 @@ namespace CompanyManagment.App.Contracts.RollCall OperationResult Edit(long id); EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId); + List GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId, + DateTime startDate, DateTime endDate); + EditRollCall GetById(long id); List Search(RollCallSearchModel searchModel); + List GetCurrentDay(RollCallSearchModel searchModel); + List GetHistoryCase(RollCallSearchModel searchModel); + CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId); + RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel); long Flag(long employeeId, long workshopId); } } diff --git a/CompanyManagment.App.Contracts/RollCall/RollCallSearchModel.cs b/CompanyManagment.App.Contracts/RollCall/RollCallSearchModel.cs index e79cdcb2..4b62832a 100644 --- a/CompanyManagment.App.Contracts/RollCall/RollCallSearchModel.cs +++ b/CompanyManagment.App.Contracts/RollCall/RollCallSearchModel.cs @@ -12,4 +12,16 @@ public class RollCallSearchModel public DateTime? EndDate { get; set; } public int Year { get; set; } public int Month { get; set; } + public int PageIndex { get; set; } + + #region Pooya + public int DateIndex { get; set; } + + #endregion + + #region Mahan + public string StarDateFa { get; set; } + public string EndDateFa { get; set; } + public string ExactDateFa { get; set; } + #endregion } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCall/RollCallTimeViewModel.cs b/CompanyManagment.App.Contracts/RollCall/RollCallTimeViewModel.cs new file mode 100644 index 00000000..9d83167e --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCall/RollCallTimeViewModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace CompanyManagment.App.Contracts.RollCall; + +public class RollCallTimeViewModel +{ + public string StartDate { get; set; } + public string EndDate { get; set; } + public TimeSpan TotalHours { get; set; } +} \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs b/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs index 131f83f8..ee1b87b2 100644 --- a/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs +++ b/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace CompanyManagment.App.Contracts.RollCall; @@ -6,12 +7,21 @@ public class RollCallViewModel { public long Id { get; set; } public long WorkshopId { get; set; } + public string Reason { get; set; } public long EmployeeId { get; set; } + public string PersonnelCode { get; set; } public string EmployeeFullName { get; set; } public DateTime? StartDate { get; set; } public DateTime? EndDate { get; set; } + public string DateFa { get; set; } + public DateTime DateGr { get; set; } public int Year { get; set; } public int Month { get; set; } public TimeSpan ShiftSpan { get; set; } public DateTime CreationDate { get; set; } + + public string StartDateFa { get; set; } + public string EndDateFa { get; set; } + public IEnumerable RollCallTimesList { get; set; } + public double TotalWorkingHours { get; set; } } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCall/RollCallsByDateViewModel.cs b/CompanyManagment.App.Contracts/RollCall/RollCallsByDateViewModel.cs new file mode 100644 index 00000000..bb1355b1 --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCall/RollCallsByDateViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace CompanyManagment.App.Contracts.RollCall +{ + public class RollCallsByDateViewModel + { + public string DateFa { get; set; } + public DateTime DateGr { get; set; } + public IEnumerable ActiveEmployees { get; set; } + } +} diff --git a/CompanyManagment.App.Contracts/RollCallEmployeeStatus/CreateRollCallEmployeeStatus.cs b/CompanyManagment.App.Contracts/RollCallEmployeeStatus/CreateRollCallEmployeeStatus.cs new file mode 100644 index 00000000..c5050891 --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCallEmployeeStatus/CreateRollCallEmployeeStatus.cs @@ -0,0 +1,7 @@ +namespace CompanyManagment.App.Contracts.RollCallEmployeeStatus +{ + public class CreateRollCallEmployeeStatus + { + public long RollCallEmployeeId { get; set; } + } +} diff --git a/CompanyManagment.App.Contracts/RollCallEmployeeStatus/EditRollCallEmployeeStatus.cs b/CompanyManagment.App.Contracts/RollCallEmployeeStatus/EditRollCallEmployeeStatus.cs new file mode 100644 index 00000000..2c64f984 --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCallEmployeeStatus/EditRollCallEmployeeStatus.cs @@ -0,0 +1,13 @@ +using System; + +namespace CompanyManagment.App.Contracts.RollCallEmployeeStatus +{ + public class EditRollCallEmployeeStatus + { + public long Id { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + + + } +} diff --git a/CompanyManagment.App.Contracts/RollCallEmployeeStatus/IRollCallEmployeeStatusApplication.cs b/CompanyManagment.App.Contracts/RollCallEmployeeStatus/IRollCallEmployeeStatusApplication.cs new file mode 100644 index 00000000..6dfb87f7 --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCallEmployeeStatus/IRollCallEmployeeStatusApplication.cs @@ -0,0 +1,11 @@ +using _0_Framework.Application; + +namespace CompanyManagment.App.Contracts.RollCallEmployeeStatus +{ + public interface IRollCallEmployeeStatusApplication + { + OperationResult Create(CreateRollCallEmployeeStatus cmd); + OperationResult Deactivate(long id); + OperationResult Edit(EditRollCallEmployeeStatus cmd); + } +} diff --git a/CompanyManagment.App.Contracts/RollCallEmployeeStatus/RollCallEmployeeStatusViewModel.cs b/CompanyManagment.App.Contracts/RollCallEmployeeStatus/RollCallEmployeeStatusViewModel.cs new file mode 100644 index 00000000..04c0b59a --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCallEmployeeStatus/RollCallEmployeeStatusViewModel.cs @@ -0,0 +1,9 @@ +namespace CompanyManagment.App.Contracts.RollCallEmployeeStatus +{ + public class RollCallEmployeeStatusViewModel + { + public long Id { get; set; } + public string StartDate { get; set; } + public string EndDate { get; set; } + } +} diff --git a/CompanyManagment.Application/RollCallApplication.cs b/CompanyManagment.Application/RollCallApplication.cs index a4cf7960..12439354 100644 --- a/CompanyManagment.Application/RollCallApplication.cs +++ b/CompanyManagment.Application/RollCallApplication.cs @@ -53,6 +53,15 @@ public class RollCallApplication : IRollCallApplication return _rollCallRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId); } + public List GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId, DateTime startDate, DateTime endDate) + { + + if (startDate >= endDate) + return new(); + + return _rollCallRepository.GetEmployeeRollCallsForDuration(employeeId, workshopId, startDate, endDate); + } + public EditRollCall GetById(long id) { return _rollCallRepository.GetById(id); @@ -63,6 +72,26 @@ public class RollCallApplication : IRollCallApplication return _rollCallRepository.Search(searchModel); } + public List GetCurrentDay(RollCallSearchModel searchModel) + { + return _rollCallRepository.GetCurrentDay(searchModel); + } + + public List GetHistoryCase(RollCallSearchModel searchModel) + { + return _rollCallRepository.GetCurrentDay(searchModel); + } + + public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId) + { + return _rollCallRepository.GetWorkshopCurrentDayRollCalls(workshopId); + } + + public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel) + { + return _rollCallRepository.GetWorkshopRollCallHistory(searchModel); + } + public long Flag(long employeeId, long workshopId) { return _rollCallRepository.Flag(employeeId, workshopId); diff --git a/CompanyManagment.Application/RollCallEmployeeApplication.cs b/CompanyManagment.Application/RollCallEmployeeApplication.cs index 91d90059..68e56b80 100644 --- a/CompanyManagment.Application/RollCallEmployeeApplication.cs +++ b/CompanyManagment.Application/RollCallEmployeeApplication.cs @@ -1,8 +1,10 @@ using System.Collections.Generic; +using System.Linq; using _0_Framework.Application; using Company.Domain.EmployeeAgg; using Company.Domain.RollCallEmployeeAgg; using CompanyManagment.App.Contracts.RollCallEmployee; +using CompanyManagment.App.Contracts.RollCallEmployeeStatus; namespace CompanyManagment.Application; @@ -10,11 +12,13 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication { private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository; private readonly IEmployeeRepository _employeeRepository; + private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication; - public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository) + public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication) { _rollCallEmployeeRepository = rollCallEmployeeRepository; _employeeRepository = employeeRepository; + _rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication; } public OperationResult Create(CreateRollCallEmployee command) @@ -39,20 +43,26 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication var emp = _rollCallEmployeeRepository.Get(id); if (emp == null) return opreation.Failed("پرسنل یافت نشد"); - + if(emp.HasUploadedImage == "false") + return opreation.Failed("لطفا ابتدا عکس پرسنل را آپلود کنید"); emp.Active(); _rollCallEmployeeRepository.SaveChanges(); + _rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus() { RollCallEmployeeId = id }); return opreation.Succcedded(); } public OperationResult DeActive(long id) { var opreation = new OperationResult(); - var emp = _rollCallEmployeeRepository.Get(id); + var emp = _rollCallEmployeeRepository.GetWithRollCallStatus(id); if (emp == null) return opreation.Failed("پرسنل یافت نشد"); + var lastStatus = emp.EmployeesStatus.MaxBy(x => x.StartDate); + if (!lastStatus.EndDate.IsDateUndefined()) + return opreation.Failed("حضور و غیاب کارمند قبلا غیر فعال شده است"); emp.DeActive(); _rollCallEmployeeRepository.SaveChanges(); + _rollCallEmployeeStatusApplication.Deactivate(lastStatus.id); return opreation.Succcedded(); } diff --git a/CompanyManagment.Application/RollCallEmployeeStatusApplication.cs b/CompanyManagment.Application/RollCallEmployeeStatusApplication.cs new file mode 100644 index 00000000..a581dcc7 --- /dev/null +++ b/CompanyManagment.Application/RollCallEmployeeStatusApplication.cs @@ -0,0 +1,74 @@ +using _0_Framework.Application; +using Company.Domain.LeftWorkAgg; +using Company.Domain.RollCallEmployeeAgg; +using Company.Domain.RollCallEmployeeStatusAgg; +using CompanyManagment.App.Contracts.RollCallEmployeeStatus; +using System; +using System.Collections.Generic; + +namespace CompanyManagment.Application +{ + public class RollCallEmployeeStatusApplication : IRollCallEmployeeStatusApplication + { + private readonly IRollCallEmployeeStatusRepository _employeeRollCallStatusRepository; + private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository; + private readonly ILeftWorkRepository _leftWorkRepository; + + + public RollCallEmployeeStatusApplication(IRollCallEmployeeStatusRepository employeeStatusRepository, IRollCallEmployeeRepository rollCallEmployeeRepository, ILeftWorkRepository leftWorkRepository) + { + _employeeRollCallStatusRepository = employeeStatusRepository; + _rollCallEmployeeRepository = rollCallEmployeeRepository; + _leftWorkRepository = leftWorkRepository; + } + + public OperationResult Create(CreateRollCallEmployeeStatus cmd) + { + OperationResult op = new(); + RollCallEmployee employee = _rollCallEmployeeRepository.Get(cmd.RollCallEmployeeId); + if (employee == null) + return op.Failed("کارمند مجاز نیست"); + + if (!_leftWorkRepository.Exists(x => x.EmployeeId == employee.EmployeeId && x.WorkshopId == employee.WorkshopId && + x.LeftWorkDate.Date > DateTime.Now.Date && x.StartWorkDate.Date < DateTime.Now.Date)) + return op.Failed("کارمند در کارگاه شروع به کار نکرده است"); + if (_employeeRollCallStatusRepository.Exists(x => x.EndDate >= DateTime.Now.Date && employee.id == x.RollCallEmployeeId)) + return op.Failed("تکراری است"); + RollCallEmployeeStatus newRecord = new(employee.id, DateTime.Now.Date); + _employeeRollCallStatusRepository.Create(newRecord); + _employeeRollCallStatusRepository.SaveChanges(); + + return op.Succcedded(); + } + + public OperationResult Deactivate(long id) + { + OperationResult op = new(); + RollCallEmployeeStatus entity = _employeeRollCallStatusRepository.Get(id); + if (entity == null) + return op.Failed(ApplicationMessages.RecordNotFound); + if (!entity.EndDate.IsDateUndefined()) + return op.Failed("کارمند قبلا غیر فعال شده است"); + entity.Deactivate(DateTime.Now.Date); + _employeeRollCallStatusRepository.SaveChanges(); + return op.Succcedded(); + } + + public OperationResult Edit(EditRollCallEmployeeStatus cmd) + { + OperationResult op = new(); + RollCallEmployeeStatus entity = _employeeRollCallStatusRepository.Get(cmd.Id); + if (entity == null) + return op.Failed(ApplicationMessages.RecordNotFound); + + entity.Edit(cmd.StartDate, cmd.EndDate); + _employeeRollCallStatusRepository.SaveChanges(); + return op.Succcedded(); + } + + public List GetAll() + { + return _employeeRollCallStatusRepository.GetAll(); + } + } +} diff --git a/CompanyManagment.EFCore/CompanyContext.cs b/CompanyManagment.EFCore/CompanyContext.cs index cc642eb0..d310debf 100644 --- a/CompanyManagment.EFCore/CompanyContext.cs +++ b/CompanyManagment.EFCore/CompanyContext.cs @@ -68,6 +68,7 @@ using Company.Domain.ProceedingSession; using Company.Domain.RepresentativeAgg; using Company.Domain.RollCallAgg; using Company.Domain.RollCallEmployeeAgg; +using Company.Domain.RollCallEmployeeStatusAgg; using Company.Domain.RollCallPlanAgg; using Company.Domain.RollCallServiceAgg; using Company.Domain.SmsResultAgg; @@ -132,6 +133,7 @@ public class CompanyContext : DbContext public DbSet TaxLeftWorkItems { get; set; } public DbSet TaxLeftWorkCategories { get; set; } public DbSet TaxJobCategories { get; set; } + public DbSet RollCallEmployeesStatus { get; set; } public DbSet RollCallEmployees { get; set; } public DbSet RollCallPlans { get; set; } public DbSet InstitutionPlans { get; set; } diff --git a/CompanyManagment.EFCore/Mapping/RollCallEmployeeMapping.cs b/CompanyManagment.EFCore/Mapping/RollCallEmployeeMapping.cs index eaf5e2a6..1347946b 100644 --- a/CompanyManagment.EFCore/Mapping/RollCallEmployeeMapping.cs +++ b/CompanyManagment.EFCore/Mapping/RollCallEmployeeMapping.cs @@ -16,6 +16,9 @@ public class RollCallEmployeeMapping : IEntityTypeConfiguration x.EmployeeFullName).HasMaxLength(100); builder.Property(x => x.IsActiveString).HasMaxLength(5); builder.Property(x => x.HasUploadedImage).HasMaxLength(5); + builder.HasMany(x => x.EmployeesStatus) + .WithOne(x => x.RollCallEmployee) + .HasForeignKey(x => x.RollCallEmployeeId); } } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Mapping/RollCallEmployeeStatusMapping.cs b/CompanyManagment.EFCore/Mapping/RollCallEmployeeStatusMapping.cs new file mode 100644 index 00000000..f96c7ce0 --- /dev/null +++ b/CompanyManagment.EFCore/Mapping/RollCallEmployeeStatusMapping.cs @@ -0,0 +1,21 @@ +using Company.Domain.RollCallEmployeeStatusAgg; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace CompanyManagment.EFCore.Mapping +{ + public class RollCallEmployeeStatusMapping : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(x => x.id); + builder.Property(x => x.EndDate).IsRequired(); + builder.Property(x => x.StartDate).IsRequired(); + builder.Property(x => x.RollCallEmployeeId).IsRequired(); + + builder.HasOne(x => x.RollCallEmployee) + .WithMany(x => x.EmployeesStatus).HasForeignKey(x => x.RollCallEmployeeId); + + } + } +} diff --git a/CompanyManagment.EFCore/Migrations/20240828122337_RollCallEmployeeStatus.Designer.cs b/CompanyManagment.EFCore/Migrations/20240828122337_RollCallEmployeeStatus.Designer.cs new file mode 100644 index 00000000..ee6ab419 --- /dev/null +++ b/CompanyManagment.EFCore/Migrations/20240828122337_RollCallEmployeeStatus.Designer.cs @@ -0,0 +1,5628 @@ +// +using System; +using CompanyManagment.EFCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace CompanyManagment.EFCore.Migrations +{ + [DbContext(typeof(CompanyContext))] + [Migration("20240828122337_RollCallEmployeeStatus")] + partial class RollCallEmployeeStatus + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Company.Domain.BillAgg.EntityBill", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Appointed") + .HasColumnType("nvarchar(max)"); + + b.Property("Contact") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActiveString") + .HasColumnType("nvarchar(max)"); + + b.Property("ProcessingStage") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectBill") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.HasKey("id"); + + b.ToTable("TextManager_Bill", (string)null); + }); + + modelBuilder.Entity("Company.Domain.Board.Board", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BoardChairman") + .HasColumnType("nvarchar(max)"); + + b.Property("BoardType_Id") + .HasColumnType("int"); + + b.Property("Branch") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DisputeResolutionPetitionDate") + .HasColumnType("datetime2"); + + b.Property("ExpertReport") + .HasColumnType("nvarchar(max)"); + + b.Property("File_Id") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("BoardType_Id"); + + b.HasIndex("File_Id"); + + b.ToTable("Boards", (string)null); + }); + + modelBuilder.Entity("Company.Domain.BoardType.BoardType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("BoardTypes", (string)null); + }); + + modelBuilder.Entity("Company.Domain.ChapterAgg.EntityChapter", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Chapter") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("IsActiveString") + .HasColumnType("nvarchar(max)"); + + b.Property("Subtitle_Id") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("Subtitle_Id"); + + b.ToTable("TextManager_Chapter", (string)null); + }); + + modelBuilder.Entity("Company.Domain.CheckoutAgg.Checkout", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AbsenceDeduction") + .HasColumnType("float"); + + b.Property("AbsencePeriod") + .HasColumnType("float"); + + b.Property("ArchiveCode") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("AverageHoursPerDay") + .HasColumnType("float"); + + b.Property("BaseYearsPay") + .HasColumnType("float"); + + b.Property("BonusesPay") + .HasColumnType("float"); + + b.Property("ConsumableItems") + .HasColumnType("float"); + + b.Property("ContractEnd") + .HasColumnType("datetime2"); + + b.Property("ContractId") + .HasColumnType("bigint"); + + b.Property("ContractNo") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ContractStart") + .HasColumnType("datetime2"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("CreditLeaves") + .HasColumnType("float"); + + b.Property("DateOfBirth") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("EmployeeFullName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("FamilyAllowance") + .HasColumnType("float"); + + b.Property("FathersName") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("FridayPay") + .HasColumnType("float"); + + b.Property("HousingAllowance") + .HasColumnType("float"); + + b.Property("InstallmentDeduction") + .HasColumnType("float"); + + b.Property("InsuranceDeduction") + .HasColumnType("float"); + + b.Property("IsActiveString") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("LeaveCheckout") + .HasColumnType("bit"); + + b.Property("LeavePay") + .HasColumnType("float"); + + b.Property("MarriedAllowance") + .HasColumnType("float"); + + b.Property("MissionPay") + .HasColumnType("float"); + + b.Property("Month") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("MonthlySalary") + .HasColumnType("float"); + + b.Property("NationalCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("NightworkPay") + .HasColumnType("float"); + + b.Property("OvertimePay") + .HasColumnType("float"); + + b.Property("PersonnelCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("RewardPay") + .HasColumnType("float"); + + b.Property("SalaryAidDeduction") + .HasColumnType("float"); + + b.Property("ShiftPay") + .HasColumnType("float"); + + b.Property("Signature") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("SumOfWorkingDays") + .HasMaxLength(6) + .HasColumnType("nvarchar(6)"); + + b.Property("TaxDeducation") + .HasColumnType("float"); + + b.Property("TotalClaims") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("TotalDeductions") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("TotalPayment") + .HasColumnType("float"); + + b.Property("WorkingHoursId") + .HasColumnType("bigint"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopName") + .HasMaxLength(70) + .HasColumnType("nvarchar(70)"); + + b.Property("Year") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b.Property("YearsPay") + .HasColumnType("float"); + + b.HasKey("id"); + + b.HasIndex("WorkshopId"); + + b.ToTable("Checkouts", (string)null); + }); + + modelBuilder.Entity("Company.Domain.ClassifiedSalaryAgg.ClassifiedSalary", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("Group1") + .HasColumnType("float"); + + b.Property("Group10") + .HasColumnType("float"); + + b.Property("Group11") + .HasColumnType("float"); + + b.Property("Group12") + .HasColumnType("float"); + + b.Property("Group13") + .HasColumnType("float"); + + b.Property("Group14") + .HasColumnType("float"); + + b.Property("Group15") + .HasColumnType("float"); + + b.Property("Group16") + .HasColumnType("float"); + + b.Property("Group17") + .HasColumnType("float"); + + b.Property("Group18") + .HasColumnType("float"); + + b.Property("Group19") + .HasColumnType("float"); + + b.Property("Group2") + .HasColumnType("float"); + + b.Property("Group20") + .HasColumnType("float"); + + b.Property("Group3") + .HasColumnType("float"); + + b.Property("Group4") + .HasColumnType("float"); + + b.Property("Group5") + .HasColumnType("float"); + + b.Property("Group6") + .HasColumnType("float"); + + b.Property("Group7") + .HasColumnType("float"); + + b.Property("Group8") + .HasColumnType("float"); + + b.Property("Group9") + .HasColumnType("float"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("ClassifiedSalaries", (string)null); + }); + + modelBuilder.Entity("Company.Domain.ClientEmployeeWorkshopAgg.ClientEmployeeWorkshop", b => + { + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.HasKey("WorkshopId", "EmployeeId"); + + b.HasIndex("EmployeeId"); + + b.ToTable("ClientWorkshopEmployee", (string)null); + }); + + modelBuilder.Entity("Company.Domain.Contact2Agg.EntityContact", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("IsActiveString") + .HasColumnType("nvarchar(max)"); + + b.Property("NameContact") + .HasColumnType("nvarchar(max)"); + + b.Property("Signature") + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.ToTable("TextManager_Contact", (string)null); + }); + + modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Address") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("AgentPhone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ArchiveCode") + .HasColumnType("int"); + + b.Property("BlockTimes") + .HasColumnType("int"); + + b.Property("City") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("FName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IdNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("IsActiveString") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsBlock") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsLegal") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("LName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NationalId") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("Nationalcode") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Phone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RegisterId") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("RepresentativeFullName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RepresentativeId") + .HasColumnType("bigint"); + + b.Property("State") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SureName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Zone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.HasIndex("RepresentativeId"); + + b.ToTable("PersonalContractingParties", (string)null); + }); + + modelBuilder.Entity("Company.Domain.ContractAgg.Contract", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AgreementSalary") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ArchiveCode") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ConsumableItems") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ContarctStart") + .HasColumnType("datetime2"); + + b.Property("ContractEnd") + .HasColumnType("datetime2"); + + b.Property("ContractNo") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ContractPeriod") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("ContractType") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DayliWage") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("EmployerId") + .HasColumnType("bigint"); + + b.Property("FamilyAllowance") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("GetWorkDate") + .HasColumnType("datetime2"); + + b.Property("HousingAllowance") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsActiveString") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("JobType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("JobTypeId") + .HasColumnType("bigint"); + + b.Property("MandatoryHoursid") + .HasColumnType("bigint"); + + b.Property("PersonnelCode") + .HasColumnType("bigint"); + + b.Property("SetContractDate") + .HasColumnType("datetime2"); + + b.Property("Signature") + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("WorkingHoursWeekly") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("WorkshopAddress1") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("WorkshopAddress2") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("WorkshopIds") + .HasColumnType("bigint"); + + b.Property("YearlySalaryId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("EmployerId"); + + b.HasIndex("JobTypeId"); + + b.HasIndex("MandatoryHoursid"); + + b.HasIndex("WorkshopIds"); + + b.HasIndex("YearlySalaryId"); + + b.ToTable("Contracts", (string)null); + }); + + modelBuilder.Entity("Company.Domain.ContractingPartyAccountAgg.ContractingPartyAccount", b => + { + b.Property("PersonalContractingPartyId") + .HasColumnType("bigint"); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.HasKey("PersonalContractingPartyId", "AccountId"); + + b.ToTable("ContractingPartyAccount", (string)null); + }); + + modelBuilder.Entity("Company.Domain.CrossJobAgg.CrossJob", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("CrossJobGuildId") + .HasColumnType("bigint"); + + b.Property("EquivalentRialOver") + .HasColumnType("bigint"); + + b.Property("EquivalentRialUnder") + .HasColumnType("bigint"); + + b.Property("SalaryRatioOver") + .HasColumnType("float"); + + b.Property("SalaryRatioUnder") + .HasColumnType("float"); + + b.HasKey("id"); + + b.HasIndex("CrossJobGuildId"); + + b.ToTable("CrossJobs", (string)null); + }); + + modelBuilder.Entity("Company.Domain.CrossJobGuildAgg.CrossJobGuild", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EconomicCode") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Year") + .HasMaxLength(4) + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("CrossJobGuilds", (string)null); + }); + + modelBuilder.Entity("Company.Domain.CrossJobItemsAgg.CrossJobItems", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("CrossJobId") + .HasColumnType("bigint"); + + b.Property("JobId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("CrossJobId"); + + b.HasIndex("JobId"); + + b.ToTable("CrossJobItems", (string)null); + }); + + modelBuilder.Entity("Company.Domain.DateSalaryAgg.DateSalary", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EndDateFa") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("EndDateGr") + .HasColumnType("datetime2"); + + b.Property("StartDateFa") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("StartDateGr") + .HasColumnType("datetime2"); + + b.Property("Year") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b.HasKey("id"); + + b.ToTable("DateSalaries", (string)null); + }); + + modelBuilder.Entity("Company.Domain.DateSalaryItemAgg.DateSalaryItem", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateSalaryId") + .HasColumnType("bigint"); + + b.Property("Percent") + .HasColumnType("float"); + + b.Property("PercentageId") + .HasColumnType("bigint"); + + b.Property("Salary") + .HasColumnType("float"); + + b.HasKey("id"); + + b.HasIndex("DateSalaryId"); + + b.HasIndex("PercentageId"); + + b.ToTable("DateSalaryItems", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployeeAccountAgg.EmployeeAccount", b => + { + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.HasKey("EmployeeId", "AccountId"); + + b.ToTable("EmployeeAccounts", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployeeAgg.Employee", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Address") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("BankBranch") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("BankCardNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("DateOfIssue") + .HasColumnType("datetime2"); + + b.Property("EservicePassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EserviceUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("FatherName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("FieldOfStudy") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Gender") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IdNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("InsuranceCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("InsuranceHistoryByMonth") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("InsuranceHistoryByYear") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsActiveString") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("LName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("LevelOfEducation") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MaritalStatus") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("MclsPassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MclsUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MilitaryService") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("NationalCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Nationality") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NumberOfChildren") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("OfficePhone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Phone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PlaceOfIssue") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SanaPassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SanaUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("State") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TaxOfficeUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TaxOfficepassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.ToTable("Employees", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployeeChildrenAgg.EmployeeChildren", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("FName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ParentNationalCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId"); + + b.ToTable("EmployeeChildren", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployeeComputeOptionsAgg.EmployeeComputeOptions", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BonusesOptions") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ComputeOptions") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("YearsOptions") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.ToTable("EmployeeComputeOptions", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployeeInsurancListDataAgg.EmployeeInsurancListData", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BenefitsIncludedContinuous") + .HasColumnType("float"); + + b.Property("BenefitsIncludedNonContinuous") + .HasColumnType("float"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DailyWage") + .HasColumnType("float"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("IncludeStatus") + .HasColumnType("bit"); + + b.Property("InsuranceListId") + .HasColumnType("bigint"); + + b.Property("InsuranceShare") + .HasColumnType("float"); + + b.Property("JobId") + .HasColumnType("bigint"); + + b.Property("LeftWorkDate") + .HasColumnType("datetime2(7)"); + + b.Property("MonthlyBenefits") + .HasColumnType("float"); + + b.Property("MonthlyBenefitsIncluded") + .HasColumnType("float"); + + b.Property("MonthlySalary") + .HasColumnType("float"); + + b.Property("StartWorkDate") + .HasColumnType("datetime2"); + + b.Property("WorkingDays") + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("EmployeeInsurancListData", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployeeInsuranceRecordAgg.EmployeeInsuranceRecord", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateOfEnd") + .HasColumnType("datetime2"); + + b.Property("DateOfStart") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("WorkShopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("WorkShopId"); + + b.ToTable("EmployeeInsuranceRecord", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployerAccountAgg.EmployerAccount", b => + { + b.Property("EmployerId") + .HasColumnType("bigint"); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.HasKey("EmployerId", "AccountId"); + + b.ToTable("EmployerAccounts", (string)null); + }); + + modelBuilder.Entity("Company.Domain.Evidence.Evidence", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BoardType_Id") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("File_Id") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("BoardType_Id"); + + b.HasIndex("File_Id"); + + b.ToTable("Evidences", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EvidenceDetail.EvidenceDetail", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Day") + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Evidence_Id") + .HasColumnType("bigint"); + + b.Property("FromDate") + .HasColumnType("datetime2"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("ToDate") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.HasIndex("Evidence_Id"); + + b.ToTable("EvidenceDetails", (string)null); + }); + + modelBuilder.Entity("Company.Domain.File1.File1", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ArchiveNo") + .HasColumnType("bigint"); + + b.Property("Client") + .HasColumnType("int"); + + b.Property("ClientVisitDate") + .HasColumnType("datetime2"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("FileClass") + .HasColumnType("nvarchar(max)"); + + b.Property("HasMandate") + .HasColumnType("int"); + + b.Property("ProceederReference") + .HasColumnType("nvarchar(max)"); + + b.Property("Reqester") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Summoned") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("Files", (string)null); + }); + + modelBuilder.Entity("Company.Domain.FileAlert.FileAlert", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AdditionalDeadline") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("FileState_Id") + .HasColumnType("bigint"); + + b.Property("File_Id") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("FileState_Id"); + + b.HasIndex("File_Id"); + + b.ToTable("File_Alerts", (string)null); + }); + + modelBuilder.Entity("Company.Domain.FileAndFileEmployerAgg.FileAndFileEmployer", b => + { + b.Property("FileId") + .HasColumnType("bigint"); + + b.Property("FileEmployerId") + .HasColumnType("bigint"); + + b.HasKey("FileId", "FileEmployerId"); + + b.HasIndex("FileEmployerId"); + + b.ToTable("FileAndFileEmployers", (string)null); + }); + + modelBuilder.Entity("Company.Domain.FileEmployeeAgg.FileEmployee", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("EservicePassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EserviceUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FName") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("FatherName") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("FieldOfStudy") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Gender") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IdNumber") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("InsuranceCode") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsActive") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("LName") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("LevelOfEducation") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("MaritalStatus") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("MclsPassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MclsUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("NationalCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("OfficePhone") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("Phone") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("RepresentativeFullName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RepresentativeId") + .HasColumnType("bigint"); + + b.Property("SanaPassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SanaUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TaxOfficeUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TaxOfficepassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.HasIndex("RepresentativeId"); + + b.ToTable("FileEmployee", (string)null); + }); + + modelBuilder.Entity("Company.Domain.FileEmployerAgg.FileEmployer", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("EservicePassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EserviceUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FName") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("FieldOfStudy") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FullName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Gender") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IdNumber") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("InsuranceWorkshopCode") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsActive") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsLegal") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("LName") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("LegalName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LevelOfEducation") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("MaritalStatus") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("MclsPassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MclsUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("NationalCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("NationalId") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("OfficePhone") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("Phone") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("RegisterId") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("RepresentativeFullName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RepresentativeId") + .HasColumnType("bigint"); + + b.Property("SanaPassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SanaUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TaxOfficeUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TaxOfficepassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.HasIndex("RepresentativeId"); + + b.ToTable("FileEmployer", (string)null); + }); + + modelBuilder.Entity("Company.Domain.FileState.FileState", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("FileTiming_Id") + .HasColumnType("bigint"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.HasIndex("FileTiming_Id"); + + b.ToTable("File_States", (string)null); + }); + + modelBuilder.Entity("Company.Domain.FileTiming.FileTiming", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Deadline") + .HasColumnType("int"); + + b.Property("Tips") + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.ToTable("File_Timings", (string)null); + }); + + modelBuilder.Entity("Company.Domain.FileTitle.FileTitle", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.ToTable("File_Titles", (string)null); + }); + + modelBuilder.Entity("Company.Domain.FinancialStatmentAgg.FinancialStatment", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ContractingPartyId") + .HasColumnType("bigint"); + + b.Property("ContractingPartyName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.ToTable("FinancialStatments", (string)null); + }); + + modelBuilder.Entity("Company.Domain.FinancialTransactionAgg.FinancialTransaction", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Balance") + .HasColumnType("float"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Creditor") + .HasColumnType("float"); + + b.Property("Deptor") + .HasColumnType("float"); + + b.Property("Description") + .HasMaxLength(600) + .HasColumnType("nvarchar(600)"); + + b.Property("DescriptionOption") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("FinancialStatementId") + .HasColumnType("bigint"); + + b.Property("MessageText") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("SentSms") + .HasColumnType("bit"); + + b.Property("SentSmsDateFa") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("TdateFa") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("TdateGr") + .HasColumnType("datetime2"); + + b.Property("TypeOfTransaction") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("id"); + + b.HasIndex("FinancialStatementId"); + + b.ToTable("FinancialTransactions", (string)null); + }); + + modelBuilder.Entity("Company.Domain.GroupPlanAgg.GroupPlan", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AnnualSalary") + .HasColumnType("float"); + + b.Property("BaseSalary") + .HasColumnType("float"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("GroupNo") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("JobSalary") + .HasColumnType("float"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopPlanId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("WorkshopPlanId"); + + b.ToTable("GroupPlans", (string)null); + }); + + modelBuilder.Entity("Company.Domain.GroupPlanJobItemAgg.GroupPlanJobItem", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("GroupNo") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("GroupPlanId") + .HasColumnType("bigint"); + + b.Property("JobId") + .HasColumnType("bigint"); + + b.Property("JobName") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopPlanId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("GroupPlanId"); + + b.ToTable("GroupPlanJobItems", (string)null); + }); + + modelBuilder.Entity("Company.Domain.HolidayAgg.Holiday", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Year") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b.HasKey("id"); + + b.ToTable("Holidays", (string)null); + }); + + modelBuilder.Entity("Company.Domain.HolidayItemAgg.HolidayItem", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("HolidayId") + .HasColumnType("bigint"); + + b.Property("HolidayYear") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b.Property("Holidaydate") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.HasIndex("HolidayId"); + + b.ToTable("Holidayitems", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContract", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Address") + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); + + b.Property("City") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("ContractAmount") + .HasColumnType("float"); + + b.Property("ContractDateFa") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ContractDateGr") + .HasColumnType("datetime2"); + + b.Property("ContractEndFa") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ContractEndGr") + .HasColumnType("datetime2"); + + b.Property("ContractNo") + .HasMaxLength(40) + .HasColumnType("nvarchar(40)"); + + b.Property("ContractStartFa") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ContractStartGr") + .HasColumnType("datetime2"); + + b.Property("ContractingPartyId") + .HasColumnType("bigint"); + + b.Property("ContractingPartyName") + .HasMaxLength(80) + .HasColumnType("nvarchar(80)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DailyCompenseation") + .HasColumnType("float"); + + b.Property("Description") + .HasMaxLength(10000) + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeManualCount") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ExtensionNo") + .HasColumnType("int"); + + b.Property("HasValueAddedTax") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActiveString") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("Obligation") + .HasColumnType("float"); + + b.Property("OfficialCompany") + .HasMaxLength(12) + .HasColumnType("nvarchar(12)"); + + b.Property("RepresentativeId") + .HasColumnType("bigint"); + + b.Property("RepresentativeName") + .HasMaxLength(80) + .HasColumnType("nvarchar(80)"); + + b.Property("Signature") + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("State") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("TotalAmount") + .HasColumnType("float"); + + b.Property("TypeOfContract") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("ValueAddedTax") + .HasColumnType("float"); + + b.Property("WorkshopManualCount") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.HasKey("id"); + + b.ToTable("InstitutionContracts", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractContactInfoAgg.InstitutionContractContactInfo", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("FnameLname") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InstitutionContractId") + .HasColumnType("bigint"); + + b.Property("PhoneNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("PhoneType") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Position") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SendSms") + .HasColumnType("bit"); + + b.HasKey("id"); + + b.HasIndex("InstitutionContractId"); + + b.ToTable("InstitutinContractContactInfo", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InstitutionPlanAgg.InstitutionPlan", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BaseContractAmont") + .HasColumnType("float"); + + b.Property("CountPerson") + .HasColumnType("int"); + + b.Property("FinalContractAmont") + .HasColumnType("float"); + + b.Property("IncreasePercentage") + .HasColumnType("float"); + + b.HasKey("id"); + + b.ToTable("InstitutionPlan", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InsurancJobAgg.InsuranceJob", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EconomicCode") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("InsuranceJobTitle") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Year") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b.Property("YearlySalaryId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("InsuranceJobs", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InsurancWorkshopInfoAgg.InsuranceWorkshopInfo", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Address") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("AgreementNumber") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployerName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("InsuranceCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ListNumber") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.HasIndex("WorkshopId") + .IsUnique(); + + b.ToTable("InsuranceWorkshopInformation", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InsuranceAgg.Insurance", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Address") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployerStr") + .HasColumnType("nvarchar(max)"); + + b.Property("ListNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Month") + .HasMaxLength(2) + .HasColumnType("int"); + + b.Property("WorkShopId") + .HasColumnType("bigint"); + + b.Property("WorkShopStr") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .HasMaxLength(4) + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("WorkShopId"); + + b.ToTable("Insurances", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InsuranceEmployeeInfoAgg.InsuranceEmployeeInfo", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("DateOfIssue") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("FName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FatherName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Gender") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IdNumber") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("InsuranceCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("LName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("NationalCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("PlaceOfIssue") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId") + .IsUnique(); + + b.ToTable("InsuranceEmployeeInformation", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InsuranceJobAndJobsAgg.InsuranceJobAndJobs", b => + { + b.Property("JobId") + .HasColumnType("bigint"); + + b.Property("InsuranceJobItemId") + .HasColumnType("bigint"); + + b.HasKey("JobId", "InsuranceJobItemId"); + + b.HasIndex("InsuranceJobItemId"); + + b.ToTable("InsuranceJobAndJobs", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InsuranceJobItemAgg.InsuranceJobItem", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("InsuranceJobId") + .HasColumnType("bigint"); + + b.Property("PercentageLessThan") + .HasColumnType("float"); + + b.Property("PercentageMoreThan") + .HasColumnType("float"); + + b.Property("SalaeyLessThan") + .HasColumnType("float"); + + b.Property("SalaryMoreThan") + .HasColumnType("float"); + + b.HasKey("id"); + + b.HasIndex("InsuranceJobId"); + + b.ToTable("InsuranceJobItems", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InsuranceListAgg.InsuranceList", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ConfirmSentlist") + .HasColumnType("bit"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DifficultJobsInsuranc") + .HasColumnType("float"); + + b.Property("EmployerShare") + .HasColumnType("float"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("Included") + .HasColumnType("float"); + + b.Property("IncludedAndNotIncluded") + .HasColumnType("float"); + + b.Property("InsuredShare") + .HasColumnType("float"); + + b.Property("Month") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("SumOfBenefitsIncluded") + .HasColumnType("float"); + + b.Property("SumOfDailyWage") + .HasColumnType("float"); + + b.Property("SumOfEmployees") + .HasColumnType("int"); + + b.Property("SumOfSalaries") + .HasColumnType("float"); + + b.Property("SumOfWorkingDays") + .HasColumnType("int"); + + b.Property("UnEmploymentInsurance") + .HasColumnType("float"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("Year") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b.HasKey("id"); + + b.ToTable("InsuranceLists", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InsuranceWorkshopAgg.InsuranceListWorkshop", b => + { + b.Property("InsurancListId") + .HasColumnType("bigint"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("InsurancListId", "WorkshopId"); + + b.HasIndex("WorkshopId"); + + b.ToTable("InsuranceListWorkshops", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InsuranceYearlySalaryAgg.InsuranceYearlySalary", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("Group1") + .HasColumnType("float"); + + b.Property("Group10") + .HasColumnType("float"); + + b.Property("Group11") + .HasColumnType("float"); + + b.Property("Group12") + .HasColumnType("float"); + + b.Property("Group13") + .HasColumnType("float"); + + b.Property("Group14") + .HasColumnType("float"); + + b.Property("Group15") + .HasColumnType("float"); + + b.Property("Group16") + .HasColumnType("float"); + + b.Property("Group17") + .HasColumnType("float"); + + b.Property("Group18") + .HasColumnType("float"); + + b.Property("Group19") + .HasColumnType("float"); + + b.Property("Group2") + .HasColumnType("float"); + + b.Property("Group20") + .HasColumnType("float"); + + b.Property("Group21") + .HasColumnType("float"); + + b.Property("Group22") + .HasColumnType("float"); + + b.Property("Group23") + .HasColumnType("float"); + + b.Property("Group24") + .HasColumnType("float"); + + b.Property("Group25") + .HasColumnType("float"); + + b.Property("Group26") + .HasColumnType("float"); + + b.Property("Group27") + .HasColumnType("float"); + + b.Property("Group28") + .HasColumnType("float"); + + b.Property("Group29") + .HasColumnType("float"); + + b.Property("Group3") + .HasColumnType("float"); + + b.Property("Group30") + .HasColumnType("float"); + + b.Property("Group4") + .HasColumnType("float"); + + b.Property("Group5") + .HasColumnType("float"); + + b.Property("Group6") + .HasColumnType("float"); + + b.Property("Group7") + .HasColumnType("float"); + + b.Property("Group8") + .HasColumnType("float"); + + b.Property("Group9") + .HasColumnType("float"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("InsuranceYearlySalaries", (string)null); + }); + + modelBuilder.Entity("Company.Domain.JobAgg.Job", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("JobCode") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("JobName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("id"); + + b.ToTable("Jobs", (string)null); + }); + + modelBuilder.Entity("Company.Domain.LeaveAgg.Leave", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Decription") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("EmployeeFullName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("EndLeave") + .HasColumnType("datetime2"); + + b.Property("IsAccepted") + .HasColumnType("bit"); + + b.Property("LeaveHourses") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("LeaveType") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("Month") + .HasColumnType("int"); + + b.Property("PaidLeaveType") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("StartLeave") + .HasColumnType("datetime2"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("Leave", (string)null); + }); + + modelBuilder.Entity("Company.Domain.LeftWorkAgg.LeftWork", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AddBonusesPay") + .HasColumnType("bit"); + + b.Property("AddLeavePay") + .HasColumnType("bit"); + + b.Property("AddYearsPay") + .HasColumnType("bit"); + + b.Property("BonusesOptions") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ComputeOptions") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeFullName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("IncludeStatus") + .HasColumnType("bit"); + + b.Property("JobId") + .HasColumnType("bigint"); + + b.Property("LeftWorkDate") + .HasColumnType("datetime2"); + + b.Property("StartWorkDate") + .HasColumnType("datetime2"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("WorkshopId"); + + b.ToTable("LeftWork", (string)null); + }); + + modelBuilder.Entity("Company.Domain.LeftWorkInsuranceAgg.LeftWorkInsurance", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeFullName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("IncludeStatus") + .HasColumnType("bit"); + + b.Property("JobId") + .HasColumnType("bigint"); + + b.Property("LeftWorkDate") + .HasColumnType("datetime2(7)"); + + b.Property("StartWorkDate") + .HasColumnType("datetime2"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("WorkshopId"); + + b.ToTable("LeftWorkInsurances", (string)null); + }); + + modelBuilder.Entity("Company.Domain.MandatoryHoursAgg.MandatoryHours", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Aban") + .HasColumnType("float"); + + b.Property("AbanFridays") + .HasColumnType("int"); + + b.Property("AbanHolidays") + .HasColumnType("int"); + + b.Property("AbanMonadatoryDays") + .HasColumnType("int"); + + b.Property("Azar") + .HasColumnType("float"); + + b.Property("AzarFridays") + .HasColumnType("int"); + + b.Property("AzarHolidays") + .HasColumnType("int"); + + b.Property("AzarMonadatoryDays") + .HasColumnType("int"); + + b.Property("Bahman") + .HasColumnType("float"); + + b.Property("BahmanFridays") + .HasColumnType("int"); + + b.Property("BahmanHolidays") + .HasColumnType("int"); + + b.Property("BahmanMonadatoryDays") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Dey") + .HasColumnType("float"); + + b.Property("DeyFridays") + .HasColumnType("int"); + + b.Property("DeyHolidays") + .HasColumnType("int"); + + b.Property("DeyMonadatoryDays") + .HasColumnType("int"); + + b.Property("Esfand") + .HasColumnType("float"); + + b.Property("EsfandFridays") + .HasColumnType("int"); + + b.Property("EsfandHolidays") + .HasColumnType("int"); + + b.Property("EsfandMonadatoryDays") + .HasColumnType("int"); + + b.Property("Farvardin") + .HasColumnType("float"); + + b.Property("FarvardinFridays") + .HasColumnType("int"); + + b.Property("FarvardinHolidays") + .HasColumnType("int"); + + b.Property("FarvardinMonadatoryDays") + .HasColumnType("int"); + + b.Property("Khordad") + .HasColumnType("float"); + + b.Property("KhordadFridays") + .HasColumnType("int"); + + b.Property("KhordadHolidays") + .HasColumnType("int"); + + b.Property("KhordadMonadatoryDays") + .HasColumnType("int"); + + b.Property("Mehr") + .HasColumnType("float"); + + b.Property("MehrFridays") + .HasColumnType("int"); + + b.Property("MehrHolidays") + .HasColumnType("int"); + + b.Property("MehrMonadatoryDays") + .HasColumnType("int"); + + b.Property("Mordad") + .HasColumnType("float"); + + b.Property("MordadFridays") + .HasColumnType("int"); + + b.Property("MordadHolidays") + .HasColumnType("int"); + + b.Property("MordadMonadatoryDays") + .HasColumnType("int"); + + b.Property("Ordibehesht") + .HasColumnType("float"); + + b.Property("OrdibeheshtFridays") + .HasColumnType("int"); + + b.Property("OrdibeheshtHolidays") + .HasColumnType("int"); + + b.Property("OrdibeheshtMonadatoryDays") + .HasColumnType("int"); + + b.Property("Shahrivar") + .HasColumnType("float"); + + b.Property("ShahrivarFridays") + .HasColumnType("int"); + + b.Property("ShahrivarHolidays") + .HasColumnType("int"); + + b.Property("ShahrivarMonadatoryDays") + .HasColumnType("int"); + + b.Property("Tir") + .HasColumnType("float"); + + b.Property("TirFridays") + .HasColumnType("int"); + + b.Property("TirHolidays") + .HasColumnType("int"); + + b.Property("TirMonadatoryDays") + .HasColumnType("int"); + + b.Property("Year") + .HasMaxLength(4) + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("MandatoryHours", (string)null); + }); + + modelBuilder.Entity("Company.Domain.MasterPenaltyTitle.MasterPenaltyTitle", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Day") + .HasColumnType("nvarchar(max)"); + + b.Property("FromDate") + .HasColumnType("datetime2"); + + b.Property("MasterPetition_Id") + .HasColumnType("bigint"); + + b.Property("PaidAmount") + .HasColumnType("nvarchar(max)"); + + b.Property("RemainingAmount") + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("ToDate") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.HasIndex("MasterPetition_Id"); + + b.ToTable("Master_PenaltyTitles", (string)null); + }); + + modelBuilder.Entity("Company.Domain.MasterPetition.MasterPetition", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BoardType_Id") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("File_Id") + .HasColumnType("bigint"); + + b.Property("MasterName") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkHistoryDescreption") + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.HasIndex("BoardType_Id"); + + b.HasIndex("File_Id"); + + b.ToTable("Master_Petitions", (string)null); + }); + + modelBuilder.Entity("Company.Domain.MasterWorkHistory.MasterWorkHistory", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("FromDate") + .HasColumnType("datetime2"); + + b.Property("MasterPetition_Id") + .HasColumnType("bigint"); + + b.Property("ToDate") + .HasColumnType("datetime2"); + + b.Property("WorkingHoursPerDay") + .HasColumnType("int"); + + b.Property("WorkingHoursPerWeek") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("MasterPetition_Id"); + + b.ToTable("Master_WorkHistories", (string)null); + }); + + modelBuilder.Entity("Company.Domain.ModuleAgg.EntityModule", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("IsActiveString") + .HasColumnType("nvarchar(max)"); + + b.Property("NameSubModule") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.ToTable("TextManager_Module", (string)null); + }); + + modelBuilder.Entity("Company.Domain.ModuleTextManagerAgg.EntityModuleTextManager", b => + { + b.Property("TextManagerId") + .HasColumnType("bigint"); + + b.Property("ModuleId") + .HasColumnType("bigint"); + + b.HasKey("TextManagerId", "ModuleId"); + + b.HasIndex("ModuleId"); + + b.ToTable("TextManager_ModuleTextManager", (string)null); + }); + + modelBuilder.Entity("Company.Domain.OriginalTitleAgg.EntityOriginalTitle", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("IsActiveString") + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.HasKey("id"); + + b.ToTable("TextManager_OriginalTitle", (string)null); + }); + + modelBuilder.Entity("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("Month") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("Year") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b.HasKey("id"); + + b.ToTable("PaymentToEmployees", (string)null); + }); + + modelBuilder.Entity("Company.Domain.PaymentToEmployeeItemAgg.PaymentToEmployeeItem", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BankCheckNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CashDescription") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DestinationBankAccountNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DestinationBankName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("PayDate") + .HasColumnType("datetime2"); + + b.Property("Payment") + .HasColumnType("float"); + + b.Property("PaymentMetod") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("PaymentTitle") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("PaymentToEmployeeId") + .HasColumnType("bigint"); + + b.Property("SourceBankAccountNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SourceBankName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TypeDestinationBankNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TypeSourceBankNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("PaymentToEmployeeId"); + + b.ToTable("PaymentToEmployeeItems", (string)null); + }); + + modelBuilder.Entity("Company.Domain.PenaltyTitle.PenaltyTitle", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Day") + .HasColumnType("nvarchar(max)"); + + b.Property("FromDate") + .HasColumnType("datetime2(7)"); + + b.Property("PaidAmount") + .HasColumnType("nvarchar(max)"); + + b.Property("Petition_Id") + .HasColumnType("bigint"); + + b.Property("RemainingAmount") + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.Property("ToDate") + .HasColumnType("datetime2(7)"); + + b.HasKey("id"); + + b.HasIndex("Petition_Id"); + + b.ToTable("PenaltyTitles", (string)null); + }); + + modelBuilder.Entity("Company.Domain.PercentageAgg.Percentage", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Percent") + .HasColumnType("float"); + + b.HasKey("id"); + + b.ToTable("Percentages", (string)null); + }); + + modelBuilder.Entity("Company.Domain.PersonnelCodeAgg.PersonnelCodeDomain", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("PersonnelCode") + .HasColumnType("bigint"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("WorkshopId"); + + b.ToTable("PersonnelCodes", (string)null); + }); + + modelBuilder.Entity("Company.Domain.Petition.Petition", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BoardType_Id") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("File_Id") + .HasColumnType("bigint"); + + b.Property("NotificationPetitionDate") + .HasColumnType("datetime2"); + + b.Property("PetitionIssuanceDate") + .HasColumnType("datetime2"); + + b.Property("PetitionNo") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalPenalty") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalPenaltyTitles") + .HasColumnType("nvarchar(max)"); + + b.Property("WorkHistoryDescreption") + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.HasIndex("BoardType_Id"); + + b.HasIndex("File_Id"); + + b.ToTable("Petitions", (string)null); + }); + + modelBuilder.Entity("Company.Domain.ProceedingSession.ProceedingSession", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Board_Id") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Time") + .HasColumnType("nvarchar(max)"); + + b.HasKey("id"); + + b.HasIndex("Board_Id"); + + b.ToTable("ProceedingSessions", (string)null); + }); + + modelBuilder.Entity("Company.Domain.RepresentativeAgg.Representative", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Address") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AgentPhone") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("FName") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("FullName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IdNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("IsActive") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsLegal") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("LName") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("LegalName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("NationalId") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Nationalcode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Phone") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("RegisterId") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.HasKey("id"); + + b.ToTable("Representative", (string)null); + }); + + modelBuilder.Entity("Company.Domain.RollCallAgg.RollCall", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeFullName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("Month") + .HasColumnType("int"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("RollCall", (string)null); + }); + + modelBuilder.Entity("Company.Domain.RollCallEmployeeAgg.RollCallEmployee", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("EmployeeFullName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("HasUploadedImage") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsActiveString") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("RollCallEmployees", (string)null); + }); + + modelBuilder.Entity("Company.Domain.RollCallEmployeeStatusAgg.RollCallEmployeeStatus", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("RollCallEmployeeId") + .HasColumnType("bigint"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.HasIndex("RollCallEmployeeId"); + + b.ToTable("RollCallEmployeesStatus"); + }); + + modelBuilder.Entity("Company.Domain.RollCallPlanAgg.RollCallPlan", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BaseAmont") + .HasColumnType("float"); + + b.Property("FinalAmont") + .HasColumnType("float"); + + b.Property("IncreasePercentage") + .HasColumnType("float"); + + b.Property("MaxPersonValid") + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("RollCallPlans", (string)null); + }); + + modelBuilder.Entity("Company.Domain.RollCallServiceAgg.RollCallService", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("Amount") + .HasColumnType("float"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Duration") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("EndService") + .HasColumnType("datetime2"); + + b.Property("IsActiveString") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("MaxPersonValid") + .HasColumnType("int"); + + b.Property("ServiceType") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("StartService") + .HasColumnType("datetime2"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("AccountId"); + + b.ToTable("RollCallServices", (string)null); + }); + + modelBuilder.Entity("Company.Domain.SmsResultAgg.SmsResult", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ContractingPartyName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ContractingPatyId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("InstitutionContractId") + .HasColumnType("bigint"); + + b.Property("MessageId") + .HasColumnType("int"); + + b.Property("Mobile") + .HasMaxLength(12) + .HasColumnType("nvarchar(12)"); + + b.Property("Status") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("TypeOfSms") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.ToTable("SmsResults", (string)null); + }); + + modelBuilder.Entity("Company.Domain.SubtitleAgg.EntitySubtitle", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EntitySubtitleid") + .HasColumnType("bigint"); + + b.Property("IsActiveString") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalTitle_Id") + .HasColumnType("bigint"); + + b.Property("Subtitle") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.HasKey("id"); + + b.HasIndex("EntitySubtitleid"); + + b.HasIndex("OriginalTitle_Id"); + + b.ToTable("TextManager_Subtitle", (string)null); + }); + + modelBuilder.Entity("Company.Domain.TaxJobCategoryAgg.TaxJobCategory", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("JobCategoryCode") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("JobCategoryName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.ToTable("TaxJobCategory", (string)null); + }); + + modelBuilder.Entity("Company.Domain.TaxLeftWorkCategoryAgg.TaxLeftWorkCategory", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BudgetLawExceptions") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("Country") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("CurrencyType") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("EmployeeName") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("EmploymentLocationStatus") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("ExchangeRate") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("InsuranceBranch") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("InsuranceName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("JobCategoryCode") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("JobCategoryId") + .HasColumnType("bigint"); + + b.Property("JobTitle") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("PaymentType") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("RetirementDate") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("TaxExempt") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("TypeOfEmployment") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("TypeOfInsurance") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopName") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("id"); + + b.HasIndex("WorkshopId"); + + b.ToTable("TaxLeftWorkCategory", (string)null); + }); + + modelBuilder.Entity("Company.Domain.TaxLeftWorkItemAgg.TaxLeftWorkItem", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("LeftWork") + .HasColumnType("datetime2"); + + b.Property("StartWork") + .HasColumnType("datetime2"); + + b.Property("TaxLeftWorkCategoryId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("TaxLeftWorkCategoryId"); + + b.ToTable("TaxLeftWorkItem", (string)null); + }); + + modelBuilder.Entity("Company.Domain.TextManagerAgg.EntityTextManager", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Chapter_Id") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateTextManager") + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActiveString") + .HasColumnType("nvarchar(max)"); + + b.Property("NoteNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("NumberTextManager") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalTitle_Id") + .HasColumnType("bigint"); + + b.Property("Paragraph") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectTextManager") + .HasColumnType("nvarchar(max)"); + + b.Property("Subtitle_Id") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("TextManager_TextManager", (string)null); + }); + + modelBuilder.Entity("Company.Domain.WorkHistory.WorkHistory", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("FromDate") + .HasColumnType("datetime2"); + + b.Property("Petition_Id") + .HasColumnType("bigint"); + + b.Property("ToDate") + .HasColumnType("datetime2"); + + b.Property("WorkingHoursPerDay") + .HasColumnType("int"); + + b.Property("WorkingHoursPerWeek") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("Petition_Id"); + + b.ToTable("WorkHistories", (string)null); + }); + + modelBuilder.Entity("Company.Domain.WorkingHoursAgg.WorkingHours", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ContractId") + .HasColumnType("bigint"); + + b.Property("ContractNo") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("NumberOfFriday") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("NumberOfWorkingDays") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("OverNightWorkH") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("OverNightWorkM") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("OverTimeWorkH") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("OverTimeWorkM") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("ShiftWork") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("TotalHoursesH") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("TotalHoursesM") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("WeeklyWorkingTime") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("id"); + + b.HasIndex("ContractId"); + + b.ToTable("WorkingHours", (string)null); + }); + + modelBuilder.Entity("Company.Domain.WorkingHoursItemsAgg.WorkingHoursItems", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ComplexEnd") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("ComplexStart") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DayOfWork") + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("End1") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("End2") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("End3") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("RestTime") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("Start1") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("Start2") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("Start3") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("WeekNumber") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("WorkingHoursId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("WorkingHoursId"); + + b.ToTable("WorkingHoursItems", (string)null); + }); + + modelBuilder.Entity("Company.Domain.WorkingHoursTempAgg.WorkingHoursTemp", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("ShiftWork") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("WorkShopAddress2") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("WorkingHoursTemp", (string)null); + }); + + modelBuilder.Entity("Company.Domain.WorkingHoursTempItemAgg.WorkingHoursTempItem", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ComplexEnd") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("ComplexStart") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DayOfWork") + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("End1") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("End2") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("RestTime") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("Start1") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("Start2") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("WeekNumber") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("WorkingHoursTempId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("WorkingHoursTempId"); + + b.ToTable("WorkingHoursTempItem", (string)null); + }); + + modelBuilder.Entity("Company.Domain.WorkshopAccountAgg.WorkshopAccount", b => + { + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("ContractAndCheckout") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("Insurance") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsActiveSting") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("Tax") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.HasKey("WorkshopId", "AccountId"); + + b.ToTable("WorkshopeAccounts", (string)null); + }); + + modelBuilder.Entity("Company.Domain.WorkshopAgg.Workshop", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AddBonusesPay") + .HasColumnType("bit"); + + b.Property("AddLeavePay") + .HasColumnType("bit"); + + b.Property("AddYearsPay") + .HasColumnType("bit"); + + b.Property("Address") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("AgentName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("AgentPhone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AgreementNumber") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ArchiveCode") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("BonusesOptions") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("ComputeOptions") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ContractTerm") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("FixedSalary") + .HasColumnType("bit"); + + b.Property("InsuranceCode") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("InsuranceJobId") + .HasColumnType("bigint"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsActiveString") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IsClassified") + .HasColumnType("bit"); + + b.Property("IsOldContract") + .HasColumnType("bit"); + + b.Property("Population") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("State") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TotalPaymentHide") + .HasColumnType("bit"); + + b.Property("TypeOfContract") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TypeOfInsuranceSend") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TypeOfOwnership") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("WorkshopFullName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("WorkshopName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("WorkshopSureName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("YearsOptions") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ZoneName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.ToTable("Workshops", (string)null); + }); + + modelBuilder.Entity("Company.Domain.WorkshopEmployerAgg.WorkshopEmployer", b => + { + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("EmployerId") + .HasColumnType("bigint"); + + b.HasKey("WorkshopId", "EmployerId"); + + b.HasIndex("EmployerId"); + + b.ToTable("WorkshopeEmployers", (string)null); + }); + + modelBuilder.Entity("Company.Domain.WorkshopPlanAgg.WorkshopPlan", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Designer") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("DesignerPhone") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("ExecutionDateFa") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ExecutionDateGr") + .HasColumnType("datetime2"); + + b.Property("IncludingDateFa") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IncludingDateGr") + .HasColumnType("datetime2"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("WorkshopPlan", (string)null); + }); + + modelBuilder.Entity("Company.Domain.WorkshopPlanEmployeeAgg.WorkshopPlanEmployee", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeFullName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopPlanId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("WorkshopPlanId"); + + b.ToTable("WorkshopPlanEmployees", (string)null); + }); + + modelBuilder.Entity("Company.Domain.YearlySalaryAgg.YearlySalary", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ConnectionId") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("Year") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("id"); + + b.ToTable("YearlySalariess", (string)null); + }); + + modelBuilder.Entity("Company.Domain.YearlySalaryItemsAgg.YearlySalaryItem", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ItemName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("ItemValue") + .HasColumnType("float"); + + b.Property("ParentConnectionId") + .HasColumnType("int"); + + b.Property("ValueType") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("YearlySalaryId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("YearlySalaryId"); + + b.ToTable("YearlyItems", (string)null); + }); + + modelBuilder.Entity("Company.Domain.YearlysSalaryTitleAgg.YearlySalaryTitle", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Title1") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title10") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title2") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title3") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title4") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title5") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title6") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title7") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title8") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title9") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("id"); + + b.ToTable("YearlySalaryTitles", (string)null); + }); + + modelBuilder.Entity("Company.Domain.ZoneAgg.Zone", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CityId") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ZoneName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.ToTable("Zones", (string)null); + }); + + modelBuilder.Entity("Company.Domain.empolyerAgg.Employer", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Address") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("AgentPhone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ContractingPartyId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("DateOfIssue") + .HasColumnType("datetime2"); + + b.Property("EmployerLName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("EmployerNo") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EservicePassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EserviceUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("FatherName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("FullName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Gender") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IdNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsLegal") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("LName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("MclsPassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MclsUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("NationalId") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("Nationalcode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Nationality") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Phone") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PlaceOfIssue") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RegisterId") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("SanaPassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("SanaUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TaxOfficeUserName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TaxOfficepassword") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.HasIndex("ContractingPartyId"); + + b.ToTable("Employers", (string)null); + }); + + modelBuilder.Entity("EmployerWorkshop", b => + { + b.Property("EmployersListid") + .HasColumnType("bigint"); + + b.Property("WorkshopsListid") + .HasColumnType("bigint"); + + b.HasKey("EmployersListid", "WorkshopsListid"); + + b.HasIndex("WorkshopsListid"); + + b.ToTable("EmployerWorkshop"); + }); + + modelBuilder.Entity("Company.Domain.Board.Board", b => + { + b.HasOne("Company.Domain.BoardType.BoardType", "BoardType") + .WithMany("BoardsList") + .HasForeignKey("BoardType_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.File1.File1", "File1") + .WithMany("BoardsList") + .HasForeignKey("File_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("BoardType"); + + b.Navigation("File1"); + }); + + modelBuilder.Entity("Company.Domain.ChapterAgg.EntityChapter", b => + { + b.HasOne("Company.Domain.SubtitleAgg.EntitySubtitle", "EntitySubtitle") + .WithMany("Chapters") + .HasForeignKey("Subtitle_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EntitySubtitle"); + }); + + modelBuilder.Entity("Company.Domain.CheckoutAgg.Checkout", b => + { + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("Checkouts") + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.ClientEmployeeWorkshopAgg.ClientEmployeeWorkshop", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany("ClientEmployeeWorkshopList") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("ClientEmployeeWorkshopList") + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b => + { + b.HasOne("Company.Domain.RepresentativeAgg.Representative", "Representative") + .WithMany("ContractingParties") + .HasForeignKey("RepresentativeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Representative"); + }); + + modelBuilder.Entity("Company.Domain.ContractAgg.Contract", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany("Contracts") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.empolyerAgg.Employer", "Employer") + .WithMany("Contracts") + .HasForeignKey("EmployerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.JobAgg.Job", "Job") + .WithMany("ContractsList") + .HasForeignKey("JobTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.MandatoryHoursAgg.MandatoryHours", null) + .WithMany("Contracts") + .HasForeignKey("MandatoryHoursid"); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("Contracts2") + .HasForeignKey("WorkshopIds") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Company.Domain.YearlySalaryAgg.YearlySalary", "YearlySalary") + .WithMany("Contracts") + .HasForeignKey("YearlySalaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Employer"); + + b.Navigation("Job"); + + b.Navigation("Workshop"); + + b.Navigation("YearlySalary"); + }); + + modelBuilder.Entity("Company.Domain.ContractingPartyAccountAgg.ContractingPartyAccount", b => + { + b.HasOne("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", "PersonalContractingParty") + .WithMany() + .HasForeignKey("PersonalContractingPartyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PersonalContractingParty"); + }); + + modelBuilder.Entity("Company.Domain.CrossJobAgg.CrossJob", b => + { + b.HasOne("Company.Domain.CrossJobGuildAgg.CrossJobGuild", "CrossJobGuild") + .WithMany("CrossJobList") + .HasForeignKey("CrossJobGuildId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CrossJobGuild"); + }); + + modelBuilder.Entity("Company.Domain.CrossJobItemsAgg.CrossJobItems", b => + { + b.HasOne("Company.Domain.CrossJobAgg.CrossJob", "CrossJob") + .WithMany("CrossJobItemsList") + .HasForeignKey("CrossJobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.JobAgg.Job", "Job") + .WithMany("CrossJobItemsList") + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CrossJob"); + + b.Navigation("Job"); + }); + + modelBuilder.Entity("Company.Domain.DateSalaryItemAgg.DateSalaryItem", b => + { + b.HasOne("Company.Domain.DateSalaryAgg.DateSalary", "DateSalary") + .WithMany("DateSalaryItemList") + .HasForeignKey("DateSalaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.PercentageAgg.Percentage", "Percentage") + .WithMany("DateSalaryItemList") + .HasForeignKey("PercentageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DateSalary"); + + b.Navigation("Percentage"); + }); + + modelBuilder.Entity("Company.Domain.EmployeeAccountAgg.EmployeeAccount", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + }); + + modelBuilder.Entity("Company.Domain.EmployeeChildrenAgg.EmployeeChildren", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany("EmployeeChildrenList") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + }); + + modelBuilder.Entity("Company.Domain.EmployeeInsuranceRecordAgg.EmployeeInsuranceRecord", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany("EmployeeInsuranceRecords") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("EmployeeInsuranceRecords") + .HasForeignKey("WorkShopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.EmployerAccountAgg.EmployerAccount", b => + { + b.HasOne("Company.Domain.empolyerAgg.Employer", "Employer") + .WithMany() + .HasForeignKey("EmployerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employer"); + }); + + modelBuilder.Entity("Company.Domain.Evidence.Evidence", b => + { + b.HasOne("Company.Domain.BoardType.BoardType", "BoardType") + .WithMany("EvidencesList") + .HasForeignKey("BoardType_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.File1.File1", "File1") + .WithMany("EvidencesList") + .HasForeignKey("File_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("BoardType"); + + b.Navigation("File1"); + }); + + modelBuilder.Entity("Company.Domain.EvidenceDetail.EvidenceDetail", b => + { + b.HasOne("Company.Domain.Evidence.Evidence", "Evidence") + .WithMany("EvidenceDetailsList") + .HasForeignKey("Evidence_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Evidence"); + }); + + modelBuilder.Entity("Company.Domain.FileAlert.FileAlert", b => + { + b.HasOne("Company.Domain.FileState.FileState", "FileState") + .WithMany("FileAlertsList") + .HasForeignKey("FileState_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.File1.File1", "File") + .WithMany("FileAlertsList") + .HasForeignKey("File_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File"); + + b.Navigation("FileState"); + }); + + modelBuilder.Entity("Company.Domain.FileAndFileEmployerAgg.FileAndFileEmployer", b => + { + b.HasOne("Company.Domain.FileEmployerAgg.FileEmployer", "FileEmployer") + .WithMany("FileAndFileEmployers") + .HasForeignKey("FileEmployerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.File1.File1", "File1") + .WithMany("FileAndFileEmployers") + .HasForeignKey("FileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("File1"); + + b.Navigation("FileEmployer"); + }); + + modelBuilder.Entity("Company.Domain.FileEmployeeAgg.FileEmployee", b => + { + b.HasOne("Company.Domain.RepresentativeAgg.Representative", "Representative") + .WithMany("FileEmployeeList") + .HasForeignKey("RepresentativeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Representative"); + }); + + modelBuilder.Entity("Company.Domain.FileEmployerAgg.FileEmployer", b => + { + b.HasOne("Company.Domain.RepresentativeAgg.Representative", "Representative") + .WithMany("FileEmployerList") + .HasForeignKey("RepresentativeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Representative"); + }); + + modelBuilder.Entity("Company.Domain.FileState.FileState", b => + { + b.HasOne("Company.Domain.FileTiming.FileTiming", "FileTiming") + .WithMany("FileStates") + .HasForeignKey("FileTiming_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FileTiming"); + }); + + modelBuilder.Entity("Company.Domain.FinancialTransactionAgg.FinancialTransaction", b => + { + b.HasOne("Company.Domain.FinancialStatmentAgg.FinancialStatment", "FinancialStatment") + .WithMany("FinancialTransactionList") + .HasForeignKey("FinancialStatementId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FinancialStatment"); + }); + + modelBuilder.Entity("Company.Domain.GroupPlanAgg.GroupPlan", b => + { + b.HasOne("Company.Domain.WorkshopPlanAgg.WorkshopPlan", "WorkshopPlan") + .WithMany("GroupPlans") + .HasForeignKey("WorkshopPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkshopPlan"); + }); + + modelBuilder.Entity("Company.Domain.GroupPlanJobItemAgg.GroupPlanJobItem", b => + { + b.HasOne("Company.Domain.GroupPlanAgg.GroupPlan", "GroupPlan") + .WithMany("GroupPlanJobItems") + .HasForeignKey("GroupPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("GroupPlan"); + }); + + modelBuilder.Entity("Company.Domain.HolidayItemAgg.HolidayItem", b => + { + b.HasOne("Company.Domain.HolidayAgg.Holiday", "Holidayss") + .WithMany("HolidayItems") + .HasForeignKey("HolidayId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Holidayss"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractContactInfoAgg.InstitutionContractContactInfo", b => + { + b.HasOne("Company.Domain.InstitutionContractAgg.InstitutionContract", "InstitutionContracts") + .WithMany("ContactInfoList") + .HasForeignKey("InstitutionContractId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("InstitutionContracts"); + }); + + modelBuilder.Entity("Company.Domain.InsurancWorkshopInfoAgg.InsuranceWorkshopInfo", b => + { + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithOne("InsuranceWorkshopInfo") + .HasForeignKey("Company.Domain.InsurancWorkshopInfoAgg.InsuranceWorkshopInfo", "WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.InsuranceAgg.Insurance", b => + { + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("Insurances") + .HasForeignKey("WorkShopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.InsuranceEmployeeInfoAgg.InsuranceEmployeeInfo", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithOne("InsuranceEmployeeInfo") + .HasForeignKey("Company.Domain.InsuranceEmployeeInfoAgg.InsuranceEmployeeInfo", "EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + }); + + modelBuilder.Entity("Company.Domain.InsuranceJobAndJobsAgg.InsuranceJobAndJobs", b => + { + b.HasOne("Company.Domain.InsuranceJobItemAgg.InsuranceJobItem", "InsuranceJobItem") + .WithMany("InsuranceJobAndJobs") + .HasForeignKey("InsuranceJobItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.JobAgg.Job", "Jobs") + .WithMany("InsuranceJobAndJobs") + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("InsuranceJobItem"); + + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("Company.Domain.InsuranceJobItemAgg.InsuranceJobItem", b => + { + b.HasOne("Company.Domain.InsurancJobAgg.InsuranceJob", "InsuranceJob") + .WithMany("InsuranceJobItemList") + .HasForeignKey("InsuranceJobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("InsuranceJob"); + }); + + modelBuilder.Entity("Company.Domain.InsuranceWorkshopAgg.InsuranceListWorkshop", b => + { + b.HasOne("Company.Domain.InsuranceListAgg.InsuranceList", "InsuranceList") + .WithMany("InsuranceListWorkshops") + .HasForeignKey("InsurancListId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("InsuranceListWorkshops") + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("InsuranceList"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.LeftWorkAgg.LeftWork", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany("LeftWorks") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("LeftWorks") + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.LeftWorkInsuranceAgg.LeftWorkInsurance", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany("LeftWorkInsurances") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("LeftWorkInsurances") + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.MasterPenaltyTitle.MasterPenaltyTitle", b => + { + b.HasOne("Company.Domain.MasterPetition.MasterPetition", "MasterPetition") + .WithMany("MasterPenaltyTitlesList") + .HasForeignKey("MasterPetition_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MasterPetition"); + }); + + modelBuilder.Entity("Company.Domain.MasterPetition.MasterPetition", b => + { + b.HasOne("Company.Domain.BoardType.BoardType", "BoardType") + .WithMany("MasterPetitionsList") + .HasForeignKey("BoardType_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.File1.File1", "File1") + .WithMany("MasterPetitionsList") + .HasForeignKey("File_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("BoardType"); + + b.Navigation("File1"); + }); + + modelBuilder.Entity("Company.Domain.MasterWorkHistory.MasterWorkHistory", b => + { + b.HasOne("Company.Domain.MasterPetition.MasterPetition", "MasterPetition") + .WithMany("MasterWorkHistoriesList") + .HasForeignKey("MasterPetition_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MasterPetition"); + }); + + modelBuilder.Entity("Company.Domain.ModuleTextManagerAgg.EntityModuleTextManager", b => + { + b.HasOne("Company.Domain.ModuleAgg.EntityModule", "Module") + .WithMany("EntityModuleTextManagers") + .HasForeignKey("ModuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.TextManagerAgg.EntityTextManager", "TextManager") + .WithMany("EntityModuleTextManagers") + .HasForeignKey("TextManagerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Module"); + + b.Navigation("TextManager"); + }); + + modelBuilder.Entity("Company.Domain.PaymentToEmployeeItemAgg.PaymentToEmployeeItem", b => + { + b.HasOne("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", "PaymentToEmployee") + .WithMany("PaymentToEmployeeItemList") + .HasForeignKey("PaymentToEmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PaymentToEmployee"); + }); + + modelBuilder.Entity("Company.Domain.PenaltyTitle.PenaltyTitle", b => + { + b.HasOne("Company.Domain.Petition.Petition", "Petition") + .WithMany("PenaltyTitlesList") + .HasForeignKey("Petition_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Petition"); + }); + + modelBuilder.Entity("Company.Domain.PersonnelCodeAgg.PersonnelCodeDomain", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany("PersonnelCodeList") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("PersonnelCodeList") + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.Petition.Petition", b => + { + b.HasOne("Company.Domain.BoardType.BoardType", "BoardType") + .WithMany("PetitionsList") + .HasForeignKey("BoardType_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.File1.File1", "File1") + .WithMany("PetitionsList") + .HasForeignKey("File_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("BoardType"); + + b.Navigation("File1"); + }); + + modelBuilder.Entity("Company.Domain.ProceedingSession.ProceedingSession", b => + { + b.HasOne("Company.Domain.Board.Board", "Board") + .WithMany("ProceedingSessionsList") + .HasForeignKey("Board_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Board"); + }); + + modelBuilder.Entity("Company.Domain.RollCallEmployeeStatusAgg.RollCallEmployeeStatus", b => + { + b.HasOne("Company.Domain.RollCallEmployeeAgg.RollCallEmployee", "RollCallEmployee") + .WithMany("EmployeesStatus") + .HasForeignKey("RollCallEmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RollCallEmployee"); + }); + + modelBuilder.Entity("Company.Domain.RollCallServiceAgg.RollCallService", b => + { + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("RollCallServicesList") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.SubtitleAgg.EntitySubtitle", b => + { + b.HasOne("Company.Domain.SubtitleAgg.EntitySubtitle", null) + .WithMany("Subtitles") + .HasForeignKey("EntitySubtitleid"); + + b.HasOne("Company.Domain.OriginalTitleAgg.EntityOriginalTitle", "EntityOriginalTitle") + .WithMany("Subtitles") + .HasForeignKey("OriginalTitle_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EntityOriginalTitle"); + }); + + modelBuilder.Entity("Company.Domain.TaxLeftWorkCategoryAgg.TaxLeftWorkCategory", b => + { + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("TaxLeftWorkCategoryList") + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.TaxLeftWorkItemAgg.TaxLeftWorkItem", b => + { + b.HasOne("Company.Domain.TaxLeftWorkCategoryAgg.TaxLeftWorkCategory", "TaxLeftWorkCategory") + .WithMany("TaxLeftWorkItemList") + .HasForeignKey("TaxLeftWorkCategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TaxLeftWorkCategory"); + }); + + modelBuilder.Entity("Company.Domain.WorkHistory.WorkHistory", b => + { + b.HasOne("Company.Domain.Petition.Petition", "Petition") + .WithMany("WorkHistoriesList") + .HasForeignKey("Petition_Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Petition"); + }); + + modelBuilder.Entity("Company.Domain.WorkingHoursAgg.WorkingHours", b => + { + b.HasOne("Company.Domain.ContractAgg.Contract", "Contracts") + .WithMany("WorkingHoursList") + .HasForeignKey("ContractId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Contracts"); + }); + + modelBuilder.Entity("Company.Domain.WorkingHoursItemsAgg.WorkingHoursItems", b => + { + b.HasOne("Company.Domain.WorkingHoursAgg.WorkingHours", "WorkingHourses") + .WithMany("WorkingHoursItemsList") + .HasForeignKey("WorkingHoursId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkingHourses"); + }); + + modelBuilder.Entity("Company.Domain.WorkingHoursTempItemAgg.WorkingHoursTempItem", b => + { + b.HasOne("Company.Domain.WorkingHoursTempAgg.WorkingHoursTemp", "WorkingHoursTemp") + .WithMany("WorkingHoursTempItemList") + .HasForeignKey("WorkingHoursTempId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkingHoursTemp"); + }); + + modelBuilder.Entity("Company.Domain.WorkshopAccountAgg.WorkshopAccount", b => + { + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany() + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.WorkshopEmployerAgg.WorkshopEmployer", b => + { + b.HasOne("Company.Domain.empolyerAgg.Employer", "Employer") + .WithMany("WorkshopEmployers") + .HasForeignKey("EmployerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("WorkshopEmployers") + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employer"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.WorkshopPlanEmployeeAgg.WorkshopPlanEmployee", b => + { + b.HasOne("Company.Domain.WorkshopPlanAgg.WorkshopPlan", "WorkshopPlan") + .WithMany("WorkshopPlanEmployees") + .HasForeignKey("WorkshopPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkshopPlan"); + }); + + modelBuilder.Entity("Company.Domain.YearlySalaryItemsAgg.YearlySalaryItem", b => + { + b.HasOne("Company.Domain.YearlySalaryAgg.YearlySalary", "YearlySalary") + .WithMany("YearlySalaryItemsList") + .HasForeignKey("YearlySalaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("YearlySalary"); + }); + + modelBuilder.Entity("Company.Domain.empolyerAgg.Employer", b => + { + b.HasOne("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", "ContractingParty") + .WithMany("Employers") + .HasForeignKey("ContractingPartyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ContractingParty"); + }); + + modelBuilder.Entity("EmployerWorkshop", b => + { + b.HasOne("Company.Domain.empolyerAgg.Employer", null) + .WithMany() + .HasForeignKey("EmployersListid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", null) + .WithMany() + .HasForeignKey("WorkshopsListid") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Company.Domain.Board.Board", b => + { + b.Navigation("ProceedingSessionsList"); + }); + + modelBuilder.Entity("Company.Domain.BoardType.BoardType", b => + { + b.Navigation("BoardsList"); + + b.Navigation("EvidencesList"); + + b.Navigation("MasterPetitionsList"); + + b.Navigation("PetitionsList"); + }); + + modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b => + { + b.Navigation("Employers"); + }); + + modelBuilder.Entity("Company.Domain.ContractAgg.Contract", b => + { + b.Navigation("WorkingHoursList"); + }); + + modelBuilder.Entity("Company.Domain.CrossJobAgg.CrossJob", b => + { + b.Navigation("CrossJobItemsList"); + }); + + modelBuilder.Entity("Company.Domain.CrossJobGuildAgg.CrossJobGuild", b => + { + b.Navigation("CrossJobList"); + }); + + modelBuilder.Entity("Company.Domain.DateSalaryAgg.DateSalary", b => + { + b.Navigation("DateSalaryItemList"); + }); + + modelBuilder.Entity("Company.Domain.EmployeeAgg.Employee", b => + { + b.Navigation("ClientEmployeeWorkshopList"); + + b.Navigation("Contracts"); + + b.Navigation("EmployeeChildrenList"); + + b.Navigation("EmployeeInsuranceRecords"); + + b.Navigation("InsuranceEmployeeInfo"); + + b.Navigation("LeftWorkInsurances"); + + b.Navigation("LeftWorks"); + + b.Navigation("PersonnelCodeList"); + }); + + modelBuilder.Entity("Company.Domain.Evidence.Evidence", b => + { + b.Navigation("EvidenceDetailsList"); + }); + + modelBuilder.Entity("Company.Domain.File1.File1", b => + { + b.Navigation("BoardsList"); + + b.Navigation("EvidencesList"); + + b.Navigation("FileAlertsList"); + + b.Navigation("FileAndFileEmployers"); + + b.Navigation("MasterPetitionsList"); + + b.Navigation("PetitionsList"); + }); + + modelBuilder.Entity("Company.Domain.FileEmployerAgg.FileEmployer", b => + { + b.Navigation("FileAndFileEmployers"); + }); + + modelBuilder.Entity("Company.Domain.FileState.FileState", b => + { + b.Navigation("FileAlertsList"); + }); + + modelBuilder.Entity("Company.Domain.FileTiming.FileTiming", b => + { + b.Navigation("FileStates"); + }); + + modelBuilder.Entity("Company.Domain.FinancialStatmentAgg.FinancialStatment", b => + { + b.Navigation("FinancialTransactionList"); + }); + + modelBuilder.Entity("Company.Domain.GroupPlanAgg.GroupPlan", b => + { + b.Navigation("GroupPlanJobItems"); + }); + + modelBuilder.Entity("Company.Domain.HolidayAgg.Holiday", b => + { + b.Navigation("HolidayItems"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContract", b => + { + b.Navigation("ContactInfoList"); + }); + + modelBuilder.Entity("Company.Domain.InsurancJobAgg.InsuranceJob", b => + { + b.Navigation("InsuranceJobItemList"); + }); + + modelBuilder.Entity("Company.Domain.InsuranceJobItemAgg.InsuranceJobItem", b => + { + b.Navigation("InsuranceJobAndJobs"); + }); + + modelBuilder.Entity("Company.Domain.InsuranceListAgg.InsuranceList", b => + { + b.Navigation("InsuranceListWorkshops"); + }); + + modelBuilder.Entity("Company.Domain.JobAgg.Job", b => + { + b.Navigation("ContractsList"); + + b.Navigation("CrossJobItemsList"); + + b.Navigation("InsuranceJobAndJobs"); + }); + + modelBuilder.Entity("Company.Domain.MandatoryHoursAgg.MandatoryHours", b => + { + b.Navigation("Contracts"); + }); + + modelBuilder.Entity("Company.Domain.MasterPetition.MasterPetition", b => + { + b.Navigation("MasterPenaltyTitlesList"); + + b.Navigation("MasterWorkHistoriesList"); + }); + + modelBuilder.Entity("Company.Domain.ModuleAgg.EntityModule", b => + { + b.Navigation("EntityModuleTextManagers"); + }); + + modelBuilder.Entity("Company.Domain.OriginalTitleAgg.EntityOriginalTitle", b => + { + b.Navigation("Subtitles"); + }); + + modelBuilder.Entity("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", b => + { + b.Navigation("PaymentToEmployeeItemList"); + }); + + modelBuilder.Entity("Company.Domain.PercentageAgg.Percentage", b => + { + b.Navigation("DateSalaryItemList"); + }); + + modelBuilder.Entity("Company.Domain.Petition.Petition", b => + { + b.Navigation("PenaltyTitlesList"); + + b.Navigation("WorkHistoriesList"); + }); + + modelBuilder.Entity("Company.Domain.RepresentativeAgg.Representative", b => + { + b.Navigation("ContractingParties"); + + b.Navigation("FileEmployeeList"); + + b.Navigation("FileEmployerList"); + }); + + modelBuilder.Entity("Company.Domain.RollCallEmployeeAgg.RollCallEmployee", b => + { + b.Navigation("EmployeesStatus"); + }); + + modelBuilder.Entity("Company.Domain.SubtitleAgg.EntitySubtitle", b => + { + b.Navigation("Chapters"); + + b.Navigation("Subtitles"); + }); + + modelBuilder.Entity("Company.Domain.TaxLeftWorkCategoryAgg.TaxLeftWorkCategory", b => + { + b.Navigation("TaxLeftWorkItemList"); + }); + + modelBuilder.Entity("Company.Domain.TextManagerAgg.EntityTextManager", b => + { + b.Navigation("EntityModuleTextManagers"); + }); + + modelBuilder.Entity("Company.Domain.WorkingHoursAgg.WorkingHours", b => + { + b.Navigation("WorkingHoursItemsList"); + }); + + modelBuilder.Entity("Company.Domain.WorkingHoursTempAgg.WorkingHoursTemp", b => + { + b.Navigation("WorkingHoursTempItemList"); + }); + + modelBuilder.Entity("Company.Domain.WorkshopAgg.Workshop", b => + { + b.Navigation("Checkouts"); + + b.Navigation("ClientEmployeeWorkshopList"); + + b.Navigation("Contracts2"); + + b.Navigation("EmployeeInsuranceRecords"); + + b.Navigation("InsuranceListWorkshops"); + + b.Navigation("InsuranceWorkshopInfo"); + + b.Navigation("Insurances"); + + b.Navigation("LeftWorkInsurances"); + + b.Navigation("LeftWorks"); + + b.Navigation("PersonnelCodeList"); + + b.Navigation("RollCallServicesList"); + + b.Navigation("TaxLeftWorkCategoryList"); + + b.Navigation("WorkshopEmployers"); + }); + + modelBuilder.Entity("Company.Domain.WorkshopPlanAgg.WorkshopPlan", b => + { + b.Navigation("GroupPlans"); + + b.Navigation("WorkshopPlanEmployees"); + }); + + modelBuilder.Entity("Company.Domain.YearlySalaryAgg.YearlySalary", b => + { + b.Navigation("Contracts"); + + b.Navigation("YearlySalaryItemsList"); + }); + + modelBuilder.Entity("Company.Domain.empolyerAgg.Employer", b => + { + b.Navigation("Contracts"); + + b.Navigation("WorkshopEmployers"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/CompanyManagment.EFCore/Migrations/20240828122337_RollCallEmployeeStatus.cs b/CompanyManagment.EFCore/Migrations/20240828122337_RollCallEmployeeStatus.cs new file mode 100644 index 00000000..68d668db --- /dev/null +++ b/CompanyManagment.EFCore/Migrations/20240828122337_RollCallEmployeeStatus.cs @@ -0,0 +1,48 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace CompanyManagment.EFCore.Migrations +{ + /// + public partial class RollCallEmployeeStatus : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "RollCallEmployeesStatus", + columns: table => new + { + id = table.Column(type: "bigint", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + RollCallEmployeeId = table.Column(type: "bigint", nullable: false), + StartDate = table.Column(type: "datetime2", nullable: false), + EndDate = table.Column(type: "datetime2", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_RollCallEmployeesStatus", x => x.id); + table.ForeignKey( + name: "FK_RollCallEmployeesStatus_RollCallEmployees_RollCallEmployeeId", + column: x => x.RollCallEmployeeId, + principalTable: "RollCallEmployees", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_RollCallEmployeesStatus_RollCallEmployeeId", + table: "RollCallEmployeesStatus", + column: "RollCallEmployeeId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "RollCallEmployeesStatus"); + } + } +} diff --git a/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs b/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs index 15f9987b..14583ae2 100644 --- a/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs +++ b/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs @@ -3389,6 +3389,30 @@ namespace CompanyManagment.EFCore.Migrations b.ToTable("RollCallEmployees", (string)null); }); + modelBuilder.Entity("Company.Domain.RollCallEmployeeStatusAgg.RollCallEmployeeStatus", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("RollCallEmployeeId") + .HasColumnType("bigint"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.HasIndex("RollCallEmployeeId"); + + b.ToTable("RollCallEmployeesStatus"); + }); + modelBuilder.Entity("Company.Domain.RollCallPlanAgg.RollCallPlan", b => { b.Property("id") @@ -5146,6 +5170,17 @@ namespace CompanyManagment.EFCore.Migrations b.Navigation("Board"); }); + modelBuilder.Entity("Company.Domain.RollCallEmployeeStatusAgg.RollCallEmployeeStatus", b => + { + b.HasOne("Company.Domain.RollCallEmployeeAgg.RollCallEmployee", "RollCallEmployee") + .WithMany("EmployeesStatus") + .HasForeignKey("RollCallEmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("RollCallEmployee"); + }); + modelBuilder.Entity("Company.Domain.RollCallServiceAgg.RollCallService", b => { b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") @@ -5503,6 +5538,11 @@ namespace CompanyManagment.EFCore.Migrations b.Navigation("FileEmployerList"); }); + modelBuilder.Entity("Company.Domain.RollCallEmployeeAgg.RollCallEmployee", b => + { + b.Navigation("EmployeesStatus"); + }); + modelBuilder.Entity("Company.Domain.SubtitleAgg.EntitySubtitle", b => { b.Navigation("Chapters"); diff --git a/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs b/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs index 59b747a2..94c84d53 100644 --- a/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs @@ -1,9 +1,12 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; +using _0_Framework.Application; using _0_Framework.InfraStructure; using Company.Domain.RollCallEmployeeAgg; using CompanyManagment.App.Contracts.RollCallEmployee; +using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; namespace CompanyManagment.EFCore.Repository; @@ -11,9 +14,14 @@ namespace CompanyManagment.EFCore.Repository; public class RollCallEmployeeRepository : RepositoryBase, IRollCallEmployeeRepository { private readonly CompanyContext _context; - public RollCallEmployeeRepository(CompanyContext context) : base(context) + private readonly IPasswordHasher _passwordHasher; + private readonly IWebHostEnvironment _webHostEnvironment; + + public RollCallEmployeeRepository(CompanyContext context, IPasswordHasher passwordHasher, IWebHostEnvironment webHostEnvironment) : base(context) { _context = context; + _passwordHasher = passwordHasher; + _webHostEnvironment = webHostEnvironment; } public List GetByWorkshopId(long workshopId) @@ -46,30 +54,152 @@ public class RollCallEmployeeRepository : RepositoryBase public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId) { - return _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel() + return _context.RollCallEmployees.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new RollCallEmployeeViewModel() { Id = x.id, WorkshopId = x.WorkshopId, EmployeeFullName = x.EmployeeFullName, IsActiveString = x.IsActiveString, HasUploadedImage = x.HasUploadedImage - }).FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId); + }).FirstOrDefault(); } public List GetPersonnelRollCallList(long workshopId) { - var nowFa = DateTime.Now; - var employee = _context.Employees.Include(x => x.LeftWorks).Where(l => l.LeftWorks.Any(c => c.StartWorkDate <= nowFa && c.LeftWorkDate > nowFa && c.WorkshopId == workshopId)); + //var nowFa = DateTime.Now; + //var employee = _context.Employees.Include(x => x.LeftWorks).Where(l => l.LeftWorks.Any(c => c.StartWorkDate <= nowFa && c.LeftWorkDate > nowFa && c.WorkshopId == workshopId)); - return employee.Select(x => new RollCallEmployeeViewModel + //return employee.Select(x => new RollCallEmployeeViewModel + //{ + // WorkshopId = workshopId, + // EmployeeId = x.id, + // EmployeeFullName= x.FName + ' ' + x.LName, + // NationalCode = x.NationalCode, + // IsActiveString = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.IsActiveString == "true") ? "true" : "false", + // HasUploadedImage = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.HasUploadedImage == "true") ? "true" : "false", + //}).ToList(); + + var leftDate = new DateTime(2121, 3, 21); + var join = new List(); + var contractLeftWork = _context.LeftWorkList.Select(x => new RollCallEmployeeViewModel() { - WorkshopId = workshopId, - EmployeeId = x.id, - EmployeeFullName= x.FName + ' ' + x.LName, - NationalCode = x.NationalCode, - IsActiveString = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.IsActiveString == "true") ? "true" : "false", - HasUploadedImage = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.HasUploadedImage == "true") ? "true" : "false", + WorkshopId = x.WorkshopId, + EmployeeId = x.EmployeeId, + PersonName = x.EmployeeFullName, + PersonelCode = 0, + ContractPerson = true, + ContractLeft = x.LeftWorkDate != leftDate, + StartWork = x.StartWorkDate + }).Where(x => x.WorkshopId == workshopId).OrderByDescending(x => x.StartWork).ToList(); + + contractLeftWork = contractLeftWork.Select(x => new RollCallEmployeeViewModel() + { + WorkshopId = x.WorkshopId, + EmployeeId = x.EmployeeId, + PersonName = x.PersonName, + PersonelCode = _context.PersonnelCodeSet.Any(p => p.EmployeeId == x.EmployeeId && p.WorkshopId == x.WorkshopId) ? + _context.PersonnelCodeSet.FirstOrDefault(p => p.EmployeeId == x.EmployeeId && p.WorkshopId == x.WorkshopId)!.PersonnelCode : 0, + ContractPerson = true, + ContractLeft = x.ContractLeft, + StartWork = x.StartWork }).ToList(); + + var insuranceLeftWork = _context.LeftWorkInsuranceList.Select(x => new RollCallEmployeeViewModel() + { + WorkshopId = x.WorkshopId, + EmployeeId = x.EmployeeId, + PersonName = x.EmployeeFullName, + PersonelCode = 0, + InsurancePerson = true, + InsurancetLeft = x.LeftWorkDate != null, + StartWork = x.StartWorkDate + }).Where(x => x.WorkshopId == workshopId).OrderByDescending(x => x.StartWork).ToList(); + insuranceLeftWork = insuranceLeftWork.Select(x => new RollCallEmployeeViewModel() + { + WorkshopId = x.WorkshopId, + EmployeeId = x.EmployeeId, + PersonName = x.PersonName, + PersonelCode = _context.PersonnelCodeSet.Any(p => p.EmployeeId == x.EmployeeId && p.WorkshopId == x.WorkshopId) ? + _context.PersonnelCodeSet.FirstOrDefault(p => p.EmployeeId == x.EmployeeId && p.WorkshopId == x.WorkshopId)!.PersonnelCode : 0, + InsurancePerson = true, + InsurancetLeft = x.InsurancetLeft, + StartWork = x.StartWork + }).ToList(); + + + var joinEqualList = contractLeftWork.Join(insuranceLeftWork, x => x.EmployeeId, c => c.EmployeeId, + (first, second) => new RollCallEmployeeViewModel + { + EmployeeId = first.EmployeeId, + ContractPerson = first.ContractPerson, + ContractLeft = first.ContractLeft, + InsurancePerson = second.InsurancePerson, + InsurancetLeft = second.InsurancetLeft + }).ToList(); + + if (contractLeftWork.Any() && !insuranceLeftWork.Any()) + { + join = contractLeftWork.ToList(); + } + else if (!contractLeftWork.Any() && insuranceLeftWork.Any()) + { + join = insuranceLeftWork.ToList(); + } + else if (contractLeftWork.Any() && insuranceLeftWork.Any()) + { + join = contractLeftWork.Concat(insuranceLeftWork).ToList(); + } + + if (joinEqualList.Count == 0) + return join; + + join = join.GroupBy(x => x.EmployeeId).Select(d => d.First()).ToList(); + + var finalList = join.Select(x => new RollCallEmployeeViewModel() + { + WorkshopId = x.WorkshopId, + EmployeeId = x.EmployeeId, + PersonName = x.PersonName, + PersonelCode = x.PersonelCode, + ContractPerson = joinEqualList.Any(c => c.EmployeeId == x.EmployeeId) ? joinEqualList.FirstOrDefault(c => c.EmployeeId == x.EmployeeId)!.ContractPerson : x.ContractPerson, + InsurancePerson = joinEqualList.Any(c => c.EmployeeId == x.EmployeeId) ? joinEqualList.FirstOrDefault(c => c.EmployeeId == x.EmployeeId)!.InsurancePerson : x.InsurancePerson, + ContractLeft = joinEqualList.Any(c => c.EmployeeId == x.EmployeeId) ? joinEqualList.FirstOrDefault(c => c.EmployeeId == x.EmployeeId)!.ContractLeft : x.ContractLeft, + InsurancetLeft = joinEqualList.Any(c => c.EmployeeId == x.EmployeeId) ? joinEqualList.FirstOrDefault(c => c.EmployeeId == x.EmployeeId)!.InsurancetLeft : x.InsurancetLeft, + Black = false, + }).ToList(); + + var f = finalList.GroupBy(x => x.EmployeeId).Select(x => x.First()).ToList(); + + var res = f.Select(x => new RollCallEmployeeViewModel + { + WorkshopId = x.WorkshopId, + EmployeeId = x.EmployeeId, + Id = _context.RollCallEmployees.FirstOrDefault(r => r.EmployeeId == x.EmployeeId && r.WorkshopId == workshopId) == null ? 0 : + _context.RollCallEmployees.FirstOrDefault(r => r.EmployeeId == x.EmployeeId && r.WorkshopId == workshopId).id, + EmployeeFullName = x.PersonName, + EmployeeSlug = _passwordHasher.SlugHasher(x.EmployeeId), + NationalCode = _context.Employees.FirstOrDefault(e => e.id == x.EmployeeId)?.NationalCode, + PersonName = x.PersonName, + IsActiveString = _context.RollCallEmployees.Any(r => r.EmployeeId == x.EmployeeId && r.WorkshopId == workshopId && r.IsActiveString == "true") ? "true" : "false", + HasUploadedImage = _context.RollCallEmployees.Any(r => r.EmployeeId == x.EmployeeId && r.WorkshopId == workshopId && r.HasUploadedImage == "true") ? "true" : "false", + ImagePath = (System.IO.File.Exists(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", x.WorkshopId.ToString(), x.EmployeeId.ToString(), "1.jpg"))) + ? Tools.ResizeImage(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", x.WorkshopId.ToString(), x.EmployeeId.ToString(), "1.jpg"), 150, 150) + : "", + // ImagePath = x.HasUploadedImage == "true" ? Convert.ToBase64String(System.IO.File.ReadAllBytes($"{_webHostEnvironment.ContentRootPath}\\Faces\\{x.WorkshopId}\\{x.EmployeeId}\\1.jpg")) : "", + ContractPerson = x.ContractPerson, + InsurancePerson = x.InsurancePerson, + ContractLeft = x.ContractLeft, + InsurancetLeft = x.InsurancetLeft, + Black = ((x.ContractPerson && x.InsurancePerson && x.InsurancetLeft && x.ContractLeft) || (x.ContractPerson && !x.InsurancePerson && x.ContractLeft) || (x.InsurancePerson && !x.ContractPerson && x.InsurancetLeft)) ? true : false + }).ToList(); + + return res.Where(x => !x.Black).ToList(); + } + + public RollCallEmployee GetWithRollCallStatus(long id) + { + return _context.RollCallEmployees.Include(x => x.EmployeesStatus) + .FirstOrDefault(x => x.id == id); } public int activedPerson(long workshopId) diff --git a/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs b/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs new file mode 100644 index 00000000..e35cc5c1 --- /dev/null +++ b/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs @@ -0,0 +1,29 @@ +using _0_Framework.Application; +using _0_Framework.InfraStructure; +using Company.Domain.RollCallEmployeeStatusAgg; +using CompanyManagment.App.Contracts.RollCallEmployeeStatus; +using System.Collections.Generic; +using System.Linq; + +namespace CompanyManagment.EFCore.Repository +{ + public class RollCallEmployeeStatusRepository : RepositoryBase, IRollCallEmployeeStatusRepository + { + private readonly CompanyContext _context; + public RollCallEmployeeStatusRepository(CompanyContext context) : base(context) + { + _context = context; + } + + public List GetAll() + { + return _context.RollCallEmployeesStatus.Select(x => new RollCallEmployeeStatusViewModel() + { + StartDate = x.StartDate.ToFarsi(), + EndDate = x.EndDate.ToFarsi(), + Id = x.id + }).ToList(); + + } + } +} diff --git a/CompanyManagment.EFCore/Repository/RollCallRepository.cs b/CompanyManagment.EFCore/Repository/RollCallRepository.cs index 6231363f..18c1a62a 100644 --- a/CompanyManagment.EFCore/Repository/RollCallRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallRepository.cs @@ -1,9 +1,12 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; +using _0_Framework.Application; using _0_Framework.InfraStructure; using Company.Domain.RollCallAgg; using CompanyManagment.App.Contracts.RollCall; +using Microsoft.EntityFrameworkCore; namespace CompanyManagment.EFCore.Repository; @@ -25,11 +28,321 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos throw new NotImplementedException(); } + public List GetCurrentDay(RollCallSearchModel searchModel) + { + //PersonnelCode = _context.PersonnelCodeSet.FirstOrDefault(e => e.EmployeeId == x.EmployeeId && e.WorkshopId == x.WorkshopId).PersonnelCode.ToString(), + var rawQuery = _context.RollCalls.Where(x => x.WorkshopId == searchModel.WorkshopId && x.StartDate >= DateTime.Now.Date).Select(x => new RollCallViewModel() + { + EmployeeId = x.EmployeeId, + WorkshopId = x.WorkshopId, + EmployeeFullName = x.EmployeeFullName, + Id = x.id, + Month = x.Month, + Year = x.Year, + StartDate = x.StartDate, + EndDate = x.EndDate, + PersonnelCode = _context.PersonnelCodeSet + .FirstOrDefault(a => a.EmployeeId == x.EmployeeId && a.WorkshopId == x.WorkshopId).PersonnelCode + .ToString(), + }); + var groupedQuery = rawQuery.GroupBy(x => x.EmployeeId).Select(x => new RollCallViewModel() + { + EmployeeId = x.First().EmployeeId, + WorkshopId = x.First().WorkshopId, + EmployeeFullName = x.First().EmployeeFullName, + Id = x.First().Id, + Month = x.First().Month, + Year = x.First().Year, + RollCallTimesList = x.Select(d => new RollCallTimeViewModel() + { + StartDate = d.StartDate != null ? d.StartDate.Value.ToString("HH:mm") : "--:--", + EndDate = d.EndDate != null ? d.EndDate.Value.ToString("HH:mm") : "--:--" + }).ToList(), + PersonnelCode = x.First().PersonnelCode, + }).AsEnumerable(); + var orderedEnum = groupedQuery.OrderBy(x => Convert.ToInt32(x.PersonnelCode)); + + var query = orderedEnum.Select(x => new RollCallViewModel() + { + EmployeeId = x.EmployeeId, + WorkshopId = x.WorkshopId, + EndDate = x.EndDate, + StartDate = x.StartDate, + Id = x.Id, + EmployeeFullName = x.EmployeeFullName, + Month = x.Month, + Year = x.Year, + RollCallTimesList = x.RollCallTimesList, + PersonnelCode = x.PersonnelCode + }); + + return query.Skip(searchModel.PageIndex).Take(30).ToList(); + } + public List Search(RollCallSearchModel searchModel) { throw new NotImplementedException(); } + #region Pooya + //حضور غیاب فیش حقوقی + public List GetEmployeeRollCallsForDuration(long employeeId, long workshopId, DateTime startMonthDay, DateTime endMonthDay) + { + + var rollCalls = _context.RollCalls.Where(x => + x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null && + x.StartDate.Value.Date >= startMonthDay && x.StartDate.Value.Date <= endMonthDay).ToList(); + + + var year = Convert.ToInt32(startMonthDay.ToFarsi().Substring(0, 4)); + var month = Convert.ToInt32(startMonthDay.ToFarsi().Substring(5, 2)); + var firstDayOfCurrentMonth = new DateTime(year, month, 1, new PersianCalendar()); + + + if (month == 12) + { + year += 1; + month = 1; + } + else + month += 1; + + var nextMonthDate = new DateTime(year, month, 1, new PersianCalendar()); + + var lastDayOfCurrentMonth = nextMonthDate.AddDays(-1); + + int dateRange = (int)(lastDayOfCurrentMonth - firstDayOfCurrentMonth).TotalDays + 1; + + //all the dates from start to end, to be compared with present days to get absent dates + var completeDaysList = Enumerable.Range(0, dateRange).Select(offset => startMonthDay.AddDays(offset).Date); + + var absentRecords = completeDaysList + .ExceptBy(rollCalls.Select(x => x.StartDate!.Value.Date), y => y.Date.Date) + .Select(x => new CheckoutDailyRollCallViewModel() + { + StartDate = null, + EndDate = null, + DateTimeGr = x.Date.Date, + DayOfWeek = x.Date.DayOfWeek.ToString(), + TotalWorkingHours = Convert.ToString(0), + RollCallDateFa = x.Date.ToFarsi() + }); + + var presentDays = rollCalls.GroupBy(x => x.StartDate!.Value.Date).Select(x => new CheckoutDailyRollCallViewModel() + { + StartDate = x.Min(y => y.StartDate)!.Value.ToString("HH:mm"), + EndDate = x.Max(y => y.EndDate)!.Value.ToString("HH:mm"), + TotalWorkingHours = x.Where(y => y.EndDate != null).Sum(y => (y.EndDate - y.StartDate)!.Value.TotalHours).ToString("F2"), + DayOfWeek = x.Key.DayOfWeek.DayOfWeeKToPersian(), + RollCallDateFa = x.Key.Date.ToFarsi(), + DateTimeGr = x.Key.Date, + IsSliced = x.Count() > 1 + }); + + + + return presentDays.Concat(absentRecords).OrderBy(x => x.DateTimeGr).ToList(); + + } + + + //سوابق حضور غیاب کارگاه + public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel) + { + + //initialize + + DateTime searchDurationStart = DateTime.Now.AddDays(-1).Date; + DateTime searchDurationEnd = searchDurationStart.AddDays(-16); + + + + //override if user has entered inputs (dates must be validated in the application layer) + if (!string.IsNullOrWhiteSpace(searchModel.StarDateFa) && !string.IsNullOrWhiteSpace(searchModel.StarDateFa)) + { + searchDurationStart = searchModel.StarDateFa.ToGeorgianDateTime().Date; + searchDurationEnd = searchModel.EndDateFa.ToGeorgianDateTime().AddDays(-1).Date; + } + + + + else + if (!string.IsNullOrWhiteSpace(searchModel.ExactDateFa)) + { + searchDurationStart = searchModel.ExactDateFa.ToGeorgianDateTime().Date; + searchDurationEnd = searchModel.ExactDateFa.ToGeorgianDateTime().AddDays(-1).Date; + } + + + if (searchDurationStart < searchDurationEnd) + return new(); + + + + DateTime dateIndex = searchDurationStart.AddDays(-1 * (searchModel.DateIndex)).Date; + + if (dateIndex <= searchDurationEnd) + return new(); + + + //get leaves for workshop that have been activated in dateIndex date + var leavesQuery = _context.LeaveList.Where(x => x.WorkshopId == searchModel.WorkshopId && + x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) && + x.EndLeave.Date >= dateIndex && x.StartLeave.Date <= dateIndex); + + //roll calls for current workshop where shift start is in dateIndex date (filters today's shifts) + var rollCallsQuery = _context.RollCalls + .Where(x => x.WorkshopId == searchModel.WorkshopId && x.StartDate.HasValue && x.EndDate.HasValue && x.StartDate < DateTime.Now.Date && + x.StartDate.Value.Date == dateIndex.Date); + + + //get active employees of workshop in dateIndex date + var activeEmployeesQuery = + _context.RollCallEmployees.Include(x => x.EmployeesStatus) + .Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeesStatus.Any(y => y.EndDate.Date >= dateIndex && y.StartDate.Date <= dateIndex)); + + + + + + + if (searchModel.EmployeeId > 0) + { + rollCallsQuery = rollCallsQuery.Where(x => x.EmployeeId == searchModel.EmployeeId); + activeEmployeesQuery = activeEmployeesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId); + leavesQuery = leavesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId); + } + + + var personnelCodeList = + _context.PersonnelCodeSet.Where(x => activeEmployeesQuery.Any(y => y.EmployeeId == x.EmployeeId)); + var rollCallsList = rollCallsQuery.ToList(); + var activatedEmployeesList = activeEmployeesQuery.ToList(); + var leavesList = leavesQuery.ToList(); + + rollCallsList = rollCallsList.Where(x => leavesList.All(y => y.EmployeeId != x.EmployeeId)).ToList(); + var result = new RollCallsByDateViewModel() + { + DateGr = dateIndex, + DateFa = dateIndex.ToFarsi(), + ActiveEmployees = activatedEmployeesList.Select(x => + { + var leave = leavesList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId); + var employeeRollCallsForDate = rollCallsList.Where(y => y.EmployeeId == x.EmployeeId).ToList(); + + return new RollCallViewModel() + { + EmployeeFullName = x.EmployeeFullName, + EmployeeId = x.EmployeeId, + Reason = leave == null ? "" : $"{leave.LeaveType}-{leave.PaidLeaveType}", + RollCallTimesList = employeeRollCallsForDate.Select(y => new RollCallTimeViewModel() + { + EndDate = y.EndDate!.Value.ToString("HH:mm:ss"), + StartDate = y.StartDate!.Value.ToString("HH:mm:ss") + }), + TotalWorkingHours = employeeRollCallsForDate.Sum(y => (y.EndDate!.Value - y.StartDate!.Value).TotalHours), + PersonnelCode = personnelCodeList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.PersonnelCode.ToString() + }; + }) + }; + + return result; + } + + + + //گزارش آنلاین حضور غیاب کارگاه + public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId) + { + //get today's roll calls + var rollCallsQuery = _context.RollCalls.Where(x => + x.WorkshopId == workshopId && x.StartDate.Value.Date == DateTime.Now.Date); + + //get active leaves for workshop which are active today and accepted and are either روزانه and استحقاقی or استعلاجی + var leaves = _context.LeaveList.Where(x => x.WorkshopId == workshopId && x.EndLeave.Date >= DateTime.Now.Date && x.StartLeave.Date <= DateTime.Now.Date && + x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه"))); + + + //get currently working employees with leftWork table + var workingEmployees = + _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.StartWorkDate < DateTime.Now.Date && x.LeftWorkDate.Date > DateTime.Now.Date); + + + + //get activated employees + var activeEmployees = + _context.RollCallEmployees.Include(x => x.EmployeesStatus) + .Where(x => x.WorkshopId == workshopId && x.EmployeesStatus.Any(y => + y.StartDate.Date <= DateTime.Now.Date && + y.EndDate.Date >= DateTime.Now.Date)); + + + + var mustBePresent = activeEmployees.Where(x => !leaves.Any(y => y.EmployeeId == x.EmployeeId) && + workingEmployees.Any(y => y.EmployeeId == x.EmployeeId)); + + + + + //filter roll calls for active and currently working employees only + var filteredRollCallQuery = rollCallsQuery.Where(x => mustBePresent + .Any(y => x.EmployeeId == y.EmployeeId)) + .Where(x => workingEmployees.Any(y => y.EmployeeId == x.EmployeeId)).ToList(); + + + + + //presents list is ready + var presentEmployees = filteredRollCallQuery.GroupBy(x => x.EmployeeId).Select(x => new RollCallViewModel() + { + EmployeeFullName = x.FirstOrDefault()!.EmployeeFullName, + EmployeeId = x.FirstOrDefault()!.EmployeeId, + + TotalWorkingHours = x.Where(y => y.EndDate != null).Sum(y => (y.EndDate!.Value - y.StartDate!.Value).TotalHours), + RollCallTimesList = x.Select(y => new RollCallTimeViewModel() + { + StartDate = y.StartDate!.Value.ToString("HH:mm:ss"), + EndDate = y.EndDate?.ToString("HH:mm:ss") + }).ToList() + + + }).ToList(); + + //absent ones are those who are active and not on the roll call list + var absentsQuery = activeEmployees.AsEnumerable() + .ExceptBy(presentEmployees.Select(x => x.EmployeeId), e => e.EmployeeId).ToList(); + + + + //get today's active leaves + var employeesWithLeave = _context.LeaveList.Where(x => + x.EndLeave.Date >= DateTime.Now.Date && x.StartLeave.Date <= DateTime.Now.Date && + x.WorkshopId == workshopId && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه"))) + .AsEnumerable() + .Where(x => absentsQuery.Any(y => y.EmployeeId == x.EmployeeId)) + .Select(x => new { x.EmployeeId, x.LeaveType }).ToList(); + + //join leave and absents + var absentsViewModel = absentsQuery.Select(x => new AbsentEmployeeViewModel() + { + PersonnelCode = _context.PersonnelCodeSet + .FirstOrDefault(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == workshopId) + !.PersonnelCode.ToString(), + EmployeeId = x.EmployeeId, + EmployeeFullName = x.EmployeeFullName, + Reason = employeesWithLeave.Any(y => y.EmployeeId == x.EmployeeId) + ? employeesWithLeave.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)!.LeaveType + : "" + }).ToList(); + + return new CurrentDayRollCall() + { + AbsentEmployees = absentsViewModel.ToList(), + PresentEmployees = presentEmployees.ToList() + }; + } + + #endregion public long Flag(long employeeId, long workshopId) { var checkDate = DateTime.Now.AddDays(-3); diff --git a/PersonalContractingParty.Config/PersonalBootstrapper.cs b/PersonalContractingParty.Config/PersonalBootstrapper.cs index 40d0a944..4593fe67 100644 --- a/PersonalContractingParty.Config/PersonalBootstrapper.cs +++ b/PersonalContractingParty.Config/PersonalBootstrapper.cs @@ -164,6 +164,8 @@ using Company.Domain.TaxJobCategoryAgg; using Company.Domain.WorkshopAccountAgg; using CompanyManagment.App.Contracts.ReportClient; using CompanyManagment.App.Contracts.TaxJobCategory; +using Company.Domain.RollCallEmployeeStatusAgg; +using CompanyManagment.App.Contracts.RollCallEmployeeStatus; namespace PersonalContractingParty.Config; @@ -346,6 +348,9 @@ public class PersonalBootstrapper services.AddTransient(); services.AddTransient(); services.AddTransient(); + + services.AddTransient(); + services.AddTransient(); //=========End Of Main==================================== //---File Project------------------------------------ diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml index 5f282702..51ea8e58 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml @@ -1 +1,262 @@ - \ No newline at end of file +@page +@model ServiceHost.Areas.Client.Pages.Company.RollCall.CaseHistoryModel +@using Version = _0_Framework.Application.Version + +@{ + ViewData["Title"] = " - " + "سوابق حضور و غیاب"; + int index = 1; + int i = 0; +} + +@section Styles { + + + + + + + + +} + + +
+ +
+
+
+
+

سوابق حضور و غیاب

+
@Model.WorkshopFullName
+
+ +
+
+
+ +
+
+
+ +
+ +
+
+ + +
+
+ +
+ @if (@Model.RollCallViewModels.Any()) + { +
+
+ +
+
ردیف
+
نام پرسنل
+
شماره پرسنلی
+
تاریخ
+
ساعت ورود
+
ساعت خروج
+
+ + @*
تاخیر در ورود
+
تعجیل در خروج
*@ +
+ + @foreach (var item in Model.RollCallViewModels) + { +
+
+
+ ردیف +
+
+
+ @(index++) +
+
+
+ +
+
نام پرسنل
+
+ @item.EmployeeFullName +
+
+ +
+
+
شماره پرسنلی:
+
@item.PersonnelCode
+
+
+ +
+
تاریخ
+
+ @item.DateFa +
+
+ +
+ @foreach (var itemTime in item.RollCallTimesList) + { +
ساعت ورود
+
+
@itemTime.StartDate
+
+ } +
+ +
+ @foreach (var itemTime in item.RollCallTimesList) + { +
ساعت خروج
+
+
@itemTime.EndDate
+
+ } +
+ +
+ + @*
*@ +
+
+ + + +
+
+
+
+
+
ساعت ورود
+ @foreach (var itemTime in item.RollCallTimesList) + { +
+
@itemTime.StartDate
+
+ } +
+
+
+
+
ساعت خروج
+ @foreach (var itemTime in item.RollCallTimesList) + { +
+
@itemTime.EndDate
+
+ } +
+
+ @*
+
+
تاخیر در ورود
+ @foreach (var itemTime in item.RollCallTimesList) + { +
+
@itemTime.StartDate
+
+ } +
+
+
+
+
تعجیل در خروج
+ @foreach (var itemTime in item.RollCallTimesList) + { +
+
@itemTime.StartDate
+
+ } +
+
*@ +
+
+
+ } + + +
+
+ } + else + { +
+
+ +
اطلاعاتی وجود ندارد.
+
+
+ } +
+
+
+
+ +@section Script { + + +} \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml.cs index cb1bf3c5..6bba3145 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml.cs @@ -50,7 +50,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall WorkshopId = workshopId, }; - //RollCallViewModels = _rollCallApplication.GetHistoryCase(searchModel); + RollCallViewModels = _rollCallApplication.GetHistoryCase(searchModel); return Page(); } else diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml index 5f282702..64cbde07 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml @@ -1 +1,197 @@ - \ No newline at end of file +@page +@model ServiceHost.Areas.Client.Pages.Company.RollCall.CurrentDayModel +@using Version = _0_Framework.Application.Version + +@{ + ViewData["Title"] = " - " + "لیست حضور و غیاب جاری"; + int index = 1; + int i = 0; +} + +@section Styles { + + + + + + + + + +} + + +
+ +
+
+
+
+

ساعات حضور و غیاب جاری

+
@Model.WorkshopFullName تاریخ امروز @Model.NowDate
+
+ +
+
+
+ + +
+
+ +
+ @if (@Model.RollCallViewModels.Any()) + { +
+
+ +
+
ردیف
+
نام پرسنل
+
شماره پرسنلی
+
ساعت ورود
+
ساعت خروج
+
+ + @*
تاخیر در ورود
+
تعجیل در خروج
*@ +
+ + @foreach (var item in Model.RollCallViewModels) + { +
+
+
+ ردیف +
+
+
+ @(index++) +
+
+
+ +
+
نام پرسنل
+
+ @item.EmployeeFullName +
+
+ +
+
+
شماره پرسنلی:
+
@item.PersonnelCode
+
+
+ +
+ @foreach (var itemTime in item.RollCallTimesList) + { +
ساعت ورود
+
+
@itemTime.StartDate
+
+ } +
+ +
+ @foreach (var itemTime in item.RollCallTimesList) + { +
ساعت خروج
+
+
@itemTime.EndDate
+
+ } +
+ +
+ + @*
*@ +
+
+ + + +
+
+
+
+
+
ساعت ورود
+ @foreach (var itemTime in item.RollCallTimesList) + { +
+
@itemTime.StartDate
+
+ } +
+
+
+
+
ساعت خروج
+ @foreach (var itemTime in item.RollCallTimesList) + { +
+
@itemTime.EndDate
+
+ } +
+
+ @*
+
+
تاخیر در ورود
+ @foreach (var itemTime in item.RollCallTimesList) + { +
+
@itemTime.StartDate
+
+ } +
+
+
+
+
تعجیل در خروج
+ @foreach (var itemTime in item.RollCallTimesList) + { +
+
@itemTime.StartDate
+
+ } +
+
*@ +
+
+
+ } + + +
+
+ } + else + { +
+
+ +
اطلاعاتی وجود ندارد.
+
+
+ } +
+
+
+
+ +@section Script { + + +} diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml.cs index bfad922f..3d33ab74 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml.cs @@ -52,7 +52,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall WorkshopId = workshopId, }; - //RollCallViewModels = _rollCallApplication.GetCurrentDay(searchModel); + RollCallViewModels = _rollCallApplication.GetCurrentDay(searchModel); return Page(); } else @@ -80,11 +80,11 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall WorkshopId = workshopId, }; - //var list= _rollCallApplication.GetCurrentDay(searchModel); + var list= _rollCallApplication.GetCurrentDay(searchModel); return new JsonResult(new { isSuccess = true, - + list }); } } diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml index c3d86341..4259508d 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml @@ -247,121 +247,12 @@ @section Script { - - + + } \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml index 0cf44117..487d5c17 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml @@ -307,40 +307,5 @@ @section Script { - - + } diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml.cs index 3af636d7..0f993815 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml.cs @@ -49,9 +49,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall if (rollCall != null) { var accountId = _authHelper.CurrentAccountId(); - //var cameraAccount = _cameraAccountApplication.HasCameraAccount(workshopId, accountId); - //if (cameraAccount) - // HasCameraAccount = "true"; + var cameraAccount = _cameraAccountApplication.HasCameraAccount(workshopId, accountId); + if (cameraAccount) + HasCameraAccount = "true"; CheckRollCallService = true; RollCallServicePersonnelActive = _rollCallEmployeeApplication.activedPerson(workshopId) > 0 ? "true" : "false"; @@ -122,10 +122,11 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall public IActionResult OnGetCheckAccount(string username) { - //var result = _cameraAccountApplication.CheckUsername(username); + var result = _cameraAccountApplication.CheckUsername(username); return new JsonResult(new { - + Success = result.IsSuccedded, + message = result.Message, }); } } diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalCameraAccount.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalCameraAccount.cshtml index 7ce75a96..55e47047 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalCameraAccount.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalCameraAccount.cshtml @@ -150,230 +150,9 @@ - \ No newline at end of file + var antiForgeryToken = $('@Html.AntiForgeryToken()').val(); + var checkAccountAjax = `@Url.Page("./Index", "CheckAccount")`; + var saveCameraAccountAjax = `@Url.Page("./Index", "SaveCameraAccount")`; + + \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalOTPAction.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalOTPAction.cshtml index 2581e93d..2824b0ff 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalOTPAction.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalOTPAction.cshtml @@ -178,262 +178,12 @@ - -@section Script -{ - -} -@* *@ \ No newline at end of file + var antiForgeryToken = $('@Html.AntiForgeryToken()').val(); + var checkCodeAjax = `@Url.Page("./Plans", "CheckCode")'`; + var saveServiceAjax = `@Url.Page("./Plans", "SaveService")`; + var saveCameraAccountUrl = `#showmodal=@Url.Page("./ Index", "SaveCameraAccount")`; + var computeMoneyByMountAjax = `@Url.Page("Plans", "ComputeMoneyByMount")`; + var sendSmsAjax = `@Url.Page("./Plans", "SendSms")`; + + \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalOTPActionFree.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalOTPActionFree.cshtml index 88ad3ee7..d212c34d 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalOTPActionFree.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalOTPActionFree.cshtml @@ -165,175 +165,10 @@ -@section Script -{ - -} \ No newline at end of file + var antiForgeryToken = $('@Html.AntiForgeryToken()').val(); + var checkCodeAjax = `@Url.Page("./Plans", "CheckCode")'`; + var saveServiceFreeAjax = `@Url.Page("./Plans", "SaveServiceFree")`; + var sendSmsAjax = `@Url.Page("./Plans", "SendSms")`; + + \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalTakeImages.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalTakeImages.cshtml index eee4cd45..fdd3bccf 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalTakeImages.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalTakeImages.cshtml @@ -1,158 +1,7 @@ @model CompanyManagment.App.Contracts.Workshop.TakePictureModel @{ int index = 1; - - + }
@@ -327,296 +176,7 @@ @* *@ - - \ No newline at end of file + \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/Plans.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/Plans.cshtml index e3f7074a..73d051fa 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/Plans.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/Plans.cshtml @@ -110,25 +110,9 @@ + } \ No newline at end of file diff --git a/ServiceHost/Faces/11/42961/1.jpg b/ServiceHost/Faces/11/42961/1.jpg new file mode 100644 index 00000000..66018426 Binary files /dev/null and b/ServiceHost/Faces/11/42961/1.jpg differ diff --git a/ServiceHost/Faces/11/42961/2.jpg b/ServiceHost/Faces/11/42961/2.jpg new file mode 100644 index 00000000..3aa98206 Binary files /dev/null and b/ServiceHost/Faces/11/42961/2.jpg differ diff --git a/ServiceHost/Faces/11/42986/1.jpg b/ServiceHost/Faces/11/42986/1.jpg new file mode 100644 index 00000000..805c260d Binary files /dev/null and b/ServiceHost/Faces/11/42986/1.jpg differ diff --git a/ServiceHost/Faces/11/42986/2.jpg b/ServiceHost/Faces/11/42986/2.jpg new file mode 100644 index 00000000..14bbe6ce Binary files /dev/null and b/ServiceHost/Faces/11/42986/2.jpg differ diff --git a/ServiceHost/ServiceHost.csproj b/ServiceHost/ServiceHost.csproj index 44c14fd5..cbda4dd3 100644 --- a/ServiceHost/ServiceHost.csproj +++ b/ServiceHost/ServiceHost.csproj @@ -447,6 +447,15 @@ + + + + + + + + + diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CaseHistory.css b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CaseHistory.css new file mode 100644 index 00000000..bd9d48ee --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CaseHistory.css @@ -0,0 +1,48 @@ +.tooltipfull-container { + cursor: pointer; + position: relative; + } + +.tooltipfull { + opacity: 0; + z-index: 99; + color: #fff; + display: grid; + font-size: 12px; + padding: 5px 10px; + border-radius: 8px; + background: #23a8a8; + border: 1px solid #23a8a8; + -webkit-transition: all .2s ease-in-out; + -moz-transition: all .2s ease-in-out; + -o-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; + -webkit-transform: scale(0); + -moz-transform: scale(0); + -o-transform: scale(0); + -ms-transform: scale(0); + transform: scale(0); + position: absolute; + right: -2px; + bottom: 30px; + white-space: nowrap; +} + +.tooltipfull-container:hover .tooltipfull, a:hover .tooltipfull { + opacity: 1; + -webkit-transform: scale(1); + -moz-transform: scale(1); + -o-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); +} + +.tooltipfull:before, .tooltipfull:after { + content: ''; + border-left: 10px solid transparent; + border-right: 10px solid transparent; + border-top: 10px solid #23a8a8; + position: absolute; + bottom: -10px; + right: 20px; +} \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CurrentDay.css b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CurrentDay.css new file mode 100644 index 00000000..d74badbb --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CurrentDay.css @@ -0,0 +1,48 @@ +.tooltipfull-container { + cursor: pointer; + position: relative; + } + +.tooltipfull { + opacity: 0; + z-index: 99; + color: #fff; + display: grid; + font-size: 12px; + padding: 5px 10px; + border-radius: 8px; + background: #23a8a8; + border: 1px solid #23a8a8; + -webkit-transition: all .2s ease-in-out; + -moz-transition: all .2s ease-in-out; + -o-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; + -webkit-transform: scale(0); + -moz-transform: scale(0); + -o-transform: scale(0); + -ms-transform: scale(0); + transform: scale(0); + position: absolute; + right: -2px; + bottom: 30px; + white-space: nowrap; +} + +.tooltipfull-container:hover .tooltipfull, a:hover .tooltipfull { + opacity: 1; + -webkit-transform: scale(1); + -moz-transform: scale(1); + -o-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); +} + +.tooltipfull:before, .tooltipfull:after { + content: ''; + border-left: 10px solid transparent; + border-right: 10px solid transparent; + border-top: 10px solid #23a8a8; + position: absolute; + bottom: -10px; + right: 20px; +} diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/ModalTakeImages.css b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/ModalTakeImages.css new file mode 100644 index 00000000..86bb07e8 --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/ModalTakeImages.css @@ -0,0 +1,149 @@ +.test { + width: 55px; + height: 10px; +} + +.panel-default > .panel-heading { + text-align: center; +} + +video { + border-radius: 10px; +} + + +@media (max-width: 992px) { + .modal-content { + padding: 0 !important; + } +} + +.md-modal { + /* margin: auto; + position: fixed; + top: 100px; + left: 0; + right: 0; + width: 50%; + max-width: 630px; + min-width: 320px; + height: auto; + z-index: 2000; + visibility: hidden; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + backface-visibility: hidden; */ + + + margin: auto; + position: fixed; + top: 70px; + left: 0; + right: 0; + width: 100%; + height: auto; + z-index: 2000; + visibility: hidden; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + backface-visibility: hidden; +} + +.md-show { + visibility: visible; +} + +.md-overlay { + position: fixed; + width: 100%; + height: 100%; + visibility: hidden; + top: 0; + left: 0; + z-index: 1000; + opacity: 0; + background: rgba(228, 240, 227, 0.8); + -webkit-transition: all 0.3s; + -moz-transition: all 0.3s; + transition: all 0.3s; +} + +.md-show ~ .md-overlay { + opacity: 1; + visibility: visible; +} + +.md-effect-12 .md-content { + -webkit-transform: scale(0.8); + -moz-transform: scale(0.8); + -ms-transform: scale(0.8); + transform: scale(0.8); + opacity: 0; + -webkit-transition: all 0.3s; + -moz-transition: all 0.3s; + transition: all 0.3s; +} + +.md-show.md-effect-12 ~ .md-overlay { + background-color: #e4f0e3; +} + +.md-effect-12 .md-content h3, +.md-effect-12 .md-content { + background: transparent; +} + +.md-show.md-effect-12 .md-content { + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); + opacity: 1; +} + +.image-show { + margin: 0 auto 8px auto; + border: 2px dashed #148b8b; + width: 200px; + height: 200px; + border-radius: 10px; + position: relative; +} + + .image-show button { + height: 100%; + width: 100%; + background: #17909040; + font-family: inherit; + position: absolute; + z-index: 3; + color: #fff; + font-weight: 900; + top: 0; + right: 0; + } + +.camera_close { + position: fixed; + top: -50px; + right: 10px; + background-color: #fff; + border-radius: 50px; + width: 42px; + height: 42px; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); +} + +/* video { + width: 100% !important; + height: 100% !important; + } */ + +video { + width: 100% !important; + height: 100% !important; + object-fit: cover !important; +} diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CaseHistory.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CaseHistory.js new file mode 100644 index 00000000..71fb977d --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CaseHistory.js @@ -0,0 +1,114 @@ +$(document).ready(function () { + $(".select2Option").select2({ + language: "fa", + dir: "rtl" + }); + + $('.loadingButton').on('click', function () { + var button = $(this); + var loadingDiv = button.find('.loading'); + loadingDiv.show(); + }); + + $(document).on('click', ".openAction", function () { + $(this).next().find(".operations-btns").slideToggle(500); + $(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500); + }); + + + var filterEmployeeId = $('#AccountId').val(); + var filterStart = $('#StartDate').val().trim(); + var filterEnd = $('#EndDate').val().trim(); + + if (filterEmployeeId != 0 || filterStart != '' || filterEnd != '') { + $('.btn-clear-filter').removeClass('disable'); + } else { + $('.btn-clear-filter').addClass('disable'); + } +}); + + +// *************************** مربوط به جستجو در دسکتاپ ******************************** + +const selectedAll = document.querySelectorAll(".wrapper-dropdown"); + +var wrapperDropdown = $(".wrapper-dropdown"); + +$(document).ready(function () { + wrapperDropdown.on("click", function () { + var dropdown = $(this); + var optionsContainer = dropdown.children(".dropdown"); + var optionsList = optionsContainer.find(".item"); + + dropdown.toggleClass("active"); + + if (dropdown.hasClass("active")) { + wrapperDropdown.not(this).removeClass("active"); + } + + optionsList.on("click", function () { + var selectedOption = $(this); + var valueData = selectedOption.data("value"); + + dropdown.removeClass("active"); + dropdown.find(".selected-display").text(selectedOption.text()); + $("#sendSorting").val(valueData); + + optionsList.removeClass("active"); + selectedOption.addClass("active"); + }); + }); + + var defaultValue = $("#sendSorting").val(); + if (defaultValue) { + + let defaultItem = $(".dropdown").find(".item[value-data='" + defaultValue + "']"); + defaultItem.addClass("active"); + var selectedDisplay = wrapperDropdown.find(".selected-display"); + selectedDisplay.text(defaultItem.text()); + } +}); + +$('.dropdown-days .item').on("click", function () { + let dataVal = $(this).attr("value-data-normal"); + console.log(dataVal); + if (dataVal === "OneDay") { + // $('#endDateRollcall').removeClass('d-flex'); + $('#endDateRollcall').addClass('d-none'); + } else { + // $('#endDateRollcall').addClass('d-flex'); + $('#endDateRollcall').removeClass('d-none'); + } + // $('#dropdown-RollcallDate').val(dataVal); +}); + + +var sendDropdownNormal = $("#sendSorting").val(); +if (sendDropdownNormal) { + let itemDropdownNormal = $(".dropdown-normal").find(".item[value-data-normal='" + sendDropdownNormal + "']"); + itemDropdownNormal.addClass("active"); + var selectedNormalDisplay = $(".wrapper-dropdown-normal").find(".selected-display"); + selectedNormalDisplay.text(itemDropdownNormal.text()); +} + +var sendDropdownYear = $("#sendDropdownYear").val(); +if (sendDropdownYear) { + let itemDropdownYear = $(".dropdown-year").find(".item[value-data-year='" + sendDropdownYear + "']"); + itemDropdownYear.addClass("active"); + var selectedYearDisplay = $(".wrapper-dropdown-year").find(".selected-display"); + selectedYearDisplay.text(itemDropdownYear.text()); +} + +var sendDropdownMonth = $("#sendDropdownMonth").val(); +if (sendDropdownMonth) { + let itemDropdownMonth = $(".dropdown-month").find(".item[value-data-month='" + sendDropdownMonth + "']"); + itemDropdownMonth.addClass("active"); + var selectedMonthDisplay = $(".wrapper-dropdown-month").find(".selected-display"); + selectedMonthDisplay.text(itemDropdownMonth.text()); +} + + +$(".date").on('input', function () { + var value = $(this).val(); + $(this).val(convertPersianNumbersToEnglish(value)); +}).mask("0000/00/00"); \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CurrentDay.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CurrentDay.js new file mode 100644 index 00000000..f2edd9e2 --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CurrentDay.js @@ -0,0 +1,12 @@ +$(document).ready(function () { + $('.loadingButton').on('click', function () { + var button = $(this); + var loadingDiv = button.find('.loading'); + loadingDiv.show(); + }); + + $(document).on('click', ".openAction", function () { + $(this).next().find(".operations-btns").slideToggle(500); + $(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500); + }); +}); \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EmployeeUploadPicture.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EmployeeUploadPicture.js new file mode 100644 index 00000000..09e7ca17 --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EmployeeUploadPicture.js @@ -0,0 +1,106 @@ +$(document).ready(function () { + $('.loadingButton').on('click', function () { + var button = $(this); + var loadingDiv = button.find('.loading'); + loadingDiv.show(); + }); +}); + +function ModalUploadPics(employeeID) +{ + $.ajax({ + async: false, + dataType: 'json', + url: checkModalTakeImageAjax, + type: 'GET', + success: function (response) { + if (response.isSuccedded) { + window.location.href = `#showmodal=/Client/Company/RollCall/EmployeeUploadPicture?employeeId=${employeeID}&handler=ModalTakeImages`; + } else { + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + }, + error: function (err) { + console.log(err); + } + }); +} + +function deactivePersonnel(id) { + $.ajax({ + async: false, + dataType: 'json', + type: 'POST', + url: deActivePersonnelAjax, + headers: { "RequestVerificationToken": antiForgeryToken }, + data: { id: Number(id) }, + success: function (response) { + if (response.isSuccedded) { + $('.alert-success-msg').show(); + $('.alert-success-msg p').text(response.message); + setTimeout(function () { + $('.alert-success-msg').hide(); + $('.alert-success-msg p').text(''); + window.location.reload(); + }, 2000); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + }, + error: function (err) { + console.log(err); + } + }); + } + +function activePersonnel(id, hasUploadedImage) { + if (hasUploadedImage === "true") { + $.ajax({ + async: false, + dataType: 'json', + type: 'POST', + url: activePersonnelAjax, + headers: { "RequestVerificationToken": antiForgeryToken }, + data: { id: Number(id) }, + success: function (response) { + if (response.isSuccedded) { + $('.alert-success-msg').show(); + $('.alert-success-msg p').text(response.message); + setTimeout(function () { + $('.alert-success-msg').hide(); + $('.alert-success-msg p').text(''); + window.location.reload(); + }, 2000); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + }, + error: function (err) { + console.log(err); + } + }); + } else { + var errorText = "برای این پرسنل، هنوز هیچ عکسی آپلود نشده است. بعد از آپلود عکس بطور خودکار فعال خواهد شد"; + $('.alert-msg').show(); + $('.alert-msg p').text(errorText); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } +} diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/Index.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/Index.js new file mode 100644 index 00000000..253f67d0 --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/Index.js @@ -0,0 +1,31 @@ +$(".openAction").click(function () { + $(this).next().find(".operations-btns").slideToggle(500); + $(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500); +}); +$(document).ready(function () { + $(this).find(".operations-btns").first().slideToggle(500); +}); + +$(document).ready(function () { + $('.loadingButton').on('click', function () { + var button = $(this); + var loadingDiv = button.find('.loading'); + loadingDiv.show(); + }); +}); + +// function AjaxPlans(id) { +// $.ajax({ +// url: '@Url.Page("./Plans")', +// type: 'GET', +// headers: { +// 'workshopId': id +// }, +// success: function (response) { +// window.location.href = '@Url.Page("./Plans")' +// }, +// error: function (e) { +// console.log('error: ' + e) +// } +// }); +// } \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalCameraAccount.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalCameraAccount.js new file mode 100644 index 00000000..a18136b6 --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalCameraAccount.js @@ -0,0 +1,224 @@ + +$('.loading').hide(); + +document.getElementById("MainModal").style.visibility = "visible"; + +$(".toggle").click(function(){ + $(".sidebar-navigation").toggleClass("small") + // $(".main-wrapper").toggleClass("small"); + $(".sidebar").toggleClass("active-sidebar-navigation"); + +$(".header-container").toggleClass("main-wrapper "); +$(".header-container").toggleClass("small"); + + +$(".content-container").toggleClass("small"); +// $(".content-container").toggleClass(""); + +$('#overlay').toggleClass("overlay"); +}); + + +$("#close-sidemenu-mobile").click(function(){ + $(".sidebar-navigation").toggleClass("small") + $(".sidebar").toggleClass("active-sidebar-navigation"); + +$(".header-container").toggleClass("main-wrapper "); +$(".header-container").toggleClass("small"); + + +$(".content-container").toggleClass("small"); + +$('#overlay').toggleClass("overlay"); +}); + + +$("#overlay").click(function(){ + $(".sidebar-navigation").toggleClass("small") + $(".sidebar").toggleClass("active-sidebar-navigation"); + +$(".header-container").toggleClass("main-wrapper "); +$(".header-container").toggleClass("small"); + + +$(".content-container").toggleClass("small"); + +$('#overlay').toggleClass("overlay"); +}); + +$(document).ready(function(){ + if ($(window).width() < 992) { + $(".sidebar-navigation").toggleClass("small"); +// $(".main-wrapper").toggleClass("small"); +$(".sidebar").toggleClass("active-sidebar-navigation"); + +$(".header-container").toggleClass("main-wrapper "); +$(".header-container").toggleClass("small"); + + +$(".content-container").toggleClass("small"); + // $(".content-container").toggleClass(""); + + } + + if ($(window).width() > 992){ + $('#overlay').toggleClass("overlay"); + } + +}); + + +var eyeShow = $('.eyeShow'); +var eyeClose = $('.eyeClose'); +var reEyeShow = $('.reEyeShow'); +var reEyeClose = $('.reEyeClose'); +eyeShow.show(); +eyeClose.hide(); +reEyeShow.show(); +reEyeClose.hide(); + +$(document).on('click','#accountModalModal button', function() { + + // alert($(this)); + // $(this).find('input').type ? 'text' : 'password'; + // document.getElementById('hybrid').type = 'password'; + $("#accountModalModal button").find('input').attr("type", "text"); + + + // var input=document.getElementById(some-id); + // var input2= input.cloneNode(false); + // input2.type='password'; + // input.parentNode.replaceChild(input2,input); +}); + +function passFunction() { + var x = document.getElementById("signupInputPassword"); + +if (x.type === "password") { + x.type = "text"; +eyeShow.hide(); +eyeClose.show(); + } else { + x.type = "password"; +eyeShow.show(); +eyeClose.hide(); + } +} + +function rePassFunction() { + var x = document.getElementById("repeat_password"); + +if (x.type === "password") { + x.type = "text"; +reEyeShow.hide(); +reEyeClose.show(); + } else { + x.type = "password"; +reEyeShow.show(); +reEyeClose.hide(); + } +} + +function passwordCheck(password) { + if (password.length >= 8) +strength += 1; +if (password.match(/(?=.*[0-9])/)) +strength += 1; +if (password.match(/(?=.*[!,%,&,@,#,$,^,*,?,_,~,<,>,])/)) +strength += 1; +if (password.match(/(?=.*[A-Z])/)) +strength += 1; + +displayBar(strength); +} + +function displayBar(strength) { + $(".password-strength-group").attr('data-strength', strength); +} + +$("#signupInputPassword").keyup(function () { + strength = 0; +var password = $(this).val(); +passwordCheck(password); +}); + +$(document).ready(function() { + $("#username").keyup(function () { + var username = $('#username').val(); + + if (username.length >= 6) { + $.ajax({ + async: false, + dataType: 'json', + type: 'GET', + url: checkAccountAjax, + data: { username: username }, + success: function (response) { + if (response.success) { + $('#errorSvg').addClass("d-none"); + $('#successSvg').removeClass("d-none"); + $('.alert-success-msg').show(); + $('.alert-success-msg p').text(response.message); + setTimeout(function () { + $('.alert-success-msg').hide(); + $('.alert-success-msg p').text(''); + }, 2000); + } else { + $('#successSvg').addClass("d-none"); + $('#errorSvg').removeClass("d-none"); + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 2000); + } + }, + error: function (err) { + console.log(err); + } + }); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text("نام کاربری حداقل باید 6 حرف باشد"); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + $('#successSvg').addClass("d-none"); + $('#errorSvg').removeClass("d-none"); + } + }); +}); + +function save() { + $.ajax({ + async: false, + dataType: 'json', + type: 'POST', + url: saveCameraAccountAjax, + headers: { "RequestVerificationToken": antiForgeryToken }, + data: $('#create-form').serialize(), + success: function (response) { + if (response.success) { + $('.alert-success-msg').show(); + $('.alert-success-msg p').text(response.message); + setTimeout(function () { + $('.alert-success-msg').hide(); + $('.alert-success-msg p').text(''); + }, 3500); + window.location.reload(); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + }, + error: function (err) { + console.log(err); + } + }); +} diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalOTPAction.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalOTPAction.js new file mode 100644 index 00000000..ec72ef2d --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalOTPAction.js @@ -0,0 +1,251 @@ + + var dateTimeNow = ''; + $(document).ready(function () { + $('#rule').click(function () { + if ($(this).is(':checked')) { + $('#btnSmsReciver').prop("disabled", false); + $('#btnSmsReciver').removeClass("disable"); + $(this).prop("disabled", true); + } else { + $('#btnSmsReciver').prop("disabled", true); + $('#btnSmsReciver').addClass("disable"); + } + }); + + $("#next-step").on("click", function () { + $('#step-form1').hide(); + $('#step-form2').show(); + $('#prev-step').text('مرحله قبل'); + $('#next-step').text('ثبت'); + // $('#next-step').addClass('disable') + $('#step-2').removeClass('not-step'); + }); + + $("#prev-step").on("click", function () { + $('#step-form1').show(); + + if ($('#step-form2').is(":hidden")) { + $("#MainModal").modal("hide"); + } + + $('#step-form2').hide(); + $('#prev-step').text('انصراف'); + $('#next-step').text('مرحله بعد'); + $('#step-2').addClass('not-step'); + + }); + + $("#time-code").on('input', function () { + var value = $(this).val(); + $(this).val(convertPersianNumbersToEnglish(value)); + }).mask("000000"); + + $('#changeDuration').on('change', function () { + + if (this.value == "1Mount") { + $('#Duration').val('یک ماهه'); + } else if (this.value == "3Mount") { + $('#Duration').val('سه ماهه'); + } else if (this.value == "6Mount") { + $('#Duration').val('شش ماهه'); + } else if (this.value == "12Mount") { + $('#Duration').val('یک ساله'); + } + + $.ajax({ + async: false, + dataType: 'json', + url: computeMoneyByMountAjax, + type: 'GET', + data: {"mount": this.value, "money": $('#AmountFaReal').val() }, + success: function (response) { + console.log(response); + if (response.isSuccedded) { + $('#AmountFaWithout').text(response.cumputeWithout); + $('#AmountFaDiscount').text(response.cumputeDiscount); + $('#AmountFaWith').text(response.cumpute); + $('#AmountFaTotal').text(response.cumpute); + $('#AmountFa').text(response.cumpute); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + }, + error: function (err) { + console.log(err); + } + }); + }); + + $('#btnSmsReciver').on("click", function () { + $('#btnSmsReciver').prop("disabled", true); + $('#btnSmsReciver').addClass("disable"); + sendVerifyCode(); + }); + + function sendVerifyCode() { + $.ajax({ + dataType: 'json', + type: 'POST', + url: sendSmsAjax, + headers: { "RequestVerificationToken": antiForgeryToken }, + success: function (response) { + if (response.isSuccess) { + $('#CodeDiv').removeClass("disable"); + $('#next-step').removeClass('disable'); + $('#next-step').attr('onclick', 'confirmCodeToLogin()'); + // codeTimer(); + dateTimeNow = new Date().toJSON(); + startTimer(2); + } else { + $('.loading').hide(); + $('#btnSmsReciver').show(); + } + }, + failure: function (response) { + console.log(5, response); + } + }); + } + + function startTimer(minutes) { + var timer = minutes * 60, display = $('#timer'); + var interval = setInterval(function () { + var minutes = parseInt(timer / 60, 10); + var seconds = parseInt(timer % 60, 10); + + minutes = minutes < 10 ? "0" + minutes : minutes; + seconds = seconds < 10 ? "0" + seconds : seconds; + + display.text(minutes + ":" + seconds); + + if (--timer < 0) { + clearInterval(interval); + $('#btnSmsReciver').prop("disabled", false); + $('#btnSmsReciver').removeClass("disable"); + $('#btnSmsReciver').text('ارسال دوباره'); + $('#CodeDiv').addClass("disable"); + } + }, 1000); + } + + function codeTimer() { + $('#timer').text(''); + var timer2 = "2:00"; + var interval = setInterval(function () { + var timer = timer2.split(':'); + //by parsing integer, I avoid all extra string processing + var minutes = parseInt(timer[0], 10); + var seconds = parseInt(timer[1], 10); + --seconds; + minutes = (seconds < 0) ? --minutes : minutes; + if (minutes < 0) clearInterval(interval); + seconds = (seconds < 0) ? 59 : seconds; + seconds = (seconds < 10) ? '0' + seconds : seconds; + //minutes = (minutes < 10) ? minutes : minutes; + $('.countdown').html(minutes + ':' + seconds); + timer2 = minutes + ':' + seconds; + + if (timer2 === "0:00" && !$('#passDiv').hasClass("showPassDiv")) { + + $('#next-step').attr('onclick', ''); + $('#next-step').addClass('disable'); + $('#CodeDiv').addClass("disable"); + + + //اینپوت برای وارد کردن کدها خالی میشود + $('.time-code').val(''); + $('#timer').text('00:00'); + } + + }, 1000); + } + + // var form = $("#steps"); + // form.steps({ + // headerTag: "h6", + // bodyTag: "section", + // transitionEffect: "fade", + // titleTemplate: '
#index#

#title#

' + // }); + }); + + function confirmCodeToLogin() { + var code = $('#time-code').val(); + + if (code.length === 6) { + $.ajax({ + async: false, + dataType: 'json', + type: 'POST', + url: checkCodeAjax, + headers: { "RequestVerificationToken": antiForgeryToken }, + data: { + 'code': code, + 'codeSendTimeStr': dateTimeNow + }, + success: function (response) { + if (response.exist === true) { + SaveServiceData(); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + }, + failure: function (response) { + console.log(5, response); + } + }); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text('کد وارد شده کمتر از 6 رقم است.'); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + } + + function SaveServiceData() + { + $.ajax({ + async: false, + dataType: 'json', + type: 'POST', + url: saveServiceAjax, + headers: { "RequestVerificationToken": antiForgeryToken }, + data: $('#create-form').serialize(), + success: function (response) { + if (response.isSuccedded === true) { + $('.alert-success-msg').show(); + $('.alert-success-msg p').text(response.message); + setTimeout(function () { + $('.alert-success-msg').hide(); + $('.alert-success-msg p').text(''); + }, 3500); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + }, + failure: function (response) { + console.log(5, response); + } + }); + } + + function OpenAccount() { + window.location.href = saveCameraAccountUrl; + } diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalOTPActionFree.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalOTPActionFree.js new file mode 100644 index 00000000..f2805163 --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalOTPActionFree.js @@ -0,0 +1,164 @@ +$(document).ready(function () { + $('#rule').click(function () { + if ($(this).is(':checked')) { + $('#btnSmsReciver').prop("disabled", false); + $('#btnSmsReciver').removeClass("disable"); + } else { + $('#btnSmsReciver').prop("disabled", true); + $('#btnSmsReciver').addClass("disable"); + } + }); + + $("#next-step").on("click", function () { + $('#step-form1').hide(); + $('#step-form2').show(); + $('#prev-step').text('مرحله قبل'); + $('#next-step').text('ثبت'); + // $('#next-step').addClass('disable') + $('#step-2').removeClass('not-step'); + }); + + $("#prev-step").on("click", function () { + $('#step-form1').show(); + + if ($('#step-form2').is(":hidden")) { + $("#MainModal").modal("hide"); + } + + $('#step-form2').hide(); + $('#prev-step').text('انصراف'); + $('#next-step').text('مرحله بعد'); + $('#step-2').addClass('not-step'); + }); + + $('#btnSmsReciver').on("click", function () { + $('#btnSmsReciver').prop("disabled", true); + $('#btnSmsReciver').addClass("disable"); + sendVerifyCode(); + }); + +function sendVerifyCode() { + $.ajax({ + dataType: 'json', + type: 'POST', + url: sendSmsAjax, + headers: { "RequestVerificationToken": antiForgeryToken }, + success: function (response) { + if (response.isSuccess) { + $('#CodeDiv').removeClass("disable"); + $('#next-step').removeClass('disable'); + $('#next-step').attr('onclick', 'confirmCodeToLogin()'); + codeTimer(); + } else { + $('.loading').hide(); + $('#btnSmsReciver').show(); + } + }, + failure: function (response) { + console.log(5, response); + } + }); +} + + function codeTimer() { + $('#timer').text(''); + var timer2 = "2:00"; + var interval = setInterval(function () { + var timer = timer2.split(':'); + //by parsing integer, I avoid all extra string processing + var minutes = parseInt(timer[0], 10); + var seconds = parseInt(timer[1], 10); + --seconds; + minutes = (seconds < 0) ? --minutes : minutes; + if (minutes < 0) clearInterval(interval); + seconds = (seconds < 0) ? 59 : seconds; + seconds = (seconds < 10) ? '0' + seconds : seconds; + //minutes = (minutes < 10) ? minutes : minutes; + $('.countdown').html(minutes + ':' + seconds); + timer2 = minutes + ':' + seconds; + + if (timer2 === "0:00" && !$('#passDiv').hasClass("showPassDiv")) { + + $('#next-step').attr('onclick', ''); + $('#next-step').addClass('disable'); + $('#CodeDiv').addClass("disable"); + + + //اینپوت برای وارد کردن کدها خالی میشود + $('.time-code').val(''); + $('#timer').text('00:00'); + } + + }, 1000); + } +}); + +function confirmCodeToLogin() { + var code = $('#time-code').val(); +if (code.length == 6) { + $.ajax({ + async: false, + dataType: 'json', + type: 'POST', + url: checkCodeAjax, + headers: { "RequestVerificationToken": antiForgeryToken }, + data: { + 'code': code + }, + success: function (response) { + if (response.exist === true) { + SaveServiceData(); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text('کد وارد شده صحیح نیست.'); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + }, + failure: function (response) { + console.log(5, response); + } + }); + } else { + $('.alert-msg').show(); +$('.alert-msg p').text('کد وارد شده کمتر از 6 رقم است.'); +setTimeout(function () { + $('.alert-msg').hide(); +$('.alert-msg p').text(''); + }, 3500); + } +} + +function SaveServiceData() +{ + $.ajax({ + async: false, + dataType: 'json', + type: 'POST', + url: saveServiceFreeAjax, + headers: { "RequestVerificationToken": antiForgeryToken }, + data: $('#create-form').serialize(), + success: function (response) { + if (response.isSuccedded === true) { + $('.alert-success-msg').show(); + $('.alert-success-msg p').text(response.message); + setTimeout(function () { + $('.alert-success-msg').hide(); + $('.alert-success-msg p').text(''); + }, 3500); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + }, + failure: function (response) { + console.log(5, response); + } + }); +} diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalTakeImages.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalTakeImages.js new file mode 100644 index 00000000..7c132834 --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/ModalTakeImages.js @@ -0,0 +1,291 @@ + // if ($(window).width() < 992) { + // Webcam.set({ + + // width: 1800, + // height: 1800, + + // // final cropped size + // // crop_width: 296, + // // crop_height: 396, + // dest_width: 1800, + // dest_height: 1800, + + // crop_width: 1800, + // crop_height: 1800, + // image_format: 'jpeg', + // jpeg_quality: 90, + // // facingMode: "environment", + // constraints: { + // facingMode: "user" // This sets the camera to front-facing + // } + // }); + // Webcam.attach('#my_camera'); + // Webcam.attach('#video'); + // var demo = $('#video'); + // let demoVideo = $('#video').find('video[playsinline="playsinline"]'); + // demo.css({ + // width: "100%", + // height: "100%", + // }); + // demoVideo.css({ + // width: "100%", + // height: "100%", + // }); + // } else { + + // Webcam.set({ + // width: 600, + // height: 600, + // image_format: 'jpeg', + // jpeg_quality: 100 + // }); + // Webcam.attach('#my_camera'); + // Webcam.attach('#video'); + // var demo = $('#video'); + // let demoVideo = $('#video').find('video[playsinline="playsinline"]'); + // demo.css({ + // width: "100%", + // height: "100%", + // }); + // demoVideo.css({ + // width: "100%", + // height: "100%", + // }); + // } + + // function take_snapshot1() { + // Webcam.snap(function (data_uri) { + // // ایجاد یک عنصر تصویر از داده‌های تصویر + // var img = new Image(); + // img.src = data_uri; + // img.onload = function() { + // let canvas = document.createElement('canvas'); + // let ctx = canvas.getContext('2d'); + + // // پیدا کردن اندازه مربع برای کراپ + // let sideLength = Math.min(img.width, img.height); + // let startX = (img.width - sideLength) / 2; + // let startY = (img.height - sideLength) / 2; + + // let newWidth = 1800; + // let newHeight = 1800; + + // // تنظیم اندازه کانواس به اندازه جدید + // canvas.width = newWidth; + // canvas.height = newHeight; + + // // رسم تصویر کراپ شده و تغییر اندازه داده شده + // ctx.drawImage(img, startX, startY, sideLength, sideLength, 0, 0, newWidth, newHeight); + // // resolve(canvas.toDataURL('image/jpeg')); + + + // // // ایجاد یک بوم برای برش دادن تصویر + // // var canvas = document.createElement('canvas'); + // // var context = canvas.getContext('2d'); + // // var size = Math.min(img.width, img.height); + + // // canvas.width = size; + // // canvas.height = size; + + // // // محاسبه محل برش تصویر + // // var sx = (img.width - size) / 2; + // // var sy = (img.height - size) / 2; + + // // context.drawImage(img, sx, sy, size, size, 0, 0, size, size); + + // // تبدیل بوم به داده‌های URI + // var croppedDataUri = canvas.toDataURL('image/jpeg'); + + // // نمایش تصویر برش داده شده + // document.getElementById('result1').innerHTML = ''; + // document.getElementById('demoResult1').innerHTML = ''; + // }; + // }); + // $('.md-modal').removeClass('md-show'); + // } + + // function take_snapshot1() { + // Webcam.snap(function(data_uri) { + // document.getElementById('result1').innerHTML = ''; + // document.getElementById('demoResult1').innerHTML = ''; + // }); + // $('.md-modal').removeClass('md-show'); + // } + // function take_snapshot2() { + // Webcam.snap(function (data_uri) { + // document.getElementById('result2').innerHTML = ''; + // document.getElementById('demoResult2').innerHTML = ''; + // }); + // $('.md-modal').removeClass('md-show'); + // } + + + $(document).ready(function () { + if ($(window).width() > 992) { + $('#desktopDisplay').show(); + $('#mobileDisplay').hide(); + $('#mobileDisplay').html(''); + } + + if ($(window).width() <= 992) { + $('#desktopDisplay').html(''); + $('#desktopDisplay').hide(); + $('#mobileDisplay').show(); + } + + $(document).on('click', '.upload-image1', function () { + $('.md-modal').addClass('md-show'); + $('.take_snapshot1').show(); + $('.take_snapshot2').hide(); + startCamera(); + }); + + $(document).on('click', '.upload-image2', function () { + $('.md-modal').addClass('md-show'); + $('.take_snapshot1').hide(); + $('.take_snapshot2').show(); + startCamera(); + }); + + $(document).on('click', '.camera_close', function () { + $('.md-modal').removeClass('md-show'); + stopCamera(); + }); + }); + + var FACING_MODES = JslibHtml5CameraPhoto.FACING_MODES; + var IMAGE_TYPES = JslibHtml5CameraPhoto.IMAGE_TYPES; + + // Check if videoElement is already declared to avoid redeclaration + // if (typeof videoElement === 'undefined') { + var videoElement = document.getElementById('videoElement'); + var cameraPhoto = new JslibHtml5CameraPhoto.default(videoElement); + // } + + function startCamera() { + // startCameraMaxResolution + cameraPhoto.startCamera(FACING_MODES.USER).then(() => { + console.log('Camera started!'); + }).catch((error) => { + console.log(error); + console.error('Camera not started!', error); + }); + } + + function stopCamera() { + cameraPhoto.stopCamera().then(() => { + console.log('Camera stopped!'); + }).catch((error) => { + console.log('No camera to stop!:', error); + }); + } + + function cropAndResizeImage(base64Str, newWidth, newHeight) { + return new Promise((resolve) => { + let img = new Image(); + img.src = base64Str; + img.onload = () => { + let canvas = document.createElement('canvas'); + let ctx = canvas.getContext('2d'); + + let sideLength = Math.min(img.width, img.height); + let startX = (img.width - sideLength) / 2; + let startY = (img.height - sideLength) / 2; + + canvas.width = newWidth; + canvas.height = newHeight; + + ctx.drawImage(img, startX, startY, sideLength, sideLength, 0, 0, newWidth, newHeight); + resolve(canvas.toDataURL('image/jpeg')); + }; + }); + } + + function take_snapshot1() { + var sizeFactor = 1; + var imageType = IMAGE_TYPES.JPG; + var imageCompression = 1; + + var config = { + sizeFactor, + imageType, + imageCompression + }; + + var dataUri = cameraPhoto.getDataUri(config); + cropAndResizeImage(dataUri, 1800, 1800).then((resizedDataUri) => { + document.getElementById('result1').innerHTML = ''; + document.getElementById('demoResult1').innerHTML = ''; + }).catch((error) => { + console.error('Error cropping and resizing photo:', error); + }); + + $('.md-modal').removeClass('md-show'); + stopCamera(); + } + + function take_snapshot2() { + var sizeFactor = 1; + var imageType = IMAGE_TYPES.JPG; + var imageCompression = 1; + + var config = { + sizeFactor, + imageType, + imageCompression + }; + + var dataUri = cameraPhoto.getDataUri(config); + cropAndResizeImage(dataUri, 1800, 1800).then((resizedDataUri) => { + document.getElementById('result2').innerHTML = ''; + document.getElementById('demoResult2').innerHTML = ''; + }).catch((error) => { + console.error('Error cropping and resizing photo:', error); + }); + + $('.md-modal').removeClass('md-show'); + stopCamera(); + } + + function set() { + let pic1 = $("#pic1").attr('src'); + let pic2 = $("#pic2").attr('src'); + let workshopId = Number($('#workshopId').val()); + let employeeId = Number($('#employeeId').val()); + if (pic1 != null && pic2 != null) { + $.ajax({ + type: 'POST', + url: takePictureAjax, + data: { "base64pic1": pic1, "base64pic2": pic2, "workshopId": workshopId, "employeeId": employeeId }, + headers: { "RequestVerificationToken": antiForgeryToken }, + success: function (response) { + if (response.isSuccedded) { + $('.alert-success-msg').show(); + $('.alert-success-msg p').text(response.message); + setTimeout(function () { + $('.alert-success-msg').hide(); + $('.alert-success-msg p').text('ثبت عکس با موفقیت انجام شد'); + window.location.reload(); + }, 2000); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text('خطایی پیش آمده است'); + }, 3500); + } + }, + failure: function (response) { + console.log(5, response); + } + }); + } else { + $('.alert-msg').show(); + $('.alert-msg p').text(response.message); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text('گرفتن دو عکس الزامیست'); + }, 3500); + } + } \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/Plans.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/Plans.js new file mode 100644 index 00000000..453fc299 --- /dev/null +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/Plans.js @@ -0,0 +1,19 @@ +function choosePlane(maxPersonnelId) { + var maxPersonnelVal = Number(maxPersonnelId); + var parameter = '&maxId=' + maxPersonnelVal; + var url = OTPActionUrl; + window.location.href = url + parameter; +} + +function choosePlaneFree() { + if (employeeCount > 0) { + window.location.href = OTPActionFreeUrl; + } else { + $('.alert-msg').show(); + $('.alert-msg p').text('هیچ پرسنلی در کارگاه وجود ندارد'); + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } +} \ No newline at end of file