Merge branch 'Main' into Feature/InstitutionContract/Create-Api
This commit is contained in:
@@ -24,30 +24,12 @@ public class ContractingPartyBankAccountController : AdminBaseController
|
||||
/// <param name="searchModel">سرچ</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<OperationResult<List<GetContractingPartyBankAccountViewModel>>> GetList(ContractingPartyBankAccountSearchModel searchModel)
|
||||
public async Task<GetContractingPartyBankAccountViewModel> GetList(ContractingPartyBankAccountSearchModel searchModel)
|
||||
{
|
||||
var res =await _contractingPartyBankAccountsApplication.GetList(searchModel);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpGet("fake")]
|
||||
public IActionResult GetFakeBankAccounts()
|
||||
{
|
||||
var bankAccountsFaker = new Faker<ContractingPartyBankAccountsItemViewModel>("fa")
|
||||
.RuleFor(x => x.AccountHolderName, f => f.Name.FullName())
|
||||
.RuleFor(x => x.CardNumber, f => f.Finance.CreditCardNumber())
|
||||
.RuleFor(x => x.AccountNumber, f => f.Finance.Account())
|
||||
.RuleFor(x => x.IBan, f => $"IR{f.Random.Number(10_000_000, 99_999_999)}{f.Random.Number(10_000_000, 99_999_999)}");
|
||||
|
||||
var viewModelFaker = new Faker<GetContractingPartyBankAccountViewModel>("fa")
|
||||
.RuleFor(x => x.ContractingPartyId, f => f.Random.Long(1000, 9999))
|
||||
.RuleFor(x => x.ContractingPartyName, f => f.Company.CompanyName())
|
||||
.RuleFor(x => x.WorkshopName, f => f.Address.City())
|
||||
.RuleFor(x => x.BankAccountsItems, f => bankAccountsFaker.Generate(f.Random.Int(1, 5)));
|
||||
|
||||
var fakeData = viewModelFaker.Generate(new Random().Next(1,35));
|
||||
return Ok(fakeData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.PaymentInstrument;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class PaymentInstrumentController:AdminBaseController
|
||||
{
|
||||
private readonly IPaymentInstrumentApplication _paymentInstrumentApplication;
|
||||
|
||||
public PaymentInstrumentController(IPaymentInstrumentApplication paymentInstrumentApplication)
|
||||
{
|
||||
_paymentInstrumentApplication = paymentInstrumentApplication;
|
||||
}
|
||||
/// <summary>
|
||||
///لیست اطلاعات بانکی جاری شرکا
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<GetPaymentInstrumentListViewModel>> List(PaymentInstrumentSearchModel searchModel)
|
||||
{
|
||||
var list =await _paymentInstrumentApplication.GetList(searchModel);
|
||||
return list;
|
||||
}
|
||||
/// <summary>
|
||||
/// ایجاد اطلاعات بانکی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("bankAccount")]
|
||||
public async Task<ActionResult<OperationResult>> CreateBankAccount([FromBody] CreateBankPaymentInstrument command)
|
||||
{
|
||||
var result = await _paymentInstrumentApplication.CreateBankAccount(command);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// ایجاد اطلاعات دستگاه پوز
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("pos")]
|
||||
public async Task<ActionResult<OperationResult>> CreatePos([FromBody]CreatePosPaymentInstrument command)
|
||||
{
|
||||
var result =await _paymentInstrumentApplication.CreatePos(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// گرفتن عنوان ها
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("group")]
|
||||
public async Task<ActionResult<List<PaymentInstrumentGroupsViewModel>>> GetGroups()
|
||||
{
|
||||
var result = await _paymentInstrumentApplication.GetGroup();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد عنوان
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("group")]
|
||||
public async Task<ActionResult<OperationResult>> CreateGroup([FromBody]CreateBankPaymentInstrumentGroup command)
|
||||
{
|
||||
var result = await _paymentInstrumentApplication.CreateGroup(command);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// ویرایش عنوان
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("group")]
|
||||
public async Task<ActionResult<OperationResult>> EditGroup([FromBody]EditBankPaymentInstrumentGroup command)
|
||||
{
|
||||
var result = await _paymentInstrumentApplication.EditGroup(command);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// حذف عنوان
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("group/{id}")]
|
||||
public async Task<ActionResult<OperationResult>> DeleteGroup(long id)
|
||||
{
|
||||
var result = await _paymentInstrumentApplication.DeleteGroup(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user