Documentation
¶
Overview ¶
Package primuss imports the Primuss "Sammellisten" data from the XLSX files (student registrations, exams, planning counts, conflicts) into the raw per-program collections, with change detection on re-import. It depends only on a small DB interface (satisfied by *db.DB) and pure XLSX parsing; the cross-domain orchestration around an import (marking planning conditions, mapping changed Primuss ancodes to ZPA exams, update emails) stays in the plexams package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface {
RawCollection(ctx context.Context, name string) ([]bson.M, error)
ReplaceRawCollection(ctx context.Context, name string, docs []bson.M) (int, error)
}
DB is the persistence the Primuss import needs; *db.DB satisfies it.
type ImportProgram ¶
type ImportProgram struct {
Program string
ExamsImported int
StudentRegs int
CountRows int
ConflictRows int
Missing []string // file types not present for this program
FirstImport bool // no prior studentregs for this program (initial import, not an update)
ChangedAncodes []int // ancodes whose registrations changed vs before (empty on first import)
}
ImportProgram is the per-program outcome.
type ImportResult ¶
type ImportResult struct {
Programs []*ImportProgram
Skipped []string // files in the zip that were ignored
}
ImportResult summarizes a Primuss XLSX ZIP import.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service imports Primuss XLSX data.
func (*Service) ImportDir ¶
ImportDir zips all .xlsx under dir (recursively) in memory and imports them like an uploaded ZIP. Convenience for the CLI / a server-side directory.
func (*Service) ImportZip ¶
ImportZip imports the Primuss XLSX files from an uploaded ZIP. The program is derived from each filename; only the four known file types are imported (drop+insert per program). Only the programs/collections actually present in the ZIP are touched (incremental). For each replaced studentregs collection it reports the ancodes whose registrations changed, so update emails can be sent to those examers.