Exemplo n.º 1
0
        public async Task <IActionResult> ProcessDropRequests()
        {
            var systemWideSettings = await _interLeagueService.GetSystemWideSettings();

            if (!systemWideSettings.BidProcessingMode)
            {
                return(BadRequest("Turn on bid processing mode first."));
            }

            var today = _clock.GetCurrentInstant().ToEasternDate();

            if (today.DayOfWeek != IsoDayOfWeek.Sunday)
            {
                return(BadRequest($"You probably didn't mean to process pickups on a {today.DayOfWeek}"));
            }

            var supportedYears = await _interLeagueService.GetSupportedYears();

            foreach (var supportedYear in supportedYears)
            {
                if (supportedYear.Finished || !supportedYear.OpenForPlay)
                {
                    continue;
                }

                await _fantasyCriticService.ProcessDrops(supportedYear.Year);
            }

            return(Ok());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> ProcessDropRequests()
        {
            var systemWideSettings = await _interLeagueService.GetSystemWideSettings();

            if (!systemWideSettings.BidProcessingMode)
            {
                return(BadRequest("Turn on bid processing mode first."));
            }

            var supportedYears = await _interLeagueService.GetSupportedYears();

            foreach (var supportedYear in supportedYears)
            {
                if (supportedYear.Finished || !supportedYear.OpenForPlay)
                {
                    continue;
                }

                await _fantasyCriticService.ProcessDrops(supportedYear.Year);
            }

            return(Ok());
        }