0.2.0 #4

Merged
mfnefd merged 15 commits from dev into main 2024-12-11 04:42:35 +04:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 7139b67994 - Show all commits

View File

@ -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)
// И сортируем их по дате

View File

@ -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)