schedules

package
v0.0.0-...-6cc2e2a Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproveSchedule

func ApproveSchedule(w http.ResponseWriter, r *http.Request, draftsCollection *mongo.Collection, previousSchedulesCollection *mongo.Collection)

ApproveSchedule - removes schedule in draft collection and adds it to previous_schedules collection, approving it.

func GenerateSchedule

func GenerateSchedule(w http.ResponseWriter, r *http.Request, draft_schedules *mongo.Collection, users_coll *mongo.Collection, courses_coll *mongo.Collection, classrooms_coll *mongo.Collection, algs1_api string, algs2_api string)

GenerateSchedule - Generates a new schedule TODO: Still waiting for Algs 2 to have proper API response

func GetSchedule

func GetSchedule(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)

GetSchedule retrieves a schedule by year

func GetSchedules

func GetSchedules(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)

GetSchedules retrieves all schedules from the MongoDB collection

func UpdateSchedule

func UpdateSchedule(w http.ResponseWriter, r *http.Request, collection *mongo.Collection)

UpdateSchedule handles updating an existing schedule

Types

type Algs1_Request

type Algs1_Request struct {
	Year       string                  `json:"year"`
	Term       string                  `json:"term"`
	Professors []users.User            `json:"professors"`
	Courses    []CoursesWithCapacities `json:"courses"`
	Classrooms []classrooms.Classroom  `json:"classrooms"`
}

type Algs1_Schedule

type Algs1_Schedule struct {
	Schedule []CourseOffering `json:"schedule"`
}

type Algs2_Request

type Algs2_Request struct {
	Year    string           `json:"year"`
	Term    string           `json:"term"`
	Courses []courses.Course `json:"courses"`
}

type Capacity

type Capacity struct {
	Estimates []Estimate `json:"estimates"`
}

type Class

type Class struct {
	Num       string   `json:"num"`
	Building  string   `json:"building"`
	Room      string   `json:"room"`
	Professor string   `json:"professor"`
	Days      []string `json:"days"`
	NumSeats  int      `json:"num_seats"`
	NumEnroll int      `json:"num_enroll"`
	StartTime string   `json:"start_time"`
	EndTime   string   `json:"end_time"`
}

type CourseOffering

type CourseOffering struct {
	Course   string  `json:"course"`
	Sections []Class `json:"sections"`
}

type CoursesWithCapacities

type CoursesWithCapacities struct {
	Course        string     `json:"course" bson:"course"`
	Peng          bool       `json:"peng" bson:"peng"`
	Prerequisites [][]string `json:"prerequisites" bson:"prerequisites"`
	CoRequisites  [][]string `json:"corequisites" bson:"corequisites"`
	Pre_enroll    int        `json:"pre_enroll" bson:"pre_enroll"`
	Min_enroll    int        `json:"min_enroll" bson:"min_enroll"`
	Hours         [3]int     `json:"hours" bson:"hours"`
}

type Estimate

type Estimate struct {
	Course   string `json:"course"`
	Estimate int    `json:"estimate"`
}

type Frontend_Request

type Frontend_Request struct {
	Year int    `json:"year"`
	Term string `json:"term"`
}

type Schedule

type Schedule struct {
	Year  int    `json:"year"`
	Terms []Term `json:"terms"`
}

Schedule represents a schedule entity

type Term

type Term struct {
	Term    string           `json:"term"`
	Courses []CourseOffering `json:"courses"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL