25 lines
765 B
C#
25 lines
765 B
C#
using AutoMapper;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using SytelineSaAppEfDataModel.Dtos;
|
|
using SytelineSaAppEfDataModel.Services;
|
|
|
|
namespace FaKrosnoApi.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("api/[controller]")]
|
|
public class VatCodeAssociationController(IVatCodeAssociationService service, IMapper mapper) : Controller
|
|
{
|
|
[HttpGet("by-parameters")]
|
|
public async Task<ActionResult<VatCodeAssociationDto>> GetVatCodesAssociation(string customerDoInvoice,
|
|
string endUserType, string productCode)
|
|
{
|
|
var result = await service.GetVatCodesAssociation(customerDoInvoice, endUserType, productCode);
|
|
if (result == null)
|
|
{
|
|
return NotFound();
|
|
}
|
|
|
|
return Ok(mapper.Map<VatCodeAssociationDto>(result));
|
|
}
|
|
|
|
} |