public IEnumerable Handle(ScheduleRoom command) { ClassRoom classRoom = ScheduleFactory.CreateClassRoom(command.RoomNumber, command.Day, command.StartTime, command.EndTime); var agRoot = DomainRepository.GetSchedule(command.ScheduleId); // TODO: Rules about start and end times // - All courses start at hh:15 and end at hh+:10 // - In blocks of 1, 2, 3, or 4 hours only // - Fits in the standard work schedule (7AM to 11PM Mon-Fri, 7AM to 5PM Sat) // TODO: Rules about over-laps // - Time overlaps in schedule // TODO: Rules about course // - Too many hours slotted // - Course happens only once per day agRoot.ScheduleRoom(command.CourseId, classRoom); DomainRepository.UpdateSchedule(agRoot); yield return(ScheduleFactory.EventFactory.RoomScheduledForCourse()); }
public void ScheduleRoom(Guid courseId, ClassRoom classRoom) { Contract.Requires(classRoom != null, "classRoom is null."); }
public void AssignRoom(ClassRoom room) { Contract.Requires(room != null, "room is null."); Rooms.Add(room); }