From 7139b67994e477b3483b15bf663855f68ad2aea7 Mon Sep 17 00:00:00 2001 From: mfnefd Date: Sun, 1 Dec 2024 23:56:57 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=BE=D1=82=D1=87=D0=B5=D1=82=D1=8B=20=D1=82=D1=80=D0=B0=D1=82?= =?UTF-8?q?=20=D0=B3=D1=80=D1=83=D0=BF=D0=BF=20=D0=B8=20=D0=BF=D0=BE=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D0=B9=20=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D0=B0=D1=8E=D1=82=20=D0=BF=D1=80=D0=B0=D0=B8=D0=B2?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D0=BE=20=D0=BD=D0=B5=20=D0=B1=D1=8B=D0=BB?= =?UTF-8?q?=D0=BE=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D0=B9=20?= =?UTF-8?q?=D0=B3=D1=80=D1=83=D0=BF=D0=BF=20=D1=83=20=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/Infrastructure/Repositories/SpendingGroupRepo.cs | 2 +- back/Infrastructure/Support/Mappers/ChangeRecordMapper.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/back/Infrastructure/Repositories/SpendingGroupRepo.cs b/back/Infrastructure/Repositories/SpendingGroupRepo.cs index a04ee9b..7d96e7b 100644 --- a/back/Infrastructure/Repositories/SpendingGroupRepo.cs +++ b/back/Infrastructure/Repositories/SpendingGroupRepo.cs @@ -70,7 +70,7 @@ public class SpendingGroupRepo : ISpendingGroupRepo var group = await context.SpendingGroups .AsNoTracking() .Where(x => x.Id == plan.SpendingGroupId) - .Include(x => x.ChangeRecords + .Include(x => x.ChangeRecords! // Выбираем из них только те, которые попадают в диапазон дат плана .Where(cg => cg.ChangedAt >= plan.StartAt && cg.ChangedAt <= plan.EndAt) // И сортируем их по дате diff --git a/back/Infrastructure/Support/Mappers/ChangeRecordMapper.cs b/back/Infrastructure/Support/Mappers/ChangeRecordMapper.cs index cd5d76e..3f7a57a 100644 --- a/back/Infrastructure/Support/Mappers/ChangeRecordMapper.cs +++ b/back/Infrastructure/Support/Mappers/ChangeRecordMapper.cs @@ -12,7 +12,8 @@ public static class ChangeRecordMapper Sum = changeRecord.Sum, ChangedAt = changeRecord.ChangedAt, SpendingGroupId = changeRecord.SpendingGroupId, - UserId = changeRecord.UserId + UserId = changeRecord.UserId, + SpendingGroupName = changeRecord.SpendingGroup?.Name ?? string.Empty }; public static ChangeRecord ToModel(this ChangeRecordDto changeRecord)