// The package models defines the stucts for objects, their repositories and the signatures of their functions. package models type OfficeHour struct { Id int Tutor Tutor Date Room Course RoomName string // A description of the room for special rooms that are not preconfigured. Info string Active bool Duration int // Duration in minutes. Must be divisible by the config field "MinuteGranularity". } type OfficeHourRepository interface { FindById(id int) (OfficeHour, error) FindByCourse(course Course, activeOnly bool) ([]OfficeHour, error) FindByRoom(room Room, activatedOnly bool) ([]OfficeHour, error) GetAll(activatedOnly bool) ([]OfficeHour, error) Delete(officeHour OfficeHour) error Add(officeHour OfficeHour) (int, error) AllowedAt(date Date, duration int, room Room, activeOnly bool) (bool, error) } func (officeHour OfficeHour) EndDate() Date { return GetEndDate(officeHour.Date, officeHour.Duration, false) }