Example #1
0
        public SlidingSupportCycle(int cycle, int slotsInADay, ISupportSlotRepository supportSlotRepository, IEngineerRepository engeneerRepository)
        {
            _cycle = cycle;
            _supportSlotRepository = supportSlotRepository;
            _supportEngeneers      = new Lazy <List <SupportEngineer> >(() =>
            {
                return(engeneerRepository.GetEngeneers().ToList());
            });

            _slotsInADay = slotsInADay;

            var lastScheduledSupportDay = _supportSlotRepository.GetLastSupportDay();

            if (lastScheduledSupportDay == null)
            {
                _curentDate = DateTime.UtcNow.Date;
            }
            else
            {
                _curentDate = lastScheduledSupportDay.Date.Date;
            }
        }