Merge branch 'Feature/ContractingPartyBankAccount/Init' into Main

This commit is contained in:
MahanCh
2025-08-05 15:54:41 +03:30
3 changed files with 35 additions and 2 deletions

View File

@@ -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)
{