add bank inquiry

This commit is contained in:
MahanCh
2025-08-05 15:12:07 +03:30
parent ebc377603a
commit daa2a0fdc1

View File

@@ -1,4 +1,5 @@
using _0_Framework.Application;
using _0_Framework.Exceptions;
using CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
using CompanyManagment.App.Contracts.PaymentInstrument;
using Microsoft.AspNetCore.Mvc;
@@ -225,4 +226,47 @@ public class PaymentInstrumentController:AdminBaseController
return combinedList.Distinct().ToList();
}
[HttpPost("bank-account-inquiry")]
public async Task<ActionResult<OperationResult<BankInquiryResponse>>> GetBankInquiry(BankInquiryRequest command)
{
if ((!string.IsNullOrWhiteSpace(command.AccountNumber) && command.AccountNumber.StartsWith("111111")) || (!string.IsNullOrWhiteSpace(command.AccountNumber)&&command.BankNumber.StartsWith("111111")) || (!string.IsNullOrWhiteSpace(command.AccountNumber)&&command.IBan.StartsWith("1111111")))
{
return new OperationResult<BankInquiryResponse>()
{
Data = new BankInquiryResponse()
{
AccountNumber = "1111111",
IBan = "111111111111111111111111",
BankNumber = "1111111111111111",
AccountHolderName = "تست تستی",
BankName = "تست بانک",
}
};
}else if (command.AccountNumber.StartsWith("2222222") || command.BankNumber.StartsWith("2222222") || command.IBan.StartsWith("2222222"))
{
return new OperationResult<BankInquiryResponse>().Failed("دیتای وارد شده نامعتبر است");
}
else
{
throw new InternalServerException("ارور سمت سرور");
}
}
}
public class BankInquiryRequest
{
public string BankNumber { get; set; }
public string IBan { get; set; }
public string AccountNumber { get; set; }
public string BankName { get; set; }
}
public class BankInquiryResponse
{
public string BankNumber { get; set; }
public string IBan { get; set; }
public string AccountNumber { get; set; }
public string BankName { get; set; }
public string AccountHolderName { get; set; }
}