public async Task <IActionResult> GetMonthlyPurchaseAndSalePrice([FromRoute] int?id)
        {
            if (id == null)
            {
                id = 1;
            }
            var startDate = DateTime.Now.AddDays(-30);
            var endDate   = DateTime.Now;
            var today     = DateTime.Today;

            List <DateTime> dates = DatetimeHelper.GenerateDatesInRange(startDate, endDate);

            var purchasesAmount = _context.Payment
                                  .Where(u => u.Method == Models.Enums.PaymentMethod.DealPrice)
                                  .Where(u => u.PayeeId == id)
                                  .Where(u => u.PayDate.Date > startDate.Date && u.PayDate.Date <= today)
                                  .GroupBy(u => u.PayDate.Date)
                                  .Select(u => new
            {
                Date   = u.Key,
                Amount = u.Sum(p => p.Amount)
            });

            var salesAmount = _context.Payment
                              .Where(u => u.Method == Models.Enums.PaymentMethod.DealPrice)
                              .Where(u => u.PayerId == id)
                              .Where(u => u.PayDate.Date > startDate.Date && u.PayDate.Date <= today)
                              .GroupBy(u => u.PayDate.Date)
                              .Select(u => new
            {
                Date   = u.Key,
                Amount = u.Sum(p => p.Amount)
            });

            var result = (from d in dates
                          join pa in purchasesAmount on d.Date equals pa.Date into pai
                          from pa in pai.DefaultIfEmpty()
                          join sa in salesAmount on d.Date equals sa.Date into sai
                          from sa in sai.DefaultIfEmpty()
                          select new DatePurchaseAndSalePriceModel
            {
                Date = d.Date,
                PurchasesAmount = pa?.Amount ?? 0,
                SalesAmount = sa?.Amount ?? 0
            });

            return(Ok(result));
        }