95 lines
3.0 KiB
C#
95 lines
3.0 KiB
C#
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;
|
||
}
|
||
|
||
} |