marge from master
This commit is contained in:
@@ -4,5 +4,11 @@ namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public interface IContractingPartyTempRepository :IRepository<long, ContractingPartyTemp>
|
||||
{
|
||||
(long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode);
|
||||
/// <summary>
|
||||
/// چک میکند که آیا طرف حساب با این کد ملی قبلا ایجاد شده است یا خبر
|
||||
/// اگر ایجاد شده احراز هویت نشده احراز هویت میشود
|
||||
/// </summary>
|
||||
/// <param name="nationalCode"></param>
|
||||
/// <returns></returns>
|
||||
bool CheckExistOrAuthenticated(string nationalCode);
|
||||
}
|
||||
@@ -18,7 +18,18 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
public OperationResult CreateContractingPartyTemp(CreateContractingPartyTemp command)
|
||||
{
|
||||
var getExistContractingParty = _contractingPartyTempRepository.CheckExistOrAuthenticated(command.NationalCode);
|
||||
|
||||
throw new System.NotImplementedException();
|
||||
//اگر طرف حساب قبلا در دیتابیس وجود داشت
|
||||
if (getExistContractingParty)
|
||||
{
|
||||
|
||||
}
|
||||
//اگر طرف حساب وجود نداشت
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.UID;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
@@ -9,9 +11,11 @@ namespace CompanyManagment.EFCore.Repository;
|
||||
public class ContractingPartyTempRepository : RepositoryBase<long, ContractingPartyTemp>, IContractingPartyTempRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public ContractingPartyTempRepository(CompanyContext context) : base(context)
|
||||
private readonly UidService _uidService;
|
||||
public ContractingPartyTempRepository(CompanyContext context, UidService uidService) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_uidService = uidService;
|
||||
}
|
||||
|
||||
//(long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode)
|
||||
@@ -28,8 +32,24 @@ public class ContractingPartyTempRepository : RepositoryBase<long, ContractingPa
|
||||
|
||||
// return new();
|
||||
//}
|
||||
public (long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode)
|
||||
public bool CheckExistOrAuthenticated(string nationalCode)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
var contractingParty = _context.PersonalContractingParties.FirstOrDefault(x=>x.Nationalcode == nationalCode);
|
||||
if (contractingParty == null)
|
||||
return false;
|
||||
|
||||
if (!contractingParty.IsAuthenticated && !string.IsNullOrWhiteSpace(contractingParty.Nationalcode) && contractingParty.DateOfBirth != null)
|
||||
{
|
||||
|
||||
var dateOfbirth = contractingParty.DateOfBirth.ToFarsi();
|
||||
var apiRespons = _uidService.GetPersonalInfo(contractingParty.Nationalcode, dateOfbirth).Result;
|
||||
if (apiRespons != null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user