Merge branch 'Feature/ContractingPartyBankAccount/Init' into Main
This commit is contained in:
@@ -50,6 +50,38 @@ public class ContractingPartyBankAccountsApplication:IContractingPartyBankAccoun
|
||||
|
||||
}
|
||||
|
||||
public async Task<OperationResult> Create(List<CreateContractingPartyBankAccounts> commands)
|
||||
{
|
||||
var operationResult = new OperationResult();
|
||||
foreach (var command in commands)
|
||||
{
|
||||
if (!_personalContractingPartyRepository.Exists(x => x.id == command.ContractingPartyId))
|
||||
return operationResult.Failed("طرف حساب مورد نظر یافت نشد");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.CardNumber))
|
||||
return operationResult.Failed("شماره کارت خود را وارد کنید");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.AccountNumber))
|
||||
return operationResult.Failed("شماره حساب خود را وارد کنید");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.IBan))
|
||||
return operationResult.Failed("شماره شبا خود را وارد کنید");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.AccountHolderName))
|
||||
return operationResult.Failed("نام صاحب حساب را وارد کنید");
|
||||
|
||||
var entity = new ContractingPartyBankAccount(command.ContractingPartyId, command.CardNumber,
|
||||
command.AccountHolderName,command.AccountNumber, command.IBan,command.IsAuth);
|
||||
|
||||
await _contractingPartyBankAccountsRepository.CreateAsync(entity);
|
||||
}
|
||||
await _contractingPartyBankAccountsRepository.SaveChangesAsync();
|
||||
|
||||
return operationResult.Succcedded();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public async Task<GetContractingPartyBankAccountViewModel> GetList(
|
||||
ContractingPartyBankAccountSearchModel searchModel)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user