* Added VatCodeAssociation
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface IVatCodeAssociationService
|
||||
{
|
||||
Task<VatCodeAssociationDto?> GetVatCodesAssociation(string customerDoInvoice, string endUserType, string productCode);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using AutoMapper;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public class VatCodeAssociationService(SytelineSaAppDbContext context, IMapper mapper) : IVatCodeAssociationService
|
||||
{
|
||||
public async Task<VatCodeAssociationDto?> GetVatCodesAssociation(string customerDoInvoice, string endUserType,
|
||||
string productCode)
|
||||
{
|
||||
return await Task.FromResult(mapper.Map<VatCodeAssociationDto?>(context.VatCodeAssociations.FirstOrDefault(x =>
|
||||
x.VATRegisterType == customerDoInvoice && x.EndUserType == endUserType && x.ProdCode == productCode)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user