Files
FA_WEB/FaKrosnoApi/Controllers/VatCodeAssociationController.cs
2025-08-22 07:01:13 +02:00

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));
}
}