private async Task <MonthsComparisonData> GetCurrentAndPreviousMonthsDataForUser(int walletId, string userId, DateTime[] date)
        {
            var currentMonthStart = date[0];
            var currentMonthEnd   = date[1];

            var previousMonthStart = date[0].AddMonths(-1);
            var previousMonthEnd   = date[1].AddMonths(-1);

            var lastMonthData = await _context.Expenses.Where(e => e.FamilyWalletId == walletId && e.ExpenseUserId == userId && e.CreationDate >= previousMonthStart && e.CreationDate <= previousMonthEnd).SumAsync(e => e.MoneySpent);

            var currentMonthData = await _context.Expenses.Where(e => e.FamilyWalletId == walletId && e.ExpenseUserId == userId && e.CreationDate >= currentMonthStart && e.CreationDate <= currentMonthEnd).SumAsync(e => e.MoneySpent);

            MonthsComparisonData data = new MonthsComparisonData
            {
                CurrentMonthData = currentMonthData,
                LastMonthData    = lastMonthData,
            };

            return(data);
        }
        private async Task <MonthsComparisonData> GetCurrentAndPreviousMonthsDataForCategory(int walletId, int categoryId)
        {
            var today                = DateTime.Today;
            var currentMonth         = new DateTime(today.Year, today.Month, 1);
            var startOfPreviousMonth = currentMonth.AddMonths(-1);
            var endOfPreviousMonth   = currentMonth.AddMilliseconds(-1);
            var endOfCurrentMonth    = currentMonth.AddMonths(1).AddMilliseconds(-1);



            var lastMonthData = await _context.Expenses.Where(e => e.FamilyWalletId == walletId && e.ExpenseCategoryId == categoryId && e.CreationDate >= startOfPreviousMonth && e.CreationDate <= endOfPreviousMonth).SumAsync(e => e.MoneySpent);

            var currentMonthData = await _context.Expenses.Where(e => e.FamilyWalletId == walletId && e.ExpenseCategoryId == categoryId && e.CreationDate >= currentMonth && e.CreationDate <= endOfCurrentMonth).SumAsync(e => e.MoneySpent);

            MonthsComparisonData data = new MonthsComparisonData
            {
                CurrentMonthData = currentMonthData,
                LastMonthData    = lastMonthData,
            };

            return(data);
        }