From 901a4ebd355629836e57018a8b613976e539fb26 Mon Sep 17 00:00:00 2001 From: SamSys Date: Thu, 27 Nov 2025 13:46:42 +0330 Subject: [PATCH 01/26] check httpContext for api to currentUrl --- ServiceHost/Program.cs | 50 ++++++++++-------------- ServiceHost/appsettings.Development.json | 6 ++- ServiceHost/appsettings.json | 2 +- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/ServiceHost/Program.cs b/ServiceHost/Program.cs index 8f08ea94..6cacd00d 100644 --- a/ServiceHost/Program.cs +++ b/ServiceHost/Program.cs @@ -331,12 +331,7 @@ builder.Services.AddParbad().ConfigureGateways(gateways => storage.UseMemoryCache(); }); -#region GetHttpContext -var httpContextAccessor = new HttpContextAccessor(); -builder.Services.AddSingleton(httpContextAccessor); - -#endregion var app = builder.Build(); @@ -346,32 +341,29 @@ app.UseCors("AllowSpecificOrigins"); - -// بعد از Build: -var host = httpContextAccessor.HttpContext?.Request.Host.Host ?? ""; - -// مقداردهی BaseUrl -string baseUrl; - -if (host.Contains("localhost")) +app.Use(async (context, next) => { - baseUrl = builder.Configuration["InternalApi:Local"]; -} -else if (host.Contains("dadmehrg.ir")) -{ - baseUrl = builder.Configuration["InternalApi:Dadmehrg"]; -} -else if (host.Contains("gozareshgir.ir")) -{ - baseUrl = builder.Configuration["InternalApi:Gozareshgir"]; -} -else -{ - baseUrl = builder.Configuration["InternalApi:Local"]; // fallback -} + var host = context.Request.Host.Host?.ToLower() ?? ""; + + string baseUrl; + + if (host.Contains("localhost")) + baseUrl = builder.Configuration["InternalApi:Local"]; + else if (host.Contains("dadmehrg.ir")) + baseUrl = builder.Configuration["InternalApi:Dadmehrg"]; + else if (host.Contains("gozareshgir.ir")) + baseUrl = builder.Configuration["InternalApi:Gozareshgir"]; + else + baseUrl = builder.Configuration["InternalApi:Local"]; // fallback + + InternalApiCaller.SetBaseUrl(baseUrl); + + await next.Invoke(); +}); + + + -// مقداردهی به کلاس Static -InternalApiCaller.SetBaseUrl(baseUrl); diff --git a/ServiceHost/appsettings.Development.json b/ServiceHost/appsettings.Development.json index 17619b5f..6fc60bbe 100644 --- a/ServiceHost/appsettings.Development.json +++ b/ServiceHost/appsettings.Development.json @@ -46,8 +46,10 @@ //, "09116067106", "09114221321" ] }, - "InternalProgramManagerApi": { - "BaseUrl": "https://localhost:7032" + "InternalApi": { + "Local": "https://localhost:7032", + "Dadmehrg": "https://api.pm.dadmehrg.ir", + "Gozareshgir": "https://api.pm.gozareshgir.ir" }, "SepehrGateWayTerminalId": 99213700 diff --git a/ServiceHost/appsettings.json b/ServiceHost/appsettings.json index 975d65c0..ebcbdcd1 100644 --- a/ServiceHost/appsettings.json +++ b/ServiceHost/appsettings.json @@ -41,7 +41,7 @@ "Dadmehrg": "https://api.pm.dadmehrg.ir", "Gozareshgir": "https://api.pm.gozareshgir.ir" }, - + "SepehrGateWayTerminalId": 99213700 From 626722e805dd7888221a005c21e0a9d0cf5ea65e Mon Sep 17 00:00:00 2001 From: mahan Date: Sat, 29 Nov 2025 11:43:58 +0330 Subject: [PATCH 02/26] Handle null response from UID service in GetPersonalInfo and return appropriate failure message --- CompanyManagment.Application/EmployeeAplication.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CompanyManagment.Application/EmployeeAplication.cs b/CompanyManagment.Application/EmployeeAplication.cs index 34fae070..728682b9 100644 --- a/CompanyManagment.Application/EmployeeAplication.cs +++ b/CompanyManagment.Application/EmployeeAplication.cs @@ -1644,7 +1644,12 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli }; return op.Succcedded(data); } + var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate); + if (apiResult == null) + { + return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeDataFromApiViewModel() { AuthorizedCanceled = true }); + } if (apiResult.ResponseContext.Status.Code == 14) { return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeDataFromApiViewModel() { AuthorizedCanceled = true }); From 720e998a541b231b9966576b83c7a594e9bf1787 Mon Sep 17 00:00:00 2001 From: mahan Date: Sat, 29 Nov 2025 12:30:12 +0330 Subject: [PATCH 03/26] Return null if FirstName is missing in UID service response and improve null checks in GetPersonalInfo --- CompanyManagment.EFCore/Services/UidService.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CompanyManagment.EFCore/Services/UidService.cs b/CompanyManagment.EFCore/Services/UidService.cs index b0b0be93..52e8772b 100644 --- a/CompanyManagment.EFCore/Services/UidService.cs +++ b/CompanyManagment.EFCore/Services/UidService.cs @@ -70,13 +70,23 @@ public class UidService : IUidService if (!requestResult.IsSuccessStatusCode) return null; + var responseResult = await requestResult.Content.ReadFromJsonAsync(); + if (responseResult.BasicInformation != null) { + if (string.IsNullOrWhiteSpace(responseResult.BasicInformation.FirstName)) + { + return null; + } responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian(); responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian(); responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian(); } + else + { + return null; + } // ذخیره اطلاعات در جدول AuthorizedPerson await SaveAuthorizedPersonData(responseResult, nationalCode, birthDate); From 452b0b6277982b4012df5b8fb4fa573d62d149ec Mon Sep 17 00:00:00 2001 From: mahan Date: Sat, 29 Nov 2025 13:26:04 +0330 Subject: [PATCH 04/26] Refactor institution contract discount calculation to use TotalAmount instead of PaymentAmount --- .../CreateInstitutionContractRequest.cs | 2 +- .../IInstitutionContractApplication.cs | 6 +- .../InstitutionContractRepository.cs | 55 ++++++++++--------- ServiceHost/Properties/launchSettings.json | 2 +- 4 files changed, 33 insertions(+), 32 deletions(-) diff --git a/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs index fb4c9f08..9ec2c821 100644 --- a/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs +++ b/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs @@ -102,7 +102,7 @@ public class CreateInstitutionContractRequest public double OneMonthAmount { get; set; } public long LawId { get; set; } - + public int DiscountPercentage { get; set; } public double DiscountAmount { get; set; } diff --git a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs index e369d462..a415d897 100644 --- a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs +++ b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs @@ -267,7 +267,7 @@ public interface IInstitutionContractApplication public class InstitutionContractResetDiscountForCreateRequest { public int Percentage { get; set; } - public double PaymentAmount { get; set; } + public double TotalAmount { get; set; } public bool IsInstallment { get; set; } public InstitutionContractDuration Duration { get; set; } } @@ -276,7 +276,7 @@ public class InstitutionContractSetDiscountForExtensionRequest { public Guid TempId { get; set; } public int DiscountPercentage { get; set; } - public double PaymentAmount { get; set; } + public double TotalAmount { get; set; } public bool IsInstallment { get; set; } } public class InstitutionContractResetDiscountForExtensionRequest @@ -289,7 +289,7 @@ public class InstitutionContractResetDiscountForExtensionRequest public class InstitutionContractSetDiscountRequest { public int DiscountPercentage { get; set; } - public double PaymentAmount { get; set; } + public double TotalAmount { get; set; } public InstitutionContractDuration Duration { get; set; } public bool IsInstallment { get; set; } } diff --git a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs index 76c4d848..512c5e69 100644 --- a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs +++ b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs @@ -1872,11 +1872,11 @@ public class InstitutionContractRepository : RepositoryBasex.Id == institutionTemp.Id, @@ -2354,16 +2355,16 @@ public class InstitutionContractRepository : RepositoryBasex.Id == institutionTemp.Id, @@ -3042,7 +3043,7 @@ public class InstitutionContractRepository : RepositoryBase Date: Sat, 29 Nov 2025 14:56:45 +0330 Subject: [PATCH 05/26] Add discount amount and percentage fields to InstitutionContract entity and database schema --- .../InstitutionContract.cs | 11 +- ...iscount to institutioncontract.Designer.cs | 11347 ++++++++++++++++ ...132_add discount to institutioncontract.cs | 40 + .../Migrations/CompanyContextModelSnapshot.cs | 6 + 4 files changed, 11403 insertions(+), 1 deletion(-) create mode 100644 CompanyManagment.EFCore/Migrations/20251129103132_add discount to institutioncontract.Designer.cs create mode 100644 CompanyManagment.EFCore/Migrations/20251129103132_add discount to institutioncontract.cs diff --git a/Company.Domain/InstitutionContractAgg/InstitutionContract.cs b/Company.Domain/InstitutionContractAgg/InstitutionContract.cs index 9a235715..9643a509 100644 --- a/Company.Domain/InstitutionContractAgg/InstitutionContract.cs +++ b/Company.Domain/InstitutionContractAgg/InstitutionContract.cs @@ -19,7 +19,8 @@ public class InstitutionContract : EntityBase string contractEndFa, double contractAmount, double dailyCompenseation, double obligation, double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description, string officialCompany, string typeOfcontract, string hasValueAddedTax, double valueAddedTax, - List workshopDetails, long lawId,int discountPercentage, double discountAmount) + List workshopDetails, long lawId, + int discountPercentage, double discountAmount) { ContractNo = contractNo; RepresentativeId = representativeId; @@ -57,8 +58,12 @@ public class InstitutionContract : EntityBase WorkshopGroup = new InstitutionContractWorkshopGroup(id, workshopDetails); PublicId = Guid.NewGuid(); LawId = lawId; + DiscountPercentage = discountPercentage; + DiscountAmount = discountAmount; + } + public long LawId { get; private set; } public string ContractNo { get; private set; } @@ -128,6 +133,10 @@ public class InstitutionContract : EntityBase public DateTime VerifyCodeCreation { get; private set; } public string VerifierFullName { get; private set; } public string VerifierPhoneNumber { get; private set; } + + public double DiscountAmount { get; private set; } + + public int DiscountPercentage { get; private set; } [NotMapped] public bool VerifyCodeExpired => VerifyCodeCreation.Add(ExpireTime) <= DateTime.Now; diff --git a/CompanyManagment.EFCore/Migrations/20251129103132_add discount to institutioncontract.Designer.cs b/CompanyManagment.EFCore/Migrations/20251129103132_add discount to institutioncontract.Designer.cs new file mode 100644 index 00000000..336e4344 --- /dev/null +++ b/CompanyManagment.EFCore/Migrations/20251129103132_add discount to institutioncontract.Designer.cs @@ -0,0 +1,11347 @@ +// +using System; +using System.Collections.Generic; +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("20251129103132_add discount to institutioncontract")] + partial class adddiscounttoinstitutioncontract + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Company.Domain.AdminMonthlyOverviewAgg.AdminMonthlyOverview", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Month") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(155) + .HasColumnType("nvarchar(155)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("AdminMonthlyOverviews"); + }); + + modelBuilder.Entity("Company.Domain.AndroidApkVersionAgg.AndroidApkVersion", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ApkType") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsForce") + .HasColumnType("bit"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("VersionCode") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("VersionName") + .HasMaxLength(35) + .HasColumnType("nvarchar(35)"); + + b.HasKey("id"); + + b.ToTable("AndroidApkVersions", (string)null); + }); + + modelBuilder.Entity("Company.Domain.AuthorizedBankDetailsAgg.AuthorizedBankDetails", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AccountNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BankName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("CardNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("IBan") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.ToTable("AuthorizedBankDetails", (string)null); + }); + + modelBuilder.Entity("Company.Domain.AuthorizedPersonAgg.AuthorizedPerson", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BirthDate") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DeathStatus") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("FatherName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Gender") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsVerified") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("NationalCode") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ShenasnameSeri") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ShenasnameSerial") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ShenasnamehNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("VerificationDate") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.HasIndex("NationalCode") + .IsUnique(); + + b.ToTable("AuthorizedPersons", (string)null); + }); + + modelBuilder.Entity("Company.Domain.BankAgg.Bank", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BankLogoMediaId") + .HasColumnType("bigint"); + + b.Property("BankName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.ToTable("Banks", (string)null); + }); + + 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("AbsenceValue") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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("EmployeeMandatoryHours") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("FamilyAllowance") + .HasColumnType("float"); + + b.Property("FathersName") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("FridayPay") + .HasColumnType("float"); + + b.Property("FridayWorkValue") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("HasAmountConflict") + .HasColumnType("bit"); + + b.Property("HasInsuranceShareTheSameAsList") + .HasColumnType("bit"); + + b.Property("HasRollCall") + .HasColumnType("bit"); + + 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("IsUpdateNeeded") + .HasColumnType("bit"); + + 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("OverNightWorkValue") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("OverTimeWorkValue") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("OvertimePay") + .HasColumnType("float"); + + b.Property("PersonnelCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("RewardPay") + .HasColumnType("float"); + + b.Property("RotatingShiftValue") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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("TotalDayOfBunosesCompute") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("TotalDayOfLeaveCompute") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("TotalDayOfYearsCompute") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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.CheckoutAgg.CheckoutWarningMessage", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CheckoutId") + .HasColumnType("bigint"); + + b.Property("TypeOfCheckoutWarning") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("WarningMessage") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("id"); + + b.HasIndex("CheckoutId"); + + b.ToTable("CheckoutWarningMessage", (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.ContactUsAgg.ContactUs", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("FirstName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FullName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("LastName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Message") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("PhoneNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Title") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("id"); + + b.ToTable("ContactUs"); + }); + + 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("CeoFName") + .HasColumnType("nvarchar(max)"); + + b.Property("CeoLName") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("FName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("FatherName") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Gender") + .IsRequired() + .HasMaxLength(6) + .HasColumnType("nvarchar(6)"); + + b.Property("IdNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("IdNumberSeri") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IdNumberSerial") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("IsActiveString") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsAuthenticated") + .HasColumnType("bit"); + + b.Property("IsBlock") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsLegal") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("LName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("LegalPosition") + .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("BaseYearAffected") + .HasColumnType("float"); + + b.Property("BaseYearUnAffected") + .HasColumnType("float"); + + 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("DailySalaryAffected") + .HasColumnType("float"); + + b.Property("DailySalaryUnAffected") + .HasColumnType("float"); + + b.Property("DailyWageType") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + 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("HasManualDailyWage") + .HasColumnType("bit"); + + 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.ContractingPartyBankAccountsAgg.ContractingPartyBankAccount", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AccountHolderName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("AccountNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CardNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ContractingPartyId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("IBan") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsAuth") + .HasColumnType("bit"); + + b.HasKey("id"); + + b.HasIndex("ContractingPartyId"); + + b.ToTable("ContractingPartyBankAccounts", (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.CustomizeCheckoutAgg.CustomizeCheckout", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BaseYearsPay") + .HasColumnType("float"); + + b.Property("BonusesPay") + .HasColumnType("float"); + + b.Property("ContractEnd") + .HasColumnType("datetime2"); + + b.Property("ContractId") + .HasColumnType("bigint"); + + b.Property("ContractNo") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("ContractStart") + .HasColumnType("datetime2"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DailyWage") + .HasColumnType("float"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("EarlyExitDeduction") + .HasColumnType("float"); + + b.Property("EmployeeFName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("EmployeeLName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FamilyAllowance") + .HasColumnType("float"); + + b.Property("FineAbsenceDeduction") + .HasColumnType("float"); + + b.Property("FineDeduction") + .HasColumnType("float"); + + b.Property("FridayPay") + .HasColumnType("float"); + + b.Property("HasAmountConflict") + .HasColumnType("bit"); + + b.Property("InstallmentDeduction") + .HasColumnType("float"); + + b.Property("InsuranceDeduction") + .HasColumnType("float"); + + b.Property("LateToWorkDeduction") + .HasColumnType("float"); + + b.Property("LateToWorkValue") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LeavePay") + .HasColumnType("float"); + + b.Property("MarriedAllowance") + .HasColumnType("float"); + + b.Property("MonthInt") + .HasColumnType("int"); + + 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("RewardPay") + .HasColumnType("float"); + + b.Property("SalaryAidDeduction") + .HasColumnType("float"); + + b.Property("SettingSalary") + .HasColumnType("float"); + + b.Property("ShiftPay") + .HasColumnType("float"); + + b.Property("ShiftStatus") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("SumOfWorkingDays") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxDeduction") + .HasColumnType("float"); + + b.Property("TotalClaims") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalDeductions") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalPayment") + .HasColumnType("float"); + + b.Property("WorkshopFullName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("YearInt") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("WorkshopId"); + + b.ToTable("CustomizeCheckouts", (string)null); + }); + + modelBuilder.Entity("Company.Domain.CustomizeCheckoutTempAgg.CustomizeCheckoutTemp", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BaseYearsPay") + .HasColumnType("float"); + + b.Property("BonusesPay") + .HasColumnType("float"); + + b.Property("ContractEnd") + .HasColumnType("datetime2"); + + b.Property("ContractId") + .HasColumnType("bigint"); + + b.Property("ContractNo") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("ContractStart") + .HasColumnType("datetime2"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DailyWage") + .HasColumnType("float"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("EarlyExitDeduction") + .HasColumnType("float"); + + b.Property("EmployeeFName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("EmployeeLName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FamilyAllowance") + .HasColumnType("float"); + + b.Property("FineAbsenceDeduction") + .HasColumnType("float"); + + b.Property("FineDeduction") + .HasColumnType("float"); + + b.Property("FridayPay") + .HasColumnType("float"); + + b.Property("HasAmountConflict") + .HasColumnType("bit"); + + b.Property("InstallmentDeduction") + .HasColumnType("float"); + + b.Property("InsuranceDeduction") + .HasColumnType("float"); + + b.Property("LateToWorkDeduction") + .HasColumnType("float"); + + b.Property("LateToWorkValue") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LeavePay") + .HasColumnType("float"); + + b.Property("MarriedAllowance") + .HasColumnType("float"); + + b.Property("MonthInt") + .HasColumnType("int"); + + 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("RewardPay") + .HasColumnType("float"); + + b.Property("SalaryAidDeduction") + .HasColumnType("float"); + + b.Property("SettingSalary") + .HasColumnType("float"); + + b.Property("ShiftPay") + .HasColumnType("float"); + + b.Property("ShiftStatus") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("SumOfWorkingDays") + .HasColumnType("nvarchar(max)"); + + b.Property("TaxDeduction") + .HasColumnType("float"); + + b.Property("TotalClaims") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalDeductions") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalPayment") + .HasColumnType("float"); + + b.Property("WorkshopFullName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("YearInt") + .HasColumnType("int"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("WorkshopId"); + + b.ToTable("CustomizeCheckoutTemps", (string)null); + }); + + modelBuilder.Entity("Company.Domain.CustomizeWorkshopEmployeeSettingsAgg.Entities.CustomizeWorkshopEmployeeSettings", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("CustomizeWorkshopGroupSettingId") + .HasColumnType("bigint"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("FridayWork") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("HolidayWork") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("IsSettingChanged") + .HasColumnType("bit"); + + b.Property("IsShiftChanged") + .HasColumnType("bit"); + + b.Property("LeavePermittedDays") + .HasColumnType("int"); + + b.Property("Salary") + .HasColumnType("float"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopShiftStatus") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.HasKey("id"); + + b.HasIndex("CustomizeWorkshopGroupSettingId"); + + b.ToTable("CustomizeWorkshopEmployeeSettings", (string)null); + }); + + modelBuilder.Entity("Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettings", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("CustomizeWorkshopSettingId") + .HasColumnType("bigint"); + + b.Property("FridayWork") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("GroupName") + .HasMaxLength(120) + .HasColumnType("nvarchar(120)"); + + b.Property("HolidayWork") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("IsSettingChange") + .HasColumnType("bit"); + + b.Property("IsShiftChange") + .HasColumnType("bit"); + + b.Property("LeavePermittedDays") + .HasColumnType("int"); + + b.Property("MainGroup") + .HasColumnType("bit"); + + b.Property("Salary") + .HasColumnType("float"); + + b.Property("WorkshopShiftStatus") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.HasKey("id"); + + b.HasIndex("CustomizeWorkshopSettingId"); + + b.ToTable("CustomizeWorkshopGroupSettings", (string)null); + }); + + modelBuilder.Entity("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BaseYearsPayInEndOfYear") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("BonusesPaysInEndOfMonth") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Currency") + .HasColumnType("int"); + + b.Property("EndTimeOffSet") + .HasColumnType("time"); + + b.Property("FridayWork") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("HolidayWork") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.Property("LeavePermittedDays") + .HasColumnType("int"); + + b.Property("MaxMonthDays") + .HasColumnType("int"); + + b.Property("OverTimeThresholdMinute") + .HasColumnType("int"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopShiftStatus") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b.HasKey("id"); + + b.HasIndex("WorkshopId") + .IsUnique(); + + b.ToTable("CustomizeWorkshopSettings", (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("IdNumberSeri") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("IdNumberSerial") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + 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("IsAuthorized") + .HasColumnType("bit"); + + 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.EmployeeAuthorizeTempAgg.EmployeeAuthorizeTemp", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BirthDate") + .HasColumnType("datetime2"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("FName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("FatherName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Gender") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("IdNumber") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("IdNumberSeri") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("IdNumberSerial") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("LName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("NationalCode") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.HasKey("id"); + + b.HasIndex("NationalCode") + .IsUnique() + .HasFilter("[NationalCode] IS NOT NULL"); + + b.ToTable("EmployeeAuthorizeTemps", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployeeBankInformationAgg.EmployeeBankInformation", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BankAccountNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("BankId") + .HasColumnType("bigint"); + + b.Property("CardNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("IsDefault") + .HasColumnType("bit"); + + b.Property("ShebaNumber") + .HasMaxLength(26) + .HasColumnType("nvarchar(26)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("BankId"); + + b.HasIndex("EmployeeId"); + + b.ToTable("EmployeeBankInformationSet", (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.EmployeeClientTempAgg.EmployeeClientTemp", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeFullName") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("MaritalStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("StartWorkDate") + .HasColumnType("datetime2"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("EmployeeClientTemps"); + }); + + 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("ContractTerm") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("CreateCheckout") + .HasColumnType("bit"); + + b.Property("CreateContract") + .HasColumnType("bit"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("CutContractEndOfYear") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("SignCheckout") + .HasColumnType("bit"); + + b.Property("SignContract") + .HasColumnType("bit"); + + 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.EmployeeDocumentItemAgg.EmployeeDocumentItem", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ConfirmationDateTime") + .HasColumnType("datetime2"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DocumentLabel") + .IsRequired() + .HasMaxLength(31) + .HasColumnType("nvarchar(31)"); + + b.Property("DocumentStatus") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("EmployeeDocumentId") + .HasColumnType("bigint"); + + b.Property("EmployeeDocumentsAdminViewId") + .HasColumnType("bigint"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("RejectionReason") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("ReviewedById") + .HasMaxLength(120) + .HasColumnType("bigint"); + + b.Property("UploaderId") + .HasColumnType("bigint"); + + b.Property("UploaderRoleId") + .HasColumnType("bigint"); + + b.Property("UploaderType") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("EmployeeDocumentId"); + + b.HasIndex("EmployeeDocumentsAdminViewId"); + + b.ToTable("EmployeeDocumentItems", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployeeDocumentsAdminSelectionAgg.EmployeeDocumentsAdminSelection", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId") + .IsUnique(); + + b.ToTable("EmployeeDocumentsAdminSelection", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployeeDocumentsAgg.EmployeeDocuments", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("Gender") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("HasRejectedItems") + .HasColumnType("bit"); + + b.Property("IsConfirmed") + .HasColumnType("bit"); + + b.Property("IsSentToChecker") + .HasColumnType("bit"); + + b.Property("RequiredItemsSubmittedByClient") + .HasColumnType("bit"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("WorkshopId"); + + b.ToTable("EmployeeDocuments", (string)null); + }); + + modelBuilder.Entity("Company.Domain.EmployeeInsurancListDataAgg.EmployeeInsurancListData", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BaseYears") + .HasColumnType("float"); + + b.Property("BenefitsIncludedContinuous") + .HasColumnType("float"); + + b.Property("BenefitsIncludedNonContinuous") + .HasColumnType("float"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DailyWage") + .HasColumnType("float"); + + b.Property("DailyWagePlusBaseYears") + .HasColumnType("float"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("FamilyAllowance") + .HasColumnType("float"); + + 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("MarriedAllowance") + .HasColumnType("float"); + + b.Property("MonthlyBenefits") + .HasColumnType("float"); + + b.Property("MonthlyBenefitsIncluded") + .HasColumnType("float"); + + b.Property("MonthlySalary") + .HasColumnType("float"); + + b.Property("OverTimePay") + .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.FinancialInvoiceAgg.FinancialInvoice", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Amount") + .HasColumnType("float"); + + b.Property("ContractingPartyId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasMaxLength(800) + .HasColumnType("nvarchar(800)"); + + b.Property("InvoiceNumber") + .HasMaxLength(22) + .HasColumnType("nvarchar(22)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("PaidAt") + .HasColumnType("datetime2"); + + b.Property("PublicId") + .HasColumnType("uniqueidentifier"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.HasKey("id"); + + b.ToTable("FinancialInvoices"); + }); + + modelBuilder.Entity("Company.Domain.FinancialInvoiceAgg.FinancialInvoiceItem", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Amount") + .HasColumnType("float"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasMaxLength(800) + .HasColumnType("nvarchar(800)"); + + b.Property("EntityId") + .HasColumnType("bigint"); + + b.Property("FinancialInvoiceId") + .HasColumnType("bigint"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.HasIndex("FinancialInvoiceId"); + + b.ToTable("FinancialInvoiceItem"); + }); + + 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.Property("PublicId") + .HasColumnType("uniqueidentifier"); + + 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(100) + .HasColumnType("nvarchar(100)"); + + 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.FineAgg.Fine", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Amount") + .HasColumnType("float"); + + b.Property("CreatedByAccountId") + .HasColumnType("bigint"); + + b.Property("CreatedByUserType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("FineDate") + .HasColumnType("datetime2"); + + b.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("LastModifiedByAccountId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByUserType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("Fines", (string)null); + }); + + modelBuilder.Entity("Company.Domain.FineSubjectAgg.FineSubject", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Amount") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("FineSubjects", (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("DiscountAmount") + .HasColumnType("float"); + + b.Property("DiscountPercentage") + .HasColumnType("int"); + + b.Property("EmployeeManualCount") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("ExtensionNo") + .HasColumnType("int"); + + b.Property("HasValueAddedTax") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IsActiveString") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsInstallment") + .HasColumnType("bit"); + + b.Property("LawId") + .HasColumnType("bigint"); + + b.Property("Obligation") + .HasColumnType("float"); + + b.Property("OfficialCompany") + .HasMaxLength(12) + .HasColumnType("nvarchar(12)"); + + b.Property("PublicId") + .HasColumnType("uniqueidentifier"); + + 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("VerificationStatus") + .IsRequired() + .HasMaxLength(122) + .HasColumnType("nvarchar(122)"); + + b.Property("VerifierFullName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("VerifierPhoneNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("VerifyCode") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("VerifyCodeCreation") + .HasColumnType("datetime2"); + + b.Property("WorkshopManualCount") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.HasKey("id"); + + b.ToTable("InstitutionContracts", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractAmendment", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Amount") + .HasColumnType("float"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("HasInstallment") + .HasColumnType("bit"); + + b.Property("InstitutionContractId") + .HasColumnType("bigint"); + + b.Property("LawId") + .HasColumnType("bigint"); + + b.Property("VerificationCreation") + .HasColumnType("datetime2"); + + b.Property("VerifierFullName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("VerifierPhoneNumber") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("VerifyCode") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("VerifyCodeCreation") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.HasIndex("InstitutionContractId"); + + b.ToTable("InstitutionContractAmendments", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractAmendmentChange", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ChangeDateGr") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("HasContractPlan") + .HasColumnType("bit"); + + b.Property("HasContractPlanInPerson") + .HasColumnType("bit"); + + b.Property("HasCustomizeCheckoutPlan") + .HasColumnType("bit"); + + b.Property("HasInsurancePlan") + .HasColumnType("bit"); + + b.Property("HasInsurancePlanInPerson") + .HasColumnType("bit"); + + b.Property("HasRollCallPlan") + .HasColumnType("bit"); + + b.Property("InstitutionContractAmendmentId") + .HasColumnType("bigint"); + + b.Property("PersonnelCount") + .HasColumnType("int"); + + b.Property("WorkshopDetailsId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("InstitutionContractAmendmentId"); + + b.ToTable("InstitutionContractAmendmentChange"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractInstallment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("float"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("InstallmentDateFa") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("InstallmentDateGr") + .HasColumnType("datetime2"); + + b.Property("InstitutionContractAmendmentId") + .HasColumnType("bigint"); + + b.Property("InstitutionContractId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("InstitutionContractAmendmentId"); + + b.HasIndex("InstitutionContractId"); + + b.ToTable("InstitutionContractInstallments", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopCurrent", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("InitialWorkshopId") + .HasColumnType("bigint"); + + b.Property("InstitutionContractId") + .HasColumnType("bigint"); + + b.Property("InstitutionContractWorkshopGroupId") + .HasColumnType("bigint"); + + b.Property("PersonnelCount") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("float"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.HasIndex("InstitutionContractWorkshopGroupId"); + + b.ToTable("InstitutionContractWorkshopCurrents", (string)null); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopGroup", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("InstitutionContractId") + .HasColumnType("bigint"); + + b.Property("LastModifiedDate") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.HasIndex("InstitutionContractId") + .IsUnique(); + + b.ToTable("InstitutionContractWorkshopGroups"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopInitial", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("InstitutionContractId") + .HasColumnType("bigint"); + + b.Property("InstitutionContractWorkshopCurrentId") + .HasColumnType("bigint"); + + b.Property("InstitutionContractWorkshopGroupId") + .HasColumnType("bigint"); + + b.Property("PersonnelCount") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("float"); + + b.Property("WorkshopCreated") + .HasColumnType("bit"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("WorkshopName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("id"); + + b.HasIndex("InstitutionContractWorkshopCurrentId") + .IsUnique() + .HasFilter("[InstitutionContractWorkshopCurrentId] IS NOT NULL"); + + b.HasIndex("InstitutionContractWorkshopGroupId"); + + b.ToTable("InstitutionContractWorkshopInitials", (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(150) + .HasColumnType("nvarchar(150)"); + + 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.InstitutionPlanAgg.PlanPercentage", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ContractAndCheckoutInPersonPercent") + .HasColumnType("int"); + + b.Property("ContractAndCheckoutPercent") + .HasColumnType("int"); + + b.Property("CustomizeCheckoutPercent") + .HasColumnType("int"); + + b.Property("InsuranceInPersonPercent") + .HasColumnType("int"); + + b.Property("InsurancePercent") + .HasColumnType("int"); + + b.Property("RollCallPercent") + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("PlanPercentage", (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("EndDate") + .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.Property("StartDate") + .HasColumnType("datetime2"); + + 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("SumOfBaseYears") + .HasColumnType("float"); + + b.Property("SumOfBenefitsIncluded") + .HasColumnType("float"); + + b.Property("SumOfDailyWage") + .HasColumnType("float"); + + b.Property("SumOfDailyWagePlusBaseYears") + .HasColumnType("float"); + + b.Property("SumOfEmployees") + .HasColumnType("int"); + + b.Property("SumOfMarriedAllowance") + .HasColumnType("float"); + + 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.ComplexProperty>("Debt", "Company.Domain.InsuranceListAgg.InsuranceList.Debt#InsuranceListDebt", b1 => + { + b1.IsRequired(); + + b1.Property("Amount") + .HasColumnType("float"); + + b1.Property("DebtDate") + .HasColumnType("datetime2"); + + b1.Property("IsDone") + .HasColumnType("bit"); + + b1.Property("MediaId") + .HasColumnType("bigint"); + + b1.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + }); + + b.ComplexProperty>("EmployerApproval", "Company.Domain.InsuranceListAgg.InsuranceList.EmployerApproval#InsuranceListEmployerApproval", b1 => + { + b1.IsRequired(); + + b1.Property("Description") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b1.Property("IsDone") + .HasColumnType("bit"); + + b1.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + }); + + b.ComplexProperty>("Inspection", "Company.Domain.InsuranceListAgg.InsuranceList.Inspection#InsuranceListInspection", b1 => + { + b1.IsRequired(); + + b1.Property("IsDone") + .HasColumnType("bit"); + + b1.Property("LastInspectionDateTime") + .HasColumnType("datetime2"); + + b1.Property("MediaId") + .HasColumnType("bigint"); + + b1.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + }); + + 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.LawAgg.Law", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("HeadTitle") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("NotificationsJson") + .HasMaxLength(3000) + .HasColumnType("nvarchar(3000)") + .HasColumnName("Notifications"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("id"); + + b.ToTable("Law", (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("HasShiftDuration") + .HasColumnType("bit"); + + b.Property("IsAccepted") + .HasColumnType("bit"); + + b.Property("IsInvalid") + .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("ShiftDuration") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + 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.LeftWorkTempAgg.LeftWorkTemp", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("JobId") + .HasColumnType("bigint"); + + b.Property("LastDayStanding") + .HasColumnType("datetime2"); + + b.Property("LeftWork") + .HasColumnType("datetime2"); + + b.Property("LeftWorkId") + .HasColumnType("bigint"); + + b.Property("LeftWorkType") + .HasColumnType("int"); + + b.Property("StartWork") + .HasColumnType("datetime2"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("LeftWorkTemps"); + }); + + modelBuilder.Entity("Company.Domain.LoanAgg.Entities.Loan", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Amount") + .HasColumnType("float"); + + b.Property("AmountPerMonth") + .HasColumnType("float"); + + b.Property("Count") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("CreatedByAccountId") + .HasColumnType("bigint"); + + b.Property("CreatedByUserType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("GetRounded") + .HasColumnType("bit"); + + b.Property("LoanGrantDate") + .HasColumnType("datetime2"); + + b.Property("StartInstallmentPayment") + .HasColumnType("datetime2"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("Loan", (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.PaymentInstrumentAgg.PaymentInstrument", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("AccountHolderName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AccountNumber") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("CardNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("IBan") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsAuth") + .HasColumnType("bit"); + + b.Property("PaymentInstrumentGroupId") + .HasColumnType("bigint"); + + b.Property("PosTerminalId") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("id"); + + b.HasIndex("PaymentInstrumentGroupId"); + + b.ToTable("PaymentInstruments"); + }); + + modelBuilder.Entity("Company.Domain.PaymentInstrumentAgg.PaymentInstrumentGroup", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("IsActive") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(120) + .HasColumnType("nvarchar(120)"); + + b.HasKey("id"); + + b.ToTable("PaymentInstrumentGroups"); + }); + + 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.PaymentTransactionAgg.PaymentTransaction", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Amount") + .HasColumnType("float"); + + b.Property("BankName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CallBackUrl") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("CardNumber") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("ContractingPartyId") + .HasColumnType("bigint"); + + b.Property("ContractingPartyName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DigitalReceipt") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("FinancialInvoiceId") + .HasColumnType("bigint"); + + b.Property("Gateway") + .IsRequired() + .HasMaxLength(35) + .HasColumnType("nvarchar(35)"); + + b.Property("Rrn") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(35) + .HasColumnType("nvarchar(35)"); + + b.Property("TransactionDate") + .HasColumnType("datetime2"); + + b.Property("TransactionId") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.HasKey("id"); + + b.HasIndex("FinancialInvoiceId"); + + b.ToTable("PaymentTransactions", (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.RewardAgg.Reward", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Amount") + .HasColumnType("float"); + + b.Property("CreatedByAccountId") + .HasColumnType("bigint"); + + b.Property("CreatedByUserType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("ntext"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("GrantDate") + .HasColumnType("datetime2"); + + b.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("LastModifiedByAccountId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByUserType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RewardType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Title") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("Rewards", (string)null); + }); + + modelBuilder.Entity("Company.Domain.RollCallAgg.RollCall", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("BreakTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EarlyEntryDuration") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("EarlyExitDuration") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("EmployeeFullName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("FridayWorkTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LateEntryDuration") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LateExitDuration") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("Month") + .HasColumnType("int"); + + b.Property("NightWorkTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("RollCallModifyType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShiftDate") + .HasColumnType("datetime2"); + + b.Property("ShiftDurationTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("ShiftType") + .IsRequired() + .HasMaxLength(22) + .HasColumnType("nvarchar(22)"); + + 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("FName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("HasChangedName") + .HasColumnType("bit"); + + b.Property("HasUploadedImage") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IsActiveString") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("LName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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("CustomizeCheckoutAmount") + .HasColumnType("float"); + + b.Property("CustomizeCheckoutServiceEnd") + .HasColumnType("datetime2"); + + b.Property("CustomizeCheckoutServiceStart") + .HasColumnType("datetime2"); + + b.Property("Duration") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("EndService") + .HasColumnType("datetime2"); + + b.Property("HasCustomizeCheckoutService") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + 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("WorkshopId"); + + b.ToTable("RollCallServices", (string)null); + }); + + modelBuilder.Entity("Company.Domain.SalaryAidAgg.SalaryAid", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Amount") + .HasColumnType("float"); + + b.Property("CalculationDate") + .HasColumnType("datetime2"); + + b.Property("CalculationMonth") + .HasColumnType("int"); + + b.Property("CalculationYear") + .HasColumnType("int"); + + b.Property("CreatedByAccountId") + .HasColumnType("bigint"); + + b.Property("CreatedByUserType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByAccountId") + .HasColumnType("bigint"); + + b.Property("LastModifiedByUserType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SalaryAidDateTime") + .HasColumnType("datetime2"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.ToTable("SalaryAids", (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.SmsResultAgg.SmsSetting", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("DayOfMonth") + .HasColumnType("int"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("TimeOfDay") + .HasColumnType("time(0)"); + + b.Property("TypeOfSmsSetting") + .IsRequired() + .HasMaxLength(70) + .HasColumnType("nvarchar(70)"); + + b.HasKey("id"); + + b.ToTable("SmsSettings", (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.TemporaryClientRegistrationAgg.ContractingPartyTemp", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("Address") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("City") + .HasMaxLength(35) + .HasColumnType("nvarchar(35)"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("FName") + .IsRequired() + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("FatherName") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("Gender") + .IsRequired() + .HasMaxLength(6) + .HasColumnType("nvarchar(6)"); + + b.Property("IdNumber") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IdNumberSeri") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("IdNumberSerial") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("LName") + .IsRequired() + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("NationalCode") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Phone") + .HasMaxLength(12) + .HasColumnType("nvarchar(12)"); + + b.Property("PublicId") + .HasColumnType("uniqueidentifier"); + + b.Property("State") + .HasMaxLength(35) + .HasColumnType("nvarchar(35)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("VerifyCode") + .HasMaxLength(12) + .HasColumnType("nvarchar(12)"); + + b.Property("VerifyCodeSentDateTime") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.ToTable("ContractingPartyTemp", (string)null); + }); + + modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractContactInfoTemp", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("FullName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InstitutionContractTempId") + .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("InstitutionContractTempId"); + + b.ToTable("InstitutionContractContactInfoTemp", (string)null); + }); + + modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ContractEndGr") + .HasColumnType("datetime2"); + + b.Property("ContractStartGr") + .HasColumnType("datetime2"); + + b.Property("ContractingPartyTempId") + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("MessageId") + .HasColumnType("int"); + + b.Property("OfficialCompany") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("PaymentModel") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("PeriodModel") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("PublicId") + .HasColumnType("uniqueidentifier"); + + b.Property("RegistrationStatus") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("SendVerifyCodeTime") + .HasColumnType("datetime2"); + + b.Property("TotalPayment") + .HasColumnType("float"); + + b.Property("ValueAddedTax") + .HasColumnType("float"); + + b.Property("VerifyCode") + .HasMaxLength(6) + .HasColumnType("nvarchar(6)"); + + b.Property("VerifyCodeEndTime") + .HasColumnType("datetime2"); + + b.HasKey("id"); + + b.ToTable("InstitutionContractTemps", (string)null); + }); + + modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopServicesTemp", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("CountPerson") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ServiceName") + .HasMaxLength(40) + .HasColumnType("nvarchar(40)"); + + b.Property("WorkshopTempId") + .HasColumnType("bigint"); + + b.HasKey("id"); + + b.HasIndex("WorkshopTempId"); + + b.ToTable("WorkshopServicesTemps", (string)null); + }); + + modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id")); + + b.Property("ContractingPartyTempId") + .HasColumnType("bigint"); + + b.Property("CountPerson") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("WorkshopName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("WorkshopServicesAmount") + .HasColumnType("float"); + + b.HasKey("id"); + + b.ToTable("WorkshopTemps", (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("ContractingPartyId") + .HasColumnType("bigint"); + + b.Property("CreateCheckout") + .HasColumnType("bit"); + + b.Property("CreateContract") + .HasColumnType("bit"); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("CutContractEndOfYear") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("FixedSalary") + .HasColumnType("bit"); + + b.Property("HasRollCallFreeVip") + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b.Property("InsuranceCheckoutFamilyAllowance") + .HasColumnType("bit"); + + b.Property("InsuranceCheckoutOvertime") + .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("IsStaticCheckout") + .HasColumnType("bit"); + + b.Property("Population") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b.Property("RotatingShiftCompute") + .HasColumnType("bit"); + + b.Property("SignCheckout") + .HasColumnType("bit"); + + b.Property("SignContract") + .HasColumnType("bit"); + + 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("WorkshopHolidayWorking") + .HasColumnType("bit"); + + 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.WorkshopSubAccountAgg.WorkshopSubAccount", b => + { + b.Property("SubAccountId") + .HasColumnType("bigint"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.Property("IsActive") + .HasMaxLength(5) + .HasColumnType("int"); + + b.HasKey("SubAccountId", "WorkshopId"); + + b.HasIndex("WorkshopId"); + + b.ToTable("WorkshopSubAccounts", (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("IdNumberSeri") + .HasColumnType("nvarchar(max)"); + + b.Property("IdNumberSerial") + .HasColumnType("nvarchar(max)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsAuth") + .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.AuthorizedBankDetailsAgg.AuthorizedBankDetails", b => + { + b.OwnsMany("Company.Domain.AuthorizedBankDetailsAgg.AuthorizedBankDetailsOwner", "OwnersList", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("AuthorizedBankDetailsId") + .HasColumnType("bigint"); + + b1.Property("CustomerType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b1.Property("FName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b1.Property("LName") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b1.Property("NationalIdentifier") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b1.HasKey("Id"); + + b1.HasIndex("AuthorizedBankDetailsId"); + + b1.ToTable("AuthorizedBankDetailsOwners", (string)null); + + b1.WithOwner() + .HasForeignKey("AuthorizedBankDetailsId"); + }); + + b.Navigation("OwnersList"); + }); + + 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.OwnsOne("Company.Domain.CheckoutAgg.CheckoutRollCall", "CheckoutRollCall", b1 => + { + b1.Property("Checkoutid") + .HasColumnType("bigint"); + + b1.Property("TotalBreakTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.Property("TotalMandatoryTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.Property("TotalPaidLeaveTmeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.Property("TotalPresentTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.Property("TotalSickLeaveTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.Property("TotalWorkingTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.HasKey("Checkoutid"); + + b1.ToTable("Checkouts"); + + b1.WithOwner() + .HasForeignKey("Checkoutid"); + + b1.OwnsMany("Company.Domain.CheckoutAgg.CheckoutRollCallDay", "RollCallDaysCollection", b2 => + { + b2.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property("Id")); + + b2.Property("BreakTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b2.Property("CheckoutId") + .HasColumnType("bigint"); + + b2.Property("Date") + .HasColumnType("datetime2"); + + b2.Property("FirstEndDate") + .HasMaxLength(18) + .HasColumnType("nvarchar(18)"); + + b2.Property("FirstStartDate") + .HasMaxLength(18) + .HasColumnType("nvarchar(18)"); + + b2.Property("IsAbsent") + .HasColumnType("bit"); + + b2.Property("IsFriday") + .HasColumnType("bit"); + + b2.Property("IsHoliday") + .HasColumnType("bit"); + + b2.Property("IsSliced") + .HasColumnType("bit"); + + b2.Property("LeaveType") + .HasMaxLength(18) + .HasColumnType("nvarchar(18)"); + + b2.Property("SecondEndDate") + .HasMaxLength(18) + .HasColumnType("nvarchar(18)"); + + b2.Property("SecondStartDate") + .HasMaxLength(18) + .HasColumnType("nvarchar(18)"); + + b2.Property("WorkingTimeSpan") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b2.HasKey("Id"); + + b2.HasIndex("CheckoutId"); + + b2.ToTable("CheckoutRollCallDay"); + + b2.WithOwner() + .HasForeignKey("CheckoutId"); + }); + + b1.Navigation("RollCallDaysCollection"); + }); + + b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutLoanInstallment", "LoanInstallments", b1 => + { + b1.Property("Checkoutid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("AmountForMonth") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("EntityId") + .HasColumnType("bigint"); + + b1.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b1.Property("LoanAmount") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.Property("LoanRemaining") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("Month") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("Year") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b1.HasKey("Checkoutid", "Id"); + + b1.ToTable("CheckoutLoanInstallment"); + + b1.WithOwner() + .HasForeignKey("Checkoutid"); + }); + + b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutSalaryAid", "SalaryAids", b1 => + { + b1.Property("Checkoutid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Amount") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("CalculationDateTime") + .HasColumnType("datetime2"); + + b1.Property("CalculationDateTimeFa") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.Property("EntityId") + .HasColumnType("bigint"); + + b1.Property("SalaryAidDateTime") + .HasColumnType("datetime2"); + + b1.Property("SalaryAidDateTimeFa") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.HasKey("Checkoutid", "Id"); + + b1.ToTable("CheckoutSalaryAid"); + + b1.WithOwner() + .HasForeignKey("Checkoutid"); + }); + + b.Navigation("CheckoutRollCall"); + + b.Navigation("LoanInstallments"); + + b.Navigation("SalaryAids"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.CheckoutAgg.CheckoutWarningMessage", b => + { + b.HasOne("Company.Domain.CheckoutAgg.Checkout", "Checkout") + .WithMany("CheckoutWarningMessageList") + .HasForeignKey("CheckoutId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Checkout"); + }); + + 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.ContractingPartyBankAccountsAgg.ContractingPartyBankAccount", b => + { + b.HasOne("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", "ContractingParty") + .WithMany("ContractingPartyBankAccounts") + .HasForeignKey("ContractingPartyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ContractingParty"); + }); + + 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.CustomizeCheckoutAgg.CustomizeCheckout", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany("CustomizeCheckouts") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("CustomizeCheckouts") + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("_0_Framework.Application.Enums.CheckoutDynamicDeductionItem", "CheckoutDynamicDeductions", b1 => + { + b1.Property("CustomizeCheckoutid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Amount") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.Property("Count") + .HasColumnType("int"); + + b1.Property("Name") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b1.HasKey("CustomizeCheckoutid", "Id"); + + b1.ToTable("CustomizeCheckouts_CheckoutDynamicDeductions"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutid"); + }); + + b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.CustomizeRotatingShift", "CustomizeRotatingShifts", b1 => + { + b1.Property("CustomizeCheckoutid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.HasKey("CustomizeCheckoutid", "Id"); + + b1.ToTable("CustomizeCheckouts_CustomizeRotatingShifts"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.IrregularShift", "IrregularShift", b1 => + { + b1.Property("CustomizeCheckoutid") + .HasColumnType("bigint"); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.Property("WorkshopIrregularShifts") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.HasKey("CustomizeCheckoutid"); + + b1.ToTable("CustomizeCheckouts"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutid"); + }); + + b.OwnsMany("Company.Domain.CustomizeCheckoutAgg.ValueObjects.CustomizeCheckoutRegularShift", "RegularShifts", b1 => + { + b1.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("id")); + + b1.Property("CreationDate") + .HasColumnType("datetime2"); + + b1.Property("CustomizeCheckoutid") + .HasColumnType("bigint"); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("Placement") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.HasKey("id"); + + b1.HasIndex("CustomizeCheckoutid"); + + b1.ToTable("CustomizeCheckouts_RegularShifts"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutid"); + }); + + b.OwnsMany("Company.Domain.CustomizeCheckoutAgg.ValueObjects.CustomizeCheckoutFine", "CheckoutFines", b1 => + { + b1.Property("CustomizeCheckoutid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Amount") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b1.Property("CreationDate") + .HasColumnType("datetime2"); + + b1.Property("EntityId") + .HasColumnType("bigint"); + + b1.Property("FineDateFa") + .HasMaxLength(12) + .HasColumnType("nvarchar(12)"); + + b1.Property("FineDateGr") + .HasColumnType("datetime2"); + + b1.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b1.Property("Title") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b1.HasKey("CustomizeCheckoutid", "Id"); + + b1.ToTable("CustomizeCheckoutFine"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutid"); + }); + + b.OwnsMany("Company.Domain.CustomizeCheckoutAgg.ValueObjects.CustomizeCheckoutLoanInstallments", "CustomizeCheckoutLoanInstallments", b1 => + { + b1.Property("CustomizeCheckoutid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("AmountForMonth") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("EntityId") + .HasColumnType("bigint"); + + b1.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b1.Property("LoanAmount") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.Property("LoanRemaining") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("Month") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("Year") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b1.HasKey("CustomizeCheckoutid", "Id"); + + b1.ToTable("CustomizeCheckoutLoanInstallments"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutid"); + }); + + b.OwnsMany("Company.Domain.CustomizeCheckoutAgg.ValueObjects.CustomizeCheckoutReward", "CustomizeCheckoutRewards", b1 => + { + b1.Property("CustomizeCheckoutid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Amount") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("Description") + .HasColumnType("ntext"); + + b1.Property("EntityId") + .HasColumnType("bigint"); + + b1.Property("GrantDate") + .HasColumnType("datetime2"); + + b1.Property("GrantDateFa") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b1.Property("Title") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b1.HasKey("CustomizeCheckoutid", "Id"); + + b1.ToTable("CustomizeCheckoutReward"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutid"); + }); + + b.OwnsMany("Company.Domain.CustomizeCheckoutAgg.ValueObjects.CustomizeCheckoutSalaryAid", "CustomizeCheckoutSalaryAids", b1 => + { + b1.Property("CustomizeCheckoutid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Amount") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("CalculationDateTime") + .HasColumnType("datetime2"); + + b1.Property("CalculationDateTimeFa") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.Property("EntityId") + .HasColumnType("bigint"); + + b1.Property("SalaryAidDateTime") + .HasColumnType("datetime2"); + + b1.Property("SalaryAidDateTimeFa") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.HasKey("CustomizeCheckoutid", "Id"); + + b1.ToTable("CustomizeCheckoutSalaryAid"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutid"); + }); + + b.Navigation("CheckoutDynamicDeductions"); + + b.Navigation("CheckoutFines"); + + b.Navigation("CustomizeCheckoutLoanInstallments"); + + b.Navigation("CustomizeCheckoutRewards"); + + b.Navigation("CustomizeCheckoutSalaryAids"); + + b.Navigation("CustomizeRotatingShifts"); + + b.Navigation("Employee"); + + b.Navigation("IrregularShift"); + + b.Navigation("RegularShifts"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.CustomizeCheckoutTempAgg.CustomizeCheckoutTemp", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany() + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("_0_Framework.Application.Enums.CheckoutDynamicDeductionItem", "CheckoutDynamicDeductions", b1 => + { + b1.Property("CustomizeCheckoutTempid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Amount") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.Property("Count") + .HasColumnType("int"); + + b1.Property("Name") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b1.HasKey("CustomizeCheckoutTempid", "Id"); + + b1.ToTable("CustomizeCheckoutTemps_CheckoutDynamicDeductions"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutTempid"); + }); + + b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.CustomizeRotatingShift", "CustomizeRotatingShifts", b1 => + { + b1.Property("CustomizeCheckoutTempid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.HasKey("CustomizeCheckoutTempid", "Id"); + + b1.ToTable("CustomizeCheckoutTemps_CustomizeRotatingShifts"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutTempid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.IrregularShift", "IrregularShift", b1 => + { + b1.Property("CustomizeCheckoutTempid") + .HasColumnType("bigint"); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.Property("WorkshopIrregularShifts") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.HasKey("CustomizeCheckoutTempid"); + + b1.ToTable("CustomizeCheckoutTemps"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutTempid"); + }); + + b.OwnsMany("Company.Domain.CustomizeCheckoutAgg.ValueObjects.CustomizeCheckoutRegularShift", "RegularShifts", b1 => + { + b1.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("id")); + + b1.Property("CreationDate") + .HasColumnType("datetime2"); + + b1.Property("CustomizeCheckoutTempid") + .HasColumnType("bigint"); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("Placement") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.HasKey("id"); + + b1.HasIndex("CustomizeCheckoutTempid"); + + b1.ToTable("CustomizeCheckoutTemps_RegularShifts"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutTempid"); + }); + + b.OwnsMany("Company.Domain.CustomizeCheckoutTempAgg.ValueObjects.CustomizeCheckoutTempFine", "CheckoutFines", b1 => + { + b1.Property("CustomizeCheckoutTempid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Amount") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b1.Property("CreationDate") + .HasColumnType("datetime2"); + + b1.Property("EntityId") + .HasColumnType("bigint"); + + b1.Property("FineDateFa") + .HasMaxLength(12) + .HasColumnType("nvarchar(12)"); + + b1.Property("FineDateGr") + .HasColumnType("datetime2"); + + b1.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b1.Property("Title") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b1.HasKey("CustomizeCheckoutTempid", "Id"); + + b1.ToTable("CustomizeCheckoutTempFine"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutTempid"); + }); + + b.OwnsMany("Company.Domain.CustomizeCheckoutTempAgg.ValueObjects.CustomizeCheckoutTempLoanInstallments", "CustomizeCheckoutLoanInstallments", b1 => + { + b1.Property("CustomizeCheckoutTempid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("AmountForMonth") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("EntityId") + .HasColumnType("bigint"); + + b1.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b1.Property("LoanAmount") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b1.Property("LoanRemaining") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("Month") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("Year") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b1.HasKey("CustomizeCheckoutTempid", "Id"); + + b1.ToTable("CustomizeCheckoutTempLoanInstallments"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutTempid"); + }); + + b.OwnsMany("Company.Domain.CustomizeCheckoutTempAgg.ValueObjects.CustomizeCheckoutTempReward", "CustomizeCheckoutRewards", b1 => + { + b1.Property("CustomizeCheckoutTempid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Amount") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("Description") + .HasColumnType("ntext"); + + b1.Property("EntityId") + .HasColumnType("bigint"); + + b1.Property("GrantDate") + .HasColumnType("datetime2"); + + b1.Property("GrantDateFa") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b1.Property("Title") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b1.HasKey("CustomizeCheckoutTempid", "Id"); + + b1.ToTable("CustomizeCheckoutTempReward"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutTempid"); + }); + + b.OwnsMany("Company.Domain.CustomizeCheckoutTempAgg.ValueObjects.CustomizeCheckoutTempSalaryAid", "CustomizeCheckoutSalaryAids", b1 => + { + b1.Property("CustomizeCheckoutTempid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Amount") + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("CalculationDateTime") + .HasColumnType("datetime2"); + + b1.Property("CalculationDateTimeFa") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.Property("EntityId") + .HasColumnType("bigint"); + + b1.Property("SalaryAidDateTime") + .HasColumnType("datetime2"); + + b1.Property("SalaryAidDateTimeFa") + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.HasKey("CustomizeCheckoutTempid", "Id"); + + b1.ToTable("CustomizeCheckoutTempSalaryAid"); + + b1.WithOwner() + .HasForeignKey("CustomizeCheckoutTempid"); + }); + + b.Navigation("CheckoutDynamicDeductions"); + + b.Navigation("CheckoutFines"); + + b.Navigation("CustomizeCheckoutLoanInstallments"); + + b.Navigation("CustomizeCheckoutRewards"); + + b.Navigation("CustomizeCheckoutSalaryAids"); + + b.Navigation("CustomizeRotatingShifts"); + + b.Navigation("Employee"); + + b.Navigation("IrregularShift"); + + b.Navigation("RegularShifts"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("Company.Domain.CustomizeWorkshopEmployeeSettingsAgg.Entities.CustomizeWorkshopEmployeeSettings", b => + { + b.HasOne("Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettings", "CustomizeWorkshopGroupSettings") + .WithMany("CustomizeWorkshopEmployeeSettingsCollection") + .HasForeignKey("CustomizeWorkshopGroupSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Company.Domain.CustomizeWorkshopEmployeeSettingsAgg.Entities.CustomizeWorkshopEmployeeSettingsShift", "CustomizeWorkshopEmployeeSettingsShifts", b1 => + { + b1.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("id")); + + b1.Property("CreationDate") + .HasColumnType("datetime2"); + + b1.Property("CustomizeWorkshopEmployeeSettingsId") + .HasColumnType("bigint"); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("Placement") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b1.Property("PreviousShiftThreshold") + .HasColumnType("time"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.HasKey("id"); + + b1.HasIndex("CustomizeWorkshopEmployeeSettingsId"); + + b1.ToTable("CustomizeWorkshopEmployeeSettingsShifts", (string)null); + + b1.WithOwner("CustomizeWorkshopEmployeeSettings") + .HasForeignKey("CustomizeWorkshopEmployeeSettingsId"); + + b1.Navigation("CustomizeWorkshopEmployeeSettings"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.BaseYearsPay", "BaseYearsPay", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("BaseYearsPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BaseYearsPay_BaseYearsPayType"); + + b1.Property("PaymentType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BaseYearsPay_PaymentType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("BaseYearsPay_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.BonusesPay", "BonusesPay", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("BonusesPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BonusesPay_BonusesPayType"); + + b1.Property("PaymentType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BonusesPay_PaymentType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("BonusesPay_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.BreakTime", "BreakTime", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("BreakTimeType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b1.Property("BreakTimeValue") + .HasColumnType("time"); + + b1.Property("HasBreakTimeValue") + .HasColumnType("bit"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.CustomizeRotatingShift", "CustomizeRotatingShifts", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid", "Id"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings_CustomizeRotatingShifts"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.EarlyExit", "EarlyExit", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("EarlyExitType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("EarlyExit_EarlyExitType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("EarlyExitTimeFines_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.EarlyExitTimeFine", "EarlyExitTimeFines", b2 => + { + b2.Property("CustomizeWorkshopEmployeeSettingsId") + .HasColumnType("bigint"); + + b2.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property("Id")); + + b2.Property("FineMoney") + .HasColumnType("float") + .HasColumnName("EarlyExitTimeFines_FineMoney"); + + b2.Property("Minute") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)") + .HasColumnName("EarlyExitTimeFines_Minute"); + + b2.HasKey("CustomizeWorkshopEmployeeSettingsId", "Id"); + + b2.ToTable("CustomizeWorkshopEmployeeSettings_EarlyExitTimeFines"); + + b2.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsId"); + }); + + b1.Navigation("EarlyExitTimeFines"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FamilyAllowance", "FamilyAllowance", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("FamilyAllowanceType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FamilyAllowance_FamilyAllowanceType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("FamilyAllowance_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FineAbsenceDeduction", "FineAbsenceDeduction", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("FineAbsenceDeductionType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FineAbsenceDeduction_FineAbsenceDeductionType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("FineAbsenceDeduction_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FineAbsenceDayOfWeek", "FineAbsenceDayOfWeekCollection", b2 => + { + b2.Property("CustomizeWorkshopEmployeeSettingsId") + .HasColumnType("bigint"); + + b2.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property("Id")); + + b2.Property("DayOfWeek") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FineAbsenceDayOfWeekCollection_DayOfWeek"); + + b2.HasKey("CustomizeWorkshopEmployeeSettingsId", "Id"); + + b2.ToTable("CustomizeWorkshopEmployeeSettings_FineAbsenceDayOfWeekCollection"); + + b2.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsId"); + }); + + b1.Navigation("FineAbsenceDayOfWeekCollection"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FridayPay", "FridayPay", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("FridayPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("FridayPay_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.InsuranceDeduction", "InsuranceDeduction", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("InsuranceDeductionType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("InsuranceDeduction_InsuranceDeductionType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("InsuranceDeduction_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.IrregularShift", "IrregularShift", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.Property("WorkshopIrregularShifts") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.LateToWork", "LateToWork", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("LateToWorkType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("LateToWork_LateToWorkType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("LateToWork_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.LateToWorkTimeFine", "LateToWorkTimeFines", b2 => + { + b2.Property("CustomizeWorkshopEmployeeSettingsId") + .HasColumnType("bigint"); + + b2.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property("Id")); + + b2.Property("FineMoney") + .HasColumnType("float") + .HasColumnName("LateToWorkTimeFines_FineMoney"); + + b2.Property("Minute") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)") + .HasColumnName("LateToWorkTimeFines_Minute"); + + b2.HasKey("CustomizeWorkshopEmployeeSettingsId", "Id"); + + b2.ToTable("CustomizeWorkshopEmployeeSettings_LateToWorkTimeFines"); + + b2.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsId"); + }); + + b1.Navigation("LateToWorkTimeFines"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.LeavePay", "LeavePay", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("LeavePayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("LeavePay_LeavePayType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("LeavePay_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.MarriedAllowance", "MarriedAllowance", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("MarriedAllowanceType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("MarriedAllowance_MarriedAllowanceType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("MarriedAllowance_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.NightWorkPay", "NightWorkPay", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("NightWorkingType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("NightWorkPay_NightWorkingType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("NightWorkPay_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.OverTimePay", "OverTimePay", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("OverTimePayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("OverTimePay_OverTimePayType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("OverTimePay_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.ShiftPay", "ShiftPay", b1 => + { + b1.Property("CustomizeWorkshopEmployeeSettingsid") + .HasColumnType("bigint"); + + b1.Property("ShiftPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("ShiftPay_ShiftPayType"); + + b1.Property("ShiftType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("ShiftPay_ShiftType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("ShiftPay_Value"); + + b1.HasKey("CustomizeWorkshopEmployeeSettingsid"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopEmployeeSettingsid"); + }); + + b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("DayOfWeek") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.Property("ParentId") + .HasColumnType("bigint"); + + b1.HasKey("Id"); + + b1.HasIndex("ParentId"); + + b1.ToTable("CustomizeWorkshopEmployeeSettings_WeeklyOffDays"); + + b1.WithOwner() + .HasForeignKey("ParentId"); + }); + + b.Navigation("BaseYearsPay"); + + b.Navigation("BonusesPay"); + + b.Navigation("BreakTime"); + + b.Navigation("CustomizeRotatingShifts"); + + b.Navigation("CustomizeWorkshopEmployeeSettingsShifts"); + + b.Navigation("CustomizeWorkshopGroupSettings"); + + b.Navigation("EarlyExit"); + + b.Navigation("FamilyAllowance"); + + b.Navigation("FineAbsenceDeduction"); + + b.Navigation("FridayPay"); + + b.Navigation("InsuranceDeduction"); + + b.Navigation("IrregularShift"); + + b.Navigation("LateToWork"); + + b.Navigation("LeavePay"); + + b.Navigation("MarriedAllowance"); + + b.Navigation("NightWorkPay"); + + b.Navigation("OverTimePay"); + + b.Navigation("ShiftPay"); + + b.Navigation("WeeklyOffDays"); + }); + + modelBuilder.Entity("Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettings", b => + { + b.HasOne("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", "CustomizeWorkshopSettings") + .WithMany("CustomizeWorkshopGroupSettingsCollection") + .HasForeignKey("CustomizeWorkshopSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettingsShift", "CustomizeWorkshopGroupSettingsShifts", b1 => + { + b1.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("id")); + + b1.Property("CreationDate") + .HasColumnType("datetime2"); + + b1.Property("CustomizeWorkshopGroupSettingsId") + .HasColumnType("bigint"); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("Placement") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.HasKey("id"); + + b1.HasIndex("CustomizeWorkshopGroupSettingsId"); + + b1.ToTable("CustomizeWorkshopGroupSettingsShifts", (string)null); + + b1.WithOwner("CustomizeWorkshopGroupSettings") + .HasForeignKey("CustomizeWorkshopGroupSettingsId"); + + b1.Navigation("CustomizeWorkshopGroupSettings"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.BaseYearsPay", "BaseYearsPay", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("BaseYearsPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BaseYearsPay_BaseYearsPayType"); + + b1.Property("PaymentType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BaseYearsPay_PaymentType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("BaseYearsPay_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.BonusesPay", "BonusesPay", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("BonusesPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BonusesPay_BonusesPayType"); + + b1.Property("PaymentType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BonusesPay_PaymentType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("BonusesPay_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.BreakTime", "BreakTime", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("BreakTimeType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b1.Property("BreakTimeValue") + .HasColumnType("time"); + + b1.Property("HasBreakTimeValue") + .HasColumnType("bit"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.CustomizeRotatingShift", "CustomizeRotatingShifts", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid", "Id"); + + b1.ToTable("CustomizeWorkshopGroupSettings_CustomizeRotatingShifts"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.EarlyExit", "EarlyExit", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("EarlyExitType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("EarlyExit_EarlyExitType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("EarlyExitTimeFines_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + + b1.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.EarlyExitTimeFine", "EarlyExitTimeFines", b2 => + { + b2.Property("CustomizeWorkshopGroupSettingsId") + .HasColumnType("bigint"); + + b2.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property("Id")); + + b2.Property("FineMoney") + .HasColumnType("float") + .HasColumnName("EarlyExitTimeFines_FineMoney"); + + b2.Property("Minute") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)") + .HasColumnName("EarlyExitTimeFines_Minute"); + + b2.HasKey("CustomizeWorkshopGroupSettingsId", "Id"); + + b2.ToTable("CustomizeWorkshopGroupSettings_EarlyExitTimeFines"); + + b2.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsId"); + }); + + b1.Navigation("EarlyExitTimeFines"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FamilyAllowance", "FamilyAllowance", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("FamilyAllowanceType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FamilyAllowance_FamilyAllowanceType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("FamilyAllowance_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FineAbsenceDeduction", "FineAbsenceDeduction", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("FineAbsenceDeductionType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FineAbsenceDeduction_FineAbsenceDeductionType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("FineAbsenceDeduction_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + + b1.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FineAbsenceDayOfWeek", "FineAbsenceDayOfWeekCollection", b2 => + { + b2.Property("CustomizeWorkshopGroupSettingsId") + .HasColumnType("bigint"); + + b2.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property("Id")); + + b2.Property("DayOfWeek") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FineAbsenceDayOfWeekCollection_DayOfWeek"); + + b2.HasKey("CustomizeWorkshopGroupSettingsId", "Id"); + + b2.ToTable("CustomizeWorkshopGroupSettings_FineAbsenceDayOfWeekCollection"); + + b2.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsId"); + }); + + b1.Navigation("FineAbsenceDayOfWeekCollection"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FridayPay", "FridayPay", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("FridayPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("FridayPay_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.InsuranceDeduction", "InsuranceDeduction", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("InsuranceDeductionType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("InsuranceDeduction_InsuranceDeductionType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("InsuranceDeduction_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.IrregularShift", "IrregularShift", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.Property("WorkshopIrregularShifts") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.LateToWork", "LateToWork", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("LateToWorkType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("LateToWork_LateToWorkType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("LateToWork_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + + b1.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.LateToWorkTimeFine", "LateToWorkTimeFines", b2 => + { + b2.Property("CustomizeWorkshopGroupSettingsId") + .HasColumnType("bigint"); + + b2.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property("Id")); + + b2.Property("FineMoney") + .HasColumnType("float") + .HasColumnName("LateToWorkTimeFines_FineMoney"); + + b2.Property("Minute") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)") + .HasColumnName("LateToWorkTimeFines_Minute"); + + b2.HasKey("CustomizeWorkshopGroupSettingsId", "Id"); + + b2.ToTable("CustomizeWorkshopGroupSettings_LateToWorkTimeFines"); + + b2.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsId"); + }); + + b1.Navigation("LateToWorkTimeFines"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.LeavePay", "LeavePay", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("LeavePayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("LeavePay_LeavePayType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("LeavePay_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.MarriedAllowance", "MarriedAllowance", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("MarriedAllowanceType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("MarriedAllowance_MarriedAllowanceType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("MarriedAllowance_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.NightWorkPay", "NightWorkPay", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("NightWorkingType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("NightWorkPay_NightWorkingType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("NightWorkPay_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.OverTimePay", "OverTimePay", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("OverTimePayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("OverTimePay_OverTimePayType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("OverTimePay_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.ShiftPay", "ShiftPay", b1 => + { + b1.Property("CustomizeWorkshopGroupSettingsid") + .HasColumnType("bigint"); + + b1.Property("ShiftPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("ShiftPay_ShiftPayType"); + + b1.Property("ShiftType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("ShiftPay_ShiftType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("ShiftPay_Value"); + + b1.HasKey("CustomizeWorkshopGroupSettingsid"); + + b1.ToTable("CustomizeWorkshopGroupSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopGroupSettingsid"); + }); + + b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("DayOfWeek") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.Property("ParentId") + .HasColumnType("bigint"); + + b1.HasKey("Id"); + + b1.HasIndex("ParentId"); + + b1.ToTable("CustomizeWorkshopGroupSettings_WeeklyOffDays"); + + b1.WithOwner() + .HasForeignKey("ParentId"); + }); + + b.Navigation("BaseYearsPay"); + + b.Navigation("BonusesPay"); + + b.Navigation("BreakTime"); + + b.Navigation("CustomizeRotatingShifts"); + + b.Navigation("CustomizeWorkshopGroupSettingsShifts"); + + b.Navigation("CustomizeWorkshopSettings"); + + b.Navigation("EarlyExit"); + + b.Navigation("FamilyAllowance"); + + b.Navigation("FineAbsenceDeduction"); + + b.Navigation("FridayPay"); + + b.Navigation("InsuranceDeduction"); + + b.Navigation("IrregularShift"); + + b.Navigation("LateToWork"); + + b.Navigation("LeavePay"); + + b.Navigation("MarriedAllowance"); + + b.Navigation("NightWorkPay"); + + b.Navigation("OverTimePay"); + + b.Navigation("ShiftPay"); + + b.Navigation("WeeklyOffDays"); + }); + + modelBuilder.Entity("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", b => + { + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithOne("CustomizeWorkshopSettings") + .HasForeignKey("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", "WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettingsShift", "CustomizeWorkshopSettingsShifts", b1 => + { + b1.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("id")); + + b1.Property("CreationDate") + .HasColumnType("datetime2"); + + b1.Property("CustomizeWorkshopSettingsId") + .HasColumnType("bigint"); + + b1.Property("EndTime") + .HasColumnType("time"); + + b1.Property("Placement") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b1.Property("StartTime") + .HasColumnType("time"); + + b1.HasKey("id"); + + b1.HasIndex("CustomizeWorkshopSettingsId"); + + b1.ToTable("CustomizeWorkshopSettingsShifts", (string)null); + + b1.WithOwner("CustomizeWorkshopSettings") + .HasForeignKey("CustomizeWorkshopSettingsId"); + + b1.Navigation("CustomizeWorkshopSettings"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.BaseYearsPay", "BaseYearsPay", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("BaseYearsPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BaseYearsPay_BaseYearsPayType"); + + b1.Property("PaymentType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BaseYearsPay_PaymentType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("BaseYearsPay_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.BonusesPay", "BonusesPay", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("BonusesPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BonusesPay_BonusesPayType"); + + b1.Property("PaymentType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("BonusesPay_PaymentType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("BonusesPay_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.EarlyExit", "EarlyExit", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("EarlyExitType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("EarlyExit_EarlyExitType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("EarlyExitTimeFines_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + + b1.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.EarlyExitTimeFine", "EarlyExitTimeFines", b2 => + { + b2.Property("CustomizeWorkshopSettingsId") + .HasColumnType("bigint"); + + b2.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property("Id")); + + b2.Property("FineMoney") + .HasColumnType("float") + .HasColumnName("EarlyExitTimeFines_FineMoney"); + + b2.Property("Minute") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)") + .HasColumnName("EarlyExitTimeFines_Minute"); + + b2.HasKey("CustomizeWorkshopSettingsId", "Id"); + + b2.ToTable("CustomizeWorkshopSettings_EarlyExitTimeFines"); + + b2.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsId"); + }); + + b1.Navigation("EarlyExitTimeFines"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FamilyAllowance", "FamilyAllowance", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("FamilyAllowanceType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FamilyAllowance_FamilyAllowanceType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("FamilyAllowance_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FineAbsenceDeduction", "FineAbsenceDeduction", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("FineAbsenceDeductionType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FineAbsenceDeduction_FineAbsenceDeductionType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("FineAbsenceDeduction_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + + b1.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FineAbsenceDayOfWeek", "FineAbsenceDayOfWeekCollection", b2 => + { + b2.Property("CustomizeWorkshopSettingsId") + .HasColumnType("bigint"); + + b2.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property("Id")); + + b2.Property("DayOfWeek") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FineAbsenceDayOfWeekCollection_DayOfWeek"); + + b2.HasKey("CustomizeWorkshopSettingsId", "Id"); + + b2.ToTable("CustomizeWorkshopSettings_FineAbsenceDayOfWeekCollection"); + + b2.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsId"); + }); + + b1.Navigation("FineAbsenceDayOfWeekCollection"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.FridayPay", "FridayPay", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("FridayPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("FridayPay_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.InsuranceDeduction", "InsuranceDeduction", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("InsuranceDeductionType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("InsuranceDeduction_InsuranceDeductionType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("InsuranceDeduction_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.LateToWork", "LateToWork", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("LateToWorkType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("LateToWork_LateToWorkType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("LateToWork_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + + b1.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.LateToWorkTimeFine", "LateToWorkTimeFines", b2 => + { + b2.Property("CustomizeWorkshopSettingsId") + .HasColumnType("bigint"); + + b2.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property("Id")); + + b2.Property("FineMoney") + .HasColumnType("float") + .HasColumnName("LateToWorkTimeFines_FineMoney"); + + b2.Property("Minute") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)") + .HasColumnName("LateToWorkTimeFines_Minute"); + + b2.HasKey("CustomizeWorkshopSettingsId", "Id"); + + b2.ToTable("CustomizeWorkshopSettings_LateToWorkTimeFines"); + + b2.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsId"); + }); + + b1.Navigation("LateToWorkTimeFines"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.LeavePay", "LeavePay", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("LeavePayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("LeavePay_LeavePayType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("LeavePay_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.MarriedAllowance", "MarriedAllowance", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("MarriedAllowanceType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("MarriedAllowance_MarriedAllowanceType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("MarriedAllowance_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.NightWorkPay", "NightWorkPay", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("NightWorkingType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("NightWorkPay_NightWorkingType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("NightWorkPay_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.OverTimePay", "OverTimePay", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("OverTimePayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("OverTimePay_OverTimePayType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("OverTimePay_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + }); + + b.OwnsOne("_0_Framework.Domain.CustomizeCheckoutShared.ValueObjects.ShiftPay", "ShiftPay", b1 => + { + b1.Property("CustomizeWorkshopSettingsid") + .HasColumnType("bigint"); + + b1.Property("ShiftPayType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("ShiftPay_ShiftPayType"); + + b1.Property("ShiftType") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("ShiftPay_ShiftType"); + + b1.Property("Value") + .HasColumnType("float") + .HasColumnName("ShiftPay_Value"); + + b1.HasKey("CustomizeWorkshopSettingsid"); + + b1.ToTable("CustomizeWorkshopSettings"); + + b1.WithOwner() + .HasForeignKey("CustomizeWorkshopSettingsid"); + }); + + b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("DayOfWeek") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b1.Property("ParentId") + .HasColumnType("bigint"); + + b1.HasKey("Id"); + + b1.HasIndex("ParentId"); + + b1.ToTable("CustomizeWorkshopSettings_WeeklyOffDays"); + + b1.WithOwner() + .HasForeignKey("ParentId"); + }); + + b.Navigation("BaseYearsPay"); + + b.Navigation("BonusesPay"); + + b.Navigation("CustomizeWorkshopSettingsShifts"); + + b.Navigation("EarlyExit"); + + b.Navigation("FamilyAllowance"); + + b.Navigation("FineAbsenceDeduction"); + + b.Navigation("FridayPay"); + + b.Navigation("InsuranceDeduction"); + + b.Navigation("LateToWork"); + + b.Navigation("LeavePay"); + + b.Navigation("MarriedAllowance"); + + b.Navigation("NightWorkPay"); + + b.Navigation("OverTimePay"); + + b.Navigation("ShiftPay"); + + b.Navigation("WeeklyOffDays"); + + b.Navigation("Workshop"); + }); + + 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.EmployeeBankInformationAgg.EmployeeBankInformation", b => + { + b.HasOne("Company.Domain.BankAgg.Bank", "Bank") + .WithMany() + .HasForeignKey("BankId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany("EmployeeBankInformationList") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Bank"); + + 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.EmployeeDocumentItemAgg.EmployeeDocumentItem", b => + { + b.HasOne("Company.Domain.EmployeeDocumentsAgg.EmployeeDocuments", "EmployeeDocuments") + .WithMany("EmployeeDocumentItemCollection") + .HasForeignKey("EmployeeDocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.EmployeeDocumentsAdminSelectionAgg.EmployeeDocumentsAdminSelection", "EmployeeDocumentsAdminSelection") + .WithMany("SelectedEmployeeDocumentItems") + .HasForeignKey("EmployeeDocumentsAdminViewId"); + + b.OwnsMany("Company.Domain.EmployeeDocumentItemAgg.EmployeeDocumentItemLog", "ItemLogs", b1 => + { + b1.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("id")); + + b1.Property("AdminMessage") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b1.Property("CreationDate") + .HasColumnType("datetime2"); + + b1.Property("EmployeeDocumentItemId") + .HasColumnType("bigint"); + + b1.Property("OperationType") + .IsRequired() + .HasMaxLength(25) + .HasColumnType("nvarchar(25)"); + + b1.Property("OperatorId") + .HasColumnType("bigint"); + + b1.Property("OperatorType") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b1.HasKey("id"); + + b1.HasIndex("EmployeeDocumentItemId"); + + b1.ToTable("EmployeeDocumentItemLogs", (string)null); + + b1.WithOwner("EmployeeDocumentItem") + .HasForeignKey("EmployeeDocumentItemId"); + + b1.Navigation("EmployeeDocumentItem"); + }); + + b.Navigation("EmployeeDocuments"); + + b.Navigation("EmployeeDocumentsAdminSelection"); + + b.Navigation("ItemLogs"); + }); + + modelBuilder.Entity("Company.Domain.EmployeeDocumentsAdminSelectionAgg.EmployeeDocumentsAdminSelection", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithOne("EmployeeDocumentsAdminSelection") + .HasForeignKey("Company.Domain.EmployeeDocumentsAdminSelectionAgg.EmployeeDocumentsAdminSelection", "EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + }); + + modelBuilder.Entity("Company.Domain.EmployeeDocumentsAgg.EmployeeDocuments", b => + { + b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") + .WithMany("EmployeeDocuments") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany() + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Workshop"); + }); + + 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.FinancialInvoiceAgg.FinancialInvoiceItem", b => + { + b.HasOne("Company.Domain.FinancialInvoiceAgg.FinancialInvoice", "FinancialInvoice") + .WithMany("Items") + .HasForeignKey("FinancialInvoiceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FinancialInvoice"); + }); + + 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.InstitutionContractAgg.InstitutionContractAmendment", b => + { + b.HasOne("Company.Domain.InstitutionContractAgg.InstitutionContract", "InstitutionContract") + .WithMany("Amendments") + .HasForeignKey("InstitutionContractId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("InstitutionContract"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractAmendmentChange", b => + { + b.HasOne("Company.Domain.InstitutionContractAgg.InstitutionContractAmendment", "InstitutionContractAmendment") + .WithMany("AmendmentChanges") + .HasForeignKey("InstitutionContractAmendmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("InstitutionContractAmendment"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractInstallment", b => + { + b.HasOne("Company.Domain.InstitutionContractAgg.InstitutionContractAmendment", "InstitutionContractAmendment") + .WithMany("Installments") + .HasForeignKey("InstitutionContractAmendmentId"); + + b.HasOne("Company.Domain.InstitutionContractAgg.InstitutionContract", "InstitutionContract") + .WithMany("Installments") + .HasForeignKey("InstitutionContractId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("InstitutionContract"); + + b.Navigation("InstitutionContractAmendment"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopCurrent", b => + { + b.HasOne("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopGroup", "WorkshopGroup") + .WithMany("CurrentWorkshops") + .HasForeignKey("InstitutionContractWorkshopGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopDetailEmployer", "Employers", b1 => + { + b1.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("id")); + + b1.Property("CreationDate") + .HasColumnType("datetime2"); + + b1.Property("EmployerId") + .HasColumnType("bigint"); + + b1.Property("InstitutionContractWorkshopCurrentid") + .HasColumnType("bigint"); + + b1.HasKey("id"); + + b1.HasIndex("InstitutionContractWorkshopCurrentid"); + + b1.ToTable("InstitutionContractWorkshopCurrentEmployers", (string)null); + + b1.WithOwner() + .HasForeignKey("InstitutionContractWorkshopCurrentid"); + }); + + b.OwnsOne("Company.Domain.InstitutionContractAgg.WorkshopServices", "Services", b1 => + { + b1.Property("InstitutionContractWorkshopCurrentid") + .HasColumnType("bigint"); + + b1.Property("Contract") + .HasColumnType("bit"); + + b1.Property("ContractInPerson") + .HasColumnType("bit"); + + b1.Property("CustomizeCheckout") + .HasColumnType("bit"); + + b1.Property("Insurance") + .HasColumnType("bit"); + + b1.Property("InsuranceInPerson") + .HasColumnType("bit"); + + b1.Property("RollCall") + .HasColumnType("bit"); + + b1.Property("RollCallInPerson") + .HasColumnType("bit"); + + b1.HasKey("InstitutionContractWorkshopCurrentid"); + + b1.ToTable("InstitutionContractWorkshopCurrents"); + + b1.WithOwner() + .HasForeignKey("InstitutionContractWorkshopCurrentid"); + }); + + b.Navigation("Employers"); + + b.Navigation("Services"); + + b.Navigation("WorkshopGroup"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopGroup", b => + { + b.HasOne("Company.Domain.InstitutionContractAgg.InstitutionContract", "InstitutionContract") + .WithOne("WorkshopGroup") + .HasForeignKey("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopGroup", "InstitutionContractId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("InstitutionContract"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopInitial", b => + { + b.HasOne("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopCurrent", "WorkshopCurrent") + .WithOne("WorkshopInitial") + .HasForeignKey("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopInitial", "InstitutionContractWorkshopCurrentId"); + + b.HasOne("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopGroup", "WorkshopGroup") + .WithMany("InitialWorkshops") + .HasForeignKey("InstitutionContractWorkshopGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsMany("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopDetailEmployer", "Employers", b1 => + { + b1.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("id")); + + b1.Property("CreationDate") + .HasColumnType("datetime2"); + + b1.Property("EmployerId") + .HasColumnType("bigint"); + + b1.Property("InstitutionContractWorkshopInitialid") + .HasColumnType("bigint"); + + b1.HasKey("id"); + + b1.HasIndex("InstitutionContractWorkshopInitialid"); + + b1.ToTable("InstitutionContractWorkshopInitialEmployers", (string)null); + + b1.WithOwner() + .HasForeignKey("InstitutionContractWorkshopInitialid"); + }); + + b.OwnsOne("Company.Domain.InstitutionContractAgg.WorkshopServices", "Services", b1 => + { + b1.Property("InstitutionContractWorkshopInitialid") + .HasColumnType("bigint"); + + b1.Property("Contract") + .HasColumnType("bit"); + + b1.Property("ContractInPerson") + .HasColumnType("bit"); + + b1.Property("CustomizeCheckout") + .HasColumnType("bit"); + + b1.Property("Insurance") + .HasColumnType("bit"); + + b1.Property("InsuranceInPerson") + .HasColumnType("bit"); + + b1.Property("RollCall") + .HasColumnType("bit"); + + b1.Property("RollCallInPerson") + .HasColumnType("bit"); + + b1.HasKey("InstitutionContractWorkshopInitialid"); + + b1.ToTable("InstitutionContractWorkshopInitials"); + + b1.WithOwner() + .HasForeignKey("InstitutionContractWorkshopInitialid"); + }); + + b.Navigation("Employers"); + + b.Navigation("Services"); + + b.Navigation("WorkshopCurrent"); + + b.Navigation("WorkshopGroup"); + }); + + 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.LawAgg.Law", b => + { + b.OwnsMany("Company.Domain.LawAgg.LawItem", "Items", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("Details") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Header") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b1.Property("LawId") + .HasColumnType("bigint"); + + b1.Property("OrderNumber") + .HasColumnType("int"); + + b1.HasKey("Id"); + + b1.HasIndex("LawId"); + + b1.ToTable("LawItem", (string)null); + + b1.WithOwner() + .HasForeignKey("LawId"); + }); + + b.Navigation("Items"); + }); + + 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.LoanAgg.Entities.Loan", b => + { + b.OwnsMany("Company.Domain.LoanAgg.Entities.LoanInstallment", "LoanInstallments", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); + + b1.Property("AmountForMonth") + .HasColumnType("float"); + + b1.Property("InstallmentDate") + .HasColumnType("datetime2"); + + b1.Property("IsActive") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("nvarchar(5)"); + + b1.Property("LoanId") + .HasColumnType("bigint"); + + b1.Property("Month") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("Year") + .HasMaxLength(4) + .HasColumnType("nvarchar(4)"); + + b1.HasKey("Id"); + + b1.HasIndex("LoanId"); + + b1.ToTable("LoanInstallment"); + + b1.WithOwner() + .HasForeignKey("LoanId"); + }); + + b.Navigation("LoanInstallments"); + }); + + 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.PaymentInstrumentAgg.PaymentInstrument", b => + { + b.HasOne("Company.Domain.PaymentInstrumentAgg.PaymentInstrumentGroup", "PaymentInstrumentGroup") + .WithMany("PaymentInstruments") + .HasForeignKey("PaymentInstrumentGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PaymentInstrumentGroup"); + }); + + 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.PaymentTransactionAgg.PaymentTransaction", b => + { + b.HasOne("Company.Domain.FinancialInvoiceAgg.FinancialInvoice", "FinancialInvoice") + .WithMany("PaymentTransactions") + .HasForeignKey("FinancialInvoiceId") + .OnDelete(DeleteBehavior.NoAction); + + b.Navigation("FinancialInvoice"); + }); + + 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("WorkshopId") + .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.TemporaryClientRegistrationAgg.InstitutionContractContactInfoTemp", b => + { + b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", "InstitutionContractTemp") + .WithMany("ContactInfoList") + .HasForeignKey("InstitutionContractTempId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("InstitutionContractTemp"); + }); + + modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopServicesTemp", b => + { + b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", "WorkshopTemp") + .WithMany("WorkshopServicesTemps") + .HasForeignKey("WorkshopTempId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkshopTemp"); + }); + + 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.WorkshopSubAccountAgg.WorkshopSubAccount", b => + { + b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop") + .WithMany("WorkshopSubAccounts") + .HasForeignKey("WorkshopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Workshop"); + }); + + 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.CheckoutAgg.Checkout", b => + { + b.Navigation("CheckoutWarningMessageList"); + }); + + modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b => + { + b.Navigation("ContractingPartyBankAccounts"); + + 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.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettings", b => + { + b.Navigation("CustomizeWorkshopEmployeeSettingsCollection"); + }); + + modelBuilder.Entity("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", b => + { + b.Navigation("CustomizeWorkshopGroupSettingsCollection"); + }); + + 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("CustomizeCheckouts"); + + b.Navigation("EmployeeBankInformationList"); + + b.Navigation("EmployeeChildrenList"); + + b.Navigation("EmployeeDocuments"); + + b.Navigation("EmployeeDocumentsAdminSelection"); + + b.Navigation("EmployeeInsuranceRecords"); + + b.Navigation("InsuranceEmployeeInfo"); + + b.Navigation("LeftWorkInsurances"); + + b.Navigation("LeftWorks"); + + b.Navigation("PersonnelCodeList"); + }); + + modelBuilder.Entity("Company.Domain.EmployeeDocumentsAdminSelectionAgg.EmployeeDocumentsAdminSelection", b => + { + b.Navigation("SelectedEmployeeDocumentItems"); + }); + + modelBuilder.Entity("Company.Domain.EmployeeDocumentsAgg.EmployeeDocuments", b => + { + b.Navigation("EmployeeDocumentItemCollection"); + }); + + 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.FinancialInvoiceAgg.FinancialInvoice", b => + { + b.Navigation("Items"); + + b.Navigation("PaymentTransactions"); + }); + + 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("Amendments"); + + b.Navigation("ContactInfoList"); + + b.Navigation("Installments"); + + b.Navigation("WorkshopGroup"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractAmendment", b => + { + b.Navigation("AmendmentChanges"); + + b.Navigation("Installments"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopCurrent", b => + { + b.Navigation("WorkshopInitial"); + }); + + modelBuilder.Entity("Company.Domain.InstitutionContractAgg.InstitutionContractWorkshopGroup", b => + { + b.Navigation("CurrentWorkshops"); + + b.Navigation("InitialWorkshops"); + }); + + 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.PaymentInstrumentAgg.PaymentInstrumentGroup", b => + { + b.Navigation("PaymentInstruments"); + }); + + 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.TemporaryClientRegistrationAgg.InstitutionContractTemp", b => + { + b.Navigation("ContactInfoList"); + }); + + modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", b => + { + b.Navigation("WorkshopServicesTemps"); + }); + + 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("CustomizeCheckouts"); + + b.Navigation("CustomizeWorkshopSettings"); + + 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"); + + b.Navigation("WorkshopSubAccounts"); + }); + + 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/20251129103132_add discount to institutioncontract.cs b/CompanyManagment.EFCore/Migrations/20251129103132_add discount to institutioncontract.cs new file mode 100644 index 00000000..20792eac --- /dev/null +++ b/CompanyManagment.EFCore/Migrations/20251129103132_add discount to institutioncontract.cs @@ -0,0 +1,40 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace CompanyManagment.EFCore.Migrations +{ + /// + public partial class adddiscounttoinstitutioncontract : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "DiscountAmount", + table: "InstitutionContracts", + type: "float", + nullable: false, + defaultValue: 0.0); + + migrationBuilder.AddColumn( + name: "DiscountPercentage", + table: "InstitutionContracts", + type: "int", + nullable: false, + defaultValue: 0); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "DiscountAmount", + table: "InstitutionContracts"); + + migrationBuilder.DropColumn( + name: "DiscountPercentage", + table: "InstitutionContracts"); + } + } +} diff --git a/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs b/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs index 13b1f7da..c302a70c 100644 --- a/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs +++ b/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs @@ -3265,6 +3265,12 @@ namespace CompanyManagment.EFCore.Migrations .HasMaxLength(10000) .HasColumnType("nvarchar(max)"); + b.Property("DiscountAmount") + .HasColumnType("float"); + + b.Property("DiscountPercentage") + .HasColumnType("int"); + b.Property("EmployeeManualCount") .HasMaxLength(10) .HasColumnType("nvarchar(10)"); From d2f0ed46aeb36fb6e82bce2a22712b7a4fad2ed3 Mon Sep 17 00:00:00 2001 From: mahan Date: Sat, 29 Nov 2025 20:07:29 +0330 Subject: [PATCH 06/26] Refactor discount calculation and response models for institution contracts - Replace InstitutionContractExtensionPaymentResponse with InstitutionContractDiscountResponse in discount-related methods and endpoints - Update request and response models to include OneMonthAmount, Obligation, and improved discount fields - Adjust method signatures and controller actions to use new response types - Refactor discount calculation logic to support new structure and ensure correct plan updates for both installment and one-time payments - Improve naming consistency for discount percentage fields --- .../IInstitutionContractRepository.cs | 9 +- .../CreateInstitutionContractRequest.cs | 2 +- .../IInstitutionContractApplication.cs | 50 +++- .../InstitutionContractApplication.cs | 13 +- .../InstitutionContractRepository.cs | 225 +++++++++++++++--- .../institutionContractController.cs | 8 +- 6 files changed, 253 insertions(+), 54 deletions(-) diff --git a/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs b/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs index 8231474f..1d33e34f 100644 --- a/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs +++ b/Company.Domain/InstitutionContractAgg/IInstitutionContractRepository.cs @@ -56,8 +56,8 @@ public interface IInstitutionContractRepository : IRepository GetVerificationDetails(Guid id); Task GetByPublicIdAsync(Guid id); - InstitutionContractExtensionPaymentResponse CalculateDiscount(InstitutionContractSetDiscountRequest request); - InstitutionContractExtensionPaymentResponse ResetDiscountCreate(InstitutionContractResetDiscountForCreateRequest request); + InstitutionContractDiscountResponse CalculateDiscount(InstitutionContractSetDiscountRequest request); + InstitutionContractDiscountResponse ResetDiscountCreate(InstitutionContractResetDiscountForCreateRequest request); #region Extension @@ -66,8 +66,9 @@ public interface IInstitutionContractRepository : IRepository GetExtensionWorkshops(InstitutionContractExtensionWorkshopsRequest request); Task GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request); Task GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request); - Task SetDiscountForExtension(InstitutionContractSetDiscountForExtensionRequest request); - Task ResetDiscountForExtension(InstitutionContractResetDiscountForExtensionRequest request); + Task SetDiscountForExtension( + InstitutionContractSetDiscountForExtensionRequest request); + Task ResetDiscountForExtension(InstitutionContractResetDiscountForExtensionRequest request); Task ExtensionComplete(InstitutionContractExtensionCompleteRequest request); diff --git a/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs b/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs index 9ec2c821..b3386d7a 100644 --- a/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs +++ b/CompanyManagment.App.Contracts/InstitutionContract/CreateInstitutionContractRequest.cs @@ -87,7 +87,7 @@ public class CreateInstitutionContractRequest /// /// مبلغ کل قرارداد /// - public double TotalAmount { get; set; } + public double PaymentAmount { get; set; } /// /// آیا قرارداد اقساطی است؟ diff --git a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs index a415d897..f77efb54 100644 --- a/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs +++ b/CompanyManagment.App.Contracts/InstitutionContract/IInstitutionContractApplication.cs @@ -215,8 +215,8 @@ public interface IInstitutionContractApplication Task> SendVerifyOtp(Guid id); Task> VerifyOtpAndMakeGateway(Guid publicId, string code, string callbackUrl); Task GetWorkshopInitialDetails(long workshopDetailsId); - InstitutionContractExtensionPaymentResponse CalculateDiscount(InstitutionContractSetDiscountRequest request); - InstitutionContractExtensionPaymentResponse ResetDiscountCreate(InstitutionContractResetDiscountForCreateRequest request); + InstitutionContractDiscountResponse CalculateDiscount(InstitutionContractSetDiscountRequest request); + InstitutionContractDiscountResponse ResetDiscountCreate(InstitutionContractResetDiscountForCreateRequest request); #region Extension @@ -231,9 +231,10 @@ public interface IInstitutionContractApplication Task GetExtensionPaymentMethod( InstitutionContractExtensionPaymentRequest request); - Task SetDiscountForExtension( - InstitutionContractSetDiscountForExtensionRequest request); - Task> ResetDiscountForExtension(InstitutionContractResetDiscountForExtensionRequest request); + Task SetDiscountForExtension( + InstitutionContractSetDiscountForExtensionRequest request); + Task ResetDiscountForExtension( + InstitutionContractResetDiscountForExtensionRequest request); Task ExtensionComplete(InstitutionContractExtensionCompleteRequest request); @@ -264,12 +265,48 @@ public interface IInstitutionContractApplication } +public class InstitutionContractDiscountResponse +{ + public InstitutionContractDiscountOneTimeViewModel OneTime { get; set; } + public InstitutionContractDiscountMonthlyViewModel Monthly { get; set; } +} + +public class InstitutionContractDiscountMonthlyViewModel:InstitutionContractDiscountOneTimeViewModel +{ + public List Installments { get; set; } +} + +public class InstitutionContractDiscountOneTimeViewModel +{ + /// + /// مجموع مبالغ + /// + public string TotalAmount { get; set; } + /// + /// ارزش افزوده + /// + public string Tax { get; set; } + /// + /// مبلغ قابل پرداخت + /// + public string PaymentAmount { get; set; } + + public string DiscountedAmount { get; set; } + + public int DiscountPercetage { get; set; } + + public string Obligation { get; set; } + + public string OneMonthAmount { get; set; } +} + public class InstitutionContractResetDiscountForCreateRequest { - public int Percentage { get; set; } + public int DiscountPercentage { get; set; } public double TotalAmount { get; set; } public bool IsInstallment { get; set; } public InstitutionContractDuration Duration { get; set; } + public double OneMonthAmount { get; set; } } public class InstitutionContractSetDiscountForExtensionRequest @@ -291,6 +328,7 @@ public class InstitutionContractSetDiscountRequest public int DiscountPercentage { get; set; } public double TotalAmount { get; set; } public InstitutionContractDuration Duration { get; set; } + public double OneMonthAmount { get; set; } public bool IsInstallment { get; set; } } diff --git a/CompanyManagment.Application/InstitutionContractApplication.cs b/CompanyManagment.Application/InstitutionContractApplication.cs index 0a249afb..2ced77de 100644 --- a/CompanyManagment.Application/InstitutionContractApplication.cs +++ b/CompanyManagment.Application/InstitutionContractApplication.cs @@ -1081,7 +1081,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication contractStartGr, contractStartGr.ToFarsi(), contractEndGr, contractEndGr.ToFarsi(), command.OneMonthAmount, command.DailyCompensation, - command.Obligation, command.TotalAmount, 0, + command.Obligation, command.PaymentAmount, 0, command.Workshops.Count.ToString(), command.Workshops.Sum(x => x.PersonnelCount).ToString(), command.Description, "NotOfficial", "JobRelation", hasValueAddedTax, @@ -1104,7 +1104,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication if (command.IsInstallment) { var installments = - CalculateInstallment(command.TotalAmount, (int)command.Duration, command.ContractStartFa, true); + CalculateInstallment(command.PaymentAmount, (int)command.Duration, command.ContractStartFa, true); // دریافت مبلغ اولین قسط @@ -1423,12 +1423,12 @@ public class InstitutionContractApplication : IInstitutionContractApplication return res; } - public InstitutionContractExtensionPaymentResponse CalculateDiscount(InstitutionContractSetDiscountRequest request) + public InstitutionContractDiscountResponse CalculateDiscount(InstitutionContractSetDiscountRequest request) { return _institutionContractRepository.CalculateDiscount(request); } - public InstitutionContractExtensionPaymentResponse ResetDiscountCreate( + public InstitutionContractDiscountResponse ResetDiscountCreate( InstitutionContractResetDiscountForCreateRequest request) { return _institutionContractRepository.ResetDiscountCreate(request); @@ -1457,13 +1457,14 @@ public class InstitutionContractApplication : IInstitutionContractApplication return await _institutionContractRepository.GetExtensionPaymentMethod(request); } - public async Task SetDiscountForExtension( + public async Task SetDiscountForExtension( InstitutionContractSetDiscountForExtensionRequest request) { return await _institutionContractRepository.SetDiscountForExtension(request); } - public async Task> ResetDiscountForExtension(InstitutionContractResetDiscountForExtensionRequest request) + public async Task ResetDiscountForExtension( + InstitutionContractResetDiscountForExtensionRequest request) { return await _institutionContractRepository.ResetDiscountForExtension(request); } diff --git a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs index 512c5e69..a06762f6 100644 --- a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs +++ b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs @@ -1870,19 +1870,21 @@ public class InstitutionContractRepository : RepositoryBase x.PublicId == id); } - public InstitutionContractExtensionPaymentResponse CalculateDiscount(InstitutionContractSetDiscountRequest request) + public InstitutionContractDiscountResponse CalculateDiscount(InstitutionContractSetDiscountRequest request) { var baseAmount = request.TotalAmount; var discountAmount = (baseAmount * request.DiscountPercentage) / 100; + var discountOneMonthAmount = (request.OneMonthAmount * request.DiscountPercentage) / 100; + var discountedOneMonthAmount = request.OneMonthAmount - discountOneMonthAmount; var totalAmount = baseAmount - discountAmount; var taxAmount = totalAmount * 0.10; var paymentAmount = totalAmount + taxAmount; - InstitutionContractPaymentMonthlyViewModel monthlyPayment = null; - InstitutionContractPaymentOneTimeViewModel oneTimePayment = null; + InstitutionContractDiscountMonthlyViewModel monthlyPayment = null; + InstitutionContractDiscountOneTimeViewModel oneTimePayment = null; if (request.IsInstallment) { - monthlyPayment = new InstitutionContractPaymentMonthlyViewModel() + monthlyPayment = new InstitutionContractDiscountMonthlyViewModel() { TotalAmount = totalAmount.ToMoney(), PaymentAmount = paymentAmount.ToMoney(), @@ -1890,43 +1892,49 @@ public class InstitutionContractRepository : RepositoryBase baseAmount) throw new BadRequestException("مقدار تخفیف نمی‌تواند بیشتر از مبلغ کل باشد"); - return new InstitutionContractExtensionPaymentResponse() + return new InstitutionContractDiscountResponse() { Monthly = monthlyPayment, OneTime = oneTimePayment }; } - public InstitutionContractExtensionPaymentResponse ResetDiscountCreate( + public InstitutionContractDiscountResponse ResetDiscountCreate( InstitutionContractResetDiscountForCreateRequest request) { - InstitutionContractPaymentMonthlyViewModel monthlyPayment = null; - InstitutionContractPaymentOneTimeViewModel oneTimePayment = null; + InstitutionContractDiscountMonthlyViewModel monthlyPayment = null; + InstitutionContractDiscountOneTimeViewModel oneTimePayment = null; if (request.IsInstallment) { - var newTotalAmount = request.TotalAmount / (1 - (request.Percentage / 100)); + var newTotalAmount = request.TotalAmount / (1 - (request.DiscountPercentage / 100.0)); var taxAmount = (newTotalAmount * 0.10); var paymentAmount = (newTotalAmount + taxAmount); - monthlyPayment = new InstitutionContractPaymentMonthlyViewModel() + var newOneMonthAmount = request.OneMonthAmount / (1 - (request.DiscountPercentage / 100.0)); + + monthlyPayment = new InstitutionContractDiscountMonthlyViewModel() { TotalAmount = newTotalAmount.ToMoney(), Tax = taxAmount.ToMoney(), @@ -1934,25 +1942,31 @@ public class InstitutionContractRepository : RepositoryBase SetDiscountForExtension(InstitutionContractSetDiscountForExtensionRequest request) + public async Task SetDiscountForExtension(InstitutionContractSetDiscountForExtensionRequest request) { if (request.DiscountPercentage <= 0) @@ -2288,26 +2302,96 @@ public class InstitutionContractRepository : RepositoryBase0) throw new BadRequestException("تخفیف قبلا برای این قرارداد اعمال شده است"); } - + var selectedPlan = institutionTemp.Duration switch + { + InstitutionContractDuration.OneMonth => institutionTemp.OneMonth, + InstitutionContractDuration.ThreeMonths => institutionTemp.ThreeMonths, + InstitutionContractDuration.SixMonths => institutionTemp.SixMonths, + InstitutionContractDuration.TwelveMonths => institutionTemp.TwelveMonths, + _ => throw new ArgumentOutOfRangeException() + }; var calculateRequest = new InstitutionContractSetDiscountRequest() { Duration = institutionTemp.Duration.Value, TotalAmount = request.TotalAmount, DiscountPercentage = request.DiscountPercentage, - IsInstallment = request.IsInstallment + IsInstallment = request.IsInstallment, + OneMonthAmount = selectedPlan.OneMonthPaymentDiscounted.MoneyToDouble() + }; var res = CalculateDiscount(calculateRequest); - + //این به این دلیل هست که متد caclulate discount یکی از مقادیر رو پر میکنه و ما نیاز داریم هر دو مقدار رو داشته باشیم if (request.IsInstallment) { - res.OneTime = institutionTemp.OneTimePayment; + var onetime = institutionTemp.OneTimePayment; + res.OneTime = new() + { + PaymentAmount = onetime.PaymentAmount, + Tax = onetime.Tax, + TotalAmount = onetime.TotalAmount, + DiscountedAmount = onetime.DiscountedAmount, + DiscountPercetage = onetime.DiscountPercetage, + }; + institutionTemp.MonthlyPayment = new() + { + Installments = res.Monthly.Installments, + PaymentAmount = res.Monthly.PaymentAmount, + Tax = res.Monthly.Tax, + TotalAmount = res.Monthly.TotalAmount, + DiscountedAmount = res.Monthly.DiscountedAmount, + DiscountPercetage = res.Monthly.DiscountPercetage, + }; + + selectedPlan.TotalPayment = res.Monthly.TotalAmount; + selectedPlan.Obligation = res.Monthly.Obligation; + selectedPlan.OneMonthPaymentDiscounted = res.Monthly.PaymentAmount; + selectedPlan.DailyCompenseation = (res.Monthly.OneMonthAmount.MoneyToDouble() * 0.10).ToMoney(); } else { - res.Monthly = institutionTemp.MonthlyPayment; + var monthly = institutionTemp.MonthlyPayment; + res.Monthly = new() + { + PaymentAmount = monthly.PaymentAmount, + Tax = monthly.Tax, + TotalAmount = monthly.TotalAmount, + DiscountedAmount = monthly.DiscountedAmount, + DiscountPercetage = monthly.DiscountPercetage, + Installments = monthly.Installments, + }; + institutionTemp.OneTimePayment = new() + { + PaymentAmount = res.OneTime.PaymentAmount, + Tax = res.OneTime.Tax, + TotalAmount = res.OneTime.TotalAmount, + DiscountedAmount = res.OneTime.DiscountedAmount, + DiscountPercetage = res.OneTime.DiscountPercetage, + }; + selectedPlan.TotalPayment = res.OneTime.TotalAmount; + selectedPlan.Obligation = res.OneTime.Obligation; + selectedPlan.OneMonthPaymentDiscounted = res.OneTime.PaymentAmount; + selectedPlan.DailyCompenseation = (res.OneTime.OneMonthAmount.MoneyToDouble() * 0.10).ToMoney(); + } + + switch (institutionTemp.Duration) + { + case InstitutionContractDuration.OneMonth: + institutionTemp.OneMonth = selectedPlan; + break; + case InstitutionContractDuration.ThreeMonths: + institutionTemp.ThreeMonths = selectedPlan; + break; + case InstitutionContractDuration.SixMonths: + institutionTemp.SixMonths = selectedPlan; + break; + case InstitutionContractDuration.TwelveMonths: + institutionTemp.TwelveMonths = selectedPlan; + break; + default: + throw new ArgumentOutOfRangeException(); + } - institutionTemp.SetAmountAndDuration(institutionTemp.Duration.Value, res.Monthly, res.OneTime); await _institutionExtensionTemp.ReplaceOneAsync(x => x.Id == institutionTemp.Id, institutionTemp); @@ -2318,7 +2402,7 @@ public class InstitutionContractRepository : RepositoryBase ResetDiscountForExtension + public async Task ResetDiscountForExtension (InstitutionContractResetDiscountForExtensionRequest request) { var institutionTemp = await _institutionExtensionTemp.Find(x => x.Id == request.TempId) @@ -2328,8 +2412,16 @@ public class InstitutionContractRepository : RepositoryBase institutionTemp.OneMonth, + InstitutionContractDuration.ThreeMonths => institutionTemp.ThreeMonths, + InstitutionContractDuration.SixMonths => institutionTemp.SixMonths, + InstitutionContractDuration.TwelveMonths => institutionTemp.TwelveMonths, + _ => throw new ArgumentOutOfRangeException() + }; if (request.IsInstallment) { var prevMonthlyPayment = institutionTemp.MonthlyPayment; @@ -2337,7 +2429,8 @@ public class InstitutionContractRepository : RepositoryBasex.Id == institutionTemp.Id, institutionTemp); @@ -2358,20 +2484,53 @@ public class InstitutionContractRepository : RepositoryBasex.Id == institutionTemp.Id, institutionTemp); } - return new() + return new InstitutionContractDiscountResponse() { OneTime = oneTimePayment, Monthly = monthlyPayment diff --git a/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs b/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs index 7d8b1039..fd7130fd 100644 --- a/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs +++ b/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs @@ -452,14 +452,14 @@ public class institutionContractController : AdminBaseController return operationResult; } [HttpPost("create/set-discount")] - public ActionResult SetDiscountForInstitutionContract([FromBody]InstitutionContractSetDiscountRequest request) + public ActionResult SetDiscountForInstitutionContract([FromBody]InstitutionContractSetDiscountRequest request) { var res = _institutionContractApplication.CalculateDiscount(request); return res; } [HttpPost("create/reset-discount")] - public ActionResult ResetDiscountForCreate([FromBody]InstitutionContractResetDiscountForCreateRequest request) + public ActionResult ResetDiscountForCreate([FromBody]InstitutionContractResetDiscountForCreateRequest request) { var res = _institutionContractApplication.ResetDiscountCreate(request); return res; @@ -558,14 +558,14 @@ public class institutionContractController : AdminBaseController } [HttpPost("extension/set-discount")] - public async Task> SetDiscountForExtension([FromBody]InstitutionContractSetDiscountForExtensionRequest request) + public async Task> SetDiscountForExtension([FromBody]InstitutionContractSetDiscountForExtensionRequest request) { var res =await _institutionContractApplication.SetDiscountForExtension(request); return res; } [HttpPost("extension/reset-discount")] - public async Task> ResetDiscountForExtension([FromBody]InstitutionContractResetDiscountForExtensionRequest request) + public async Task> ResetDiscountForExtension([FromBody]InstitutionContractResetDiscountForExtensionRequest request) { var res =await _institutionContractApplication.ResetDiscountForExtension(request); return res; From 238926118f201b5a5ec03fce088112be69137590 Mon Sep 17 00:00:00 2001 From: mahan Date: Sun, 30 Nov 2025 11:09:25 +0330 Subject: [PATCH 07/26] Handle additional status code 3 in UID service response for employee authorization checks --- CompanyManagment.Application/EmployeeAplication.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CompanyManagment.Application/EmployeeAplication.cs b/CompanyManagment.Application/EmployeeAplication.cs index 728682b9..152890b1 100644 --- a/CompanyManagment.Application/EmployeeAplication.cs +++ b/CompanyManagment.Application/EmployeeAplication.cs @@ -1585,7 +1585,7 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli if (employee.IsAuthorized == false) { var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate); - if (apiResult.ResponseContext.Status.Code == 14) + if (apiResult.ResponseContext.Status.Code is 14 or 3) { return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد"); @@ -1650,7 +1650,7 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli { return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeDataFromApiViewModel() { AuthorizedCanceled = true }); } - if (apiResult.ResponseContext.Status.Code == 14) + if (apiResult.ResponseContext.Status.Code is 14 or 3) { return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeDataFromApiViewModel() { AuthorizedCanceled = true }); From c63eb23b223bcfc7260d7f3a547b05f327d0d300 Mon Sep 17 00:00:00 2001 From: mahan Date: Mon, 1 Dec 2025 10:07:09 +0330 Subject: [PATCH 08/26] Handle null API response in employee authorization checks --- CompanyManagment.Application/EmployeeAplication.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CompanyManagment.Application/EmployeeAplication.cs b/CompanyManagment.Application/EmployeeAplication.cs index 152890b1..7ac810f6 100644 --- a/CompanyManagment.Application/EmployeeAplication.cs +++ b/CompanyManagment.Application/EmployeeAplication.cs @@ -1585,6 +1585,11 @@ public class EmployeeAplication : RepositoryBase, IEmployeeAppli if (employee.IsAuthorized == false) { var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate); + + if (apiResult == null) + { + return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد"); + } if (apiResult.ResponseContext.Status.Code is 14 or 3) { return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد"); From 9e92d2215fca0c517b9181f3e179fd0faf03c0b7 Mon Sep 17 00:00:00 2001 From: mahan Date: Mon, 1 Dec 2025 10:53:26 +0330 Subject: [PATCH 09/26] Add institution contract workflow count functionality to admin workflow --- .../Pages/Company/WorkFlow/Index.cshtml | 28 ++++++++ .../Pages/Company/WorkFlow/Index.cshtml.cs | 27 +++++++- .../Areas/AdminNew/Pages/Index.cshtml.cs | 4 +- .../IAdminWorkFlowApplication.cs | 4 +- .../AdminWorkFlowApplication.cs | 65 ++++++++++++------- .../Employee/IWorkFlowEmployeeACL.cs | 1 + .../IWorkFlowInstitutionContractACL.cs | 23 +++++++ .../WorkFlowBootstrapper.cs | 4 +- 8 files changed, 127 insertions(+), 29 deletions(-) create mode 100644 WorkFlow/Infrastructure/WorkFlow.Infrastructure.ACL/InstitutionContract/IWorkFlowInstitutionContractACL.cs diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/WorkFlow/Index.cshtml b/ServiceHost/Areas/AdminNew/Pages/Company/WorkFlow/Index.cshtml index 85bed152..507e4b50 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/WorkFlow/Index.cshtml +++ b/ServiceHost/Areas/AdminNew/Pages/Company/WorkFlow/Index.cshtml @@ -136,6 +136,9 @@
قرارداد های مالی
+
+ +
@@ -3466,7 +3472,6 @@ public class InstitutionContractRepository : RepositoryBase> GetBlockListData(DateTime checkDate) { var smsList = new List(); - var institutionContracts =await _context.InstitutionContractSet.Select(x => new InstitutionContractViewModel - { - Id = x.id, - ContractingPartyId = x.ContractingPartyId, - ContractingPartyName = x.ContractingPartyName, - ContractStartGr = x.ContractStartGr, - ContractStartFa = x.ContractStartFa, - ContractEndGr = x.ContractEndGr, - ContractEndFa = x.ContractEndFa, - IsActiveString = x.IsActiveString, - ContractAmountDouble = x.ContractAmount, - OfficialCompany = x.OfficialCompany - }).Where(x => x.ContractStartGr < checkDate && x.ContractEndGr >= checkDate && - x.ContractAmountDouble > 0).GroupBy(x => x.ContractingPartyId).Select(x => x.First()).ToListAsync(); + var institutionContracts = await _context.InstitutionContractSet.Select(x => new InstitutionContractViewModel + { + Id = x.id, + ContractingPartyId = x.ContractingPartyId, + ContractingPartyName = x.ContractingPartyName, + ContractStartGr = x.ContractStartGr, + ContractStartFa = x.ContractStartFa, + ContractEndGr = x.ContractEndGr, + ContractEndFa = x.ContractEndFa, + IsActiveString = x.IsActiveString, + ContractAmountDouble = x.ContractAmount, + OfficialCompany = x.OfficialCompany + }).Where(x => x.ContractStartGr < checkDate && x.ContractEndGr >= checkDate && + x.ContractAmountDouble > 0).GroupBy(x => x.ContractingPartyId).Select(x => x.First()) + .ToListAsync(); var contractingPartyList = await _context.PersonalContractingParties @@ -3548,8 +3550,7 @@ public class InstitutionContractRepository : RepositoryBase institutionContracts.Select(ins => ins.ContractingPartyId).Contains(x.ContractingPartyId)) - .Include(x => x.FinancialTransactionList).Where( - x => x.FinancialTransactionList.Count > 0).ToListAsync(); + .Include(x => x.FinancialTransactionList).Where(x => x.FinancialTransactionList.Count > 0).ToListAsync(); var phoneNumberList = await _context.InstitutionContractContactInfos .Where(x => institutionContracts.Select(ins => ins.Id).Contains(x.InstitutionContractId)) @@ -3563,8 +3564,9 @@ public class InstitutionContractRepository : RepositoryBase x.id == item.ContractingPartyId); if (contractingParty != null && contractingParty.IsBlock == "true") { - - var partyName = contractingParty.IsLegal == "حقیقی" ? $"{contractingParty.FName} {contractingParty.LName}" : $"{contractingParty.LName}"; + var partyName = contractingParty.IsLegal == "حقیقی" + ? $"{contractingParty.FName} {contractingParty.LName}" + : $"{contractingParty.LName}"; if (!string.IsNullOrWhiteSpace(contractingParty.SureName)) partyName = $"{partyName} ({contractingParty.SureName})"; @@ -3573,21 +3575,21 @@ public class InstitutionContractRepository : RepositoryBase x.ContractingPartyId == item.ContractingPartyId & x.FinancialTransactionList.Count > 0); + financialStatmentList.Any(x => + x.ContractingPartyId == item.ContractingPartyId & x.FinancialTransactionList.Count > 0); var hasPhonNumber = phoneNumberList.Any(x => x.InstitutionContractId == item.Id); - if (hasFinancialStatment && hasPhonNumber) { - - var transactions = financialStatmentList.FirstOrDefault(x => x.ContractingPartyId == item.ContractingPartyId); + var transactions = + financialStatmentList.FirstOrDefault(x => x.ContractingPartyId == item.ContractingPartyId); var debtor = transactions.FinancialTransactionList.Sum(x => x.Deptor); var creditor = transactions.FinancialTransactionList.Sum(x => x.Creditor); - + var id = $"{item.ContractingPartyId}"; var aprove = $"{transactions.id}"; @@ -3631,21 +3633,26 @@ public class InstitutionContractRepository : RepositoryBase 18 ? item.ContractingPartyName.Substring(0, 18) : item.ContractingPartyName; + string name = item.ContractingPartyName.Length > 18 + ? item.ContractingPartyName.Substring(0, 18) + : item.ContractingPartyName; string errMess = $"{name}-خطا"; await _smsService.Alarm("09114221321", errMess); - } } @@ -3656,7 +3663,6 @@ public class InstitutionContractRepository : RepositoryBase ///دریافت لیست بدهکارن /// جهت ارسال پیامک @@ -3664,7 +3670,6 @@ public class InstitutionContractRepository : RepositoryBase public async Task> GetSmsListData(DateTime checkDate, TypeOfSmsSetting typeOfSmsSetting) { - var watch = new Stopwatch(); var smsList = new List(); var currentMonthStart = ($"{(checkDate.ToFarsi()).Substring(0, 8)}01").ToGeorgianDateTime(); @@ -3673,37 +3678,39 @@ public class InstitutionContractRepository : RepositoryBase x.StartService.Date <= previusMonthStart.Date && x.EndService.Date >= previusMonthEnd.Date).ToList(); - var institutionContracts = await _context.InstitutionContractSet.AsSplitQuery().Select(x => new InstitutionContractViewModel - { - Id = x.id, - ContractingPartyId = x.ContractingPartyId, - ContractingPartyName = x.ContractingPartyName, - ContractStartGr = x.ContractStartGr, - ContractStartFa = x.ContractStartFa, - ContractEndGr = x.ContractEndGr, - ContractEndFa = x.ContractEndFa, - IsActiveString = x.IsActiveString, - ContractAmountDouble = x.ContractAmount, - OfficialCompany = x.OfficialCompany - }).Where(x => x.ContractStartGr < checkDate && x.ContractEndGr >= checkDate && - x.ContractAmountDouble > 0).GroupBy(x => x.ContractingPartyId).Select(x => x.First()).ToListAsync(); + var institutionContracts = await _context.InstitutionContractSet.AsSplitQuery().Select(x => + new InstitutionContractViewModel + { + Id = x.id, + ContractingPartyId = x.ContractingPartyId, + ContractingPartyName = x.ContractingPartyName, + ContractStartGr = x.ContractStartGr, + ContractStartFa = x.ContractStartFa, + ContractEndGr = x.ContractEndGr, + ContractEndFa = x.ContractEndFa, + IsActiveString = x.IsActiveString, + ContractAmountDouble = x.ContractAmount, + OfficialCompany = x.OfficialCompany + }).Where(x => x.ContractStartGr < checkDate && x.ContractEndGr >= checkDate && + x.ContractAmountDouble > 0).GroupBy(x => x.ContractingPartyId).Select(x => x.First()) + .ToListAsync(); var contractingPartyList = await _context.PersonalContractingParties - .Where(x=> institutionContracts.Select(ins => ins.ContractingPartyId).Contains(x.id)).ToListAsync(); - + .Where(x => institutionContracts.Select(ins => ins.ContractingPartyId).Contains(x.id)).ToListAsync(); + var financialStatmentList = await _context.FinancialStatments.AsSplitQuery() - .Where(x=> institutionContracts.Select(ins => ins.ContractingPartyId).Contains(x.ContractingPartyId)) - .Include(x => x.FinancialTransactionList).Where( - x => x.FinancialTransactionList.Count > 0).ToListAsync(); + .Where(x => institutionContracts.Select(ins => ins.ContractingPartyId).Contains(x.ContractingPartyId)) + .Include(x => x.FinancialTransactionList).Where(x => x.FinancialTransactionList.Count > 0).ToListAsync(); var phoneNumberList = await _context.InstitutionContractContactInfos - .Where(x=> institutionContracts.Select(ins=>ins.Id).Contains(x.InstitutionContractId)) + .Where(x => institutionContracts.Select(ins => ins.Id).Contains(x.InstitutionContractId)) .Where(x => x.SendSms && x.PhoneType == "شماره همراه" && !string.IsNullOrWhiteSpace(x.PhoneNumber) && - x.PhoneNumber.Length == 11).ToListAsync(); + x.PhoneNumber.Length == 11).ToListAsync(); Console.WriteLine("database query: " + watch.Elapsed); watch.Stop(); @@ -3717,7 +3724,9 @@ public class InstitutionContractRepository : RepositoryBase x.InstitutionContractId == item.Id) .Select(x => new CreateContactInfo { @@ -3748,7 +3756,8 @@ public class InstitutionContractRepository : RepositoryBase x.PhoneNumber.Length == 11).ToList(); - var transactions = financialStatmentList.FirstOrDefault(x=>x.ContractingPartyId == item.ContractingPartyId); + var transactions = financialStatmentList.FirstOrDefault(x => + x.ContractingPartyId == item.ContractingPartyId); var debtor = transactions.FinancialTransactionList.Sum(x => x.Deptor); var creditor = transactions.FinancialTransactionList.Sum(x => x.Creditor); @@ -3799,7 +3808,6 @@ public class InstitutionContractRepository : RepositoryBase 18 ? item.ContractingPartyName.Substring(0, 18) : item.ContractingPartyName; + string name = item.ContractingPartyName.Length > 18 + ? item.ContractingPartyName.Substring(0, 18) + : item.ContractingPartyName; string errMess = $"{name}-خطا"; // _smsService.Alarm("09114221321", errMess); - } } @@ -3998,7 +4042,6 @@ public class InstitutionContractRepository : RepositoryBase smsListData, string typeOfSms, @@ -4006,7 +4049,6 @@ public class InstitutionContractRepository : RepositoryBase 18 ? item.PartyName.Substring(0, 18) : item.PartyName; string errMess = $"{name}-خطا"; await _smsService.Alarm("09114221321", errMess); - } + Thread.Sleep(600); var percent = (successProcess / (double)countList) * 100; await _hubContext.Clients.Group(SendSmsHub.GetGroupName(10)) @@ -4053,21 +4095,20 @@ public class InstitutionContractRepository : RepositoryBase /// - public async Task SendReminderSmsToContractingParties(List smsListData, string typeOfSms, string sendMessStart, string sendMessEnd) + public async Task SendReminderSmsToContractingParties(List smsListData, string typeOfSms, + string sendMessStart, string sendMessEnd) { //ارسال پیامک با اساس لیست - #region SendSMSFromList - + #region SendSMSFromList if (smsListData.Any()) { - //await _smsService.Alarm("09114221321", sendMessStart); //Thread.Sleep(1000); //await _smsService.Alarm("09111485044", sendMessStart); //Thread.Sleep(1000); - + int successProcess = 1; int countList = smsListData.Count; @@ -4078,7 +4119,8 @@ public class InstitutionContractRepository : RepositoryBase 18 ? item.PartyName.Substring(0, 18) : item.PartyName; string errMess = $"{name}-خطا"; await _smsService.Alarm("09114221321", errMess); - } - var percent =(successProcess / (double)countList) * 100; + + var percent = (successProcess / (double)countList) * 100; await _hubContext.Clients.Group(SendSmsHub.GetGroupName(7)) .SendAsync("showStatus", (int)percent); successProcess += 1; - - - - } @@ -4132,7 +4170,6 @@ public class InstitutionContractRepository : RepositoryBase new FinancialTransactionViewModel - { - Id = t.id, - TdateFa = t.TdateFa, - TdateGr = t.TdateGr, - Description = t.TypeOfTransaction == "debt" - ? "ایجاد درآمد" + " " + t.DescriptionOption + " " + t.Description - : "دریافت درآمد" + " " + t.DescriptionOption + " " + t.Description, - Deptor = t.Deptor, - DeptorString = t.Deptor != 0 ? t.Deptor.ToMoney() : "", - Creditor = t.Creditor, - CreditorString = t.Creditor != 0 ? t.Creditor.ToMoney() : "", - Balance = t.Balance, - MessageText = t.MessageText, - SentSms = t.SentSms, - SentSmsDateFa = t.SentSmsDateFa, - FinancialStatementId = t.FinancialStatementId, - TypeOfTransaction = t.TypeOfTransaction, - DescriptionOption = t.DescriptionOption - }).OrderBy(t => t.TdateGr).ToList() + FinancialTransactionViewModels = x.FinancialTransactionList.Select(t => + new FinancialTransactionViewModel + { + Id = t.id, + TdateFa = t.TdateFa, + TdateGr = t.TdateGr, + Description = t.TypeOfTransaction == "debt" + ? "ایجاد درآمد" + " " + t.DescriptionOption + " " + t.Description + : "دریافت درآمد" + " " + t.DescriptionOption + " " + t.Description, + Deptor = t.Deptor, + DeptorString = t.Deptor != 0 ? t.Deptor.ToMoney() : "", + Creditor = t.Creditor, + CreditorString = t.Creditor != 0 ? t.Creditor.ToMoney() : "", + Balance = t.Balance, + MessageText = t.MessageText, + SentSms = t.SentSms, + SentSmsDateFa = t.SentSmsDateFa, + FinancialStatementId = t.FinancialStatementId, + TypeOfTransaction = t.TypeOfTransaction, + DescriptionOption = t.DescriptionOption + }).OrderBy(t => t.TdateGr).ToList() }) .FirstOrDefaultAsync(x => x.ContractingPartyId == contractingPartyId); - - } #endregion @@ -4189,18 +4225,20 @@ public class InstitutionContractRepository : RepositoryBase /// - public async Task CreateTransactionForInstitutionContracts(DateTime endOfMonthGr, string endOfMonthFa, string description) + public async Task CreateTransactionForInstitutionContracts(DateTime endOfMonthGr, string endOfMonthFa, + string description) { - #region FindeNextMonth 1th var firstDayOfMonthGr = ($"{endOfMonthFa.Substring(0, 8)}01").ToGeorgianDateTime(); var nextMonthGr = endOfMonthGr.AddDays(1); var endOfCurrentMonth = (($"{endOfMonthFa.Substring(0, 8)}/01").FindeEndOfMonth()).ToGeorgianDateTime(); + #endregion #region GetAvtiveContracts + var institutionContracts = await _context.InstitutionContractSet.Where(x => x.IsActiveString == "true") .Include(x => x.Installments) .Select(x => new InstitutionContractViewModel @@ -4217,11 +4255,14 @@ public class InstitutionContractRepository : RepositoryBase new InstitutionContractInstallmentViewModel { AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr }).OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(), - + InstallmentList = x.Installments + .Select(ins => new InstitutionContractInstallmentViewModel + { AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr }) + .OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(), }).Where(x => x.ContractStartGr < endOfMonthGr && x.ContractEndGr >= endOfMonthGr && x.ContractAmountDouble > 0) .ToListAsync(); + #endregion #region GetFutureContracts @@ -4233,7 +4274,6 @@ public class InstitutionContractRepository : RepositoryBase new InstitutionContractInstallmentViewModel { AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr }).OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(), + InstallmentList = x.Installments + .Select(ins => new InstitutionContractInstallmentViewModel + { AmountDouble = ins.Amount, InstallmentDateGr = ins.InstallmentDateGr }) + .OrderBy(ins => ins.InstallmentDateGr).Skip(1).ToList(), }).ToListAsync(); if (deatcivedContract.Any()) institutionContracts.AddRange(deatcivedContract); - - - } @@ -4275,19 +4315,19 @@ public class InstitutionContractRepository : RepositoryBase x.IsActiveString == "true").ToListAsync(); var activeStatusDate = new DateTime(2121, 03, 21); + #endregion + int count = 0; int serviceCounter = 0; foreach (var item in institutionContracts) { var jobRelation = "بابت قرارداد مابین (روابط کار)"; var taxAndFinancial = "بابت قرارداد مابین (حسابداری و مالیات)"; - + var contractingParty = await _context.PersonalContractingParties.FirstOrDefaultAsync(x => x.id == item.ContractingPartyId); - - string partyName = item.ContractingPartyName; if (partyName.Length > 18) partyName = $"{partyName.Substring(0, 18)}"; @@ -4298,8 +4338,9 @@ public class InstitutionContractRepository : RepositoryBase x.ContractingPartyId == item.ContractingPartyId); + var hasFinancialStatment = + await _context.FinancialStatments.AnyAsync(x => + x.ContractingPartyId == item.ContractingPartyId); var computeOption = item.TypeOfContract == "JobRelation" ? jobRelation : taxAndFinancial; if (hasFinancialStatment) @@ -4308,49 +4349,40 @@ public class InstitutionContractRepository : RepositoryBase x.ContractingPartyId == item.ContractingPartyId); var financialStatmentId = financialStatmentData.id; - + var alreadyCreated = await _context.FinancialTransactions.AnyAsync(x => x.DescriptionOption == computeOption && x.TypeOfTransaction == "debt" && x.TdateGr.Date == endOfMonthGr.Date && x.FinancialStatementId == financialStatmentId); if (!alreadyCreated) { - - - - - if (item.IsInstallment && item.VerificationStatus == InstitutionContractVerificationStatus.Verified) - { - var instalment = item.InstallmentList - .FirstOrDefault(x => - x.InstallmentDateGr >= firstDayOfMonthGr && - x.InstallmentDateGr <= endOfMonthGr); - if (instalment != null) - { - var transaction = new FinancialTransaction(financialStatmentId, endOfMonthGr, - endOfMonthFa, - description, - "debt", computeOption, instalment.AmountDouble, 0, 0, isblock); - await _financialTransactionRepository.CreateAsync(transaction); - await _financialTransactionRepository.SaveChangesAsync(); - } - - } - else + if (item.IsInstallment && + item.VerificationStatus == InstitutionContractVerificationStatus.Verified) + { + var instalment = item.InstallmentList + .FirstOrDefault(x => + x.InstallmentDateGr >= firstDayOfMonthGr && + x.InstallmentDateGr <= endOfMonthGr); + if (instalment != null) { var transaction = new FinancialTransaction(financialStatmentId, endOfMonthGr, endOfMonthFa, description, - "debt", computeOption, item.ContractAmountDouble, 0, 0, isblock); + "debt", computeOption, instalment.AmountDouble, 0, 0, isblock); await _financialTransactionRepository.CreateAsync(transaction); await _financialTransactionRepository.SaveChangesAsync(); } - - + } + else + { + var transaction = new FinancialTransaction(financialStatmentId, endOfMonthGr, + endOfMonthFa, + description, + "debt", computeOption, item.ContractAmountDouble, 0, 0, isblock); + await _financialTransactionRepository.CreateAsync(transaction); + await _financialTransactionRepository.SaveChangesAsync(); + } } - - - } else { @@ -4359,7 +4391,8 @@ public class InstitutionContractRepository : RepositoryBase @@ -4372,9 +4405,7 @@ public class InstitutionContractRepository : RepositoryBase x.ContractingPartyId == item.ContractingPartyId) - .Select(x => x.id).ToListAsync(); - var workshops = await _context.WorkshopEmployers.Where(x => employers.Contains(x.EmployerId)) + var employers = await _context.Employers + .Where(x => x.ContractingPartyId == item.ContractingPartyId) + .Select(x => x.id).ToListAsync(); + var workshops = await _context.WorkshopEmployers + .Where(x => employers.Contains(x.EmployerId)) .Select(x => x.WorkshopId).Distinct().ToListAsync(); var services = @@ -4419,7 +4449,9 @@ public class InstitutionContractRepository : RepositoryBase x.id == rollCallService.WorkshopId); + var workshop = + await _context.Workshops.FirstOrDefaultAsync(x => + x.id == rollCallService.WorkshopId); string rollCallTransactionDescription = ""; //if (rollCallService.StartService <= prevMonthStart) @@ -4443,11 +4475,13 @@ public class InstitutionContractRepository : RepositoryBase x.WorkshopId == rollCallService.WorkshopId) + _context.RollCallEmployees + .Where(x => x.WorkshopId == rollCallService.WorkshopId) .Select(x => x.id).ToListAsync(); var employeeCount = await _context.RollCallEmployeesStatus @@ -4456,12 +4490,11 @@ public class InstitutionContractRepository : RepositoryBase 0 && monthCounter > 0) { - - - - var dailyWageYearlySalery = await _context.YearlySalaries.Include(i => i.YearlySalaryItemsList) + var dailyWageYearlySalery = await _context.YearlySalaries + .Include(i => i.YearlySalaryItemsList) .FirstOrDefaultAsync(x => - x.StartDate.Date <= DateTime.Now.Date && x.EndDate >= DateTime.Now.Date); + x.StartDate.Date <= DateTime.Now.Date && + x.EndDate >= DateTime.Now.Date); var dailyWage = dailyWageYearlySalery.YearlySalaryItemsList .Where(x => x.ItemName == "مزد روزانه") @@ -4488,8 +4521,6 @@ public class InstitutionContractRepository : RepositoryBase x.ContractingPartyId == item.ContractingPartyId); @@ -4500,32 +4531,35 @@ public class InstitutionContractRepository : RepositoryBase x.FinancialStatementId == financialStatementId && - x.Description == rollCallTransactionDescription && - x.DescriptionOption == "بابت سرویس حضور غیاب" && + x.Description == rollCallTransactionDescription && + x.DescriptionOption == "بابت سرویس حضور غیاب" && x.TypeOfTransaction == "debt" && x.TdateFa == endOfMonthFa); if (!alreadyCreated) { serviceCounter++; - Console.WriteLine(serviceCounter + " - " + rollCallService.StartService.ToFarsi() + " - " + + Console.WriteLine(serviceCounter + " - " + + rollCallService.StartService.ToFarsi() + " - " + rollCallService.WorkshopId + " - " + employeeCount + $" - {totalAmonut} - round {result}"); await _context.FinancialTransactions.AddAsync(transaction); await _context.SaveChangesAsync(); } - + //Console.WriteLine(" number : " + counter + " - " + rollCallService.StartService.ToFarsi() + " - WorkshopId : " + rollCallService.WorkshopId + " - monthCount : " + monthCounter + " - employeeCount : " + employeeCount + $" - Amount : {amountWithoutTax.ToMoney()}" + $" - ten : {tenPercent.ToMoney()} total : {totalAmonut.ToMoney()}"); } @@ -4534,8 +4568,6 @@ public class InstitutionContractRepository : RepositoryBase 18 ? partyName.Substring(0, 18) : partyName; string errMess = $"{name}-خطا"; await _smsService.Alarm("09114221321", errMess); - } count += 1; Console.WriteLine(count); - } } #endregion #endregion - } public async Task GetIdByInstallmentId(long installmentId) { - return await _context.InstitutionContractSet.Include(x=>x.Installments) - .Where(x=>x.Installments.Any(i=>i.Id==installmentId)) - .Select(x=>x.id).FirstOrDefaultAsync(); + return await _context.InstitutionContractSet.Include(x => x.Installments) + .Where(x => x.Installments.Any(i => i.Id == installmentId)) + .Select(x => x.id).FirstOrDefaultAsync(); } #endregion - - #region CustomViewModels public class WorkshopsAndEmployeeViewModel @@ -4587,8 +4612,5 @@ public class InstitutionContractRepository : RepositoryBase Date: Tue, 2 Dec 2025 13:06:22 +0330 Subject: [PATCH 14/26] change lunch setting adddress --- ServiceHost/Properties/launchSettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ServiceHost/Properties/launchSettings.json b/ServiceHost/Properties/launchSettings.json index 3c6abef3..09e8afe7 100644 --- a/ServiceHost/Properties/launchSettings.json +++ b/ServiceHost/Properties/launchSettings.json @@ -19,7 +19,7 @@ "sqlDebugging": true, "dotnetRunMessages": "true", "nativeDebugging": true, - "applicationUrl": "https://localhost:5004;http://localhost:5003;https://192.168.0.117:5005", + "applicationUrl": "https://localhost:5004;", "jsWebView2Debugging": false, "hotReloadEnabled": true }, From 88c10ac1417bb6a58bb189abbba998fd5e497586 Mon Sep 17 00:00:00 2001 From: mahan Date: Tue, 2 Dec 2025 13:44:25 +0330 Subject: [PATCH 15/26] Add phone and ID number series fields to temporary client registration result --- .../TemporaryClientRegistrationApplication.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs b/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs index 90159c5d..9d7d7f39 100644 --- a/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs +++ b/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs @@ -240,6 +240,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati result.IdNumberSerial = createTemp.IdNumberSerial; result.IdNumber = idNumber; result.NationalCode = createTemp.NationalCode; + result.Phone = createTemp.Phone; + result.IdNumberSeri = createTemp.IdNumberSeri; return op.Succcedded(result); From 6a2e4405dea9d4d083a332c7999af63246a17ce8 Mon Sep 17 00:00:00 2001 From: mahan Date: Tue, 2 Dec 2025 14:00:01 +0330 Subject: [PATCH 16/26] add check for gender if is empty --- Company.Domain/EmployeeDocumentsAgg/EmployeeDocuments.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Company.Domain/EmployeeDocumentsAgg/EmployeeDocuments.cs b/Company.Domain/EmployeeDocumentsAgg/EmployeeDocuments.cs index 2889caab..e159b78c 100644 --- a/Company.Domain/EmployeeDocumentsAgg/EmployeeDocuments.cs +++ b/Company.Domain/EmployeeDocumentsAgg/EmployeeDocuments.cs @@ -37,7 +37,7 @@ namespace Company.Domain.EmployeeDocumentsAgg { WorkshopId = workshopId; EmployeeId = employeeId; - Gender = gender; + Gender = gender??string.Empty; } private EmployeeDocuments() From 90aa6058f055cccf62ea2658234c1f3743c62f4a Mon Sep 17 00:00:00 2001 From: mahan Date: Tue, 2 Dec 2025 14:40:54 +0330 Subject: [PATCH 17/26] Handle "*" in NationalCode assignment gracefully Updated the `NationalCode` assignment in the `CreateInstitutionContractLegalPartyRequest` object to replace `"*"` with an empty string (`string.Empty`). This ensures compliance with business rules where `"*"` is not considered a valid value for `NationalCode`. Retains the original value otherwise. --- .../Repository/InstitutionContractRepository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs index ffaa4102..61a43882 100644 --- a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs +++ b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs @@ -1999,7 +1999,7 @@ public class InstitutionContractRepository : RepositoryBase Date: Tue, 2 Dec 2025 15:01:25 +0330 Subject: [PATCH 18/26] change lunchSettings --- ServiceHost/Properties/launchSettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ServiceHost/Properties/launchSettings.json b/ServiceHost/Properties/launchSettings.json index 09e8afe7..788962e4 100644 --- a/ServiceHost/Properties/launchSettings.json +++ b/ServiceHost/Properties/launchSettings.json @@ -19,7 +19,7 @@ "sqlDebugging": true, "dotnetRunMessages": "true", "nativeDebugging": true, - "applicationUrl": "https://localhost:5004;", + "applicationUrl": "https://localhost:5004;http://localhost:5003;", "jsWebView2Debugging": false, "hotReloadEnabled": true }, From 4a041ca8e2e30cb4d52b92fd165471e57a1f4e75 Mon Sep 17 00:00:00 2001 From: mahan Date: Wed, 3 Dec 2025 12:10:48 +0330 Subject: [PATCH 19/26] add condition for null rollcall employee in IfEmloyeeHasNewLeftWorkDateAddEndDateToRollCallStatus --- .../LeftWorkTempApplication.cs | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/CompanyManagment.Application/LeftWorkTempApplication.cs b/CompanyManagment.Application/LeftWorkTempApplication.cs index 3f2b2dab..75a27a98 100644 --- a/CompanyManagment.Application/LeftWorkTempApplication.cs +++ b/CompanyManagment.Application/LeftWorkTempApplication.cs @@ -290,8 +290,34 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication //get rollCallEmployee associated with those leftworks which have a higher end date than leftworkDate + var rollCallsEmployee = _rollCallEmployeeRepository.GetBy(employeeId, workshopId); + if (rollCallsEmployee != null) + { + var status = rollCallsEmployee.EmployeesStatus.OrderByDescending(z => z.StartDate) + .FirstOrDefault(rollCallEmployeeStatus => rollCallEmployeeStatus.StartDate.Date < maxLeftWork.LeftWorkDateGr + && rollCallEmployeeStatus.EndDate.Date > + maxLeftWork.LeftWorkDateGr); + + if (status != null) + { + var adjust = new AdjustRollCallEmployeesWithEmployeeLeftWork() + { + LeaveDate = maxLeftWork.LeftWorkDateGr, + RollCallStatusId = status.id + }; + _rollCallEmployeeStatusRepository.AdjustRollCallStatusEndDates([adjust]); + } + + var rollCallEmployeeStatusList = rollCallsEmployee.EmployeesStatus + .Where(x => x.StartDate >= maxLeftWork.LeftWorkDateGr).ToList(); + if (rollCallEmployeeStatusList.Any()) + { + _rollCallEmployeeStatusRepository.RemoveRange(rollCallEmployeeStatusList); + _rollCallEmployeeStatusRepository.SaveChanges(); + } + } // var joinedList = rollCallsEmployee.Join(leftWorks, x => x.WorkshopId, y => y.WorkshopId, (x, y) => new // { // x.WorkshopId, @@ -301,27 +327,6 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication // }); - var status = rollCallsEmployee.EmployeesStatus.OrderByDescending(z => z.StartDate) - .FirstOrDefault(rollCallEmployeeStatus => rollCallEmployeeStatus.StartDate.Date < maxLeftWork.LeftWorkDateGr - && rollCallEmployeeStatus.EndDate.Date > - maxLeftWork.LeftWorkDateGr); - - if (status != null) - { - var adjust = new AdjustRollCallEmployeesWithEmployeeLeftWork() - { - LeaveDate = maxLeftWork.LeftWorkDateGr, - RollCallStatusId = status.id - }; - _rollCallEmployeeStatusRepository.AdjustRollCallStatusEndDates([adjust]); - } - - var rollCallEmployeeStatusList = rollCallsEmployee.EmployeesStatus - .Where(x => x.StartDate >= maxLeftWork.LeftWorkDateGr).ToList(); - if (rollCallEmployeeStatusList.Any()) - { - _rollCallEmployeeStatusRepository.RemoveRange(rollCallEmployeeStatusList); - _rollCallEmployeeStatusRepository.SaveChanges(); - } + } } \ No newline at end of file From b5c1a4c29dfbed54b027bc8437df6b219f13a721 Mon Sep 17 00:00:00 2001 From: mahan Date: Wed, 3 Dec 2025 20:21:08 +0330 Subject: [PATCH 20/26] Refactor legal party handling logic Replaced `realPersonalContractingParty` with `legalPersonalContractingParty` to ensure correct variable usage in legal party operations. Updated the authentication logic to handle both authenticated and unauthenticated states, introducing a new `else` block for `LegalAuthentication`. Adjusted method calls (`UnAuthenticateLegalEdit` and `EditLegalPartyFromInstitution`) to use the updated variable and ensure consistent updates to legal party details. --- .../InstitutionContractRepository.cs | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs index 61a43882..65259abb 100644 --- a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs +++ b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs @@ -2078,19 +2078,27 @@ public class InstitutionContractRepository : RepositoryBase x.NationalId == legalCommand.NationalId); if (!request.LegalParty.IsAuth) { - if (realPersonalContractingParty is { IsAuthenticated: false }) + if (legalPersonalContractingParty is { IsAuthenticated: false }) { - realPersonalContractingParty.UnAuthenticateLegalEdit(legalCommand.FName, legalCommand.LName, - legalCommand.FatherName, legalCommand.IdNumber, realPersonalContractingParty.IdNumberSeri, - realPersonalContractingParty.IdNumberSerial, legalCommand.BirthDateFa, legalCommand.Gender, + legalPersonalContractingParty.UnAuthenticateLegalEdit(legalCommand.FName, legalCommand.LName, + legalCommand.FatherName, legalCommand.IdNumber, legalPersonalContractingParty.IdNumberSeri, + legalPersonalContractingParty.IdNumberSerial, legalCommand.BirthDateFa, legalCommand.Gender, legalCommand.PhoneNumber); } } - realPersonalContractingParty?.EditLegalPartyFromInstitution(legalCommand.Position, legalCommand.CompanyName, + else + { + legalPersonalContractingParty?.LegalAuthentication(legalCommand.FName, legalCommand.LName, + legalCommand.FatherName, legalCommand.IdNumber, legalPersonalContractingParty.IdNumberSeri, + legalPersonalContractingParty.IdNumberSerial, legalCommand.BirthDateFa, legalCommand.Gender, + legalCommand.PhoneNumber); + } + + legalPersonalContractingParty?.EditLegalPartyFromInstitution(legalCommand.Position, legalCommand.CompanyName, legalCommand.RegisterId, legalCommand.NationalId); break; case LegalType.Real: From a533850f24b00db1dffcd09882293528f2119886 Mon Sep 17 00:00:00 2001 From: mahan Date: Thu, 4 Dec 2025 10:36:59 +0330 Subject: [PATCH 21/26] Enhance contract removal logic and handle financial statement updates --- .../InstitutionContractApplication.cs | 1 + .../InstitutionContractRepository.cs | 44 +++++++++++++++++-- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/CompanyManagment.Application/InstitutionContractApplication.cs b/CompanyManagment.Application/InstitutionContractApplication.cs index ffbcb7d9..41fcf9a2 100644 --- a/CompanyManagment.Application/InstitutionContractApplication.cs +++ b/CompanyManagment.Application/InstitutionContractApplication.cs @@ -888,6 +888,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication public void RemoveContract(long id) { _institutionContractRepository.RemoveContract(id); + } diff --git a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs index 65259abb..bcb8bf5a 100644 --- a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs +++ b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs @@ -638,9 +638,19 @@ public class InstitutionContractRepository : RepositoryBase x.id == id); - var contactInfo = _context.InstitutionContractContactInfos.Where(x => x.InstitutionContractId == id) + var institutionContarct = _context.InstitutionContractSet + .FirstOrDefault(x => x.id == id); + + var prevInstitutionContracts = _context.InstitutionContractSet + .Where(x => x.ContractingPartyId == institutionContarct.ContractingPartyId) + .OrderByDescending(x => x.ContractEndGr).Skip(1).FirstOrDefault(); + + var transaction = _context.Database.BeginTransaction(); + + var contactInfo = _context.InstitutionContractContactInfos + .Where(x => x.InstitutionContractId == id) .ToList(); + if (contactInfo.Count > 0) { foreach (var item in contactInfo) @@ -656,6 +666,31 @@ public class InstitutionContractRepository : RepositoryBase x.FinancialTransactionList) + .FirstOrDefault(x=>x.ContractingPartyId == institutionContarct.ContractingPartyId); + if (financialStatement != null) + { + + var sumDebtor = financialStatement.FinancialTransactionList + .Sum(x => x.Deptor); + var sumCreditor = financialStatement.FinancialTransactionList + .Sum(x => x.Creditor); + var balance = sumDebtor - sumCreditor; + if (balance>0 && prevInstitutionContracts.ContractEndGr Date: Sat, 6 Dec 2025 10:41:03 +0330 Subject: [PATCH 22/26] Add menu item for bank account information MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a new menu item with `permission="307"` to `_Menu.cshtml` for accessing the `account-number-database` page. The link is dynamically constructed using `AppSetting.Value.Domain` and styled with `class="clik10"` and inline styles. Included an SVG icon and the text "اطلاعات بانکی طرف حساب" ("Bank account information of the counterparty"). Maintained the hierarchical structure of the menu. --- ServiceHost/Areas/Admin/Pages/Shared/_Menu.cshtml | 7 +++++++ ServiceHost/Areas/AdminNew/Pages/Shared/_Menu.cshtml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ServiceHost/Areas/Admin/Pages/Shared/_Menu.cshtml b/ServiceHost/Areas/Admin/Pages/Shared/_Menu.cshtml index 06228481..956fdd4f 100644 --- a/ServiceHost/Areas/Admin/Pages/Shared/_Menu.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Shared/_Menu.cshtml @@ -507,6 +507,13 @@ لیست تراکنش های درگاه پرداخت +
  • + + + + + اطلاعات بانکی طرف حساب +
  • diff --git a/ServiceHost/Areas/AdminNew/Pages/Shared/_Menu.cshtml b/ServiceHost/Areas/AdminNew/Pages/Shared/_Menu.cshtml index 6e57e512..f6ec0b36 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Shared/_Menu.cshtml +++ b/ServiceHost/Areas/AdminNew/Pages/Shared/_Menu.cshtml @@ -655,6 +655,13 @@ لیست تراکنش های درگاه پرداخت +
  • + + + + + اطلاعات بانکی طرف حساب +
  • From 343f830d0d7561df575d7eeceb469901138e1515 Mon Sep 17 00:00:00 2001 From: mahan Date: Sat, 6 Dec 2025 16:46:02 +0330 Subject: [PATCH 23/26] Fix calculation of discounted payment amount in institution contract repository --- .../Repository/InstitutionContractRepository.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs index bcb8bf5a..1a22db1f 100644 --- a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs +++ b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs @@ -2397,7 +2397,7 @@ public class InstitutionContractRepository : RepositoryBase Date: Sat, 6 Dec 2025 16:58:34 +0330 Subject: [PATCH 24/26] Change --- .../PmDomains/PmPermissionAgg/Permission.cs | 20 +++ .../PmDomains/PmRoleAgg/Role.cs | 46 +++++++ .../PmDomains/PmRoleUserAgg/RoleUser.cs | 19 +++ .../PmDomains/PmUserAgg/User.cs | 127 ++++++++++++++++++ .../Mapping/PmMappings/RoleMapping.cs | 23 ++++ .../Mapping/PmMappings/UserMapping.cs | 34 +++++ CompanyManagment.EFCore/PmDbContext.cs | 30 +++++ .../PmDbBootstrapper.cs | 18 +++ ServiceHost/Program.cs | 2 + ServiceHost/appsettings.Development.json | 6 +- 10 files changed, 323 insertions(+), 2 deletions(-) create mode 100644 AccountManagement.Domain/PmDomains/PmPermissionAgg/Permission.cs create mode 100644 AccountManagement.Domain/PmDomains/PmRoleAgg/Role.cs create mode 100644 AccountManagement.Domain/PmDomains/PmRoleUserAgg/RoleUser.cs create mode 100644 AccountManagement.Domain/PmDomains/PmUserAgg/User.cs create mode 100644 CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs create mode 100644 CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs create mode 100644 CompanyManagment.EFCore/PmDbContext.cs create mode 100644 PersonalContractingParty.Config/PmDbBootstrapper.cs diff --git a/AccountManagement.Domain/PmDomains/PmPermissionAgg/Permission.cs b/AccountManagement.Domain/PmDomains/PmPermissionAgg/Permission.cs new file mode 100644 index 00000000..7be4d5d0 --- /dev/null +++ b/AccountManagement.Domain/PmDomains/PmPermissionAgg/Permission.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using AccountManagement.Domain.PmDomains.PmRoleAgg; + +namespace AccountManagement.Domain.PmDomains.PmPermissionAgg; + +public class Permission +{ + public long Id { get; private set; } + public int Code { get; private set; } + public Role Role { get; private set; } + + public Permission(int code) + { + Code = code; + } +} \ No newline at end of file diff --git a/AccountManagement.Domain/PmDomains/PmRoleAgg/Role.cs b/AccountManagement.Domain/PmDomains/PmRoleAgg/Role.cs new file mode 100644 index 00000000..698d271b --- /dev/null +++ b/AccountManagement.Domain/PmDomains/PmRoleAgg/Role.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using _0_Framework.Domain; +using AccountManagement.Domain.PmDomains.PmPermissionAgg; + +namespace AccountManagement.Domain.PmDomains.PmRoleAgg; + +public class Role : EntityBase +{ + /// + /// نام نقش + /// + public string RoleName { get; private set; } + + + /// + /// لیست پرمیشن کد ها + /// + public List Permissions { get; private set; } + + /// + /// ای دی نقش در گزارشگیر + /// + public long? GozareshgirRoleId { get; private set; } + + + protected Role() + { + } + + public Role(string roleName,long? gozareshgirRolId, List permissions) + { + RoleName = roleName; + Permissions = permissions; + GozareshgirRoleId = gozareshgirRolId; + + } + + + public void Edit(string roleName, List permissions) + { + RoleName = roleName; + Permissions = permissions; + } + + +} \ No newline at end of file diff --git a/AccountManagement.Domain/PmDomains/PmRoleUserAgg/RoleUser.cs b/AccountManagement.Domain/PmDomains/PmRoleUserAgg/RoleUser.cs new file mode 100644 index 00000000..335ee877 --- /dev/null +++ b/AccountManagement.Domain/PmDomains/PmRoleUserAgg/RoleUser.cs @@ -0,0 +1,19 @@ +using AccountManagement.Domain.PmDomains.PmUserAgg; + +namespace AccountManagement.Domain.PmDomains.PmRoleUserAgg; + +public class RoleUser +{ + public RoleUser(long roleId) + { + RoleId = roleId; + } + + public long Id { get; private set; } + public long RoleId { get; private set; } + + + public User User { get; set; } + + +} \ No newline at end of file diff --git a/AccountManagement.Domain/PmDomains/PmUserAgg/User.cs b/AccountManagement.Domain/PmDomains/PmUserAgg/User.cs new file mode 100644 index 00000000..876d2bb4 --- /dev/null +++ b/AccountManagement.Domain/PmDomains/PmUserAgg/User.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using _0_Framework.Domain; +using AccountManagement.Domain.PmDomains.PmRoleUserAgg; + + +namespace AccountManagement.Domain.PmDomains.PmUserAgg; + +/// +/// کاربر +/// +public class User : EntityBase +{ + /// + /// ایجاد + /// + /// + /// + /// + /// + /// + /// + /// + public User(string fullName, string userName, string password, string mobile, string email, long? accountId, List roles) + { + FullName = fullName; + UserName = userName; + Password = password; + Mobile = mobile; + Email = email; + IsActive = true; + AccountId = accountId; + RoleUser = roles; + } + + protected User() + { + + } + /// + /// نام و نام خانوادگی + /// + public string FullName { get; private set; } + + /// + /// نام کاربری + /// + public string UserName { get; private set; } + + /// + /// گذرواژه + /// + public string Password { get; private set; } + + /// + /// مسیر عکس پروفایل + /// + public string ProfilePhotoPath { get; private set; } + + /// + /// شماره موبایل + /// + public string Mobile { get; set; } + + /// + /// ایمیل + /// + public string Email { get; private set; } + + /// + /// فعال/غیر فعال بودن یوزر + /// + public bool IsActive { get; private set; } + + + /// + /// کد یکبارمصرف ورود + /// + public string VerifyCode { get; private set; } + + /// + /// آی دی کاربر در گزارشگیر + /// + public long? AccountId { get; private set; } + + + /// + /// لیست پرمیشن کد ها + /// + public List RoleUser { get; private set; } + + + /// + /// آپدیت کاربر + /// + /// + /// + /// + /// + /// + public void Edit(string fullName, string userName, string mobile, List roles, bool isActive) + { + FullName = fullName; + UserName = userName; + Mobile = mobile; + RoleUser = roles; + IsActive = isActive; + } + + /// + /// غیرفعال سازی + /// + public void DeActive() + { + IsActive = false; + } + + /// + /// فعال سازی + /// + public void ReActive() + { + IsActive = true; + } + + +} \ No newline at end of file diff --git a/CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs b/CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs new file mode 100644 index 00000000..8d6292d6 --- /dev/null +++ b/CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs @@ -0,0 +1,23 @@ +using AccountManagement.Domain.PmDomains.PmRoleAgg; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace CompanyManagment.EFCore.Mapping.PmMappings; + +public class RoleMapping : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("Roles"); + builder.HasKey(x => x.id); + + builder.Property(x => x.RoleName).HasMaxLength(100).IsRequired(); + + builder.OwnsMany(x => x.Permissions, navigationBuilder => + { + navigationBuilder.HasKey(x => x.Id); + navigationBuilder.ToTable("RolePermissions"); + navigationBuilder.WithOwner(x => x.Role); + }); + } +} \ No newline at end of file diff --git a/CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs b/CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs new file mode 100644 index 00000000..39ca99ac --- /dev/null +++ b/CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs @@ -0,0 +1,34 @@ +using GozareshgirProgramManager.Domain.UserAgg.Entities; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace GozareshgirProgramManager.Infrastructure.Persistence.Mappings; + +public class UserMapping :IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("Users"); + builder.HasKey(x => x.Id); + + builder.Property(x => x.FullName).HasMaxLength(100).IsRequired(); + builder.Property(x => x.UserName).HasMaxLength(100).IsRequired(); + builder.Property(x => x.Password).HasMaxLength(1000).IsRequired(); + builder.Property(x => x.ProfilePhotoPath).HasMaxLength(500).IsRequired(false); + builder.Property(x => x.Mobile).HasMaxLength(20).IsRequired(); + builder.Property(x => x.Email).HasMaxLength(150).IsRequired(false); ; + builder.Property(x => x.VerifyCode).HasMaxLength(10).IsRequired(false); + builder.OwnsMany(x => x.RoleUser, navigationBuilder => + { + navigationBuilder.HasKey(x => x.Id); + navigationBuilder.ToTable("RoleUsers"); + navigationBuilder.WithOwner(x => x.User); + }); + + builder.HasMany(x=>x.RefreshTokens) + .WithOne(x=>x.User) + .HasForeignKey(x=>x.UserId) + .OnDelete(DeleteBehavior.Cascade); + + } +} \ No newline at end of file diff --git a/CompanyManagment.EFCore/PmDbContext.cs b/CompanyManagment.EFCore/PmDbContext.cs new file mode 100644 index 00000000..e2890873 --- /dev/null +++ b/CompanyManagment.EFCore/PmDbContext.cs @@ -0,0 +1,30 @@ + +using Microsoft.EntityFrameworkCore; +using System; +using AccountManagement.Domain.PmDomains.PmRoleAgg; +using AccountManagement.Domain.PmDomains.PmUserAgg; + +namespace CompanyManagment.EFCore; + +public class PmDbContext : DbContext +{ + public PmDbContext(DbContextOptions options) : base(options) + { + + } + public DbSet Users { get; set; } = null!; + public DbSet Roles { get; set; } = null!; + + + public PmDbContext() + { + + } + + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.ApplyConfigurationsFromAssembly(typeof(PmDbContext).Assembly); + base.OnModelCreating(modelBuilder); + } +} \ No newline at end of file diff --git a/PersonalContractingParty.Config/PmDbBootstrapper.cs b/PersonalContractingParty.Config/PmDbBootstrapper.cs new file mode 100644 index 00000000..8d0b130d --- /dev/null +++ b/PersonalContractingParty.Config/PmDbBootstrapper.cs @@ -0,0 +1,18 @@ +using Company.Domain.InsuranceJobItemAgg; +using Company.Domain.InsurancJobAgg; +using CompanyManagment.App.Contracts.InsuranceJob; +using CompanyManagment.Application; +using CompanyManagment.EFCore; +using CompanyManagment.EFCore.Repository; +using Microsoft.Extensions.DependencyInjection; + +namespace PersonalContractingParty.Config; + +public class PmDbBootstrapper +{ + public static void Configure(IServiceCollection services, string connectionString) + { + + services.AddDbContext(x => x.UseSqlServer(connectionString)); + } +} \ No newline at end of file diff --git a/ServiceHost/Program.cs b/ServiceHost/Program.cs index 6cacd00d..ac6074e2 100644 --- a/ServiceHost/Program.cs +++ b/ServiceHost/Program.cs @@ -53,6 +53,7 @@ builder.Services.AddHttpContextAccessor(); builder.Services.AddHttpClient("holidayApi", c => c.BaseAddress = new System.Uri("https://api.github.com")); var connectionString = builder.Configuration.GetConnectionString("MesbahDb"); var connectionStringTestDb = builder.Configuration.GetConnectionString("TestDb"); +var connectionStringProgramManager = builder.Configuration.GetConnectionString("ProgramManagerDb"); #region MongoDb @@ -68,6 +69,7 @@ builder.Services.AddSingleton(mongoDatabase); builder.Services.AddSingleton, CustomJsonResultExecutor>(); PersonalBootstrapper.Configure(builder.Services, connectionString); TestDbBootStrapper.Configure(builder.Services, connectionStringTestDb); +PmDbBootstrapper.Configure(builder.Services, connectionStringProgramManager); AccountManagementBootstrapper.Configure(builder.Services, connectionString); WorkFlowBootstrapper.Configure(builder.Services, connectionString); QueryBootstrapper.Configure(builder.Services); diff --git a/ServiceHost/appsettings.Development.json b/ServiceHost/appsettings.Development.json index b979657f..786c04ab 100644 --- a/ServiceHost/appsettings.Development.json +++ b/ServiceHost/appsettings.Development.json @@ -16,15 +16,17 @@ //local "MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;", - + //server //"MesbahDb": "Data Source=185.208.175.186;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;", //dad-mehr //"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;", - "TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;" + "TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;", + + "ProgramManagerDb": "Server=.;Database=program_manager_db;Integrated Security=True;TrustServerCertificate=True;" //mahan Docker //"MesbahDb": "Data Source=localhost,5069;Initial Catalog=mesbah_db;User ID=sa;Password=YourPassword123;TrustServerCertificate=True;" }, From 3c0ec01f777dc97162e7c2c24ff6a6913b01f423 Mon Sep 17 00:00:00 2001 From: mahan Date: Sat, 6 Dec 2025 18:57:52 +0330 Subject: [PATCH 25/26] Fix date comparison logic in roll call validation --- CompanyManagment.Application/RollCallApplication.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CompanyManagment.Application/RollCallApplication.cs b/CompanyManagment.Application/RollCallApplication.cs index 4d3796cd..b5b6a873 100644 --- a/CompanyManagment.Application/RollCallApplication.cs +++ b/CompanyManagment.Application/RollCallApplication.cs @@ -446,7 +446,7 @@ public class RollCallApplication : IRollCallApplication return operation.Failed("کارمند در بازه انتخاب شده مرخصی ساعتی دارد"); } - if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate >= y.StartDateGr && x.EndDate <= y.EndDateGr))) + if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate.Value.Date >= y.StartDateGr.Date && x.EndDate.Value.Date <= y.EndDateGr.Date))) return operation.Failed("کارمند در بازه وارد شده غیر فعال است"); @@ -486,7 +486,8 @@ public class RollCallApplication : IRollCallApplication - if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate >= y.StartDateGr && x.EndDate <= y.EndDateGr))) + if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate.Value.Date >= y.StartDateGr.Date + && x.EndDate.Value.Date <= y.EndDateGr.Date))) return operation.Failed("کارمند در بازه وارد شده غیر فعال است"); @@ -630,7 +631,7 @@ public class RollCallApplication : IRollCallApplication return operation.Failed("کارمند در بازه انتخاب شده مرخصی ساعتی دارد"); } - if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate >= y.StartDateGr && x.EndDate <= y.EndDateGr))) + if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate.Value.Date >= y.StartDateGr.Date && x.EndDate.Value.Date <= y.EndDateGr.Date))) return operation.Failed("کارمند در بازه وارد شده غیر فعال است"); @@ -662,7 +663,7 @@ public class RollCallApplication : IRollCallApplication && (y.StartDate.Value.Date <= x.ContractEndGr.Date)))) return operation.Failed("برای بازه های وارد شده فیش حقوقی ثبت شده است"); - if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate >= y.StartDateGr && x.EndDate <= y.EndDateGr))) + if (newRollCallDates == null || !newRollCallDates.All(x => employeeStatuses.Any(y => x.StartDate.Value.Date >= y.StartDateGr.Date && x.EndDate.Value.Date <= y.EndDateGr.Date))) return operation.Failed("کارمند در بازه وارد شده غیر فعال است"); var currentDayRollCall = employeeRollCalls.FirstOrDefault(x => x.EndDate == null); From acd96bcdc73bd81de83c3c19bff7d7be05d028f2 Mon Sep 17 00:00:00 2001 From: SamSys Date: Sun, 7 Dec 2025 15:21:53 +0330 Subject: [PATCH 26/26] Add ProgramManager Context --- .../Account/IAccountApplication.cs | 17 +- .../ProgramManager/GetPmUserDto.cs | 56 ++++ .../ProgramManager/GetRoleDto.cs | 28 ++ .../Role/IRoleApplication.cs | 16 +- .../AccountApplication.cs | 308 +++++++++++------- .../RoleApplication.cs | 295 ++++++++++------- .../PmDbBootstrapper.cs | 18 + .../{Permission.cs => PmPermission.cs} | 6 +- .../PmDomains/PmRoleAgg/IPmRoleRepository.cs | 15 + .../PmRoleAgg/{Role.cs => PmRole.cs} | 14 +- .../{RoleUser.cs => PmRoleUser.cs} | 6 +- .../PmDomains/PmUserAgg/IPmUserRepository.cs | 21 ++ .../PmUserAgg/{User.cs => PmUser.cs} | 10 +- .../Mappings/PmMappings/PmRoleMapping.cs | 24 ++ .../Mappings/PmMappings/PmUserMapping.cs | 16 +- .../PmDbConetxt/PmDbContext.cs | 32 ++ .../PmRepositories/PmRoleRepository.cs | 49 +++ .../PmRepositories/PmUserRepository.cs | 47 +++ .../Mapping/PmMappings/RoleMapping.cs | 23 -- CompanyManagment.EFCore/PmDbContext.cs | 30 -- .../PmDbBootstrapper.cs | 18 - .../Pages/Accounts/Account/Index.cshtml.cs | 138 ++++---- 22 files changed, 781 insertions(+), 406 deletions(-) create mode 100644 AccountManagement.Application.Contracts/ProgramManager/GetPmUserDto.cs create mode 100644 AccountManagement.Application.Contracts/ProgramManager/GetRoleDto.cs create mode 100644 AccountManagement.Configuration/PmDbBootstrapper.cs rename AccountManagement.Domain/PmDomains/PmPermissionAgg/{Permission.cs => PmPermission.cs} (77%) create mode 100644 AccountManagement.Domain/PmDomains/PmRoleAgg/IPmRoleRepository.cs rename AccountManagement.Domain/PmDomains/PmRoleAgg/{Role.cs => PmRole.cs} (65%) rename AccountManagement.Domain/PmDomains/PmRoleUserAgg/{RoleUser.cs => PmRoleUser.cs} (72%) create mode 100644 AccountManagement.Domain/PmDomains/PmUserAgg/IPmUserRepository.cs rename AccountManagement.Domain/PmDomains/PmUserAgg/{User.cs => PmUser.cs} (90%) create mode 100644 AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmRoleMapping.cs rename CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs => AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmUserMapping.cs (66%) create mode 100644 AccountMangement.Infrastructure.EFCore/PmDbConetxt/PmDbContext.cs create mode 100644 AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmRoleRepository.cs create mode 100644 AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmUserRepository.cs delete mode 100644 CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs delete mode 100644 CompanyManagment.EFCore/PmDbContext.cs delete mode 100644 PersonalContractingParty.Config/PmDbBootstrapper.cs diff --git a/AccountManagement.Application.Contracts/Account/IAccountApplication.cs b/AccountManagement.Application.Contracts/Account/IAccountApplication.cs index ac21411b..badb8c23 100644 --- a/AccountManagement.Application.Contracts/Account/IAccountApplication.cs +++ b/AccountManagement.Application.Contracts/Account/IAccountApplication.cs @@ -2,15 +2,21 @@ using System.Collections.Generic; using System.Threading.Tasks; +using AccountManagement.Application.Contracts.ProgramManager; namespace AccountManagement.Application.Contracts.Account; public interface IAccountApplication { AccountViewModel GetAccountBy(long id); - OperationResult Create(CreateAccount command); + /// + /// ایجاد کاربر گزارشگیر و پروگرام منیجر + /// + /// + /// + Task Create(CreateAccount command); OperationResult RegisterClient(RegisterAccount command); - OperationResult Edit(EditAccount command); + Task Edit(EditAccount command); OperationResult EditClient(EditClientAccount command); OperationResult ChangePassword(ChangePassword command); OperationResult Login(Login command); @@ -67,6 +73,13 @@ public interface IAccountApplication List GetAdminAccountsNew(); void CameraLogin(CameraLoginRequest request); + + /// + /// دریافت کاربر پروگرام منیجر با اکانت آی دی + /// + /// + /// + Task GetPmUserByAccountId(long accountId); } public class CameraLoginRequest diff --git a/AccountManagement.Application.Contracts/ProgramManager/GetPmUserDto.cs b/AccountManagement.Application.Contracts/ProgramManager/GetPmUserDto.cs new file mode 100644 index 00000000..d5901f72 --- /dev/null +++ b/AccountManagement.Application.Contracts/ProgramManager/GetPmUserDto.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; + +namespace AccountManagement.Application.Contracts.ProgramManager; + +public class GetPmUserDto +{ + /// + /// نام و نام خانوادگی + /// + public string FullName { get; set; } + + /// + /// نام کاربری + /// + public string UserName { get; set; } + + + + /// + /// مسیر عکس پروفایل + /// + public string ProfilePhotoPath { get; set; } + + /// + /// شماره موبایل + /// + public string Mobile { get; set; } + + + /// + /// فعال/غیر فعال بودن یوزر + /// + public bool IsActive { get; set; } + + /// + /// آی دی کاربر در گزارشگیر + /// + public long? AccountId { get; set; } + + /// + /// نقش ها + /// + public List Roles { get; set; } + + + public List RoleListDto { get; set; } + + +} +public record RoleListDto +{ + public string RoleName { get; set; } + public long RoleId { get; set; } + public List Permissions { get; set; } + +} diff --git a/AccountManagement.Application.Contracts/ProgramManager/GetRoleDto.cs b/AccountManagement.Application.Contracts/ProgramManager/GetRoleDto.cs new file mode 100644 index 00000000..a3256abd --- /dev/null +++ b/AccountManagement.Application.Contracts/ProgramManager/GetRoleDto.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; + +namespace AccountManagement.Application.Contracts.ProgramManager; + +public record GetPmRolesDto +{ + /// + /// آی دی نقش + /// + public long Id { get; set; } + + /// + /// نام نقش + /// + public string RoleName { get; set; } + + /// + /// آی دی نقش در گزارشگیر + /// + public long? GozareshgirRoleId { get; set; } + + /// + /// لیست کدهای دسترسی + /// + public List Permissions { get; set; } + + +} \ No newline at end of file diff --git a/AccountManagement.Application.Contracts/Role/IRoleApplication.cs b/AccountManagement.Application.Contracts/Role/IRoleApplication.cs index bfe6e358..9d49f8e2 100644 --- a/AccountManagement.Application.Contracts/Role/IRoleApplication.cs +++ b/AccountManagement.Application.Contracts/Role/IRoleApplication.cs @@ -1,13 +1,25 @@ using _0_Framework.Application; +using AccountManagement.Application.Contracts.ProgramManager; +using Microsoft.AspNetCore.Mvc.Rendering; using System.Collections.Generic; +using System.Threading.Tasks; namespace AccountManagement.Application.Contracts.Role { public interface IRoleApplication { - OperationResult Create(CreateRole command); - OperationResult Edit(EditRole command); + Task Create(CreateRole command); + Task Edit(EditRole command); List List(); EditRole GetDetails(long id); + + #region ProgramManager + + Task GetPmRoleList(long? gozareshgirRoleId); + Task> GetPmRoleListToEdit(long? gozareshgirRoleId); + + + #endregion + } } diff --git a/AccountManagement.Application/AccountApplication.cs b/AccountManagement.Application/AccountApplication.cs index 42185fe5..bba09128 100644 --- a/AccountManagement.Application/AccountApplication.cs +++ b/AccountManagement.Application/AccountApplication.cs @@ -1,36 +1,40 @@ -using System; -using System.Collections; -using _0_Framework.Application; +using _0_Framework.Application; +using _0_Framework.Application.Sms; +using _0_Framework.Exceptions; using AccountManagement.Application.Contracts.Account; +using AccountManagement.Application.Contracts.ProgramManagerApiResult; using AccountManagement.Domain.AccountAgg; +using AccountManagement.Domain.AccountLeftWorkAgg; +using AccountManagement.Domain.CameraAccountAgg; +using AccountManagement.Domain.InternalApiCaller; +using AccountManagement.Domain.PmDomains.PmRoleUserAgg; +using AccountManagement.Domain.PmDomains.PmUserAgg; +using AccountManagement.Domain.PositionAgg; +using AccountManagement.Domain.RoleAgg; +using AccountManagement.Domain.SubAccountAgg; +using AccountManagement.Domain.SubAccountPermissionSubtitle1Agg; +using AccountManagement.Domain.SubAccountRoleAgg; +using Company.Domain._common; +using Company.Domain.WorkshopAgg; +using Company.Domain.WorkshopSubAccountAgg; +using CompanyManagment.App.Contracts.Workshop; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.JsonPatch.Operations; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Runtime.InteropServices; -using System.Threading; -using System.Threading.Tasks; -using _0_Framework.Application.Sms; -using AccountManagement.Domain.AccountLeftWorkAgg; -using AccountManagement.Domain.CameraAccountAgg; -using AccountManagement.Domain.RoleAgg; -using CompanyManagment.App.Contracts.Workshop; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc.Rendering; -using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; -using Company.Domain.WorkshopAgg; using System.Security.Claims; using System.Text; -using _0_Framework.Exceptions; -using AccountManagement.Domain.PositionAgg; -using AccountManagement.Domain.SubAccountAgg; -using AccountManagement.Domain.SubAccountPermissionSubtitle1Agg; -using AccountManagement.Domain.SubAccountRoleAgg; -using Company.Domain.WorkshopSubAccountAgg; -using Newtonsoft.Json; -using Microsoft.EntityFrameworkCore; -using Company.Domain._common; -using AccountManagement.Domain.InternalApiCaller; -using AccountManagement.Application.Contracts.ProgramManagerApiResult; +using System.Threading; +using System.Threading.Tasks; +using AccountManagement.Application.Contracts.ProgramManager; +using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; //using AccountManagement.Domain.RoleAgg; @@ -52,10 +56,11 @@ public class AccountApplication : IAccountApplication private readonly ISubAccountRoleRepository _subAccountRoleRepository; private readonly IWorkshopSubAccountRepository _workshopSubAccountRepository; private readonly ISubAccountPermissionSubtitle1Repository _accountPermissionSubtitle1Repository; + private readonly IPmUserRepository _pmUserRepository; private readonly IUnitOfWork _unitOfWork; public AccountApplication(IAccountRepository accountRepository, IPasswordHasher passwordHasher, - IFileUploader fileUploader, IAuthHelper authHelper, IRoleRepository roleRepository, IWorker worker, ISmsService smsService, ICameraAccountRepository cameraAccountRepository, IPositionRepository positionRepository, IAccountLeftworkRepository accountLeftworkRepository, IWorkshopRepository workshopRepository, ISubAccountRepository subAccountRepository, ISubAccountRoleRepository subAccountRoleRepository, IWorkshopSubAccountRepository workshopSubAccountRepository, ISubAccountPermissionSubtitle1Repository accountPermissionSubtitle1Repository, IUnitOfWork unitOfWork) + IFileUploader fileUploader, IAuthHelper authHelper, IRoleRepository roleRepository, IWorker worker, ISmsService smsService, ICameraAccountRepository cameraAccountRepository, IPositionRepository positionRepository, IAccountLeftworkRepository accountLeftworkRepository, IWorkshopRepository workshopRepository, ISubAccountRepository subAccountRepository, ISubAccountRoleRepository subAccountRoleRepository, IWorkshopSubAccountRepository workshopSubAccountRepository, ISubAccountPermissionSubtitle1Repository accountPermissionSubtitle1Repository, IUnitOfWork unitOfWork, IPmUserRepository pmUserRepository) { _authHelper = authHelper; _roleRepository = roleRepository; @@ -69,6 +74,7 @@ public class AccountApplication : IAccountApplication _workshopSubAccountRepository = workshopSubAccountRepository; _accountPermissionSubtitle1Repository = accountPermissionSubtitle1Repository; _unitOfWork = unitOfWork; + _pmUserRepository = pmUserRepository; _fileUploader = fileUploader; _passwordHasher = passwordHasher; _accountRepository = accountRepository; @@ -132,7 +138,7 @@ public class AccountApplication : IAccountApplication }; } - public OperationResult Create(CreateAccount command) + public async Task Create(CreateAccount command) { var operation = new OperationResult(); @@ -159,36 +165,61 @@ public class AccountApplication : IAccountApplication if (command.IsProgramManagerUser) { - var parameters = new CreateProgramManagerUser( - command.Fullname, - command.Username, - password, - command.Mobile, - command.Email, - account.id, - command.UserRoles - ); - var url = "api/user/create"; - var key = SecretKeys.ProgramManagerInternalApi; - - var response = InternalApiCaller.PostAsync( - url, - key, - parameters - ); - - if (!response.Success) + try { - _unitOfWork.RollbackAccountContext(); - return operation.Failed(response.Error); + if (_pmUserRepository.Exists(x => x.FullName == command.Fullname)) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed("نام و خانوادگی تکراری است"); + } + + if (_pmUserRepository.Exists(x => x.UserName == command.Username)) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed("نام کاربری تکراری است"); + } + + if (_pmUserRepository.Exists(x => !string.IsNullOrWhiteSpace(x.Mobile) && x.Mobile == command.Mobile)) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed("این شماره همراه قبلا به فرد دیگری اختصاص داده شده است"); + } + + + + var userRoles = command.UserRoles.Where(x => x > 0).Select(x => new PmRoleUser(x)).ToList(); + var create = new PmUser(command.Fullname, command.Username, command.Password, command.Mobile, + null, account.id, userRoles); + await _pmUserRepository.CreateAsync(create); + await _pmUserRepository.SaveChangesAsync(); + } + catch (Exception e) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed("خطا در ایجاد کاربر پروگرام منیجر"); } - if (!response.Result.isSuccess) - { - _unitOfWork.RollbackAccountContext(); - return operation.Failed(response.Result.errorMessage); - } + //var url = "api/user/create"; + //var key = SecretKeys.ProgramManagerInternalApi; + + //var response = InternalApiCaller.PostAsync( + // url, + // key, + // parameters + //); + + //if (!response.Success) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed(response.Error); + //} + + //if (!response.Result.isSuccess) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed(response.Result.errorMessage); + //} } _unitOfWork.CommitAccountContext(); @@ -230,7 +261,7 @@ public class AccountApplication : IAccountApplication return opreation.Succcedded(register.id, message: "ثبت نام شما با موفقیت انجام شد"); } - public OperationResult Edit(EditAccount command) + public async Task Edit(EditAccount command) { var operation = new OperationResult(); var account = _accountRepository.Get(command.Id); @@ -249,47 +280,62 @@ public class AccountApplication : IAccountApplication _accountRepository.SaveChanges(); var key = SecretKeys.ProgramManagerInternalApi; - var apiResult = InternalApiCaller.GetAsync( - $"api/user/{account.id}", - key - ); + //var apiResult = InternalApiCaller.GetAsync( + // $"api/user/{account.id}", + // key + //); + var userResult = _pmUserRepository.GetByPmUsertoEditbyAccountId(account.id).GetAwaiter().GetResult(); - //اگر کاربر در پروگرام منیجر قبلا ایجاد شده - if (apiResult.Success && apiResult.Result.Data.accountId == account.id) + if (userResult != null) { if (!command.UserRoles.Any()) + { + _unitOfWork.RollbackAccountContext(); return operation.Failed("حداقل یک نقش باید انتخاب شود"); + } + + try + { - var parameters = new EditUserCommand( - command.Fullname, - command.Username, - command.Mobile, - account.id, - command.UserRoles, - command.IsProgramManagerUser - ); - var url = "api/user/edit"; - var response = InternalApiCaller.PostAsync( - url, - key, - parameters - ); - - if (!response.Success) + var userRoles = command.UserRoles.Where(x => x > 0).Select(x => new PmRoleUser(x)).ToList(); + userResult.Edit(command.Fullname, command.Username, command.Mobile, userRoles, command.IsProgramManagerUser); + await _pmUserRepository.SaveChangesAsync(); + } + catch (Exception) { _unitOfWork.RollbackAccountContext(); - return operation.Failed(response.Error); - + return operation.Failed("خطا در ویرایش کاربر پروگرام منیجر"); } + //var parameters = new EditUserCommand( + // command.Fullname, + // command.Username, + // command.Mobile, + // account.id, + // command.UserRoles, + // command.IsProgramManagerUser + //); + //var url = "api/user/edit"; + //var response = InternalApiCaller.PostAsync( + // url, + // key, + // parameters + //); - if (!response.Result.isSuccess) - { - _unitOfWork.RollbackAccountContext(); - return operation.Failed(response.Error); - } + //if (!response.Success) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed(response.Error); + + //} + + //if (!response.Result.isSuccess) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed(response.Error); + //} } else //اگر کاربر قبلا ایجاد نشده @@ -298,38 +344,77 @@ public class AccountApplication : IAccountApplication if (command.IsProgramManagerUser) { if (!command.UserRoles.Any()) + { + _unitOfWork.RollbackAccountContext(); return operation.Failed("حداقل یک نقش باید انتخاب شود"); - var parameters = new CreateProgramManagerUser( - command.Fullname, - command.Username, - account.Password, - command.Mobile, - command.Email, - account.id, - command.UserRoles - ); - - var url = "api/user/Create"; - - - var response = InternalApiCaller.PostAsync( - url, - key, - parameters - ); - - if (!response.Success) - { - _unitOfWork.RollbackAccountContext(); - return operation.Failed(response.Error); - } - if (!response.Result.isSuccess) + if (_pmUserRepository.Exists(x => x.FullName == command.Fullname)) { _unitOfWork.RollbackAccountContext(); - return operation.Failed(response.Error); + return operation.Failed("نام و خانوادگی تکراری است"); } + + if (_pmUserRepository.Exists(x => x.UserName == command.Username)) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed("نام کاربری تکراری است"); + } + + if (_pmUserRepository.Exists(x => !string.IsNullOrWhiteSpace(x.Mobile) && x.Mobile == command.Mobile)) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed("این شماره همراه قبلا به فرد دیگری اختصاص داده شده است"); + } + + + try + { + var userRoles = command.UserRoles.Where(x => x > 0).Select(x => new PmRoleUser(x)).ToList(); + var create = new PmUser(command.Fullname, command.Username, account.Password, command.Mobile, + null, account.id, userRoles); + await _pmUserRepository.CreateAsync(create); + await _pmUserRepository.SaveChangesAsync(); + } + catch (Exception) + { + + _unitOfWork.RollbackAccountContext(); + return operation.Failed("خطا در ویرایش کاربر پروگرام منیجر"); + } + + + //var parameters = new CreateProgramManagerUser( + // command.Fullname, + // command.Username, + // account.Password, + // command.Mobile, + // command.Email, + // account.id, + // command.UserRoles + //); + + //var url = "api/user/Create"; + + + //var response = InternalApiCaller.PostAsync( + // url, + // key, + // parameters + //); + + //if (!response.Success) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed(response.Error); + + //} + + //if (!response.Result.isSuccess) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed(response.Error); + //} } } @@ -968,4 +1053,9 @@ public class AccountApplication : IAccountApplication _authHelper.CameraSignIn(authViewModel); } + + public async Task GetPmUserByAccountId(long accountId) + { + return await _pmUserRepository.GetPmUserByAccountId(accountId); + } } \ No newline at end of file diff --git a/AccountManagement.Application/RoleApplication.cs b/AccountManagement.Application/RoleApplication.cs index 51d05489..6ea605d4 100644 --- a/AccountManagement.Application/RoleApplication.cs +++ b/AccountManagement.Application/RoleApplication.cs @@ -3,25 +3,36 @@ using AccountManagement.Application.Contracts.Role; using AccountManagement.Domain.RoleAgg; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; +using AccountManagement.Application.Contracts.ProgramManager; using AccountManagement.Application.Contracts.ProgramManagerApiResult; using AccountManagement.Domain.InternalApiCaller; using Company.Domain._common; using AccountManagement.Application.Contracts.Ticket; +using AccountManagement.Domain.PmDomains.PmPermissionAgg; +using AccountManagement.Domain.PmDomains.PmRoleAgg; +using AccountManagement.Domain.PmDomains.PmUserAgg; +using Microsoft.AspNetCore.Mvc.Rendering; +using Role = AccountManagement.Domain.RoleAgg.Role; namespace AccountManagement.Application; public class RoleApplication : IRoleApplication { private readonly IRoleRepository _roleRepository; + private readonly IPmRoleRepository _pmRoleRepository; + private readonly IPmUserRepository _pmUserRepository; private readonly IUnitOfWork _unitOfWork; - public RoleApplication(IRoleRepository roleRepository, IUnitOfWork unitOfWork) + public RoleApplication(IRoleRepository roleRepository, IUnitOfWork unitOfWork, IPmRoleRepository pmRoleRepository, IPmUserRepository pmUserRepository) { _roleRepository = roleRepository; _unitOfWork = unitOfWork; + _pmRoleRepository = pmRoleRepository; + _pmUserRepository = pmUserRepository; } - public OperationResult Create(CreateRole command) + public async Task Create(CreateRole command) { var operation = new OperationResult(); if (_roleRepository.Exists(x => x.Name == command.Name)) @@ -36,35 +47,49 @@ public class RoleApplication : IRoleApplication var pmPermissions = command.PmPermissions.Where(x => x > 0).ToList(); if (pmPermissions.Any()) { - var parameters = new CreateProgramManagerRole + try { - RoleName = command.Name, - Permissions = pmPermissions, - GozareshgirRoleId = role.id + var pmPermissionsData = pmPermissions.Where(x => x > 0).Select(x => new PmPermission(x)).ToList(); + var pmRole = new PmRole(command.Name, role.id, pmPermissionsData); + await _pmRoleRepository.CreateAsync(pmRole); + await _pmRoleRepository.SaveChangesAsync(); - }; - - var url = "api/role"; - var key = SecretKeys.ProgramManagerInternalApi; - - var response = InternalApiCaller.PostAsync( - url, - key, - parameters - ); - - - if (!response.Success) + } + catch (System.Exception) { _unitOfWork.RollbackAccountContext(); - return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد"); + return operation.Failed("خطا در ویرایش دسترسی ها در پروگرام منیجر"); } - if (!response.Result.isSuccess) - { - _unitOfWork.RollbackAccountContext(); - return operation.Failed(response.Result.errorMessage); - } + //var parameters = new CreateProgramManagerRole + //{ + // RoleName = command.Name, + // Permissions = pmPermissions, + // GozareshgirRoleId = role.id + + //}; + + //var url = "api/role"; + //var key = SecretKeys.ProgramManagerInternalApi; + + //var response = InternalApiCaller.PostAsync( + // url, + // key, + // parameters + //); + + + //if (!response.Success) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد"); + //} + + //if (!response.Result.isSuccess) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed(response.Result.errorMessage); + //} } @@ -74,7 +99,7 @@ public class RoleApplication : IRoleApplication return operation.Succcedded(); } - public OperationResult Edit(EditRole command) + public async Task Edit(EditRole command) { var operation = new OperationResult(); var role = _roleRepository.Get(command.Id); @@ -89,7 +114,7 @@ public class RoleApplication : IRoleApplication var permissions = command.Permissions.Where(x => x > 0).Select(x => new Permission(x)).ToList(); - + _unitOfWork.BeginAccountContext(); role.Edit(command.Name, permissions); @@ -99,117 +124,120 @@ public class RoleApplication : IRoleApplication //یافتن نقش در پروگرام منیجر - var apiResult = InternalApiCaller.GetAsync( - "api/role", - key, - new Dictionary - { - { "RoleName", "" }, + //var apiResult = InternalApiCaller.GetAsync( + // "api/role", + // key, + // new Dictionary + // { + // { "RoleName", "" }, - { "GozareshgirRoleId", command.Id} - } - ); + // { "GozareshgirRoleId", command.Id} + // } + //); + var pmRoleResult = await _pmRoleRepository.GetPmRoleToEdit(command.Id); - if (apiResult.Success) + + //اگر این نقش در پروگرام منیجر وجود داشت ویرایش کن + if (pmRoleResult != null) { - - if (apiResult.Result.isSuccess) + + try { - //اگر این نقش در پروگرام منیجر وجود داشت ویرایش کن - if (apiResult.Result.data.role.Any()) - { - var parameters = new CreateProgramManagerRole - { - RoleName = command.Name, - Permissions = pmPermissions, - GozareshgirRoleId = role.id - - }; - - var url = "api/role/edit"; - - - var response = InternalApiCaller.PostAsync( - url, - key, - parameters - ); - - - if (!response.Success) - { - _unitOfWork.RollbackAccountContext(); - return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد"); - } - - if (!response.Result.isSuccess) - { - _unitOfWork.RollbackAccountContext(); - return operation.Failed(response.Result.errorMessage); - } - } - else //اگر نقش در پروگرام منیجر وجود نداشت - { - - //اگر تیک پرمیشن های پروگرام منیجر زده شده - //این نقش را سمت پروگرام منیجر بساز - if (pmPermissions.Any()) - { - var parameters = new CreateProgramManagerRole - { - RoleName = command.Name, - Permissions = pmPermissions, - GozareshgirRoleId = role.id - - }; - - var url = "api/role"; - - - var response = InternalApiCaller.PostAsync( - url, - key, - parameters - ); - - - if (!response.Success) - { - _unitOfWork.RollbackAccountContext(); - return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد"); - } - - if (!response.Result.isSuccess) - { - _unitOfWork.RollbackAccountContext(); - return operation.Failed(response.Result.errorMessage); - } - } - } - + var pmpermissionsData = pmPermissions.Where(x => x > 0).Select(x => new PmPermission(x)).ToList(); + pmRoleResult.Edit(command.Name, pmpermissionsData); + await _pmRoleRepository.SaveChangesAsync(); } - else + catch (System.Exception) { _unitOfWork.RollbackAccountContext(); - return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد"); - + return operation.Failed("خطا در ویرایش دسترسی ها در پروگرام منیجر"); } + + //var parameters = new CreateProgramManagerRole + //{ + // RoleName = command.Name, + // Permissions = pmPermissions, + // GozareshgirRoleId = role.id + + //}; + //var url = "api/role/edit"; + //var response = InternalApiCaller.PostAsync( + // url, + // key, + // parameters + //); + + + //if (!response.Success) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد"); + //} + + //if (!response.Result.isSuccess) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed(response.Result.errorMessage); + //} } - else + else //اگر نقش در پروگرام منیجر وجود نداشت { - _unitOfWork.RollbackAccountContext(); - return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد"); + + //اگر تیک پرمیشن های پروگرام منیجر زده شده + //این نقش را سمت پروگرام منیجر بساز + if (pmPermissions.Any()) + { + + + try + { + var pmPermissionsData = pmPermissions.Where(x => x > 0).Select(x => new PmPermission(x)).ToList(); + var pmRole = new PmRole(command.Name, command.Id, pmPermissionsData); + await _pmRoleRepository.CreateAsync(pmRole); + await _pmRoleRepository.SaveChangesAsync(); + + } + catch (System.Exception) + { + _unitOfWork.RollbackAccountContext(); + return operation.Failed("خطا در ویرایش دسترسی ها در پروگرام منیجر"); + } + + //var parameters = new CreateProgramManagerRole + //{ + // RoleName = command.Name, + // Permissions = pmPermissions, + // GozareshgirRoleId = role.id + + //}; + + //var url = "api/role"; + + + //var response = InternalApiCaller.PostAsync( + // url, + // key, + // parameters + //); + + + //if (!response.Success) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed("ارتباط با اپلیکیش پروگرام منیجر برقرار نشد"); + //} + + //if (!response.Result.isSuccess) + //{ + // _unitOfWork.RollbackAccountContext(); + // return operation.Failed(response.Result.errorMessage); + //} + } } - - - - - - - + _unitOfWork.CommitAccountContext(); return operation.Succcedded(); } @@ -222,4 +250,23 @@ public class RoleApplication : IRoleApplication { return _roleRepository.List(); } + + + public async Task GetPmRoleList(long? gozareshgirRoleId) + { + var rolse = await _pmRoleRepository.GetPmRoleList(gozareshgirRoleId); + return new SelectList(rolse, "Id", "RoleName"); + + + } + + public async Task> GetPmRoleListToEdit(long? gozareshgirRoleId) + { + return await _pmRoleRepository.GetPmRoleList(gozareshgirRoleId); + + } + + + + } \ No newline at end of file diff --git a/AccountManagement.Configuration/PmDbBootstrapper.cs b/AccountManagement.Configuration/PmDbBootstrapper.cs new file mode 100644 index 00000000..84d93fa8 --- /dev/null +++ b/AccountManagement.Configuration/PmDbBootstrapper.cs @@ -0,0 +1,18 @@ +using AccountManagement.Domain.PmDomains.PmRoleAgg; +using AccountManagement.Domain.PmDomains.PmUserAgg; +using AccountMangement.Infrastructure.EFCore.PmDbConetxt; +using AccountMangement.Infrastructure.EFCore.Repository.PmRepositories; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +namespace AccountManagement.Configuration; + +public class PmDbBootstrapper +{ + public static void Configure(IServiceCollection services, string connectionString) + { + services.AddTransient(); + services.AddTransient(); + services.AddDbContext(x => x.UseSqlServer(connectionString)); + } +} \ No newline at end of file diff --git a/AccountManagement.Domain/PmDomains/PmPermissionAgg/Permission.cs b/AccountManagement.Domain/PmDomains/PmPermissionAgg/PmPermission.cs similarity index 77% rename from AccountManagement.Domain/PmDomains/PmPermissionAgg/Permission.cs rename to AccountManagement.Domain/PmDomains/PmPermissionAgg/PmPermission.cs index 7be4d5d0..691a9954 100644 --- a/AccountManagement.Domain/PmDomains/PmPermissionAgg/Permission.cs +++ b/AccountManagement.Domain/PmDomains/PmPermissionAgg/PmPermission.cs @@ -7,13 +7,13 @@ using AccountManagement.Domain.PmDomains.PmRoleAgg; namespace AccountManagement.Domain.PmDomains.PmPermissionAgg; -public class Permission +public class PmPermission { public long Id { get; private set; } public int Code { get; private set; } - public Role Role { get; private set; } + public PmRole Role { get; private set; } - public Permission(int code) + public PmPermission(int code) { Code = code; } diff --git a/AccountManagement.Domain/PmDomains/PmRoleAgg/IPmRoleRepository.cs b/AccountManagement.Domain/PmDomains/PmRoleAgg/IPmRoleRepository.cs new file mode 100644 index 00000000..49cb7f4e --- /dev/null +++ b/AccountManagement.Domain/PmDomains/PmRoleAgg/IPmRoleRepository.cs @@ -0,0 +1,15 @@ +using _0_Framework.Domain; +using System.Collections.Generic; +using System.Threading.Tasks; +using AccountManagement.Application.Contracts.ProgramManager; + +namespace AccountManagement.Domain.PmDomains.PmRoleAgg; + +public interface IPmRoleRepository :IRepository +{ + Task> GetPmRoleList(long? gozareshgirRoleId); + + Task GetPmRoleToEdit(long gozareshgirRoleId); + +} + diff --git a/AccountManagement.Domain/PmDomains/PmRoleAgg/Role.cs b/AccountManagement.Domain/PmDomains/PmRoleAgg/PmRole.cs similarity index 65% rename from AccountManagement.Domain/PmDomains/PmRoleAgg/Role.cs rename to AccountManagement.Domain/PmDomains/PmRoleAgg/PmRole.cs index 698d271b..ddb305ea 100644 --- a/AccountManagement.Domain/PmDomains/PmRoleAgg/Role.cs +++ b/AccountManagement.Domain/PmDomains/PmRoleAgg/PmRole.cs @@ -4,7 +4,7 @@ using AccountManagement.Domain.PmDomains.PmPermissionAgg; namespace AccountManagement.Domain.PmDomains.PmRoleAgg; -public class Role : EntityBase +public class PmRole : EntityBase { /// /// نام نقش @@ -15,7 +15,7 @@ public class Role : EntityBase /// /// لیست پرمیشن کد ها /// - public List Permissions { get; private set; } + public List PmPermission { get; private set; } /// /// ای دی نقش در گزارشگیر @@ -23,23 +23,23 @@ public class Role : EntityBase public long? GozareshgirRoleId { get; private set; } - protected Role() + protected PmRole() { } - public Role(string roleName,long? gozareshgirRolId, List permissions) + public PmRole(string roleName,long? gozareshgirRolId, List permissions) { RoleName = roleName; - Permissions = permissions; + PmPermission = permissions; GozareshgirRoleId = gozareshgirRolId; } - public void Edit(string roleName, List permissions) + public void Edit(string roleName, List permissions) { RoleName = roleName; - Permissions = permissions; + PmPermission = permissions; } diff --git a/AccountManagement.Domain/PmDomains/PmRoleUserAgg/RoleUser.cs b/AccountManagement.Domain/PmDomains/PmRoleUserAgg/PmRoleUser.cs similarity index 72% rename from AccountManagement.Domain/PmDomains/PmRoleUserAgg/RoleUser.cs rename to AccountManagement.Domain/PmDomains/PmRoleUserAgg/PmRoleUser.cs index 335ee877..a7cf6355 100644 --- a/AccountManagement.Domain/PmDomains/PmRoleUserAgg/RoleUser.cs +++ b/AccountManagement.Domain/PmDomains/PmRoleUserAgg/PmRoleUser.cs @@ -2,9 +2,9 @@ namespace AccountManagement.Domain.PmDomains.PmRoleUserAgg; -public class RoleUser +public class PmRoleUser { - public RoleUser(long roleId) + public PmRoleUser(long roleId) { RoleId = roleId; } @@ -13,7 +13,7 @@ public class RoleUser public long RoleId { get; private set; } - public User User { get; set; } + public PmUser User { get; set; } } \ No newline at end of file diff --git a/AccountManagement.Domain/PmDomains/PmUserAgg/IPmUserRepository.cs b/AccountManagement.Domain/PmDomains/PmUserAgg/IPmUserRepository.cs new file mode 100644 index 00000000..c28c3db1 --- /dev/null +++ b/AccountManagement.Domain/PmDomains/PmUserAgg/IPmUserRepository.cs @@ -0,0 +1,21 @@ +using _0_Framework.Domain; +using AccountManagement.Application.Contracts.ProgramManager; +using System.Threading.Tasks; + +namespace AccountManagement.Domain.PmDomains.PmUserAgg; + +public interface IPmUserRepository : IRepository +{ + /// + /// دریافت کاربر پروگرام منیجر جهتد ویرایش + /// + /// + /// + Task GetByPmUsertoEditbyAccountId(long accountId); + /// + /// دریافت کرابر پروگرام منیجر با اکانت آی دی در گزارشگیر + /// + /// + /// + Task GetPmUserByAccountId(long accountId); +} \ No newline at end of file diff --git a/AccountManagement.Domain/PmDomains/PmUserAgg/User.cs b/AccountManagement.Domain/PmDomains/PmUserAgg/PmUser.cs similarity index 90% rename from AccountManagement.Domain/PmDomains/PmUserAgg/User.cs rename to AccountManagement.Domain/PmDomains/PmUserAgg/PmUser.cs index 876d2bb4..6b0c531a 100644 --- a/AccountManagement.Domain/PmDomains/PmUserAgg/User.cs +++ b/AccountManagement.Domain/PmDomains/PmUserAgg/PmUser.cs @@ -9,7 +9,7 @@ namespace AccountManagement.Domain.PmDomains.PmUserAgg; /// /// کاربر /// -public class User : EntityBase +public class PmUser : EntityBase { /// /// ایجاد @@ -21,7 +21,7 @@ public class User : EntityBase /// /// /// - public User(string fullName, string userName, string password, string mobile, string email, long? accountId, List roles) + public PmUser(string fullName, string userName, string password, string mobile, string email, long? accountId, List roles) { FullName = fullName; UserName = userName; @@ -33,7 +33,7 @@ public class User : EntityBase RoleUser = roles; } - protected User() + protected PmUser() { } @@ -87,7 +87,7 @@ public class User : EntityBase /// /// لیست پرمیشن کد ها /// - public List RoleUser { get; private set; } + public List RoleUser { get; private set; } /// @@ -98,7 +98,7 @@ public class User : EntityBase /// /// /// - public void Edit(string fullName, string userName, string mobile, List roles, bool isActive) + public void Edit(string fullName, string userName, string mobile, List roles, bool isActive) { FullName = fullName; UserName = userName; diff --git a/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmRoleMapping.cs b/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmRoleMapping.cs new file mode 100644 index 00000000..00324b3d --- /dev/null +++ b/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmRoleMapping.cs @@ -0,0 +1,24 @@ +using AccountManagement.Domain.PmDomains.PmRoleAgg; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace AccountMangement.Infrastructure.EFCore.Mappings.PmMappings; + +public class PmRoleMapping : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("PmRoles", t => t.ExcludeFromMigrations()); + builder.HasKey(x => x.id); + + builder.Property(x => x.RoleName).HasMaxLength(100).IsRequired(); + + builder.OwnsMany(x => x.PmPermission, navigationBuilder => + { + navigationBuilder.HasKey(x => x.Id); + navigationBuilder.ToTable("PmRolePermissions", t => t.ExcludeFromMigrations()); + + navigationBuilder.WithOwner(x => x.Role); + }); + } +} \ No newline at end of file diff --git a/CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs b/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmUserMapping.cs similarity index 66% rename from CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs rename to AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmUserMapping.cs index 39ca99ac..9ee5e126 100644 --- a/CompanyManagment.EFCore/Mapping/PmMappings/UserMapping.cs +++ b/AccountMangement.Infrastructure.EFCore/Mappings/PmMappings/PmUserMapping.cs @@ -1,15 +1,15 @@ -using GozareshgirProgramManager.Domain.UserAgg.Entities; +using AccountManagement.Domain.PmDomains.PmUserAgg; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace GozareshgirProgramManager.Infrastructure.Persistence.Mappings; +namespace AccountMangement.Infrastructure.EFCore.Mappings.PmMappings; -public class UserMapping :IEntityTypeConfiguration +public class PmUserMapping :IEntityTypeConfiguration { - public void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.ToTable("Users"); - builder.HasKey(x => x.Id); + builder.HasKey(x => x.id); builder.Property(x => x.FullName).HasMaxLength(100).IsRequired(); builder.Property(x => x.UserName).HasMaxLength(100).IsRequired(); @@ -24,11 +24,7 @@ public class UserMapping :IEntityTypeConfiguration navigationBuilder.ToTable("RoleUsers"); navigationBuilder.WithOwner(x => x.User); }); - - builder.HasMany(x=>x.RefreshTokens) - .WithOne(x=>x.User) - .HasForeignKey(x=>x.UserId) - .OnDelete(DeleteBehavior.Cascade); + } } \ No newline at end of file diff --git a/AccountMangement.Infrastructure.EFCore/PmDbConetxt/PmDbContext.cs b/AccountMangement.Infrastructure.EFCore/PmDbConetxt/PmDbContext.cs new file mode 100644 index 00000000..a668490e --- /dev/null +++ b/AccountMangement.Infrastructure.EFCore/PmDbConetxt/PmDbContext.cs @@ -0,0 +1,32 @@ +using AccountManagement.Domain.PmDomains.PmRoleAgg; +using AccountManagement.Domain.PmDomains.PmUserAgg; +using AccountMangement.Infrastructure.EFCore.Mappings; +using AccountMangement.Infrastructure.EFCore.Mappings.PmMappings; +using Microsoft.EntityFrameworkCore; + +namespace AccountMangement.Infrastructure.EFCore.PmDbConetxt; + +public class PmDbContext : DbContext +{ + public PmDbContext(DbContextOptions options) : base(options) + { + + } + public DbSet Users { get; set; } = null!; + public DbSet PmRoles { get; set; } = null!; + + + public PmDbContext() + { + + } + + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + var assembly = typeof(PmUserMapping).Assembly; + modelBuilder.ApplyConfigurationsFromAssembly(assembly); + //SubAccountPermissionSeeder.Seed(modelBuilder); + base.OnModelCreating(modelBuilder); + } +} \ No newline at end of file diff --git a/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmRoleRepository.cs b/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmRoleRepository.cs new file mode 100644 index 00000000..e3f93e53 --- /dev/null +++ b/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmRoleRepository.cs @@ -0,0 +1,49 @@ +using _0_Framework.InfraStructure; +using AccountManagement.Application.Contracts.ProgramManager; +using AccountManagement.Domain.PmDomains.PmRoleAgg; +using AccountMangement.Infrastructure.EFCore.PmDbConetxt; +using Microsoft.EntityFrameworkCore; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using static Microsoft.EntityFrameworkCore.DbLoggerCategory; + +namespace AccountMangement.Infrastructure.EFCore.Repository.PmRepositories; + +public class PmRoleRepository : RepositoryBase, IPmRoleRepository +{ + private readonly PmDbContext _pmDbContext; + public PmRoleRepository(PmDbContext context) : base(context) + { + _pmDbContext = context; + } + + public async Task> GetPmRoleList(long? gozareshgirRoleId) + { + var query = _pmDbContext.PmRoles.AsQueryable(); + if (gozareshgirRoleId != null && gozareshgirRoleId > 0) + query = query.Where(x => x.GozareshgirRoleId == gozareshgirRoleId); + var res = await query + .Select(p => new GetPmRolesDto() + { + Id = p.id, + RoleName = p.RoleName, + GozareshgirRoleId = p.GozareshgirRoleId, + Permissions = p.PmPermission.Select(x => x.Code).ToList() + + }) + .ToListAsync(); + + return res; + } + + + + public async Task GetPmRoleToEdit(long gozareshgirRoleId) + { + return await _pmDbContext.PmRoles.FirstOrDefaultAsync(x => x.GozareshgirRoleId == gozareshgirRoleId); + + } + +} \ No newline at end of file diff --git a/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmUserRepository.cs b/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmUserRepository.cs new file mode 100644 index 00000000..70a378df --- /dev/null +++ b/AccountMangement.Infrastructure.EFCore/Repository/PmRepositories/PmUserRepository.cs @@ -0,0 +1,47 @@ +using _0_Framework.InfraStructure; +using AccountManagement.Application.Contracts.ProgramManager; +using AccountManagement.Domain.PmDomains.PmUserAgg; +using AccountMangement.Infrastructure.EFCore.PmDbConetxt; +using Microsoft.EntityFrameworkCore; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace AccountMangement.Infrastructure.EFCore.Repository.PmRepositories; + +public class PmUserRepository :RepositoryBase, IPmUserRepository +{ + private readonly PmDbContext _pmDbContext; + public PmUserRepository(PmDbContext context, PmDbContext pmDbContext) : base(context) + { + _pmDbContext = pmDbContext; + } + public async Task GetByPmUsertoEditbyAccountId(long accountId) + { + return await _pmDbContext.Users.FirstOrDefaultAsync(x => x.AccountId == accountId); + } + + public async Task GetPmUserByAccountId(long accountId) + { + var query = await _pmDbContext.Users.FirstOrDefaultAsync(x => x.AccountId == accountId); + if (query == null) + return new GetPmUserDto(); + List roles = query.RoleUser.Select(x => x.RoleId).ToList(); + return new GetPmUserDto() + { + FullName = query.FullName, + UserName = query.UserName, + ProfilePhotoPath = query.ProfilePhotoPath, + Mobile = query.Mobile, + IsActive = query.IsActive, + AccountId = query.AccountId, + Roles = roles, + RoleListDto = await _pmDbContext.PmRoles.Where(x => roles.Contains(x.id)).Select(x => new RoleListDto() + { + RoleName = x.RoleName, + RoleId = x.id, + Permissions = x.PmPermission.Select(x => x.Code).ToList() + }).ToListAsync(), + }; + } +} \ No newline at end of file diff --git a/CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs b/CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs deleted file mode 100644 index 8d6292d6..00000000 --- a/CompanyManagment.EFCore/Mapping/PmMappings/RoleMapping.cs +++ /dev/null @@ -1,23 +0,0 @@ -using AccountManagement.Domain.PmDomains.PmRoleAgg; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace CompanyManagment.EFCore.Mapping.PmMappings; - -public class RoleMapping : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.ToTable("Roles"); - builder.HasKey(x => x.id); - - builder.Property(x => x.RoleName).HasMaxLength(100).IsRequired(); - - builder.OwnsMany(x => x.Permissions, navigationBuilder => - { - navigationBuilder.HasKey(x => x.Id); - navigationBuilder.ToTable("RolePermissions"); - navigationBuilder.WithOwner(x => x.Role); - }); - } -} \ No newline at end of file diff --git a/CompanyManagment.EFCore/PmDbContext.cs b/CompanyManagment.EFCore/PmDbContext.cs deleted file mode 100644 index e2890873..00000000 --- a/CompanyManagment.EFCore/PmDbContext.cs +++ /dev/null @@ -1,30 +0,0 @@ - -using Microsoft.EntityFrameworkCore; -using System; -using AccountManagement.Domain.PmDomains.PmRoleAgg; -using AccountManagement.Domain.PmDomains.PmUserAgg; - -namespace CompanyManagment.EFCore; - -public class PmDbContext : DbContext -{ - public PmDbContext(DbContextOptions options) : base(options) - { - - } - public DbSet Users { get; set; } = null!; - public DbSet Roles { get; set; } = null!; - - - public PmDbContext() - { - - } - - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.ApplyConfigurationsFromAssembly(typeof(PmDbContext).Assembly); - base.OnModelCreating(modelBuilder); - } -} \ No newline at end of file diff --git a/PersonalContractingParty.Config/PmDbBootstrapper.cs b/PersonalContractingParty.Config/PmDbBootstrapper.cs deleted file mode 100644 index 8d0b130d..00000000 --- a/PersonalContractingParty.Config/PmDbBootstrapper.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Company.Domain.InsuranceJobItemAgg; -using Company.Domain.InsurancJobAgg; -using CompanyManagment.App.Contracts.InsuranceJob; -using CompanyManagment.Application; -using CompanyManagment.EFCore; -using CompanyManagment.EFCore.Repository; -using Microsoft.Extensions.DependencyInjection; - -namespace PersonalContractingParty.Config; - -public class PmDbBootstrapper -{ - public static void Configure(IServiceCollection services, string connectionString) - { - - services.AddDbContext(x => x.UseSqlServer(connectionString)); - } -} \ No newline at end of file diff --git a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs index 6f2d7132..e4597d4f 100644 --- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs +++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs @@ -55,41 +55,42 @@ public class IndexModel : PageModel public IActionResult OnGetCreate() - { + { - + var pmRolseSelectList = _roleApplication.GetPmRoleList(null).GetAwaiter().GetResult(); var command = new CreateAccount { - Roles = _roleApplication.List() - }; - var key = SecretKeys.ProgramManagerInternalApi; - var response = InternalApiCaller.GetAsync( - "api/role", - key, - new Dictionary - { - { "RoleName", "" }, + Roles = _roleApplication.List(), + RoleList = pmRolseSelectList, + }; + //var key = SecretKeys.ProgramManagerInternalApi; + //var response = InternalApiCaller.GetAsync( + // "api/role", + // key, + // new Dictionary + // { + // { "RoleName", "" }, - { "GozareshgirRoleId", "" } - } - ); + // { "GozareshgirRoleId", "" } + // } + //); - if (response.Success) - { - if (response.Result.isSuccess) - { - command.RoleList = new SelectList(response.Result.data.role, "id", "roleName"); + //if (response.Success) + //{ + // if (response.Result.isSuccess) + // { + // command.RoleList = new SelectList(response.Result.data.role, "id", "roleName"); - } + // } - } + //} return Partial("./Create", command); } public IActionResult OnPostCreate(CreateAccount command) { - var result = _accountApplication.Create(command); + var result = _accountApplication.Create(command).GetAwaiter().GetResult(); return new JsonResult(result); } @@ -102,7 +103,7 @@ public class IndexModel : PageModel public IActionResult OnPostCreateRole(CreateRole command) { - var result = _roleApplication.Create(command); + var result = _roleApplication.Create(command).GetAwaiter().GetResult(); return new JsonResult(result); } @@ -112,55 +113,51 @@ public class IndexModel : PageModel var account = _accountApplication.GetDetails(id); + //var key = SecretKeys.ProgramManagerInternalApi; + + //var apiResult = InternalApiCaller.GetAsync( + // $"api/user/{account.Id}", + // key + //); + var result = _accountApplication.GetPmUserByAccountId(account.Id).GetAwaiter().GetResult(); - var key = SecretKeys.ProgramManagerInternalApi; - - var apiResult = InternalApiCaller.GetAsync( - $"api/user/{account.Id}", - key - ); - - - - // حالا نتیجه دیسریال شده در apiResult.Result قرار دارد - var result = apiResult.Result; - // مثل قبل: - if (result != null && result.isSuccess) + if (result != null) { - account.IsProgramManagerUser = (result.Data.accountId == account.Id && result.Data.isActive); - account.UserRoles = apiResult.Result.Data.Roles; + account.IsProgramManagerUser = (result.AccountId== account.Id && result.IsActive); + account.UserRoles = result.Roles; } else { account.IsProgramManagerUser = false; } + var pmRolseSelectList = _roleApplication.GetPmRoleList(null).GetAwaiter().GetResult(); + account.RoleList = pmRolseSelectList; + //var response = InternalApiCaller.GetAsync( + // "api/role", + // key, + // new Dictionary + // { + // { "RoleName", "" }, - var response = InternalApiCaller.GetAsync( - "api/role", - key, - new Dictionary - { - { "RoleName", "" }, + // { "GozareshgirRoleId", "" } + // } + //); - { "GozareshgirRoleId", "" } - } - ); + //if (response.Success) + //{ + // if (response.Result.isSuccess) + // { + // account.RoleList = new SelectList(response.Result.data.role, "id", "roleName"); - if (response.Success) - { - if (response.Result.isSuccess) - { - account.RoleList = new SelectList(response.Result.data.role, "id", "roleName"); - - } + // } - } + //} @@ -172,7 +169,7 @@ public class IndexModel : PageModel public JsonResult OnPostEdit(EditAccount command) { - var result = _accountApplication.Edit(command); + var result = _accountApplication.Edit(command).GetAwaiter().GetResult(); return new JsonResult(result); } @@ -182,26 +179,27 @@ public class IndexModel : PageModel var rol = new List(); foreach (var item in role.MappedPermissions) rol.Add(item.Code); - var key = SecretKeys.ProgramManagerInternalApi; + //var key = SecretKeys.ProgramManagerInternalApi; - var apiResult = InternalApiCaller.GetAsync( - "api/role", - key, - new Dictionary - { - { "RoleName", "" }, + //var apiResult = InternalApiCaller.GetAsync( + // "api/role", + // key, + // new Dictionary + // { + // { "RoleName", "" }, - { "GozareshgirRoleId", role.Id } - } - ); + // { "GozareshgirRoleId", role.Id } + // } + //); + var pmRoleResult = _roleApplication.GetPmRoleListToEdit(role.Id).GetAwaiter().GetResult(); role.Permissions = rol; - if (apiResult.Success) + if (pmRoleResult != null) { - if (apiResult.Result.isSuccess && apiResult.Result.data.role.Any()) + if (pmRoleResult.Any()) { - var pmPermission = apiResult.Result.data.role.FirstOrDefault()!.permissions; + var pmPermission = pmRoleResult.FirstOrDefault()!.Permissions; role.Permissions.AddRange(pmPermission); } @@ -213,7 +211,7 @@ public class IndexModel : PageModel public JsonResult OnPostEditRole(EditRole command) { - var result = _roleApplication.Edit(command); + var result = _roleApplication.Edit(command).GetAwaiter().GetResult(); return new JsonResult(result); }