Documentation
¶
Index ¶
- type CollectionName
- type Conflict
- type Count
- type DB
- func (db *DB) AddAncode(ctx context.Context, zpaAncode int, program string, primussAncode int) error
- func (db *DB) AddConstraints(ctx context.Context, ancode int, constraints *model.Constraints) (*model.Constraints, error)
- func (db *DB) AddExamToSlot(ctx context.Context, planEntry *model.PlanEntry) (bool, error)
- func (db *DB) AddInvigilation(ctx context.Context, room string, day, slot, invigilatorID int) error
- func (db *DB) AddMutationLogEntry(ctx context.Context, entry *model.MutationLogEntry) error
- func (db *DB) AddNonZpaExam(ctx context.Context, exam *model.ZPAExam) error
- func (db *DB) AddNta(ctx context.Context, nta *model.NTA) (*model.NTA, error)
- func (db *DB) AddNtaRoomAloneWaiver(ctx context.Context, waiver *model.NtaRoomAloneWaiver) error
- func (db *DB) AddPrePlannedInvigilation(ctx context.Context, prePlannedInvigilation *model.PrePlannedInvigilation) (bool, error)
- func (db *DB) AddPrePlannedRoomToExam(ctx context.Context, prePlannedRoom *model.PrePlannedRoom) (bool, error)
- func (db *DB) AddRoom(ctx context.Context, room *model.Room) (*model.Room, error)
- func (db *DB) AddRoomRequest(ctx context.Context, request *model.RoomRequest) error
- func (db *DB) AddStudentReg(ctx context.Context, program string, ancode int, mtknr string) error
- func (db *DB) AddSyncLogEntry(ctx context.Context, entry *model.SyncLogEntry) error
- func (db *DB) AddZpaExamToPlan(ctx context.Context, ancode int) (bool, error)
- func (db *DB) AdditionalExams(ctx context.Context) ([]*model.AdditionalExam, error)
- func (db *DB) AllAnnyBookings(ctx context.Context) ([]*model.AnnyBooking, error)
- func (db *DB) AllInvigilatorRequirements(ctx context.Context) ([]*zpa.SupervisorRequirements, error)
- func (db *DB) AllSemesterNames(ctx context.Context) ([]*model.Semester, error)
- func (db *DB) AncodesInPlan(ctx context.Context) ([]int, error)
- func (db *DB) AnnyBookings(ctx context.Context, room *string) ([]*model.AnnyBooking, error)
- func (db *DB) AnnyBookingsCollection(ctx context.Context) *mongo.Collection
- func (db *DB) BackupPlan(ctx context.Context) error
- func (db *DB) BlockRoomForSlot(ctx context.Context, block *model.BlockedRoom) error
- func (db *DB) BlockedRooms(ctx context.Context) ([]*model.BlockedRoom, error)
- func (db *DB) CacheGeneratedExams(ctx context.Context, exams []*model.GeneratedExam) error
- func (db *DB) CacheInvigilatorTodos(ctx context.Context, todos *model.InvigilationTodos) error
- func (db *DB) CacheTeachers(teachers []*model.Teacher, semester string) error
- func (db *DB) CacheZPAExams(exams []*model.ZPAExam) error
- func (db *DB) ChangeAncode(ctx context.Context, program string, ancode, newAncode int) (*model.PrimussExam, error)
- func (db *DB) ChangeAncodeInConflicts(ctx context.Context, program string, ancode, newAncode int) (*model.Conflicts, error)
- func (db *DB) ChangeAncodeInStudentRegs(ctx context.Context, program string, ancode, newAncode int) ([]*model.StudentReg, error)
- func (db *DB) ChangeAncodeInStudentRegsCount(ctx context.Context, program string, ancode, newAncode int) error
- func (db *DB) CheckStudentRegsCount(ctx context.Context, program string, ancode, studentRegsCount int) bool
- func (db *DB) ClearEmailAttachments(ctx context.Context, kind string) (int, error)
- func (db *DB) DeleteAdditionalExam(ctx context.Context, ancode int) (bool, error)
- func (db *DB) DeleteInvigilatorConstraints(ctx context.Context, teacherID int) (bool, error)
- func (db *DB) DeleteNonZpaExam(ctx context.Context, ancode int) error
- func (db *DB) DeletePermanentNonInvigilator(ctx context.Context, teacherID int) (bool, error)
- func (db *DB) DeletePreplanExam(ctx context.Context, id int) (bool, error)
- func (db *DB) DeleteSpecialInterest(ctx context.Context, name string) (bool, error)
- func (db *DB) DeleteStudyProgram(ctx context.Context, shortname string) (bool, error)
- func (db *DB) DropAndSave(ctx context.Context, objects []interface{}) error
- func (db *DB) EmailAttachmentInfos(ctx context.Context, kind string) ([]*EmailAttachment, error)
- func (db *DB) EnsureSchemaVersion(ctx context.Context, version int) error
- func (db *DB) Exahm(ctx context.Context, ancode int) (bool, error)
- func (db *DB) ExamDurationOverrides(ctx context.Context) ([]*model.ExamDurationOverride, error)
- func (db *DB) ExamIsLocked(ctx context.Context, ancode int) bool
- func (db *DB) ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error)
- func (db *DB) ExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExam, error)
- func (db *DB) ExcludeDays(ctx context.Context, ancode int, days []*time.Time) (bool, error)
- func (db *DB) GetAddedAncodes(ctx context.Context) (map[int][]model.ZPAPrimussAncodes, error)
- func (db *DB) GetAddedAncodesForAncode(ctx context.Context, ancode int) ([]model.ZPAPrimussAncodes, error)
- func (db *DB) GetAllInvigilations(ctx context.Context) ([]*model.Invigilation, error)
- func (db *DB) GetConstraints(ctx context.Context) ([]*model.Constraints, error)
- func (db *DB) GetConstraintsForAncode(ctx context.Context, ancode int) (*model.Constraints, error)
- func (db *DB) GetEmailAttachment(ctx context.Context, kind, key string) (*EmailAttachment, error)
- func (db *DB) GetGeneratedExam(ctx context.Context, ancode int) (*model.GeneratedExam, error)
- func (db *DB) GetGeneratedExams(ctx context.Context) ([]*model.GeneratedExam, error)
- func (db *DB) GetGeneratedExamsForExamer(ctx context.Context, examerID int) ([]*model.GeneratedExam, error)
- func (db *DB) GetGeneratedExamsState(ctx context.Context) (*model.GeneratedExamsState, error)
- func (db *DB) GetGenerationConfig(ctx context.Context) (*model.GenerationConfig, error)
- func (db *DB) GetInvigilationInSlot(ctx context.Context, roomname string, day, slot int) ([]*model.Invigilation, error)
- func (db *DB) GetInvigilationTodos(ctx context.Context) (*model.InvigilationTodos, error)
- func (db *DB) GetInvigilatorForRoom(ctx context.Context, name string, day, time int) (*model.Teacher, error)
- func (db *DB) GetInvigilatorInSlot(ctx context.Context, roomname string, day, slot int) (*model.Teacher, error)
- func (db *DB) GetInvigilatorRequirements(ctx context.Context, teacherID int) (*zpa.SupervisorRequirements, error)
- func (db *DB) GetInvigilators(ctx context.Context) ([]*model.Teacher, error)
- func (db *DB) GetOtherInvigilations(ctx context.Context) ([]*model.Invigilation, error)
- func (db *DB) GetPlanEntriesInSlot(ctx context.Context, day int, time int) ([]*model.PlanEntry, error)
- func (db *DB) GetPlaner(ctx context.Context) (*model.Planer, error)
- func (db *DB) GetPrimussConflictsForAncode(ctx context.Context, program string, ancode int) (*model.Conflicts, error)
- func (db *DB) GetPrimussConflictsForAncodeOnlyPlanned(ctx context.Context, program string, ancode int, ...) (*model.Conflicts, error)
- func (db *DB) GetPrimussConflictsPerAncode(ctx context.Context, program string) (map[int]*model.Conflicts, error)
- func (db *DB) GetPrimussExam(ctx context.Context, program string, ancode int) (*model.PrimussExam, error)
- func (db *DB) GetPrimussExams(ctx context.Context) ([]*model.PrimussExamByProgram, error)
- func (db *DB) GetPrimussExamsForAncode(ctx context.Context, ancode int) ([]*model.PrimussExam, error)
- func (db *DB) GetPrimussStudentRegsForProgrammAncode(ctx context.Context, program string, ancode int) ([]*model.StudentReg, error)
- func (db *DB) GetPrimussStudentRegsPerAncode(ctx context.Context, program string) (map[int][]*model.StudentReg, error)
- func (db *DB) GetPrimussStudentRegsPerStudent(ctx context.Context, program string) (map[string][]*model.StudentReg, error)
- func (db *DB) GetPrograms(ctx context.Context) ([]string, error)
- func (db *DB) GetRegsWithErrors(ctx context.Context) ([]*model.RegWithError, error)
- func (db *DB) GetRoomRequest(ctx context.Context, room string, day, slot int) (*model.RoomRequest, error)
- func (db *DB) GetSelfInvigilations(ctx context.Context) ([]*model.Invigilation, error)
- func (db *DB) GetSemesterConfigInput(ctx context.Context) (*model.SemesterConfigInput, error)
- func (db *DB) GetSemesterConfigInputForSemester(ctx context.Context, semester string) (*model.SemesterConfigInput, error)
- func (db *DB) GetSemesterMeta(ctx context.Context) (*SemesterMeta, error)
- func (db *DB) GetStudentRegsCount(ctx context.Context, program string, ancode int) (int, error)
- func (db *DB) GetStudentRegsState(ctx context.Context) (*model.StudentRegsState, error)
- func (db *DB) GetTeacher(ctx context.Context, id int) (*model.Teacher, error)
- func (db *DB) GetTeacherIdByRegex(ctx context.Context, name string) (int, error)
- func (db *DB) GetTeachers(ctx context.Context) ([]*model.Teacher, error)
- func (db *DB) GetZPAExams(ctx context.Context) ([]*model.ZPAExam, error)
- func (db *DB) GetZPAExamsNotToPlan(ctx context.Context) ([]*model.ZPAExam, error)
- func (db *DB) GetZPAExamsPlannedOrNotPlanned(ctx context.Context) ([]*model.ZPAExam, error)
- func (db *DB) GetZPAExamsToPlan(ctx context.Context) ([]*model.ZPAExam, error)
- func (db *DB) GetZPAStudentByMtknr(ctx context.Context, mtknr string) (*model.ZPAStudent, error)
- func (db *DB) GetZPAStudents(ctx context.Context) ([]*model.ZPAStudent, error)
- func (db *DB) GetZpaAncodesNotPlanned(ctx context.Context) (*set.Set[int], error)
- func (db *DB) GetZpaAncodesPlanned(ctx context.Context) (*set.Set[int], error)
- func (db *DB) GetZpaAncodesPlannedOrNotPlanned(ctx context.Context) (*set.Set[int], error)
- func (db *DB) GetZpaExamByAncode(ctx context.Context, ancode int) (*model.ZPAExam, error)
- func (db *DB) HasRoom(ctx context.Context, name string) (bool, error)
- func (db *DB) InsertPreplanExam(ctx context.Context, preplanExam *model.PreplanExam) (*model.PreplanExam, error)
- func (db *DB) InvigilationsForInvigilator(ctx context.Context, invigilatorID int) ([]*model.Invigilation, error)
- func (db *DB) InvigilatorConstraints(ctx context.Context) ([]*model.InvigilatorConstraints, error)
- func (db *DB) InvigilatorConstraintsForTeacher(ctx context.Context, teacherID int) (*model.InvigilatorConstraints, error)
- func (db *DB) Lab(ctx context.Context, ancode int) (bool, error)
- func (db *DB) LockExam(ctx context.Context, ancode int) (*model.PlanEntry, error)
- func (db *DB) LockPlan(ctx context.Context) error
- func (db *DB) MigrateLegacySemesterConfigInput(ctx context.Context) error
- func (db *DB) MucDaiExam(ctx context.Context, program string, ancode int) (*MucDaiExam, error)
- func (db *DB) MucDaiExamsForProgram(ctx context.Context, program string) ([]*MucDaiExam, error)
- func (db *DB) MutationLog(ctx context.Context, opType, name *string, ancode *int, ...) ([]*model.MutationLogEntry, error)
- func (db *DB) MutationLogNames(ctx context.Context) ([]string, error)
- func (db *DB) NonZpaExam(ctx context.Context, ancode int) (*model.ZPAExam, error)
- func (db *DB) NonZpaExams(ctx context.Context) ([]*model.ZPAExam, error)
- func (db *DB) NotPlannedByMe(ctx context.Context, ancode int) (bool, error)
- func (db *DB) Nta(ctx context.Context, mtknr string) (*model.NTA, error)
- func (db *DB) NtaRoomAloneWaivers(ctx context.Context) ([]*model.NtaRoomAloneWaiver, error)
- func (db *DB) NtaWithRegs(ctx context.Context, mtknr string) (*model.NTAWithRegs, error)
- func (db *DB) Ntas(ctx context.Context) ([]*model.NTA, error)
- func (db *DB) NtasWithRegs(ctx context.Context) ([]*model.Student, error)
- func (db *DB) Online(ctx context.Context, ancode int) (bool, error)
- func (db *DB) PermanentNonInvigilators(ctx context.Context) ([]*model.PermanentNonInvigilator, error)
- func (db *DB) PlacesWithSockets(ctx context.Context, ancode int) (bool, error)
- func (db *DB) PlanEntries(ctx context.Context) ([]*model.PlanEntry, error)
- func (db *DB) PlanEntry(ctx context.Context, ancode int) (*model.PlanEntry, error)
- func (db *DB) PlannedAncodes(ctx context.Context) ([]*model.PlanEntry, error)
- func (db *DB) PlannedRoomNames(ctx context.Context) ([]string, error)
- func (db *DB) PlannedRoomNamesInSlot(ctx context.Context, day, slot int) ([]string, error)
- func (db *DB) PlannedRooms(ctx context.Context) ([]*model.PlannedRoom, error)
- func (db *DB) PlannedRoomsForAncode(ctx context.Context, ancode int) ([]*model.PlannedRoom, error)
- func (db *DB) PlannedRoomsInSlot(ctx context.Context, day, slot int) ([]*model.PlannedRoom, error)
- func (db *DB) PlanningConditionsSet(ctx context.Context) ([]string, error)
- func (db *DB) PossibleDays(ctx context.Context, ancode int, days []*time.Time) (bool, error)
- func (db *DB) PrePlannedInvigilations(ctx context.Context) ([]*model.PrePlannedInvigilation, error)
- func (db *DB) PrePlannedInvigilationsForInvigilator(ctx context.Context, invigilatorID int) ([]*model.PrePlannedInvigilation, error)
- func (db *DB) PrePlannedRooms(ctx context.Context) ([]*model.PrePlannedRoom, error)
- func (db *DB) PrePlannedRoomsForExam(ctx context.Context, ancode int) ([]*model.PrePlannedRoom, error)
- func (db *DB) PreplanExam(ctx context.Context, id int) (*model.PreplanExam, error)
- func (db *DB) PreplanExams(ctx context.Context) ([]*model.PreplanExam, error)
- func (db *DB) PrimussExamExists(ctx context.Context, program string, ancode int) (bool, error)
- func (db *DB) PrimussExamsForProgram(ctx context.Context, program string) ([]*model.PrimussExam, error)
- func (db *DB) RemoveAddedAncode(ctx context.Context, zpaAncode int, program string) (bool, error)
- func (db *DB) RemoveExamDurationOverride(ctx context.Context, ancode int) (bool, error)
- func (db *DB) RemoveNtaRoomAloneWaiver(ctx context.Context, mtknr string, ancode int) (bool, error)
- func (db *DB) RemovePlanEntry(ctx context.Context, ancode int) error
- func (db *DB) RemovePrePlannedInvigilation(ctx context.Context, day, slot int, roomName *string) (bool, error)
- func (db *DB) RemovePrePlannedRoomFromExam(ctx context.Context, ancode int, roomName string, mtknr *string) (bool, error)
- func (db *DB) RemoveStudentReg(ctx context.Context, program string, ancode int, mtknr string) (int, error)
- func (db *DB) ReplaceAllRoomRequests(ctx context.Context, requests []*model.RoomRequest) error
- func (db *DB) ReplaceMucDaiExamsForProgram(ctx context.Context, program string, exams []*MucDaiExam) error
- func (db *DB) ReplaceNta(ctx context.Context, nta *model.NTA) (*model.NTA, error)
- func (db *DB) ReplacePlannedRooms(ctx context.Context, plannedRooms []*model.PlannedRoom) error
- func (db *DB) ReplacePreplanExam(ctx context.Context, preplanExam *model.PreplanExam) (bool, error)
- func (db *DB) ReplaceRoom(ctx context.Context, room *model.Room) (*model.Room, error)
- func (db *DB) ReplaceUnplacedExams(ctx context.Context, unplaced []*model.UnplacedExam) error
- func (db *DB) ResetGeneratedInvigilations(ctx context.Context) error
- func (db *DB) ResetPlannedRooms(ctx context.Context) error
- func (db *DB) ResetUnplacedExams(ctx context.Context) error
- func (db *DB) RmConstraints(ctx context.Context, ancode int) (bool, error)
- func (db *DB) RmZpaExamFromPlan(ctx context.Context, ancode int) (bool, error)
- func (db *DB) RoomByName(ctx context.Context, roomName string) (*model.Room, error)
- func (db *DB) RoomRequests(ctx context.Context) ([]*model.RoomRequest, error)
- func (db *DB) Rooms(ctx context.Context) ([]*model.Room, error)
- func (db *DB) SafeExamBrowser(ctx context.Context, ancode int) (bool, error)
- func (db *DB) SameSlot(ctx context.Context, ancode int, ancodes []int) (bool, error)
- func (db *DB) Save(ctx context.Context, objects []interface{}) error
- func (db *DB) SaveAnnyBookings(ctx context.Context, bookings []*model.AnnyBooking) error
- func (db *DB) SaveEmailAttachment(ctx context.Context, att *EmailAttachment) error
- func (db *DB) SavePlanEntries(ctx context.Context, planEntries []*model.PlanEntry) error
- func (db *DB) SavePlanEntriesToBackup(ctx context.Context, planEntries []*model.PlanEntry) error
- func (db *DB) SavePlaner(ctx context.Context, planer *model.Planer) error
- func (db *DB) SaveSemesterConfig(ctx context.Context, semesterConfig *model.SemesterConfig) error
- func (db *DB) SaveSemesterConfigInput(ctx context.Context, input *model.SemesterConfigInput) error
- func (db *DB) SaveSemesterConfigInputForSemester(ctx context.Context, semester string, input *model.SemesterConfigInput) error
- func (db *DB) SaveStudentRegs(ctx context.Context, studentRegs []interface{}) error
- func (db *DB) SetExamDurationOverride(ctx context.Context, ancode, duration int) (*model.ExamDurationOverride, error)
- func (db *DB) SetGeneratedExamsDirty(ctx context.Context, dirty bool, reason string, t time.Time) error
- func (db *DB) SetGenerationConfig(ctx context.Context, cfg *model.GenerationConfig) error
- func (db *DB) SetInvigilationPrePlanned(ctx context.Context, day, slot int, roomName *string, prePlanned bool) error
- func (db *DB) SetNtaDeactivated(ctx context.Context, mtknr string, deactivated bool) (*model.NTA, error)
- func (db *DB) SetPlanningCondition(ctx context.Context, key string, set bool) error
- func (db *DB) SetRegsWithErrors(ctx context.Context, regsWithErrors []*model.RegWithError) error
- func (db *DB) SetRoomDeactivated(ctx context.Context, name string, deactivated bool) (*model.Room, error)
- func (db *DB) SetRoomRequestActive(ctx context.Context, room string, day, slot int, active bool) (*model.RoomRequest, error)
- func (db *DB) SetRoomRequestApproved(ctx context.Context, room string, day, slot int, approved bool) (*model.RoomRequest, error)
- func (db *DB) SetRoomRequestWith(ctx context.Context, name, requestWith string, needsRequest bool) error
- func (db *DB) SetSemester(semester, database string) string
- func (db *DB) SetSemesterOnNTAs(ctx context.Context, studentRegs []interface{}) error
- func (db *DB) SetSemesterReadOnly(ctx context.Context, readOnly bool) error
- func (db *DB) SetStudentRegsDirty(ctx context.Context, dirty bool, reason string, t time.Time) error
- func (db *DB) SetZPAExamsToPlan(ctx context.Context, examsToPlan, examsNotToPlan []*model.ZPAExam) error
- func (db *DB) SpecialInterests(ctx context.Context) ([]*model.SpecialInterest, error)
- func (db *DB) StudentByMtknr(ctx context.Context, mtknr string) (*model.Student, error)
- func (db *DB) StudentRegsForProgram(ctx context.Context, program string) ([]*model.StudentReg, error)
- func (db *DB) StudentRegsPerStudentPlanned(ctx context.Context) ([]*model.Student, error)
- func (db *DB) StudentsByName(ctx context.Context, regex string) ([]*model.Student, error)
- func (db *DB) StudyProgram(ctx context.Context, shortname string) (*model.StudyProgram, error)
- func (db *DB) StudyPrograms(ctx context.Context) ([]*model.StudyProgram, error)
- func (db *DB) SyncLog(ctx context.Context, limit int) ([]*model.SyncLogEntry, error)
- func (db *DB) UnblockRoomForSlot(ctx context.Context, room string, day, slot int) (bool, error)
- func (db *DB) UnlockExam(ctx context.Context, ancode int) (*model.PlanEntry, error)
- func (db *DB) UnplacedExams(ctx context.Context) ([]*model.UnplacedExam, error)
- func (db *DB) UpdateRoomRequestTime(ctx context.Context, room string, day, slot int, from, until time.Time) (*model.RoomRequest, error)
- func (db *DB) UpsertAdditionalExam(ctx context.Context, exam *model.AdditionalExam) error
- func (db *DB) UpsertInvigilatorConstraints(ctx context.Context, constraints *model.InvigilatorConstraints) error
- func (db *DB) UpsertPermanentNonInvigilator(ctx context.Context, nonInvigilator *model.PermanentNonInvigilator) error
- func (db *DB) UpsertSpecialInterest(ctx context.Context, si *model.SpecialInterest) error
- func (db *DB) UpsertStudyProgram(ctx context.Context, program *model.StudyProgram) error
- type EmailAttachment
- type ExamToPlanType
- type MucDaiExam
- type PrimussType
- type SemesterMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectionName ¶
type CollectionName string
type DB ¶
func (*DB) AddConstraints ¶ added in v1.20.0
func (db *DB) AddConstraints(ctx context.Context, ancode int, constraints *model.Constraints) (*model.Constraints, error)
func (*DB) AddExamToSlot ¶
func (*DB) AddInvigilation ¶
func (*DB) AddMutationLogEntry ¶ added in v1.168.0
AddMutationLogEntry appends one mutating-operation entry to the per-semester mutation_log collection.
func (*DB) AddNonZpaExam ¶ added in v1.3.0
func (*DB) AddNtaRoomAloneWaiver ¶ added in v1.131.0
AddNtaRoomAloneWaiver stores (or replaces) a waiver (key: mtknr/ancode).
func (*DB) AddPrePlannedInvigilation ¶ added in v1.84.0
func (*DB) AddPrePlannedRoomToExam ¶ added in v1.33.0
func (*DB) AddRoomRequest ¶ added in v1.117.0
AddRoomRequest inserts a single room request.
func (*DB) AddStudentReg ¶ added in v1.36.0
func (*DB) AddSyncLogEntry ¶ added in v1.156.0
AddSyncLogEntry appends one transfer event to the sync-log history.
func (*DB) AddZpaExamToPlan ¶
func (*DB) AdditionalExams ¶
AdditionalExams returns all additional (publish-only) exams.
func (*DB) AllAnnyBookings ¶ added in v1.77.0
func (*DB) AllInvigilatorRequirements ¶ added in v1.152.0
func (db *DB) AllInvigilatorRequirements(ctx context.Context) ([]*zpa.SupervisorRequirements, error)
AllInvigilatorRequirements returns all stored ZPA invigilator requirements.
func (*DB) AllSemesterNames ¶
func (*DB) AnnyBookings ¶ added in v1.77.0
func (*DB) AnnyBookingsCollection ¶ added in v1.77.0
func (db *DB) AnnyBookingsCollection(ctx context.Context) *mongo.Collection
func (*DB) BlockRoomForSlot ¶ added in v1.119.0
BlockRoomForSlot stores (or updates) a room-slot block (key: room/day/slot).
func (*DB) BlockedRooms ¶ added in v1.119.0
BlockedRooms returns all room-slot blocks of the semester, sorted by room/day/slot.
func (*DB) CacheGeneratedExams ¶
func (*DB) CacheInvigilatorTodos ¶
func (*DB) CacheTeachers ¶
func (*DB) ChangeAncode ¶
func (*DB) ChangeAncodeInConflicts ¶
func (*DB) ChangeAncodeInStudentRegs ¶
func (*DB) ChangeAncodeInStudentRegsCount ¶
func (*DB) CheckStudentRegsCount ¶
func (*DB) ClearEmailAttachments ¶ added in v1.102.0
ClearEmailAttachments deletes all attachments of a kind and returns how many were removed.
func (*DB) DeleteAdditionalExam ¶ added in v1.173.0
DeleteAdditionalExam removes one additional exam by ancode.
func (*DB) DeleteInvigilatorConstraints ¶ added in v1.139.0
DeleteInvigilatorConstraints removes the constraints record of one invigilator. Returns false if there was none.
func (*DB) DeleteNonZpaExam ¶ added in v1.176.0
DeleteNonZpaExam removes a non-ZPA exam by its ancode.
func (*DB) DeletePermanentNonInvigilator ¶ added in v1.140.0
DeletePermanentNonInvigilator removes one permanent non-invigilator. Returns false if there was none.
func (*DB) DeletePreplanExam ¶ added in v1.160.0
DeletePreplanExam removes one pre-exam. Returns false if there was none.
func (*DB) DeleteSpecialInterest ¶ added in v1.173.0
DeleteSpecialInterest removes one special-interest group by name.
func (*DB) DeleteStudyProgram ¶ added in v1.159.0
DeleteStudyProgram removes one study program. Returns false if there was none.
func (*DB) DropAndSave ¶
func (*DB) EmailAttachmentInfos ¶ added in v1.102.0
EmailAttachmentInfos returns the attachments of a kind WITHOUT their binary data (for listing in the GUI), sorted by key.
func (*DB) EnsureSchemaVersion ¶ added in v1.178.0
EnsureSchemaVersion writes the schema version into the current database's meta if no meta exists yet (stamping a freshly set-up semester). Existing meta is left untouched (it keeps its version and readOnly flag).
func (*DB) ExamDurationOverrides ¶ added in v1.173.0
ExamDurationOverrides returns all duration overrides.
func (*DB) ExamerInPlan ¶
func (*DB) ExamsInSlot ¶
func (*DB) ExcludeDays ¶
func (*DB) GetAddedAncodes ¶
func (*DB) GetAddedAncodesForAncode ¶
func (*DB) GetAllInvigilations ¶
func (*DB) GetConstraints ¶
func (*DB) GetConstraintsForAncode ¶
func (*DB) GetEmailAttachment ¶ added in v1.102.0
GetEmailAttachment returns one attachment incl. its data, or nil if not found.
func (*DB) GetGeneratedExam ¶
func (*DB) GetGeneratedExams ¶
func (*DB) GetGeneratedExamsForExamer ¶
func (*DB) GetGeneratedExamsState ¶ added in v1.171.0
GetGeneratedExamsState returns the generated-exams state; a missing document means nothing has been generated yet and is reported as not dirty.
func (*DB) GetGenerationConfig ¶ added in v1.173.0
GetGenerationConfig returns the (single, global) generation config, or nil when none is stored yet.
func (*DB) GetInvigilationInSlot ¶
func (*DB) GetInvigilationTodos ¶
func (*DB) GetInvigilatorForRoom ¶
func (*DB) GetInvigilatorInSlot ¶
func (*DB) GetInvigilatorRequirements ¶
func (*DB) GetInvigilators ¶
func (*DB) GetOtherInvigilations ¶
func (*DB) GetPlanEntriesInSlot ¶ added in v1.23.0
func (*DB) GetPlaner ¶ added in v1.164.0
GetPlaner returns the planner (name/email), or nil when none is stored. The planner lives in the global "plexams" database (not a secret, carries over between semesters).
func (*DB) GetPrimussConflictsForAncode ¶
func (*DB) GetPrimussConflictsForAncodeOnlyPlanned ¶
func (*DB) GetPrimussConflictsPerAncode ¶ added in v1.171.0
func (db *DB) GetPrimussConflictsPerAncode(ctx context.Context, program string) (map[int]*model.Conflicts, error)
GetPrimussConflictsPerAncode returns all conflicts of a program at once, keyed by ancode. Used to compute generated exams without a per-exam DB lookup.
func (*DB) GetPrimussExam ¶
func (*DB) GetPrimussExams ¶
func (*DB) GetPrimussExamsForAncode ¶
func (*DB) GetPrimussStudentRegsForProgrammAncode ¶
func (*DB) GetPrimussStudentRegsPerAncode ¶
func (*DB) GetPrimussStudentRegsPerStudent ¶
func (*DB) GetRegsWithErrors ¶
func (*DB) GetRoomRequest ¶ added in v1.115.0
func (db *DB) GetRoomRequest(ctx context.Context, room string, day, slot int) (*model.RoomRequest, error)
GetRoomRequest returns one room request (key: room/day/slot) or nil.
func (*DB) GetSelfInvigilations ¶
func (*DB) GetSemesterConfigInput ¶ added in v1.158.0
GetSemesterConfigInput returns the raw, editable per-semester config (the source of truth) or nil when none has been stored yet.
func (*DB) GetSemesterConfigInputForSemester ¶ added in v1.158.0
func (db *DB) GetSemesterConfigInputForSemester(ctx context.Context, semester string) (*model.SemesterConfigInput, error)
GetSemesterConfigInputForSemester returns the raw config of another semester (its own database), or nil when none is stored. Used to seed a new semester from a previous one and to guard createSemester against overwriting.
func (*DB) GetSemesterMeta ¶ added in v1.178.0
func (db *DB) GetSemesterMeta(ctx context.Context) (*SemesterMeta, error)
GetSemesterMeta returns the meta of the current database (nil when none).
func (*DB) GetStudentRegsCount ¶
func (*DB) GetStudentRegsState ¶ added in v1.174.0
GetStudentRegsState returns the student-regs state; a missing document means nothing has been generated yet and is reported as not dirty.
func (*DB) GetTeacher ¶
func (*DB) GetTeacherIdByRegex ¶ added in v1.39.0
func (*DB) GetZPAExamsNotToPlan ¶
func (*DB) GetZPAExamsPlannedOrNotPlanned ¶
func (*DB) GetZPAExamsToPlan ¶
func (*DB) GetZPAStudentByMtknr ¶ added in v1.61.0
func (*DB) GetZPAStudents ¶ added in v1.62.0
func (*DB) GetZpaAncodesNotPlanned ¶
func (*DB) GetZpaAncodesPlanned ¶
func (*DB) GetZpaAncodesPlannedOrNotPlanned ¶
func (*DB) GetZpaExamByAncode ¶
func (*DB) InsertPreplanExam ¶ added in v1.160.0
func (db *DB) InsertPreplanExam(ctx context.Context, preplanExam *model.PreplanExam) (*model.PreplanExam, error)
InsertPreplanExam assigns the next id and inserts the pre-exam.
func (*DB) InvigilationsForInvigilator ¶
func (*DB) InvigilatorConstraints ¶ added in v1.139.0
InvigilatorConstraints returns all per-invigilator constraints stored in the DB (managed via the GUI), separate from the ZPA-sourced requirements.
func (*DB) InvigilatorConstraintsForTeacher ¶ added in v1.139.0
func (db *DB) InvigilatorConstraintsForTeacher(ctx context.Context, teacherID int) (*model.InvigilatorConstraints, error)
InvigilatorConstraintsForTeacher returns the constraints of one invigilator, or nil if none are stored.
func (*DB) MigrateLegacySemesterConfigInput ¶ added in v1.163.0
MigrateLegacySemesterConfigInput rewrites a stored config that still carries removed/renamed fields:
- `from` becomes the former numbering anchor (from when dayNumberStart was "from", else fromFK07), so existing plan day numbers stay stable;
- the former goSlots (offsets relative to goDay0) become absolute mucDaiSlots ([dayNumber, slotNumber]);
- fromFK07 / dayNumberStart / goDay0 / goSlots are dropped.
No-op when none of these legacy fields are present.
func (*DB) MucDaiExam ¶ added in v1.3.0
func (*DB) MucDaiExamsForProgram ¶
func (*DB) MutationLog ¶ added in v1.168.0
func (db *DB) MutationLog(ctx context.Context, opType, name *string, ancode *int, argFilters []*model.ArgFilterInput, since, until *time.Time, limit int) ([]*model.MutationLogEntry, error)
MutationLog returns the mutation log, newest first, filtered by operation name, a referenced ancode, argument key/value pairs and/or a time range. limit <= 0 returns all.
func (*DB) MutationLogNames ¶ added in v1.168.0
MutationLogNames returns the distinct operation names present in the log.
func (*DB) NonZpaExam ¶ added in v1.3.0
func (*DB) NonZpaExams ¶ added in v1.3.0
func (*DB) NotPlannedByMe ¶
func (*DB) NtaRoomAloneWaivers ¶ added in v1.131.0
NtaRoomAloneWaivers returns all accepted NTA room-alone waivers of the semester, sorted by mtknr/ancode.
func (*DB) NtaWithRegs ¶
func (*DB) PermanentNonInvigilators ¶ added in v1.140.0
func (db *DB) PermanentNonInvigilators(ctx context.Context) ([]*model.PermanentNonInvigilator, error)
PermanentNonInvigilators returns the teachers who never do invigilation duty again. This list lives in the global "plexams" database and carries over between semesters.
func (*DB) PlacesWithSockets ¶
func (*DB) PlannedAncodes ¶
func (*DB) PlannedRoomNamesInSlot ¶
func (*DB) PlannedRooms ¶
func (*DB) PlannedRoomsForAncode ¶
func (*DB) PlannedRoomsInSlot ¶
func (*DB) PlanningConditionsSet ¶ added in v1.121.0
PlanningConditionsSet returns the keys of all conditions that are currently set (done) for the semester.
func (*DB) PossibleDays ¶
func (*DB) PrePlannedInvigilations ¶ added in v1.84.0
func (*DB) PrePlannedInvigilationsForInvigilator ¶ added in v1.84.0
func (*DB) PrePlannedRooms ¶ added in v1.33.0
func (*DB) PrePlannedRoomsForExam ¶ added in v1.50.0
func (*DB) PreplanExam ¶ added in v1.160.0
PreplanExam returns one pre-exam by id, or nil when none.
func (*DB) PreplanExams ¶ added in v1.160.0
PreplanExams returns all SEB/EXaHM pre-planning pseudo-exams of this semester, sorted by id.
func (*DB) PrimussExamExists ¶
func (*DB) PrimussExamsForProgram ¶ added in v1.166.0
func (db *DB) PrimussExamsForProgram(ctx context.Context, program string) ([]*model.PrimussExam, error)
PrimussExamsForProgram returns all Primuss exams of one program.
func (*DB) RemoveAddedAncode ¶ added in v1.167.0
RemoveAddedAncode removes a manually added Primuss ancode mapping (program) of a ZPA exam. Returns false when there was none. (Mappings that come from ZPA itself are not stored here and are not affected.)
func (*DB) RemoveExamDurationOverride ¶ added in v1.173.0
RemoveExamDurationOverride deletes the duration override for an ancode; returns false when there was none.
func (*DB) RemoveNtaRoomAloneWaiver ¶ added in v1.131.0
RemoveNtaRoomAloneWaiver deletes a waiver (key: mtknr/ancode). It reports whether a document was removed.
func (*DB) RemovePlanEntry ¶ added in v1.176.0
RemovePlanEntry removes the plan entry (if any) of an ancode.
func (*DB) RemovePrePlannedInvigilation ¶ added in v1.125.0
func (db *DB) RemovePrePlannedInvigilation(ctx context.Context, day, slot int, roomName *string) (bool, error)
RemovePrePlannedInvigilation deletes a pre-planned invigilation (key: day/slot/roomName; roomName nil = the reserve). It reports whether a document was actually removed.
func (*DB) RemovePrePlannedRoomFromExam ¶ added in v1.119.0
func (db *DB) RemovePrePlannedRoomFromExam(ctx context.Context, ancode int, roomName string, mtknr *string) (bool, error)
RemovePrePlannedRoomFromExam deletes a pre-planned room from an exam (key: ancode/roomName/mtknr). It reports whether a document was actually removed.
func (*DB) RemoveStudentReg ¶
func (*DB) ReplaceAllRoomRequests ¶ added in v1.115.0
ReplaceAllRoomRequests drops the collection and inserts the given requests.
func (*DB) ReplaceMucDaiExamsForProgram ¶ added in v1.175.0
func (db *DB) ReplaceMucDaiExamsForProgram(ctx context.Context, program string, exams []*MucDaiExam) error
ReplaceMucDaiExamsForProgram drops and refills the mucdai_<program> collection.
func (*DB) ReplaceNta ¶ added in v1.111.0
ReplaceNta replaces the NTA document identified by its mtknr. It does not upsert: if no document matches, nothing is changed.
func (*DB) ReplacePlannedRooms ¶ added in v1.34.0
func (*DB) ReplacePreplanExam ¶ added in v1.160.0
ReplacePreplanExam replaces the pre-exam with the same id. Returns false if there was none.
func (*DB) ReplaceRoom ¶ added in v1.113.0
ReplaceRoom replaces the room identified by its name (no upsert) and returns it. Errors if no room with that name exists.
func (*DB) ReplaceUnplacedExams ¶ added in v1.137.1
ReplaceUnplacedExams drops and rewrites the rooms_unplaced collection (the students that could not be assigned a real room in their slot during room generation).
func (*DB) ResetGeneratedInvigilations ¶ added in v1.126.0
ResetGeneratedInvigilations drops the generated invigilations (invigilations_other). The pre-planning (invigilations_pre_planned) and the self-invigilations (invigilations_self) are not touched.
func (*DB) ResetPlannedRooms ¶ added in v1.126.0
ResetPlannedRooms drops the generated planned rooms (planned_rooms). The pre-planning (rooms_pre_planned) is not touched.
func (*DB) ResetUnplacedExams ¶ added in v1.137.1
ResetUnplacedExams drops the rooms_unplaced collection.
func (*DB) RmConstraints ¶ added in v1.20.0
func (*DB) RmZpaExamFromPlan ¶
func (*DB) RoomByName ¶ added in v1.33.0
func (*DB) RoomRequests ¶ added in v1.115.0
RoomRequests returns all building-management room requests of the semester, sorted by room, day, slot.
func (*DB) SafeExamBrowser ¶
func (*DB) SaveAnnyBookings ¶ added in v1.77.0
func (*DB) SaveEmailAttachment ¶ added in v1.102.0
func (db *DB) SaveEmailAttachment(ctx context.Context, att *EmailAttachment) error
SaveEmailAttachment stores (upserts) one attachment, keyed by (kind, key).
func (*DB) SavePlanEntries ¶
func (*DB) SavePlanEntriesToBackup ¶
func (*DB) SavePlaner ¶ added in v1.164.0
SavePlaner stores the planner (single document, replaced on upsert).
func (*DB) SaveSemesterConfig ¶
func (*DB) SaveSemesterConfigInput ¶ added in v1.158.0
SaveSemesterConfigInput replaces the stored raw per-semester config.
func (*DB) SaveSemesterConfigInputForSemester ¶ added in v1.158.0
func (db *DB) SaveSemesterConfigInputForSemester(ctx context.Context, semester string, input *model.SemesterConfigInput) error
SaveSemesterConfigInputForSemester writes the raw config into another semester's database (used when creating a new semester).
func (*DB) SaveStudentRegs ¶
func (*DB) SetExamDurationOverride ¶ added in v1.173.0
func (db *DB) SetExamDurationOverride(ctx context.Context, ancode, duration int) (*model.ExamDurationOverride, error)
SetExamDurationOverride upserts the duration override (minutes) for an ancode.
func (*DB) SetGeneratedExamsDirty ¶ added in v1.171.0
func (db *DB) SetGeneratedExamsDirty(ctx context.Context, dirty bool, reason string, t time.Time) error
SetGeneratedExamsDirty upserts the (single) generated-exams state document: dirty=true when an input changed, dirty=false right after a (re)generation.
func (*DB) SetGenerationConfig ¶ added in v1.173.0
SetGenerationConfig upserts the (single, global) generation config.
func (*DB) SetInvigilationPrePlanned ¶ added in v1.85.0
func (db *DB) SetInvigilationPrePlanned(ctx context.Context, day, slot int, roomName *string, prePlanned bool) error
SetInvigilationPrePlanned sets the prePlanned flag on the invigilation for a room (roomName != nil) or the reserve (roomName == nil) in a slot in the invigilations_other collection.
func (*DB) SetNtaDeactivated ¶ added in v1.111.0
func (db *DB) SetNtaDeactivated(ctx context.Context, mtknr string, deactivated bool) (*model.NTA, error)
SetNtaDeactivated sets the deactivated flag of the NTA identified by mtknr. Returns nil if no NTA with that mtknr exists.
func (*DB) SetPlanningCondition ¶ added in v1.121.0
SetPlanningCondition marks a condition as done (set=true, upsert) or removes it (set=false).
func (*DB) SetRegsWithErrors ¶
func (*DB) SetRoomDeactivated ¶ added in v1.112.0
func (db *DB) SetRoomDeactivated(ctx context.Context, name string, deactivated bool) (*model.Room, error)
SetRoomDeactivated sets the deactivated flag of the room identified by name. Returns an error if no room with that name exists.
func (*DB) SetRoomRequestActive ¶ added in v1.115.0
func (db *DB) SetRoomRequestActive(ctx context.Context, room string, day, slot int, active bool) (*model.RoomRequest, error)
SetRoomRequestActive sets the active flag (key: room/day/slot). Returns nil if no such request exists.
func (*DB) SetRoomRequestApproved ¶ added in v1.115.0
func (db *DB) SetRoomRequestApproved(ctx context.Context, room string, day, slot int, approved bool) (*model.RoomRequest, error)
SetRoomRequestApproved sets the approved flag (key: room/day/slot). Returns nil if no such request exists.
func (*DB) SetRoomRequestWith ¶ added in v1.114.0
func (db *DB) SetRoomRequestWith(ctx context.Context, name, requestWith string, needsRequest bool) error
SetRoomRequestWith sets the requestWith and (derived) needsRequest fields of the room identified by name.
func (*DB) SetSemester ¶
SetSemester repoints the DB (reusing the same mongo client). semester is the logical semester (used verbatim against external systems like ZPA, e.g. "2026 SS"); database is where the data lives and may differ from the semester (e.g. a clone "2026-SS-Test") — empty means derive it from the semester. Returns the normalized semester label.
func (*DB) SetSemesterOnNTAs ¶
func (*DB) SetSemesterReadOnly ¶ added in v1.178.0
SetSemesterReadOnly sets the read-only flag of the current database (upsert, preserving the schema version).
func (*DB) SetStudentRegsDirty ¶ added in v1.174.0
func (db *DB) SetStudentRegsDirty(ctx context.Context, dirty bool, reason string, t time.Time) error
SetStudentRegsDirty upserts the (single) student-regs state document: dirty=true when an input changed, dirty=false right after a (re)generation.
func (*DB) SetZPAExamsToPlan ¶
func (*DB) SpecialInterests ¶ added in v1.173.0
SpecialInterests returns all special-interest groups.
func (*DB) StudentByMtknr ¶
func (*DB) StudentRegsForProgram ¶
func (*DB) StudentRegsPerStudentPlanned ¶
func (*DB) StudentsByName ¶
func (*DB) StudyProgram ¶ added in v1.159.0
StudyProgram returns one study program by its shortname, or nil when none.
func (*DB) StudyPrograms ¶ added in v1.159.0
StudyPrograms returns all study programs (Studiengänge). This list lives in the global "plexams" database and carries over between semesters.
func (*DB) SyncLog ¶ added in v1.156.0
SyncLog returns the transfer history, newest first. limit <= 0 returns all.
func (*DB) UnblockRoomForSlot ¶ added in v1.119.0
UnblockRoomForSlot removes a room-slot block (key: room/day/slot). It reports whether a block was actually removed.
func (*DB) UnlockExam ¶
func (*DB) UnplacedExams ¶ added in v1.137.1
UnplacedExams returns the students that could not be assigned a real room in their slot during the last room generation.
func (*DB) UpdateRoomRequestTime ¶ added in v1.117.0
func (db *DB) UpdateRoomRequestTime(ctx context.Context, room string, day, slot int, from, until time.Time) (*model.RoomRequest, error)
UpdateRoomRequestTime changes the time range of a room request (key: room/day/slot). Returns nil if no such request exists.
func (*DB) UpsertAdditionalExam ¶ added in v1.173.0
UpsertAdditionalExam creates or updates one additional exam (key: ancode).
func (*DB) UpsertInvigilatorConstraints ¶ added in v1.139.0
func (db *DB) UpsertInvigilatorConstraints(ctx context.Context, constraints *model.InvigilatorConstraints) error
UpsertInvigilatorConstraints creates or replaces the whole constraints record of one invigilator (key: teacherID).
func (*DB) UpsertPermanentNonInvigilator ¶ added in v1.140.0
func (db *DB) UpsertPermanentNonInvigilator(ctx context.Context, nonInvigilator *model.PermanentNonInvigilator) error
UpsertPermanentNonInvigilator creates or replaces one permanent non-invigilator (key: teacherID).
func (*DB) UpsertSpecialInterest ¶ added in v1.173.0
UpsertSpecialInterest creates or updates one special-interest group (key: name).
func (*DB) UpsertStudyProgram ¶ added in v1.159.0
UpsertStudyProgram creates or replaces one study program (key: shortname).
type EmailAttachment ¶ added in v1.102.0
type EmailAttachment struct {
Kind string `bson:"kind"`
Key string `bson:"key"`
Filename string `bson:"filename"`
ContentType string `bson:"contentType"`
Size int `bson:"size"`
Data []byte `bson:"data,omitempty"`
UploadedAt time.Time `bson:"uploadedAt"`
}
EmailAttachment is a file uploaded by the GUI (or imported by the CLI) to be attached to an individual email later: cover-page PDFs (kind "cover-page", key = teacher ID) and per-invigilator PNGs (kind "invigilation-image", key = invigilator ID). One document per (kind, key); re-uploading replaces it.
type ExamToPlanType ¶
type MucDaiExam ¶
type MucDaiExam struct {
PrimussAncode int `bson:"Nr"`
Module string `bson:"Modulname"`
ExamType string `bson:"Prüfungsform"`
Grading string `bson:"Bewertung"`
Duration int `bson:"Dauer"`
MainExamer string `bson:"Erstpruefender"`
SecondExamer string `bson:"Zweitpruefender"`
IsRepeaterExam string `bson:"IstWiederholung"`
Program string `bson:"Studiengruppe"`
Planer string `bson:"Prüfungsplanung"`
}
type PrimussType ¶
type PrimussType string
const ( StudentRegs PrimussType = "studentregs" Exams PrimussType = "exams" Counts PrimussType = "count" Conflicts PrimussType = "conflicts" )
type SemesterMeta ¶ added in v1.178.0
type SemesterMeta struct {
SchemaVersion int `bson:"schemaVersion"`
ReadOnly bool `bson:"readOnly"`
}
SemesterMeta is per-database metadata (not planning config): the data schema version (compatibility) and the read-only flag.
Source Files
¶
- additional_exam.go
- anny_bookings.go
- collection.go
- constraints.go
- database.go
- email_attachments.go
- exam_duration.go
- generatedExams.go
- generated_exams_state.go
- generation_config.go
- invigilation.go
- invigilator.go
- invigilator_constraints.go
- mongo.go
- mucdai.go
- mutation_log.go
- non_zpa_exams.go
- nta.go
- nta_room_alone_waivers.go
- permanent_non_invigilators.go
- plan.go
- planer.go
- planning_state.go
- prepare_studentregs.go
- preplan_exams.go
- primuss.go
- primuss_conflicts.go
- primuss_exam.go
- primuss_studentregs.go
- room_requests.go
- rooms.go
- rooms_blocked.go
- rooms_unplaced.go
- save.go
- semester_meta.go
- special_interest.go
- student_regs_state.go
- studentregs.go
- study_programs.go
- sync_log.go
- zpa.go
- zpa_exams.go