public async Task <BonusSummary> GetBonusesSummary(BonusSummaryFilter filter, AgentContext agentContext)
        {
            var query = from appliedMarkup in _context.AppliedBookingMarkups
                        join markupPolicy in _context.MarkupPolicies on appliedMarkup.PolicyId equals markupPolicy.Id
                        where markupPolicy.SubjectScopeId == agentContext.AgencyId.ToString() && markupPolicy.SubjectScopeType == SubjectMarkupScopeTypes.Agency
                        select new { appliedMarkup.Paid, appliedMarkup.Amount, markupPolicy.Currency };


            if (filter.From is not null)
            {
                query = query.Where(x => x.Paid >= filter.From.Value);
            }

            if (filter.To is not null)
            {
                query = query.Where(x => x.Paid <= filter.To.Value);
            }

            var summary = await query
                          .GroupBy(x => x.Currency)
                          .Select(x => new MoneyAmount(x.Sum(g => g.Amount), x.Key))
                          .ToListAsync();

            return(new BonusSummary {
                Summary = summary
            });
        }
        public async Task <IActionResult> GetBonusesSummary([FromQuery] BonusSummaryFilter filter)
        {
            var agent = await _agentContext.GetAgent();

            return(Ok(await _markupBonusDisplayService.GetBonusesSummary(filter, agent)));
        }