services

package
v0.0.0-...-cf487a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDateFormat = errors.New("invalid date format, expected YYYY-MM-DD")

Functions

func ParseDateOrNow

func ParseDateOrNow(dateStr string) (time.Time, error)

Types

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type ScheduleService

type ScheduleService struct {
	Repo *repo.ScheduleRepo
}

func NewScheduleService

func NewScheduleService(scheduleRepo *repo.ScheduleRepo) *ScheduleService

func (*ScheduleService) AddEmptyLessons

func (s *ScheduleService) AddEmptyLessons(schedule *models.NumeratorDenominator[models.StudentWeek], times []string)

func (*ScheduleService) GetAllTeachers

func (s *ScheduleService) GetAllTeachers(ctx context.Context) (*models.TeachersList, error)

func (*ScheduleService) GetAuditorium

func (s *ScheduleService) GetAuditorium(ctx context.Context, auditoriumID int) (*models.Auditorium, error)

func (*ScheduleService) GetAuditoriumSchedule

func (s *ScheduleService) GetAuditoriumSchedule(ctx context.Context, auditoriumID int, dateStr string) (*models.AuditoriumSchedule, error)

func (*ScheduleService) GetAuditoriumsList

func (s *ScheduleService) GetAuditoriumsList(ctx context.Context, buildingID int) ([]*models.Auditorium, error)

func (*ScheduleService) GetBuilding

func (s *ScheduleService) GetBuilding(ctx context.Context, buildingID int) (*models.Building, error)

func (*ScheduleService) GetBuildingsList

func (s *ScheduleService) GetBuildingsList(ctx context.Context) ([]*models.Building, error)

func (*ScheduleService) GetCourseFaculties

func (s *ScheduleService) GetCourseFaculties(ctx context.Context, course int) (*models.CourseFaculties, error)

func (*ScheduleService) GetDay

func (s *ScheduleService) GetDay(ctx context.Context) (*models.Day, error)

func (*ScheduleService) GetFaculties

func (s *ScheduleService) GetFaculties(ctx context.Context) (*models.Faculties, error)

func (*ScheduleService) GetFacultiesWithCourses

func (s *ScheduleService) GetFacultiesWithCourses(ctx context.Context) (*models.FacultiesCourses, error)

func (*ScheduleService) GetFacultyCourses

func (s *ScheduleService) GetFacultyCourses(ctx context.Context, facultyName string) (*models.FacultyCourses, error)

func (*ScheduleService) GetGroups

func (s *ScheduleService) GetGroups(ctx context.Context, facultyName string, course int) (*models.CourseFacultyGroups, error)

func (*ScheduleService) GetLessonTypes

func (s *ScheduleService) GetLessonTypes() []models.LessonType

func (*ScheduleService) GetScheduleByGroup

func (s *ScheduleService) GetScheduleByGroup(ctx context.Context, group string, addEmptyLessons bool, dateStr string) (*models.StudentSchedule, error)

func (*ScheduleService) GetSchedulesByGroups

func (s *ScheduleService) GetSchedulesByGroups(ctx context.Context, dateStr string, groups []string) ([]*models.StudentSchedule, error)

func (*ScheduleService) GetTeacherSchedule

func (s *ScheduleService) GetTeacherSchedule(ctx context.Context, teacherID int, dateStr string) (*models.TeacherSchedule, error)

func (*ScheduleService) GetTeachersDepartments

func (s *ScheduleService) GetTeachersDepartments(ctx context.Context, facultyID int) ([]*models.Department, error)

func (*ScheduleService) GetTeachersFaculties

func (s *ScheduleService) GetTeachersFaculties(ctx context.Context, departmentID int) ([]*models.Faculty, error)

func (*ScheduleService) GetTeachersList

func (s *ScheduleService) GetTeachersList(ctx context.Context, facultyID, departmentID int) (*models.TeachersList, error)