Пример #1
0
        public async Task <IActionResult> BillsDue(string days)
        {
            var ownerId    = this.User.FindFirstValue(ClaimTypes.NameIdentifier);
            var ownerEmail = this.User.FindFirstValue(ClaimTypes.Email);
            var bills      = await _billService.GetUserDueBills(ownerId, days);

            if (bills == null)
            {
                return(BadRequest(new { message = "Network error. Bills could not be found." }));
            }

            if (bills.Count() > 0)
            {
                _notificationService.AddToNotificationQueue(ownerEmail, bills);
            }
            return(Ok(bills));
        }