* Additional Functions added to services

* Changes in MaterialTransaction mapping
This commit is contained in:
2025-04-02 21:25:13 +02:00
parent 3f0da4ba79
commit 94c4586c35
9 changed files with 86 additions and 58 deletions

View File

@@ -26,6 +26,15 @@ namespace FaKrosnoEfDataModel.Services
return scheduleOrders.Where(x => x?.RecipientID == recipientId);
}
public async Task<IList<ScheduleOrderDto>> GetByPurchaserId(int purchaserId)
{
return await Context.ScheduleOrders.Include(x => x.Recipient).ThenInclude(x => x.Purchaser)
.Include(x => x.ScheduleOrderDetails).ThenInclude(x => x.ScheduleOrderDetailMiscs)
.Include(x => x.ScheduleOrderDetails).ThenInclude(x => x.ScheduleOrderDetailDetails)
.Where(x => x.Recipient.Purchaser.ID == purchaserId).Select(x => Mapper.Map<ScheduleOrderDto>(x))
.ToListAsync();
}
public async Task<IEnumerable<ScheduleOrderDto?>> GetByRecipientAndLastUpdateDate(int recipientId, DateTime date)
{
IList<ScheduleOrderDto?> scheduleOrders = (await GetEntitiesByLastUpdateDate(date)).ToList();