public async Task <IActionResult> ProcessPickups()
        {
            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.Monday)
            {
                return(BadRequest($"You probably didn't mean to process pickups on a {today.DayOfWeek}"));
            }

            SystemWideValues systemWideValues = await _interLeagueService.GetSystemWideValues();

            var supportedYears = await _interLeagueService.GetSupportedYears();

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

                await _fantasyCriticService.ProcessPickups(systemWideValues, supportedYear.Year);
            }

            return(Ok());
        }
示例#2
0
        public async Task <IActionResult> ProcessPickups()
        {
            var systemWideSettings = await _interLeagueService.GetSystemWideSettings();

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

            SystemWideValues systemWideValues = await _interLeagueService.GetSystemWideValues();

            var supportedYears = await _interLeagueService.GetSupportedYears();

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

                await _fantasyCriticService.ProcessPickups(systemWideValues, supportedYear.Year);
            }

            return(Ok());
        }
        public async Task <IActionResult> ProcessPickups([FromBody] ProcessPickupsRequest request)
        {
            await _fantasyCriticService.ProcessPickups(request.Year);

            return(Ok());
        }