Documentation
¶
Overview ¶
Package zpaimport holds the pure decision logic of the ZPA import: diffing a fresh import against the previous DB state into a SyncLogEntry plus human-readable report lines, classifying a ZPA exam for the automatic to-plan pre-selection, and computing the new to-plan / not-to-plan sets. All functions are I/O-free over graph/model types; the ZPA client fetches, DB writes, reporter output and condition marking stay in the plexams package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffChanges ¶
func DiffChanges[T any](old, neu []T, id func(T) int, name func(T) string, fields func(T) map[string]string) (*model.SyncLogEntry, []string)
DiffChanges compares a fresh ZPA import (neu) against the previous DB state (old), keyed by id, and returns a partial SyncLogEntry (Added/Changed/Removed/Entries) that the caller completes (operation/label/…) together with the human-readable report lines, in order, for the caller to emit. New entries, per-field changes on existing entries and dropped entries are reported.
func ExamShouldBePlanned ¶
ExamShouldBePlanned classifies a ZPA exam for the automatic pre-selection: written and practical exams ("schriftliche/praktische Prüfung") are planned centrally, all other types (Modularbeit, Präsentation, mündliche Prüfung, Schein, extern, …) are not.
func Preselect ¶
func Preselect(all, toPlan, notToPlan []*model.ZPAExam) (newToPlan, newNotToPlan []*model.ZPAExam, toPlanAdded, notToPlanAdded int)
Preselect computes the new to-plan / not-to-plan sets for all exams that have no decision yet (written/practical → to plan, rest → not to plan) while keeping every existing decision in toPlan/notToPlan. It returns the extended sets and how many were newly added to each. When nothing was undecided both added counts are 0 and the returned sets equal the inputs.
Types ¶
This section is empty.