* Added VatCodeAssociation

This commit is contained in:
2025-08-22 07:01:13 +02:00
parent eb40cc35fe
commit 8c646d4bc7
8 changed files with 492 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
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));
}
}

View File

@@ -106,6 +106,7 @@ builder.Services.AddScoped<IEdiCustomerOrderImportService, EdiCustomerOrderImpor
builder.Services.AddScoped<ICustomerService, CustomerService>();
builder.Services.AddScoped<ICustomerTpService, CustomerTpService>();
builder.Services.AddScoped<IItemService, ItemService>();
builder.Services.AddScoped<IVatCodeAssociationService, VatCodeAssociationService>();
builder.Services.AddHostedService<TimedHostedService>();