diff --git a/Company.Domain/ContarctingPartyAgg/PersonalContractingParty.cs b/Company.Domain/ContarctingPartyAgg/PersonalContractingParty.cs index 3029da18..d8e2c3a7 100644 --- a/Company.Domain/ContarctingPartyAgg/PersonalContractingParty.cs +++ b/Company.Domain/ContarctingPartyAgg/PersonalContractingParty.cs @@ -45,6 +45,8 @@ public class PersonalContractingParty : EntityBase public int BlockTimes {get; private set; } + #region NewProps + /// /// سری شناسنامه /// @@ -70,6 +72,9 @@ public class PersonalContractingParty : EntityBase /// public bool IsAuthenticated { get; private set; } + #endregion + + public List Employers { get; private set; } public Representative Representative { get; set; } diff --git a/Company.Domain/TemporaryClientRegistrationAgg/ContractingPartyTemp.cs b/Company.Domain/TemporaryClientRegistrationAgg/ContractingPartyTemp.cs index 0b642d33..b72758d3 100644 --- a/Company.Domain/TemporaryClientRegistrationAgg/ContractingPartyTemp.cs +++ b/Company.Domain/TemporaryClientRegistrationAgg/ContractingPartyTemp.cs @@ -1,11 +1,12 @@ using System; +using _0_Framework.Application; using _0_Framework.Domain; namespace Company.Domain.TemporaryClientRegistrationAgg; public class ContractingPartyTemp : EntityBase { - public ContractingPartyTemp(string fName, string lName, string nationalCode, string idNumber, string phone, string fatherName, string state, string city, string address, string idNumberSeri, string idNumberSerial, string gender, DateTime dateOfBirth) + public ContractingPartyTemp(string fName, string lName, string nationalCode, string idNumber, string phone, string fatherName, string state, string city, string address, string idNumberSeri, string idNumberSerial, Gender gender, DateTime dateOfBirth) { FName = fName; LName = lName; @@ -39,7 +40,7 @@ public class ContractingPartyTemp : EntityBase /// /// جنسیت /// - public string Gender { get; private set; } + public Gender Gender { get; private set; } /// /// کد ملی @@ -61,25 +62,30 @@ public class ContractingPartyTemp : EntityBase /// public string IdNumberSerial { get; private set; } + /// /// شماره شناسنامه /// public string IdNumber { get; private set; } + /// /// شماره همراه /// public string Phone { get; private set; } + /// /// استان /// public string State { get; private set; } + /// /// شهر /// public string City { get; private set; } + /// /// نشانی /// diff --git a/Company.Domain/TemporaryClientRegistrationAgg/IContractingPartyTemp.cs b/Company.Domain/TemporaryClientRegistrationAgg/IContractingPartyTemp.cs deleted file mode 100644 index ac0b036a..00000000 --- a/Company.Domain/TemporaryClientRegistrationAgg/IContractingPartyTemp.cs +++ /dev/null @@ -1,8 +0,0 @@ -using _0_Framework.Domain; - -namespace Company.Domain.TemporaryClientRegistrationAgg; - -public interface IContractingPartyTemp :IRepository -{ - -} \ No newline at end of file diff --git a/Company.Domain/TemporaryClientRegistrationAgg/IContractingPartyTempRepository.cs b/Company.Domain/TemporaryClientRegistrationAgg/IContractingPartyTempRepository.cs new file mode 100644 index 00000000..9b27b72d --- /dev/null +++ b/Company.Domain/TemporaryClientRegistrationAgg/IContractingPartyTempRepository.cs @@ -0,0 +1,8 @@ +using _0_Framework.Domain; + +namespace Company.Domain.TemporaryClientRegistrationAgg; + +public interface IContractingPartyTempRepository :IRepository +{ + (long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode); +} \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/PersonalContractingPartyViewModel.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/PersonalContractingPartyViewModel.cs index a3635607..c2e955b2 100644 --- a/CompanyManagment.App.Contracts/PersonalContractingParty/PersonalContractingPartyViewModel.cs +++ b/CompanyManagment.App.Contracts/PersonalContractingParty/PersonalContractingPartyViewModel.cs @@ -44,6 +44,7 @@ public class PersonalContractingPartyViewModel public string IsActiveString { get; set; } public string IsBlock { get; set; } public int BlockTimes { get; set; } + public bool IsAuthenticated { get; set; } public List EmployerList { get; set; } } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/ContractingPartyTempViewModel.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ContractingPartyTempViewModel.cs new file mode 100644 index 00000000..b5d6dd68 --- /dev/null +++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ContractingPartyTempViewModel.cs @@ -0,0 +1,6 @@ +namespace CompanyManagment.App.Contracts.TemporaryClientRegistration; + +public class ContractingPartyTempViewModel : CreateContractingPartyTemp +{ + public long Id { get; set; } +} \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateContractingPartyTemp.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateContractingPartyTemp.cs new file mode 100644 index 00000000..b7cf1d67 --- /dev/null +++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/CreateContractingPartyTemp.cs @@ -0,0 +1,78 @@ +using _0_Framework.Application; +using System; +using System.Drawing.Interop; + +namespace CompanyManagment.App.Contracts.TemporaryClientRegistration; + + + +public class CreateContractingPartyTemp +{ + /// + /// نام + /// + public string FName { get; set; } + /// + /// نام خانوادگی + /// + public string LName { get; set; } + + /// + /// نام پدر + /// + public string FatherName { get; set; } + + /// + /// جنسیت + /// + public Gender Gender { get; set; } + + /// + /// کد ملی + /// + public string NationalCode { get; set; } + + /// + ///تاریخ تولد + /// + public DateTime DateOfBirth { get; set; } + + /// + /// سری شناسنامه + /// + public string IdNumberSeri { get; set; } + + /// + /// سریال شناسنامه + /// + public string IdNumberSerial { get; set; } + + + /// + /// شماره شناسنامه + /// + public string IdNumber { get; set; } + + + + /// + /// شماره همراه + /// + public string Phone { get; set; } + + + /// + /// استان + /// + public string State { get; set; } + + /// + /// شهر + /// + public string City { get; set; } + + /// + /// نشانی + /// + public string Address { get; set; } +} \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/ITemporaryClientRegistrationApplication.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ITemporaryClientRegistrationApplication.cs new file mode 100644 index 00000000..c829e5f2 --- /dev/null +++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ITemporaryClientRegistrationApplication.cs @@ -0,0 +1,8 @@ +using _0_Framework.Application; + +namespace CompanyManagment.App.Contracts.TemporaryClientRegistration; + +public interface ITemporaryClientRegistrationApplication +{ + OperationResult CreateContractingPartyTemp(CreateContractingPartyTemp command); +} \ No newline at end of file diff --git a/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs b/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs new file mode 100644 index 00000000..5f90e96f --- /dev/null +++ b/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs @@ -0,0 +1,24 @@ +using _0_Framework.Application; +using Company.Domain.ContarctingPartyAgg; +using Company.Domain.TemporaryClientRegistrationAgg; +using CompanyManagment.App.Contracts.TemporaryClientRegistration; + +namespace CompanyManagment.Application; + +public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrationApplication +{ + private readonly IContractingPartyTempRepository _contractingPartyTempRepository; + private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository; + + public TemporaryClientRegistrationApplication(IContractingPartyTempRepository contractingPartyTempRepository, IPersonalContractingPartyRepository personalContractingPartyRepository) + { + _contractingPartyTempRepository = contractingPartyTempRepository; + _personalContractingPartyRepository = personalContractingPartyRepository; + } + + public OperationResult CreateContractingPartyTemp(CreateContractingPartyTemp command) + { + + throw new System.NotImplementedException(); + } +} \ No newline at end of file diff --git a/CompanyManagment.EFCore/Mapping/ContractingPartyTempMapping.cs b/CompanyManagment.EFCore/Mapping/ContractingPartyTempMapping.cs new file mode 100644 index 00000000..7d7f6ebd --- /dev/null +++ b/CompanyManagment.EFCore/Mapping/ContractingPartyTempMapping.cs @@ -0,0 +1,32 @@ +using System; +using _0_Framework.Application; +using Company.Domain.TemporaryClientRegistrationAgg; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace CompanyManagment.EFCore.Mapping; + +public class ContractingPartyTempMapping : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("ContractingPartyTemp"); + builder.HasKey(x => x.id); + + builder.Property(x => x.FName).HasMaxLength(25).IsRequired(); + builder.Property(x => x.LName).HasMaxLength(25).IsRequired(); + builder.Property(x => x.NationalCode).HasMaxLength(10).IsRequired(); + builder.Property(x => x.IdNumber).HasMaxLength(10).IsRequired(false); + builder.Property(x => x.Phone).HasMaxLength(12); + builder.Property(x => x.FatherName).HasMaxLength(25); + builder.Property(x => x.State).HasMaxLength(35); + builder.Property(x => x.City).HasMaxLength(35); + builder.Property(x => x.Address).HasMaxLength(500); + builder.Property(x => x.IdNumberSeri).HasMaxLength(5); + builder.Property(x => x.IdNumberSerial).HasMaxLength(15); + builder.Property(x => x.Gender).HasConversion( + v => v.ToString(), + v => (Gender)Enum.Parse(typeof(Gender), v)).HasMaxLength(6); + builder.Property(x => x.DateOfBirth); + } +} \ No newline at end of file diff --git a/CompanyManagment.EFCore/Repository/ContractingPartyTempRepository.cs b/CompanyManagment.EFCore/Repository/ContractingPartyTempRepository.cs new file mode 100644 index 00000000..bfdb39c4 --- /dev/null +++ b/CompanyManagment.EFCore/Repository/ContractingPartyTempRepository.cs @@ -0,0 +1,35 @@ +using System.Linq; +using _0_Framework.InfraStructure; +using Company.Domain.TemporaryClientRegistrationAgg; +using CompanyManagment.App.Contracts.PersonalContractingParty; +using Microsoft.EntityFrameworkCore; + +namespace CompanyManagment.EFCore.Repository; + +public class ContractingPartyTempRepository : RepositoryBase, IContractingPartyTempRepository +{ + private readonly CompanyContext _context; + public ContractingPartyTempRepository(CompanyContext context) : base(context) + { + _context = context; + } + + //(long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode) + //{ + // //return _context.PersonalContractingParties.Select(x=>new PersonalContractingPartyViewModel + // //{ + // // id = x.id, + // // IsAuthenticated = x.IsAuthenticated, + // // Nationalcode = x.Nationalcode, + // // IdNumber = x.IdNumber, + + + // //}).FirstOrDefault(x => x.Nationalcode == nationalcode); + + // return new(); + //} + public (long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode) + { + throw new System.NotImplementedException(); + } +} \ No newline at end of file