primuss

package
v1.220.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: BSD-3-Clause Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 New

func New(db DB) *Service

New builds a Primuss import service.

func (*Service) ImportDir

func (s *Service) ImportDir(ctx context.Context, dir string) (*ImportResult, error)

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

func (s *Service) ImportZip(ctx context.Context, zipData []byte) (*ImportResult, error)

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.

Jump to

Keyboard shortcuts

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