Esempio n. 1
0
        public IActionResult OpenDay()
        {
            var today = DateTime.Today;

            if (calendar.Contains(today))
            {
                return(BadRequest("TodayAlreadyOpened"));
            }

            if (calendar.HasOpenedDay())
            {
                return(BadRequest("AnotherDayAlreadyOpened"));
            }

            calendar.Add(new Day(today, false));

            return(Ok());
        }