* Added ItemCustPriceAll entity

This commit is contained in:
2025-08-22 07:13:47 +02:00
parent 8c646d4bc7
commit 764ba68f56
8 changed files with 293 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
using SytelineSaAppEfDataModel.Dtos;
namespace SytelineSaAppEfDataModel.Services;
public interface IItemCustPriceAllService
{
Task<ItemCustPriceAllDto?> GetItemCustPriceAllAsync(string item, string customerNumber);
}

View File

@@ -0,0 +1,13 @@
using AutoMapper;
using SytelineSaAppEfDataModel.Dtos;
namespace SytelineSaAppEfDataModel.Services;
public class ItemCustPriceAllService(SytelineSaAppDbContext context, IMapper mapper) : IItemCustPriceAllService
{
public async Task<ItemCustPriceAllDto?> GetItemCustPriceAllAsync(string item, string customerNumber)
{
return await Task.FromResult(mapper.Map<ItemCustPriceAllDto?>(context.ItemCustPriceAlls
.OrderByDescending(x => x.EffectDate).FirstOrDefault(x => x.Item == item && x.CustNum == customerNumber)));
}
}