diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 8459ff9..ef27cfa 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -7,12 +7,28 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 - with: - go-version: "1.20" - cache: false - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v2 with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version version: latest + + # Optional: working directory, useful for monorepos + # working-directory: somedir + + # Optional: golangci-lint command line arguments. + # args: --issues-exit-code=0 + args: --timeout=10m + + # Optional: show only new issues if it's a pull request. The default value is `false`. + # only-new-issues: true + + # Optional: if set to true then the action will use pre-installed Go. + # skip-go-installation: true + + # Optional: if set to true then the action don't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. + # skip-build-cache: true diff --git a/.vscode/launch.json b/.vscode/launch.json index 0306fca..bfd858e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,17 +1,16 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Debug plexams.go", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "main.go", - "args": ["validate", "all"] - } - - ] -} \ No newline at end of file + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Debug plexams.go", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "main.go", + "args": [] + } + ] +} diff --git a/README.md b/README.md index 8688585..d78cef0 100644 --- a/README.md +++ b/README.md @@ -3,22 +3,103 @@ # plexams.go -Rewrite of obcode/plexams in Go +- Import aus ZPA -- daher nicht verändern! + - teachers + - zpaexams -## Config `plexams.yaml` +## Datenmodell -## Run GraphQL server - -``` -plexams.go server +```mermaid +erDiagram + teachers + zpaexams + zpaexamsToPlan { + int ancode + bool toPlan + } + zpaexams ||--|| zpaexamsToPlan: planOrNot + constraints |o--|| zpaexams: hasConstraint + zpaexams |o--o{ exams_primuss: connectedExam + externalExams { + int ancode + string program + } ``` -## Fetch from ZPA + additionalExam |o--o{ exams_primuss: connectedAdditionalExam -``` -plexams.go zpa teacher -``` + conflicts_XY + count_XY + exams_XY + studentregs_XY +## Ablauf + +```mermaid +flowchart TD + ZPA_Exams --> Connected_Exams + Primuss_Exams --> Connected_Exams + Connected_Exams --> Exams/Cached_Exams + Primuss_StudentRegs/Conflicts --> Exams/Cached_Exams + NTAs --> Exams/Cached_Exams ``` -plexams.go zpa exams -``` + +1. Prüfungen aus dem ZPA importieren (bei Änderungen erneut): + + ``` + plexams.go zpa exams + ``` + +2. Dozierende aus dem ZPA importieren (bei Änderungen erneut): + + ``` + plexams.go zpa teacher + ``` + +3. Prüfungen in `plexams.gui` auswählen, die geplant werden müssen. +4. (optional) zusätzliche Prüfungen einfügen, die beachtet werden müssen. +5. Besonderheiten (`constraints`) bei Prüfungen einpflegen. +6. Primuss-Daten per `Makefile` importieren. +7. Zuordnung ZPA <-> Primuss: + + ``` + plexams.go prepare connected-exams + ``` + + Kontrollieren in `plexams.gui`. + +8. Evtl. Primuss-Anmeldungen korrigieren + + ``` + plexams.go primuss fix-ancode + ``` + + und erneut zuordnen lassen (siehe 7.) oder zusätzlich zuordnen (siehe 9.) + +9. Evtl. mit + + ``` + plexams.go prepare connect-exam + ``` + + ein zusätzliches connecten + +10. Primuss-Anmeldungen ins ZPA importieren + + ``` + plexams.go zpa studentregs + ``` + +11. Zuordnung ZPA-Prüfungen zu Primuss-Anmeldungen fixieren. +12. Nachteilsausgleiche bei Prüfer:innen per E-Mail melden/nachfragen + + ``` + plexams.go email nta -r + ``` + +bis hier + +13. MUC.DAI-Planung an Prüfungsplaner FK03 (DE), FK08 (GS), FK12 (ID) +14. Vorläufigen Plan ins ZPA und an Fachschaft +15. Plan im ZPA veröffentlichen +16. E-Mail Anforderungen an die Aufsichtenplanung diff --git a/cmd/cache.go b/cmd/cache.go new file mode 100644 index 0000000..e1d3c31 --- /dev/null +++ b/cmd/cache.go @@ -0,0 +1,65 @@ +package cmd + +import ( + "fmt" + "log" + "os" + "strconv" + + "github.com/logrusorgru/aurora" + "github.com/spf13/cobra" +) + +var ( + cacheCmd = &cobra.Command{ + Use: "cache", + Short: "cache [subcommand]", + Long: `cache collections. + exam + exams + rm-exams +`, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + plexams := initPlexamsConfig() + switch args[0] { + + case "exam": + if len(args) < 2 { + log.Fatal("need ancode") + } + ancode, err := strconv.Atoi(args[1]) + if err != nil { + fmt.Printf("cannot use %s as ancode", args[1]) + os.Exit(1) + } + + err = plexams.CacheExam(ancode) + if err != nil { + os.Exit(1) + } + + case "exams": + err := plexams.CacheExams() + if err != nil { + os.Exit(1) + } + + case "rm-exams": + err := plexams.RmCacheExams() + if err != nil { + fmt.Println(err) + os.Exit(1) + } + fmt.Println(aurora.Green("successfully removed the cached exams")) + + default: + fmt.Println("cache called with unknown sub command") + } + }, + } +) + +func init() { + rootCmd.AddCommand(cacheCmd) +} diff --git a/cmd/csv.go b/cmd/csv.go new file mode 100644 index 0000000..13f02de --- /dev/null +++ b/cmd/csv.go @@ -0,0 +1,57 @@ +package cmd + +import ( + "fmt" + "log" + "os" + + "github.com/spf13/cobra" +) + +var ( + csvCmd = &cobra.Command{ + Use: "csv", + Short: "csv [subcommand]", + Long: `Generate various CSVs. + draft [program] - generate csv for program + exahm - csv for EXaHM/SEB exams.`, + Args: cobra.MinimumNArgs(1), + Run: func(cmd *cobra.Command, args []string) { + plexams := initPlexamsConfig() + switch args[0] { + case "draft": + if len(args) < 2 { + log.Fatal("need program") + } + program := args[1] + if len(Csvfile) == 0 { + Csvfile = fmt.Sprintf("VorläufigePrüfungsplanung_FK07_%s.csv", program) + } + fmt.Printf("generating %s\n", Csvfile) + err := plexams.CsvForProgram(program, Csvfile) + if err != nil { + os.Exit(1) + } + + case "exahm": + if len(Csvfile) == 0 { + Csvfile = "Prüfungsplanung_EXaHM_SEB_FK07.csv" + } + fmt.Printf("generating %s\n", Csvfile) + err := plexams.CsvForEXaHM(Csvfile) + if err != nil { + os.Exit(1) + } + + default: + fmt.Println("pdf called with unknown sub command") + } + }, + } + Csvfile string +) + +func init() { + rootCmd.AddCommand(csvCmd) + csvCmd.Flags().StringVarP(&Csvfile, "out", "o", "", "output (csv) file") +} diff --git a/cmd/email.go b/cmd/email.go index 4ae6ab1..35ec18a 100644 --- a/cmd/email.go +++ b/cmd/email.go @@ -13,7 +13,9 @@ var ( Use: "email [subcommand]", Short: "send email", Long: `Send emails. -nta --- send emails to teachers about nta.`, +nta --- send emails to teachers about nta, +nta-with-room-alone --- send emails to students with room alone, +primuss-data --- send emails to teachers about primuss data and nta.`, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { plexams := initPlexamsConfig() @@ -23,6 +25,16 @@ nta --- send emails to teachers about nta.`, if err != nil { log.Fatalf("got error: %v\n", err) } + case "nta-with-room-alone": + err := plexams.SendHandicapsMailsNTARoomAlone(context.Background(), run) + if err != nil { + log.Fatalf("got error: %v\n", err) + } + case "primuss-data": + err := plexams.SendGeneratedExamMails(context.Background(), run) + if err != nil { + log.Fatalf("got error: %v\n", err) + } default: fmt.Println("email called with unknown sub command") } diff --git a/cmd/generate.go b/cmd/generate.go index ac95ebd..0832d0d 100644 --- a/cmd/generate.go +++ b/cmd/generate.go @@ -19,7 +19,7 @@ plan --- generate the plan.`, plexams := initPlexamsConfig() switch args[0] { case "plan": - err := plexams.GeneratePlan(context.Background()) + err := plexams.GeneratePlan(context.Background()) // nolint if err != nil { log.Fatalf("got error: %v\n", err) } diff --git a/cmd/info.go b/cmd/info.go index df34850..9a04ea8 100644 --- a/cmd/info.go +++ b/cmd/info.go @@ -1,6 +1,7 @@ package cmd import ( + "context" "encoding/json" "fmt" "log" @@ -16,16 +17,19 @@ var ( Use: "info [subcommand]", Short: "get info", Long: `Get info. +samename --- exams with same module name goslots --- info about slots for GO/GN request-rooms --- which rooms to request stats --- get statistics student-regs ancode --- get student-reqs for ancode rooms-for-nta name --- get planned rooms for student -exams-for-student name --- get exams for student.`, +student name --- get info for student.`, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { p := initPlexamsConfig() switch args[0] { + case "samename": + p.PrintSameName() case "goslots": err := plexams.PrintGOSlots(p.GetSemesterConfig().Slots, p.GetGoSlots()) if err != nil { @@ -85,15 +89,24 @@ exams-for-student name --- get exams for student.`, fmt.Println(err) return } - case "exams-for-student": + case "student": if len(args) < 2 { log.Fatal("need name") } - err := p.GetExamsForStudent(args[1]) + // FIXME + students, err := p.StudentsByName(context.TODO(), args[1]) // nolint if err != nil { fmt.Println(err) return } + for _, student := range students { + fmt.Printf("%s (%s, %s%s): regs %v", student.Name, student.Mtknr, student.Program, student.Group, student.Regs) + if student.Nta != nil { + fmt.Printf(", NTA: %s\n", student.Nta.Compensation) + } else { + fmt.Println() + } + } default: fmt.Println("info called with unknown sub command") } diff --git a/cmd/plan.go b/cmd/plan.go index 3dc5654..7fa74a5 100644 --- a/cmd/plan.go +++ b/cmd/plan.go @@ -17,8 +17,8 @@ var ( Long: `Manipulate the plan. move-to ancode day slot --- move [ancode] to [day number] [slot number] change-room ancode oldroom newroom --- change room for [ancode] from [oldroom] to [newroom] - lock-examgroup groupcode --- lock exam group to slot - unlock-examgroup groupcode --- unlock / allow moving + lock-exam ancode --- lock exam to slot + unlock-exam ancode --- unlock / allow moving remove-unlocked --- remove all unlocked exam groups from the plan lock --- lock the whole plan`, Args: cobra.MinimumNArgs(1), @@ -43,12 +43,31 @@ var ( } success, err := plexams.AddExamToSlot(context.Background(), ancode, day, slot) if err != nil { + fmt.Printf("error: %v\n", err) os.Exit(1) } if success { fmt.Printf("successfully moved exam %d to (%d,%d)\n", ancode, day, slot) } + case "fixslotsindb": + planEntries, err := plexams.PlanEntries(context.TODO()) + if err != nil { + log.Fatal("cannot get plan entries") + } + + for i, planEntry := range planEntries { + fmt.Printf("%2d. fixing %v", i+1, planEntry) + success, err := plexams.AddExamToSlot(context.Background(), planEntry.Ancode, planEntry.DayNumber, planEntry.SlotNumber) + if err != nil { + fmt.Printf("error: %v\n", err) + os.Exit(1) + } + if success { + fmt.Println(" ... success") + } + } + case "change-room": if len(args) < 4 { log.Fatal("need ancode, old room and new room names") @@ -68,50 +87,38 @@ var ( fmt.Printf("successfully moved exam %d from %s to %s\n", ancode, oldRoom, newRoom) } - case "lock-examgroup": + case "lock-exam": if len(args) < 2 { - log.Fatal("need exam group code") + log.Fatal("need ancode") } - examGroupCode, err := strconv.Atoi(args[1]) + ancode, err := strconv.Atoi(args[1]) if err != nil { log.Fatalf("cannot convert %s to int", args[1]) } - planEntry, examGroup, err := plexams.LockExamGroup(context.Background(), examGroupCode) + planEntry, exam, err := plexams.LockExam(context.Background(), ancode) if err != nil { os.Exit(1) } - if planEntry != nil { - fmt.Printf("successfully locked exam group %d to slot (%d,%d)\n", - planEntry.ExamGroupCode, planEntry.DayNumber, planEntry.SlotNumber) - } - if examGroup != nil { - for _, exam := range examGroup.Exams { - fmt.Printf(" - %d. %s, %s\n", - exam.Exam.Ancode, exam.Exam.ZpaExam.MainExamer, exam.Exam.ZpaExam.Module) - } + if planEntry != nil && exam != nil { + fmt.Printf("successfully locked exam %d. %s, %s to slot (%d,%d)\n", + exam.Ancode, exam.ZpaExam.MainExamer, exam.ZpaExam.Module, planEntry.DayNumber, planEntry.SlotNumber) } - case "unlock-examgroup": + case "unlock-exam": if len(args) < 2 { - log.Fatal("need exam group code") + log.Fatal("need ancode") } - examGroupCode, err := strconv.Atoi(args[1]) + ancode, err := strconv.Atoi(args[1]) if err != nil { log.Fatalf("cannot convert %s to int", args[1]) } - planEntry, examGroup, err := plexams.UnlockExamGroup(context.Background(), examGroupCode) + planEntry, exam, err := plexams.UnlockExam(context.Background(), ancode) if err != nil { os.Exit(1) } - if planEntry != nil { - fmt.Printf("successfully unlocked exam group %d to slot (%d,%d)\n", - planEntry.ExamGroupCode, planEntry.DayNumber, planEntry.SlotNumber) - } - if examGroup != nil { - for _, exam := range examGroup.Exams { - fmt.Printf(" - %d. %s, %s\n", - exam.Exam.Ancode, exam.Exam.ZpaExam.MainExamer, exam.Exam.ZpaExam.Module) - } + if planEntry != nil && exam != nil { + fmt.Printf("successfully unlocked exam %d. %s, %s from slot (%d,%d)\n", + exam.Ancode, exam.ZpaExam.MainExamer, exam.ZpaExam.Module, planEntry.DayNumber, planEntry.SlotNumber) } case "remove-unlocked": diff --git a/cmd/prepare.go b/cmd/prepare.go index 9513c20..6fbc7f9 100644 --- a/cmd/prepare.go +++ b/cmd/prepare.go @@ -1,6 +1,7 @@ package cmd import ( + "context" "fmt" "log" "os" @@ -16,29 +17,71 @@ var ( Long: `Prepare collections. connected-exams --- prepare connected exams --- step 1 connect-exam ancode program --- connect an unconnected exam --- step 1,5 - studentregs --- regs per exam & regs per student --- step 2 - nta --- find NTAs for semester --- step 3 - exams-with-regs --- exams from connected-exams and studentregs --- step 4 - exam-groups --- group of exams in the same slot --- step 5 -- according to constraints? - partition --- generate partition of groups --- step 6 + + add-external-exam program ancode duration --- add an external exam + + generated-exams --- generate exams from connected-exams, external-exams and primuss-data --- step 2 + + studentregs --- regs per exam & regs per student (needs connected-exams) --- step 2 + + # nta --- find NTAs for semester --- step 3 + + # exams-with-regs --- exams from connected-exams and studentregs --- step 4 + # exam-groups --- group of exams in the same slot --- step 5 -- according to constraints? + # partition --- generate partition of groups --- step 6 Add exam after planning has started: - connected-exam --- prepare a connected exam for ancode - exam-group --- group of exams out of ancodes + # connected-exam --- prepare a connected exam for ancode + # exam-group --- group of exams out of ancodes For planning rooms: - exams-in-plan --- split exam-groups into exams - rooms-for-semester --- prepare rooms which are allowed to use - rooms-for-exams --- rooms for exams + # exams-in-plan --- split exam-groups into exams + rooms-for-semester --- prepare rooms which are allowed to use + rooms-for-ntas --- rooms for ntas alone + rooms-for-exams --- rooms for exams - invigilate-self --- set main examer as invigilator if possible + self-invigilations --- set main examer as invigilator if possible + invigilator-todos --- cache snapshot `, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { plexams := initPlexamsConfig() switch args[0] { + case "add-external-exam": + if len(args) < 4 { + log.Fatal("need program, ancode, and duration") + } + program := args[1] + ancode, err := strconv.Atoi(args[2]) + if err != nil { + fmt.Printf("cannot use %s as ancode", args[1]) + os.Exit(1) + } + duration, err := strconv.Atoi(args[3]) + if err != nil { + fmt.Printf("cannot use %s as duration", args[1]) + os.Exit(1) + } + + ctx := context.Background() + + primussExam, err := plexams.GetPrimussExam(ctx, program, ancode) + if err != nil { + log.Fatal(err) + } + + if !confirm(fmt.Sprintf("add external exam %s/%d. %s (%s)?", + primussExam.Program, primussExam.AnCode, primussExam.Module, primussExam.MainExamer), 10) { + os.Exit(0) + } + + err = plexams.AddExternalExam(ctx, primussExam, duration) + if err != nil { + os.Exit(1) + } + case "connected-exams": err := plexams.PrepareConnectedExams() if err != nil { @@ -75,75 +118,93 @@ var ( os.Exit(1) } - case "studentregs": - err := plexams.PrepareStudentRegs() - if err != nil { - os.Exit(1) - } - - case "exams-with-regs": - err := plexams.PrepareExamsWithRegs() - if err != nil { - os.Exit(1) - } + // case "exams-with-regs": // Deprecated: no longer needed + // err := plexams.PrepareExamsWithRegs() + // if err != nil { + // os.Exit(1) + // } - case "exam-groups": - err := plexams.PrepareExamGroups() + case "generated-exams": + err := plexams.PrepareGeneratedExams() if err != nil { os.Exit(1) } - case "exam-group": - if len(args) < 2 { - log.Fatal("need ancode(s)") - } - ancodes := make([]int, 0, len(args)-1) - for _, arg := range args[1:] { - ancode, err := strconv.Atoi(arg) - if err != nil { - fmt.Printf("cannot use %s as ancode", args[1]) - os.Exit(1) - } - ancodes = append(ancodes, ancode) - } - - err := plexams.PrepareExamGroup(ancodes) + case "studentregs": + err := plexams.PrepareStudentRegs() if err != nil { os.Exit(1) } - case "partition": - err := plexams.PartitionGroups() - if err != nil { - os.Exit(1) - } + // case "exam-groups": + // err := plexams.PrepareExamGroups() + // if err != nil { + // os.Exit(1) + // } + + // case "exam-group": + // if len(args) < 2 { + // log.Fatal("need ancode(s)") + // } + // ancodes := make([]int, 0, len(args)-1) + // for _, arg := range args[1:] { + // ancode, err := strconv.Atoi(arg) + // if err != nil { + // fmt.Printf("cannot use %s as ancode", args[1]) + // os.Exit(1) + // } + // ancodes = append(ancodes, ancode) + // } + + // err := plexams.PrepareExamGroup(ancodes) + // if err != nil { + // os.Exit(1) + // } + + // case "partition": + // err := plexams.PartitionGroups() + // if err != nil { + // os.Exit(1) + // } + + // case "nta": // Deprecated: part of generate exams + // err := plexams.PrepareNta() + // if err != nil { + // os.Exit(1) + // } + + // case "exams-in-plan": + // err := plexams.PreparePlannedExams() + // if err != nil { + // os.Exit(1) + // } - case "nta": - err := plexams.PrepareNta() + case "rooms-for-semester": + err := plexams.PrepareRoomsForSemester() if err != nil { os.Exit(1) } - case "exams-in-plan": - err := plexams.PreparePlannedExams() + case "rooms-for-ntas": + err := plexams.RoomsForNTAsWithRoomAlone() if err != nil { os.Exit(1) } - case "rooms-for-semester": - err := plexams.PrepareRoomsForSemester() + case "rooms-for-exams": + err := plexams.PrepareRoomForExams() if err != nil { os.Exit(1) } - case "rooms-for-exams": - err := plexams.PrepareRoomForExams() + case "self-invigilations": + err := plexams.PrepareSelfInvigilation() if err != nil { os.Exit(1) } - case "invigilate-self": - err := plexams.PrepareSelfInvigilation() + case "invigilator-todos": + _, err := plexams.PrepareInvigilationTodos(context.Background()) if err != nil { os.Exit(1) } diff --git a/cmd/primuss.go b/cmd/primuss.go index 45f48f8..afab844 100644 --- a/cmd/primuss.go +++ b/cmd/primuss.go @@ -15,12 +15,44 @@ var primussCmd = &cobra.Command{ Use: "primuss", Short: "primuss [subcommand]", Long: `Handle primuss data. + add-ancode zpa-ancode program primuss-ancode --- add ancode to zpa-data fix-ancode program from to --- fix ancode in primuss data (exam and studentregs) rm-studentreg program ancode mtknr --- remove a student registration`, Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { plexams := initPlexamsConfig() switch args[0] { + case "add-ancode": + if len(args) < 4 { + log.Fatal("need program and primuss ancode") + } + ancode, err := strconv.Atoi(args[1]) + if err != nil { + log.Fatalf("cannot convert %s to int\n", args[2]) + } + program := args[2] + primussAncode, err := strconv.Atoi(args[3]) + if err != nil { + log.Fatalf("cannot convert %s to int\n", args[2]) + } + + ctx := context.Background() + zpaExam, err := plexams.GetZPAExam(ctx, ancode) + if err != nil { + log.Fatalf("cannot get zpa exam with ancode %d\n", ancode) + } + + fmt.Printf("Found exam: %d. %s, %s (%v)\n", zpaExam.AnCode, zpaExam.Module, zpaExam.MainExamer, zpaExam.PrimussAncodes) + + if !confirm(fmt.Sprintf("add primuss ancode %s/%d to zpa exam?", program, primussAncode), 10) { + os.Exit(0) + } + + err = plexams.AddAncode(ctx, ancode, program, primussAncode) + if err != nil { + log.Fatalf("cannot add ancode") + } + case "fix-ancode": if len(args) < 4 { log.Fatal("need program, from and to") diff --git a/cmd/root.go b/cmd/root.go index 8a6248f..8f19db9 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -110,7 +110,7 @@ func initPlexamsConfig() *plexams.Plexams { panic(fmt.Errorf("fatal cannot create mongo client: %w", err)) } - plexams.PrintSemester() + plexams.PrintInfo() return plexams } diff --git a/cmd/validate.go b/cmd/validate.go index e4a0dba..603120f 100644 --- a/cmd/validate.go +++ b/cmd/validate.go @@ -18,6 +18,7 @@ var ( all --- guess what :-) conflicts --- check conflicts for each student constraints --- check if constraints hold + db --- data base entries rooms --- check room constraints zpa --- check if the plan on ZPA is the same here invigilator-reqs @@ -33,9 +34,11 @@ var ( switch arg { case "all": validations = append(validations, []func() error{ + plexams.ValidateDB, func() error { return plexams.ValidateConflicts(OnlyPlannedByMe, Ancode) }, plexams.ValidateConstraints, plexams.ValidateRoomsPerSlot, + plexams.ValidateRoomsNeedRequest, plexams.ValidateRoomsPerExam, plexams.ValidateRoomsTimeDistance, }...) @@ -48,25 +51,30 @@ var ( case "constraints": validations = append(validations, plexams.ValidateConstraints) + case "db": + validations = append(validations, plexams.ValidateDB) + case "rooms": validations = append(validations, - []func() error{plexams.ValidateRoomsPerSlot, plexams.ValidateRoomsPerExam, plexams.ValidateRoomsTimeDistance}...) + []func() error{ + plexams.ValidateRoomsPerSlot, + plexams.ValidateRoomsNeedRequest, + plexams.ValidateRoomsPerExam, + plexams.ValidateRoomsTimeDistance, + }...) case "zpa": - fmt.Println("validating zpa dates and times") err := plexams.ValidateZPADateTimes() if err != nil { log.Fatal(err) } if Rooms || Invigilators { - fmt.Println("validating zpa rooms") err := plexams.ValidateZPARooms() if err != nil { log.Fatal(err) } } if Invigilators { - fmt.Println("validating zpa invigilators") err := plexams.ValidateZPAInvigilators() if err != nil { log.Fatal(err) @@ -74,7 +82,11 @@ var ( } case "invigilator-reqs": - validations = append(validations, plexams.ValidateInvigilatorRequirements) + validations = append(validations, + plexams.ValidateInvigilatorRequirements, + plexams.ValidateInvigilationDups, + plexams.ValidateInvigilationsTimeDistance, + ) case "invigilator-slots": validations = append(validations, plexams.ValidateInvigilatorSlots) @@ -111,6 +123,7 @@ func validate(funcs []func() error) { if Sleep == 0 { return } + fmt.Printf("\n... sleeping %d seconds ...\n\n", Sleep) time.Sleep(time.Duration(Sleep) * time.Second) } } @@ -120,7 +133,7 @@ func init() { validateCmd.Flags().IntVarP(&Sleep, "sleep", "s", 0, "sleep [s] seconds and validate again") validateCmd.Flags().IntVarP(&Ancode, "ancode", "a", 0, "show only constraints for given ancode") validateCmd.Flags().BoolVarP(&Clear, "clear", "c", false, "clear screen before output") - validateCmd.Flags().BoolVarP(&Rooms, "room", "r", false, "validate zpa rooms") + validateCmd.Flags().BoolVarP(&Rooms, "rooms", "r", false, "validate zpa rooms") validateCmd.Flags().BoolVarP(&Invigilators, "invigilators", "i", false, "validate zpa invigilators") validateCmd.Flags().BoolVarP(&OnlyPlannedByMe, "onlyplannedbyme", "o", false, "check no conflicts if both exams are not planned by me") } diff --git a/cmd/zpa.go b/cmd/zpa.go index 22d97ba..bbe343f 100644 --- a/cmd/zpa.go +++ b/cmd/zpa.go @@ -24,6 +24,7 @@ var ( Run: func(cmd *cobra.Command, args []string) { plexams := initPlexamsConfig() switch args[0] { + // TODO: wenn schon in der DB vorhanden, Änderungen anzeigen case "teacher": t := true teachers, err := plexams.GetTeachers(context.Background(), &t) @@ -34,6 +35,7 @@ var ( fmt.Printf("%3d. %s\n", i+1, teacher.Fullname) } + // TODO: wenn schon in der DB vorhanden, Änderungen anzeigen case "exams": t := true exams, err := plexams.GetZPAExams(context.Background(), &t) @@ -41,9 +43,10 @@ var ( log.Fatal().Err(err).Msg("cannot get teachers") } for _, exam := range exams { - fmt.Printf("%3d. %s (%s)\n", exam.AnCode, exam.Module, exam.MainExamer) + fmt.Printf("%3d. %s (%s): %v\n", exam.AnCode, exam.Module, exam.MainExamer, exam.PrimussAncodes) } + // TODO: wenn schon in der DB vorhanden, Änderungen anzeigen case "invigs": invigs, err := plexams.GetSupervisorRequirements(context.Background()) if err != nil { @@ -52,11 +55,25 @@ var ( fmt.Printf("fetched %d invigilator requirements\n", len(invigs)) case "studentregs": - count, regsWithErrors, err := plexams.PostStudentRegsToZPA(context.Background()) + regsPosted, regsWithErrors, err := plexams.PostStudentRegsToZPA(context.Background()) if err != nil { log.Fatal().Err(err).Msg("cannot get student regs") } - fmt.Printf("%d successfully imported, %d errors\n", count, len(regsWithErrors)) + fmt.Printf("%d successfully imported, %d errors\n", len(regsPosted), len(regsWithErrors)) + + if len(jsonOutputFile) == 0 { + jsonOutputFile = "studentregs.json" + } + json, err := json.MarshalIndent(regsPosted, "", " ") + if err != nil { + log.Error().Err(err).Msg("cannot marshal studentregs into json") + } + err = os.WriteFile(jsonOutputFile, json, 0644) + if err != nil { + log.Error().Err(err).Msg("cannot write studentregs to file") + } else { + fmt.Printf(" saved copy to %s\n", jsonOutputFile) + } case "upload-plan": diff --git a/db/cli/main.go b/db/cli/main.go index 49cabf8..f6ed868 100644 --- a/db/cli/main.go +++ b/db/cli/main.go @@ -16,7 +16,15 @@ func main() { panic(fmt.Errorf("fatal error config file: %w", err)) } - client, _ := db.NewDB(viper.GetString("db.uri"), viper.GetString("semester")) + dbName := viper.GetString("db.database") + var databaseName *string + if dbName == "" { + databaseName = nil + } else { + databaseName = &dbName + } + + client, _ := db.NewDB(viper.GetString("db.uri"), viper.GetString("semester"), databaseName) semester, _ := client.AllSemesterNames() diff --git a/db/collection.go b/db/collection.go index 256b4b0..8d8db16 100644 --- a/db/collection.go +++ b/db/collection.go @@ -14,6 +14,7 @@ const ( collectionConstraints = "constraints" collectionNameExamGroups = "exam_groups" collectionNameAdditionalExams = "additional_exams" + collectionNameExternalExams = "external_exams" collectionNameConnectedExams = "connected_exams" collectionNameExamsWithRegs = "exams_with_regs" collectionNameNTAs = "nta" @@ -25,17 +26,22 @@ const ( collectionStudentRegsPerStudentPlanned = "studentregs_per_student_planned" collectionStudentRegsPerStudentAll = "studentregs_per_student_all" - collectionAll = "zpaexams" - collectionToPlan = "zpaexams-to-plan" - collectionNotToPlan = "zpaexams-not-to-plan" + collectionAll = "zpaexams" + collectionToPlan = "zpaexamsToPlan" - collectionExamsInPlan = "exams_in_plan" + collectionPrimussAncodes = "primuss_ancodes" + + collectionExamsInPlan = "exams_in_plan" // Deprecated: rm me + + collectionCachedExams = "cached_exams" // ? + collectionGeneratedExams = "generated_exams" collectionRooms = "rooms" collectionRoomsPlanned = "rooms_planned" - collectionRoomsForExams = "rooms_for_exams" + collectionRoomsForExams = "rooms_for_exams" // Deprecated: ? collectionInvigilatorRequirements = "invigilator_requirements" + collectionInvigilatorTodos = "invigilator_todos" collectionOtherInvigilations = "invigilations_other" collectionSelfInvigilations = "invigilations_self" ) @@ -50,13 +56,13 @@ const ( ) func (db *DB) getCollection(program string, primussType PrimussType) *mongo.Collection { - return db.Client.Database(databaseName(db.semester)).Collection(fmt.Sprintf("%s_%s", primussType, program)) + return db.Client.Database(db.databaseName).Collection(fmt.Sprintf("%s_%s", primussType, program)) } func (db *DB) getCollectionSemester(collectionName string) *mongo.Collection { - return db.Client.Database(databaseName(db.semester)).Collection(collectionName) + return db.Client.Database(db.databaseName).Collection(collectionName) } func (db *DB) getCollectionSemesterFromContext(ctx context.Context) *mongo.Collection { - return db.Client.Database(databaseName(db.semester)).Collection(ctx.Value(CollectionName("collectionName")).(string)) + return db.Client.Database(db.databaseName).Collection(ctx.Value(CollectionName("collectionName")).(string)) } diff --git a/db/constraints.go b/db/constraints.go index 2d4d717..11b7f5a 100644 --- a/db/constraints.go +++ b/db/constraints.go @@ -26,7 +26,7 @@ func (db *DB) NotPlannedByMe(ctx context.Context, ancode int) (bool, error) { constraint.NotPlannedByMe = true - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) if update { _, err = collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: ancode}}, constraint) } else { @@ -54,7 +54,7 @@ func (db *DB) Online(ctx context.Context, ancode int) (bool, error) { constraint.Online = true - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) if update { _, err = collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: ancode}}, constraint) } else { @@ -82,7 +82,7 @@ func (db *DB) ExcludeDays(ctx context.Context, ancode int, days []*time.Time) (b constraint.ExcludeDays = days - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) if update { _, err = collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: ancode}}, constraint) @@ -111,7 +111,7 @@ func (db *DB) PossibleDays(ctx context.Context, ancode int, days []*time.Time) ( constraint.PossibleDays = days - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) if update { _, err = collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: ancode}}, constraint) @@ -157,7 +157,7 @@ func (db *DB) SameSlot(ctx context.Context, ancode int, ancodes []int) (bool, er sort.Ints(list) constraint.SameSlot = list - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) if update { _, err = collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: ancode}}, constraint) } else { @@ -188,7 +188,7 @@ func (db *DB) PlacesWithSockets(ctx context.Context, ancode int) (bool, error) { constraint.RoomConstraints.PlacesWithSocket = true - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) if update { _, err = collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: ancode}}, constraint) } else { @@ -219,7 +219,7 @@ func (db *DB) Lab(ctx context.Context, ancode int) (bool, error) { constraint.RoomConstraints.Lab = true - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) if update { _, err = collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: ancode}}, constraint) } else { @@ -250,7 +250,7 @@ func (db *DB) ExahmRooms(ctx context.Context, ancode int) (bool, error) { constraint.RoomConstraints.ExahmRooms = true - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) if update { _, err = collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: ancode}}, constraint) } else { @@ -281,7 +281,7 @@ func (db *DB) SafeExamBrowser(ctx context.Context, ancode int) (bool, error) { constraint.RoomConstraints.Seb = true - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) if update { _, err = collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: ancode}}, constraint) } else { @@ -295,7 +295,7 @@ func (db *DB) SafeExamBrowser(ctx context.Context, ancode int) (bool, error) { } func (db *DB) GetConstraintsForAncode(ctx context.Context, ancode int) (*model.Constraints, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) var constraint model.Constraints res := collection.FindOne(ctx, bson.D{{Key: "ancode", Value: ancode}}) @@ -313,7 +313,7 @@ func (db *DB) GetConstraintsForAncode(ctx context.Context, ancode int) (*model.C } func (db *DB) GetConstraints(ctx context.Context) ([]*model.Constraints, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionConstraints) + collection := db.Client.Database(db.databaseName).Collection(collectionConstraints) constraints := make([]*model.Constraints, 0) diff --git a/db/database.go b/db/database.go index 3bcf434..ba83afa 100644 --- a/db/database.go +++ b/db/database.go @@ -41,7 +41,7 @@ func (db *DB) AllSemesterNames() ([]*model.Semester, error) { } func (db *DB) SaveSemesterConfig(ctx context.Context, semesterConfig *model.SemesterConfig) error { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameSemesterConfig) + collection := db.Client.Database(db.databaseName).Collection(collectionNameSemesterConfig) err := collection.Drop(ctx) if err != nil { diff --git a/db/exam.go b/db/exam.go index 1c99c3a..c0a0ecf 100644 --- a/db/exam.go +++ b/db/exam.go @@ -2,17 +2,16 @@ package db import ( "context" - "fmt" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" ) +// Deprecated: rm me func (db *DB) AddAdditionalExam(ctx context.Context, exam model.AdditionalExamInput) (bool, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameAdditionalExams) + collection := db.Client.Database(db.databaseName).Collection(collectionNameAdditionalExams) _, err := collection.InsertOne(ctx, exam) if err != nil { return false, err @@ -21,8 +20,9 @@ func (db *DB) AddAdditionalExam(ctx context.Context, exam model.AdditionalExamIn return true, nil } +// Deprecated: rm me func (db *DB) AdditionalExams(ctx context.Context) ([]*model.AdditionalExam, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameAdditionalExams) + collection := db.Client.Database(db.databaseName).Collection(collectionNameAdditionalExams) exams := make([]*model.AdditionalExam, 0) @@ -58,7 +58,7 @@ func (db *DB) AdditionalExams(ctx context.Context) ([]*model.AdditionalExam, err } func (db *DB) ExamsAlreadyPrepared(ctx context.Context) bool { - collection := db.Client.Database(databaseName(db.semester)).Collection("exams") + collection := db.Client.Database(db.databaseName).Collection("exams") docsCount, err := collection.CountDocuments(ctx, bson.D{}) if err != nil { @@ -68,131 +68,28 @@ func (db *DB) ExamsAlreadyPrepared(ctx context.Context) bool { return docsCount != 0 } -func (db *DB) AddExam(ctx context.Context, exam *model.Exam) error { - collection := db.Client.Database(databaseName(db.semester)).Collection("exams") +// func (db *DB) AddExam(ctx context.Context, exam *model.Exam) error { +// collection := db.Client.Database(db.databaseName).Collection("exams") - result := collection.FindOne(ctx, bson.D{{Key: "ancode", Value: exam.AnCode}}) - if result.Err() == nil { - log.Error().Int("ancode", exam.AnCode).Msg("cannot add exam, exam with ancode already in db") - return fmt.Errorf("cannot add exam, exam with ancode %d already in db", exam.AnCode) - } - - if result.Err() == mongo.ErrNoDocuments { - _, err := collection.InsertOne(ctx, exam) - if err != nil { - return err - } - return nil - } - - return result.Err() -} - -func (db *DB) SaveConnectedExam(ctx context.Context, exam *model.ConnectedExam) error { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameConnectedExams) - - _, err := collection.InsertOne(ctx, exam) - if err != nil { - log.Error().Err(err). - Str("collectionName", collectionNameConnectedExams). - Msg("cannot insert exams") - return err - } - - return nil -} - -func (db *DB) SaveConnectedExams(ctx context.Context, exams []*model.ConnectedExam) error { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameConnectedExams) - - err := collection.Drop(ctx) - if err != nil { - log.Error().Err(err). - Str("collectionName", collectionNameConnectedExams). - Msg("cannot drop collection") - return err - } - - examsToInsert := make([]interface{}, 0, len(exams)) - for _, exam := range exams { - examsToInsert = append(examsToInsert, exam) - } - - _, err = collection.InsertMany(ctx, examsToInsert) - if err != nil { - log.Error().Err(err). - Str("collectionName", collectionNameConnectedExams). - Msg("cannot insert exams") - return err - } - - return nil -} +// result := collection.FindOne(ctx, bson.D{{Key: "ancode", Value: exam.AnCode}}) +// if result.Err() == nil { +// log.Error().Int("ancode", exam.AnCode).Msg("cannot add exam, exam with ancode already in db") +// return fmt.Errorf("cannot add exam, exam with ancode %d already in db", exam.AnCode) +// } -func (db *DB) ReplaceConnectedExam(ctx context.Context, exam *model.ConnectedExam) error { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameConnectedExams) +// if result.Err() == mongo.ErrNoDocuments { +// _, err := collection.InsertOne(ctx, exam) +// if err != nil { +// return err +// } +// return nil +// } - _, err := collection.ReplaceOne(ctx, bson.D{{Key: "zpaexam.ancode", Value: exam.ZpaExam.AnCode}}, exam) - if err != nil { - log.Error().Err(err).Int("zpaexam.ancode", exam.ZpaExam.AnCode).Msg("cannot replace connected exam") - return err - } - - return nil -} - -func (db *DB) GetConnectedExam(ctx context.Context, ancode int) (*model.ConnectedExam, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameConnectedExams) - - var result model.ConnectedExam - err := collection.FindOne(ctx, bson.D{{Key: "zpaexam.ancode", Value: ancode}}).Decode(&result) - if err != nil { - log.Error().Err(err).Str("semester", db.semester). - Int("ancode", ancode).Msg("cannot find Connected exam") - return nil, err - } - - return &result, nil -} - -func (db *DB) GetConnectedExams(ctx context.Context) ([]*model.ConnectedExam, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameConnectedExams) - - exams := make([]*model.ConnectedExam, 0) - - findOptions := options.Find() - findOptions.SetSort(bson.D{{Key: "zpaexam.ancode", Value: 1}}) - - cur, err := collection.Find(ctx, bson.M{}, findOptions) - if err != nil { - log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionNameConnectedExams).Msg("MongoDB Find") - return exams, err - } - defer cur.Close(ctx) - - for cur.Next(ctx) { - var exam model.ConnectedExam - - err := cur.Decode(&exam) - if err != nil { - log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionNameConnectedExams).Interface("cur", cur). - Msg("Cannot decode to additional exam") - return exams, err - } - - exams = append(exams, &exam) - } - - if err := cur.Err(); err != nil { - log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionNameConnectedExams).Msg("Cursor returned error") - return exams, err - } - - return exams, nil -} +// return result.Err() +// } func (db *DB) SaveExamsWithRegs(ctx context.Context, exams []*model.ExamWithRegs) error { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameExamsWithRegs) + collection := db.Client.Database(db.databaseName).Collection(collectionNameExamsWithRegs) err := collection.Drop(ctx) if err != nil { @@ -219,7 +116,7 @@ func (db *DB) SaveExamsWithRegs(ctx context.Context, exams []*model.ExamWithRegs } func (db *DB) ExamWithRegs(ctx context.Context, ancode int) (*model.ExamWithRegs, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameExamsWithRegs) + collection := db.Client.Database(db.databaseName).Collection(collectionNameExamsWithRegs) res := collection.FindOne(ctx, bson.D{{Key: "ancode", Value: ancode}}) if res.Err() != nil { @@ -237,7 +134,7 @@ func (db *DB) ExamWithRegs(ctx context.Context, ancode int) (*model.ExamWithRegs } func (db *DB) ExamsWithRegs(ctx context.Context) ([]*model.ExamWithRegs, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameExamsWithRegs) + collection := db.Client.Database(db.databaseName).Collection(collectionNameExamsWithRegs) exams := make([]*model.ExamWithRegs, 0) diff --git a/db/exam_cache.go b/db/exam_cache.go new file mode 100644 index 0000000..2de4c10 --- /dev/null +++ b/db/exam_cache.go @@ -0,0 +1,61 @@ +package db + +import ( + "context" + + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" +) + +func (db *DB) CacheExam(ctx context.Context, exam *model.Exam) error { + collection := db.Client.Database(db.databaseName).Collection(collectionCachedExams) + + res, err := collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: exam.Ancode}}, exam, options.Replace().SetUpsert(true)) + + log.Debug().Interface("res", res).Msg("replaced") + + return err +} + +func (db *DB) CachedExam(ctx context.Context, ancode int) (*model.Exam, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionCachedExams) + + res := collection.FindOne(ctx, bson.D{{Key: "ancode", Value: ancode}}) + if res.Err() == mongo.ErrNoDocuments { + return nil, nil + } + + var exam model.Exam + + err := res.Decode(&exam) + + return &exam, err +} + +func (db *DB) CachedExams(ctx context.Context) ([]*model.Exam, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionCachedExams) + + cur, err := collection.Find(ctx, bson.M{}) + if err != nil { + log.Error().Err(err).Msg("cannot get cached exams") + return nil, err + } + defer cur.Close(ctx) + + exams := make([]*model.Exam, 0) + + err = cur.All(ctx, &exams) + if err != nil { + log.Error().Err(err).Msg("cannot decode cached exams") + return nil, err + } + + return exams, nil +} + +func (db *DB) RmCacheExams(ctx context.Context) error { + return db.Client.Database(db.databaseName).Collection(collectionCachedExams).Drop(ctx) +} diff --git a/db/exam_connected.go b/db/exam_connected.go new file mode 100644 index 0000000..bdeb28d --- /dev/null +++ b/db/exam_connected.go @@ -0,0 +1,199 @@ +package db + +import ( + "context" + + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo/options" +) + +type PrimussExam struct { + Ancode int `bson:"ancode"` + Program string `bson:"program"` +} + +type ConnectedExam struct { + ZpaExam int `bson:"zpaExamAncode"` + PrimussExams []*PrimussExam `bson:"primussExamsAncodes"` + OtherPrimussExams []*PrimussExam `bson:"otherPrimussExamsAncodes"` + Errors []string `bson:"errors"` +} + +func (db *DB) SaveConnectedExam(ctx context.Context, exam *model.ConnectedExam) error { + collection := db.Client.Database(db.databaseName).Collection(collectionNameConnectedExams) + + _, err := collection.InsertOne(ctx, exam) + if err != nil { + log.Error().Err(err). + Str("collectionName", collectionNameConnectedExams). + Msg("cannot insert exams") + return err + } + + return nil +} + +func (db *DB) SaveConnectedExams(ctx context.Context, exams []*model.ConnectedExam) error { + collection := db.Client.Database(db.databaseName).Collection(collectionNameConnectedExams) + + err := collection.Drop(ctx) + if err != nil { + log.Error().Err(err). + Str("collectionName", collectionNameConnectedExams). + Msg("cannot drop collection") + return err + } + + examsToInsert := make([]interface{}, 0, len(exams)) + for _, exam := range exams { + examsToInsert = append(examsToInsert, db.modelConnectedExamToConnectedExam(exam)) + } + + _, err = collection.InsertMany(ctx, examsToInsert) + if err != nil { + log.Error().Err(err). + Str("collectionName", collectionNameConnectedExams). + Msg("cannot insert exams") + return err + } + + return nil +} + +func (db *DB) ReplaceConnectedExam(ctx context.Context, exam *model.ConnectedExam) error { + collection := db.Client.Database(db.databaseName).Collection(collectionNameConnectedExams) + + connectedExam := db.modelConnectedExamToConnectedExam(exam) + _, err := collection.ReplaceOne(ctx, bson.D{{Key: "zpaExamAncode", Value: exam.ZpaExam.AnCode}}, connectedExam) + if err != nil { + log.Error().Err(err).Int("zpaexam.ancode", exam.ZpaExam.AnCode).Msg("cannot replace connected exam") + return err + } + + return nil +} + +func (db *DB) GetConnectedExam(ctx context.Context, ancode int) (*model.ConnectedExam, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionNameConnectedExams) + + var result ConnectedExam + err := collection.FindOne(ctx, bson.D{{Key: "zpaExamAncode", Value: ancode}}).Decode(&result) + if err != nil { + log.Error().Err(err).Str("semester", db.semester). + Int("ancode", ancode).Msg("cannot find Connected exam") + return nil, err + } + + connectedExam, err := db.connectedExamToModelConnectedExam(ctx, &result) + if err != nil { + log.Error().Err(err).Int("ancode", result.ZpaExam).Msg("cannot get connected exam") + } + + return connectedExam, nil +} + +func (db *DB) GetConnectedExams(ctx context.Context) ([]*model.ConnectedExam, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionNameConnectedExams) + + exams := make([]*ConnectedExam, 0) + + findOptions := options.Find() + findOptions.SetSort(bson.D{{Key: "zpaExamAncode", Value: 1}}) + + cur, err := collection.Find(ctx, bson.M{}, findOptions) + if err != nil { + log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionNameConnectedExams).Msg("MongoDB Find") + return nil, err + } + defer cur.Close(ctx) + + err = cur.All(ctx, &exams) + + if err != nil { + log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionNameConnectedExams).Msg("Cursor returned error") + return nil, err + } + + if exams == nil { + return nil, nil + } + + connectedExams := make([]*model.ConnectedExam, 0, len(exams)) + for _, exam := range exams { + connectedExam, err := db.connectedExamToModelConnectedExam(ctx, exam) + if err != nil { + log.Error().Err(err).Int("ancode", exam.ZpaExam).Msg("cannot get connected exam") + } + connectedExams = append(connectedExams, connectedExam) + } + + return connectedExams, nil +} + +func (db *DB) modelConnectedExamToConnectedExam(exam *model.ConnectedExam) *ConnectedExam { + var primussExamsAncodes []*PrimussExam + if exam.PrimussExams != nil && len(exam.PrimussExams) > 0 { + primussExamsAncodes = make([]*PrimussExam, 0, len(exam.PrimussExams)) + for _, primussExam := range exam.PrimussExams { + primussExamsAncodes = append(primussExamsAncodes, &PrimussExam{ + Ancode: primussExam.AnCode, + Program: primussExam.Program, + }) + } + } + + var otherPrimussExamsAncodes []*PrimussExam + if exam.OtherPrimussExams != nil && len(exam.OtherPrimussExams) > 0 { + otherPrimussExamsAncodes = make([]*PrimussExam, 0, len(exam.OtherPrimussExams)) + for _, otherPrimussExam := range exam.OtherPrimussExams { + otherPrimussExamsAncodes = append(otherPrimussExamsAncodes, &PrimussExam{ + Ancode: otherPrimussExam.AnCode, + Program: otherPrimussExam.Program, + }) + } + } + + return &ConnectedExam{ + ZpaExam: exam.ZpaExam.AnCode, + PrimussExams: primussExamsAncodes, + OtherPrimussExams: otherPrimussExamsAncodes, + Errors: exam.Errors, + } +} + +func (db *DB) connectedExamToModelConnectedExam(ctx context.Context, exam *ConnectedExam) (*model.ConnectedExam, error) { + zpaExam, err := db.GetZpaExamByAncode(ctx, exam.ZpaExam) + if err != nil { + log.Error().Err(err).Int("ancode", exam.ZpaExam).Msg("cannot get zpa exam") + return nil, err + } + + var primussExams []*model.PrimussExam + for _, exam := range exam.PrimussExams { + primussExam, err := db.GetPrimussExam(ctx, exam.Program, exam.Ancode) + if err != nil { + log.Error().Err(err).Int("ancode", exam.Ancode).Str("program", exam.Program).Msg("cannot get primuss exam") + return nil, err + } + primussExams = append(primussExams, primussExam) + } + + var otherPrimussExams []*model.PrimussExam + for _, exam := range exam.OtherPrimussExams { + primussExam, err := db.GetPrimussExam(ctx, exam.Program, exam.Ancode) + if err != nil { + log.Error().Err(err).Int("ancode", exam.Ancode).Str("program", exam.Program).Msg("cannot get primuss exam") + return nil, err + } + otherPrimussExams = append(otherPrimussExams, primussExam) + } + + return &model.ConnectedExam{ + ZpaExam: zpaExam, + PrimussExams: primussExams, + OtherPrimussExams: otherPrimussExams, + Errors: exam.Errors, + }, nil +} diff --git a/db/examgroup.go b/db/examgroup.go index cd7d7be..aee136c 100644 --- a/db/examgroup.go +++ b/db/examgroup.go @@ -10,7 +10,7 @@ import ( ) func (db *DB) GetNextExamGroupCode(ctx context.Context) (int, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameExamGroups) + collection := db.Client.Database(db.databaseName).Collection(collectionNameExamGroups) filter := bson.D{} opts := options.Find().SetSort(bson.D{{Key: "examgroupcode", Value: -1}}).SetLimit(1) @@ -39,7 +39,7 @@ func (db *DB) GetNextExamGroupCode(ctx context.Context) (int, error) { } func (db *DB) SaveExamGroups(ctx context.Context, exams []*model.ExamGroup) error { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameExamGroups) + collection := db.Client.Database(db.databaseName).Collection(collectionNameExamGroups) err := collection.Drop(ctx) if err != nil { @@ -66,7 +66,7 @@ func (db *DB) SaveExamGroups(ctx context.Context, exams []*model.ExamGroup) erro } func (db *DB) ExamGroup(ctx context.Context, examGroupCode int) (*model.ExamGroup, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameExamGroups) + collection := db.Client.Database(db.databaseName).Collection(collectionNameExamGroups) res := collection.FindOne(ctx, bson.D{{Key: "examgroupcode", Value: examGroupCode}}) if res.Err() != nil { @@ -102,7 +102,7 @@ func (db *DB) GetExamGroupForAncode(ctx context.Context, ancode int) (*model.Exa } func (db *DB) ExamGroups(ctx context.Context) ([]*model.ExamGroup, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameExamGroups) + collection := db.Client.Database(db.databaseName).Collection(collectionNameExamGroups) examGroups := make([]*model.ExamGroup, 0) diff --git a/db/external_exam.go b/db/external_exam.go new file mode 100644 index 0000000..15d2168 --- /dev/null +++ b/db/external_exam.go @@ -0,0 +1,40 @@ +package db + +import ( + "context" + + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" + "go.mongodb.org/mongo-driver/bson" +) + +func (db *DB) AddExternalExam(ctx context.Context, exam *model.ExternalExam) error { + collection := db.Client.Database(db.databaseName).Collection(collectionNameExternalExams) + _, err := collection.InsertOne(ctx, exam) + if err != nil { + log.Error().Err(err).Interface("exam", exam). + Msg("cannot insert external exam to database") + } + + return err +} + +func (db *DB) ExternalExams(ctx context.Context) ([]*model.ExternalExam, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionNameExternalExams) + + cur, err := collection.Find(ctx, bson.M{}) + if err != nil { + log.Error().Err(err).Msg("cannot get external exams") + return nil, err + } + defer cur.Close(ctx) + + var result []*model.ExternalExam + err = cur.All(ctx, &result) + if err != nil { + log.Error().Err(err).Msg("cannot decode external exams") + return nil, err + } + + return result, nil +} diff --git a/db/generatedExams.go b/db/generatedExams.go new file mode 100644 index 0000000..1f2a5a7 --- /dev/null +++ b/db/generatedExams.go @@ -0,0 +1,95 @@ +package db + +import ( + "context" + + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" + "go.mongodb.org/mongo-driver/bson" +) + +func (db *DB) CacheGeneratedExams(ctx context.Context, exams []*model.GeneratedExam) error { + collection := db.Client.Database(db.databaseName).Collection(collectionGeneratedExams) + + err := collection.Drop(ctx) + if err != nil { + log.Error().Err(err).Str("collection", collectionGeneratedExams).Msg("cannot drop collection") + return err + } + + examsIntf := make([]interface{}, 0, len(exams)) + for _, exam := range exams { + examsIntf = append(examsIntf, exam) + } + + res, err := collection.InsertMany(ctx, examsIntf) + if err != nil { + log.Error().Err(err).Str("collection", collectionGeneratedExams).Msg("cannot insert generated exams") + return err + } + + log.Debug().Int("count", len(res.InsertedIDs)).Msg("successfully inserted generated exams") + return nil +} + +func (db *DB) GetGeneratedExams(ctx context.Context) ([]*model.GeneratedExam, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionGeneratedExams) + + cur, err := collection.Find(ctx, bson.M{}) + if err != nil { + log.Error().Err(err).Msg("cannot get generated exams") + return nil, err + } + defer cur.Close(ctx) + + exams := make([]*model.GeneratedExam, 0) + + err = cur.All(ctx, &exams) + if err != nil { + log.Error().Err(err).Msg("cannot decode generated exams") + return nil, err + } + + return exams, nil +} + +func (db *DB) GetGeneratedExamsForExamer(ctx context.Context, examerID int) ([]*model.GeneratedExam, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionGeneratedExams) + + cur, err := collection.Find(ctx, bson.D{{Key: "zpaexam.mainexamerid", Value: examerID}}) + if err != nil { + log.Error().Err(err).Msg("cannot get generated exams") + return nil, err + } + defer cur.Close(ctx) + + exams := make([]*model.GeneratedExam, 0) + + err = cur.All(ctx, &exams) + if err != nil { + log.Error().Err(err).Msg("cannot decode generated exams") + return nil, err + } + + return exams, nil +} + +func (db *DB) GetGeneratedExam(ctx context.Context, ancode int) (*model.GeneratedExam, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionGeneratedExams) + + res := collection.FindOne(ctx, bson.D{{Key: "ancode", Value: ancode}}) + if res.Err() != nil { + log.Error().Err(res.Err()).Int("ancode", ancode).Msg("cannot get generated exam") + return nil, res.Err() + } + + var exam *model.GeneratedExam + + err := res.Decode(&exam) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get generated exam") + return nil, err + } + + return exam, nil +} diff --git a/db/invigilation.go b/db/invigilation.go index 420141f..04e3d73 100644 --- a/db/invigilation.go +++ b/db/invigilation.go @@ -121,6 +121,61 @@ func (db *DB) invigilationsForInvigilator(ctx context.Context, collectionName st return invigilations, nil } +func (db *DB) GetAllInvigilations(ctx context.Context) ([]*model.Invigilation, error) { + selfInvigilations, err := db.GetSelfInvigilations(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get self invigilations") + return nil, err + } + otherInvigilations, err := db.GetOtherInvigilations(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get other invigilations") + return nil, err + } + + return append(selfInvigilations, otherInvigilations...), nil +} + +func (db *DB) GetSelfInvigilations(ctx context.Context) ([]*model.Invigilation, error) { + collection := db.getCollectionSemester(collectionSelfInvigilations) + + cur, err := collection.Find(ctx, bson.M{}) + if err != nil { + log.Error().Err(err).Msg("cannot get invgilations") + return nil, err + } + defer cur.Close(ctx) + + invigilations := make([]*model.Invigilation, 0) + err = cur.All(ctx, &invigilations) + if err != nil { + log.Error().Err(err).Msg("cannot get decode invgilations") + return nil, err + } + + return invigilations, nil +} + +func (db *DB) GetOtherInvigilations(ctx context.Context) ([]*model.Invigilation, error) { + collection := db.getCollectionSemester(collectionOtherInvigilations) + + cur, err := collection.Find(ctx, bson.M{}) + if err != nil { + log.Error().Err(err).Msg("cannot get invgilations") + return nil, err + } + defer cur.Close(ctx) + + invigilations := make([]*model.Invigilation, 0) + err = cur.All(ctx, &invigilations) + if err != nil { + log.Error().Err(err).Msg("cannot get decode invgilations") + return nil, err + } + + return invigilations, nil +} + func (db *DB) AddInvigilation(ctx context.Context, room string, day, slot, invigilatorID int) error { collection := db.getCollectionSemester(collectionOtherInvigilations) @@ -181,10 +236,12 @@ func (db *DB) AddInvigilation(ctx context.Context, room string, day, slot, invig func (db *DB) getMaxDurationForRoomInSlot(ctx context.Context, roomname string, day, slot int) int { maxDuration := 0 - plannedRooms, _ := db.RoomsPlannedInSlot(ctx, day, slot) - for _, room := range plannedRooms { - if roomname == room.RoomName && maxDuration < room.Duration { - maxDuration = room.Duration + examsInSlot, _ := db.GetExamsInSlot(ctx, day, slot) + for _, exam := range examsInSlot { + for _, room := range exam.PlannedRooms { + if roomname == room.RoomName && maxDuration < room.Duration { + maxDuration = room.Duration + } } } diff --git a/db/invigilator.go b/db/invigilator.go index d1df239..4f3d50c 100644 --- a/db/invigilator.go +++ b/db/invigilator.go @@ -2,6 +2,7 @@ package db import ( "context" + "fmt" "github.com/obcode/plexams.go/graph/model" "github.com/obcode/plexams.go/zpa" @@ -74,3 +75,49 @@ func (db *DB) getInvigilatorForRoom(ctx context.Context, collectionName, name st return db.GetTeacher(ctx, invigilation.InvigilatorID) } + +func (db *DB) CacheInvigilatorTodos(ctx context.Context, todos *model.InvigilationTodos) error { + collection := db.Client.Database(db.databaseName).Collection(collectionInvigilatorTodos) + + err := collection.Drop(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot drop invigilator todos collection") + return err + } + _, err = collection.InsertOne(ctx, todos) + if err != nil { + log.Error().Err(err).Msg("cannot cache invigilator todos") + return err + } + + return err +} + +func (db *DB) GetInvigilationTodos(ctx context.Context) (*model.InvigilationTodos, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionInvigilatorTodos) + + cur, err := collection.Find(ctx, bson.M{}) + if err != nil { + log.Error().Err(err).Msg("cannot find invigilator todos") + return nil, err + } + + todos := make([]*model.InvigilationTodos, 0) + + err = cur.All(ctx, &todos) + if err != nil { + log.Error().Err(err).Msg("cannot decode invigilator todos") + return nil, err + } + + if len(todos) == 0 { + return nil, nil + } + if len(todos) > 1 { + err := fmt.Errorf("found more than one todo") + log.Error().Err(err).Msg("cannot decode invigilator todos") + return nil, err + } + + return todos[0], nil +} diff --git a/db/log.go b/db/log.go index 6b7df14..d5ce8e0 100644 --- a/db/log.go +++ b/db/log.go @@ -9,7 +9,7 @@ import ( ) func (db *DB) Log(ctx context.Context, subj, msg string) error { - collection := db.Client.Database(databaseName(db.semester)).Collection("log") + collection := db.Client.Database(db.databaseName).Collection("log") doc := bson.D{ {Key: "created", Value: time.Now()}, diff --git a/db/mongo.go b/db/mongo.go index cc3f568..482f673 100644 --- a/db/mongo.go +++ b/db/mongo.go @@ -4,17 +4,19 @@ import ( "context" "strings" + "github.com/rs/zerolog/log" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/readpref" ) type DB struct { - Client *mongo.Client - semester string + Client *mongo.Client + semester string + databaseName string } -func NewDB(uri, semester string) (*DB, error) { +func NewDB(uri, semester string, dbName *string) (*DB, error) { client, err := mongo.Connect(context.Background(), options.Client().ApplyURI(uri)) if err != nil { return nil, err @@ -24,16 +26,20 @@ func NewDB(uri, semester string) (*DB, error) { return nil, err } + databaseName := strings.Replace(semester, " ", "-", 1) + if dbName != nil { + databaseName = *dbName + } + + log.Debug().Str("database name", databaseName).Msg("using database") + return &DB{ - Client: client, - semester: semester, + Client: client, + semester: semester, + databaseName: databaseName, }, nil } -func databaseName(semester string) string { - return strings.Replace(semester, " ", "-", 1) -} - func semesterName(semester string) string { return strings.Replace(semester, "-", " ", 1) } diff --git a/db/nta.go b/db/nta.go index 784b3c4..144b725 100644 --- a/db/nta.go +++ b/db/nta.go @@ -6,6 +6,7 @@ import ( "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" ) @@ -21,6 +22,25 @@ func (db *DB) AddNta(ctx context.Context, nta *model.NTA) (*model.NTA, error) { return nta, nil // FIXME: return NTA from DB? } +func (db *DB) Nta(ctx context.Context, mtknr string) (*model.NTA, error) { + collection := db.Client.Database("plexams").Collection(collectionNameNTAs) + + res := collection.FindOne(ctx, bson.D{{Key: "mtknr", Value: mtknr}}) + if res.Err() == mongo.ErrNoDocuments { + return nil, nil + } + + var nta *model.NTA + + err := res.Decode(&nta) + if err != nil { + log.Error().Err(res.Err()).Str("mtknr", mtknr).Msg("error while finding nta") + return nil, err + } + + return nta, nil +} + func (db *DB) Ntas(ctx context.Context) ([]*model.NTA, error) { collection := db.Client.Database("plexams").Collection(collectionNameNTAs) @@ -44,20 +64,47 @@ func (db *DB) Ntas(ctx context.Context) ([]*model.NTA, error) { return ntas, nil } -func (db *DB) NtasWithRegs(ctx context.Context) ([]*model.NTAWithRegs, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameNTAs) +func (db *DB) SetSemesterOnNTAs(ctx context.Context, studentRegs []interface{}) error { + collection := db.Client.Database("plexams").Collection(collectionNameNTAs) + + for _, regRaw := range studentRegs { + reg := regRaw.(*model.Student) + if reg.Nta == nil { + continue + } + + res := collection.FindOneAndUpdate(ctx, bson.D{{Key: "mtknr", Value: reg.Mtknr}}, + bson.M{"$set": bson.M{"lastSemester": db.semester}}) + + if res.Err() != nil { + if res.Err() == mongo.ErrNoDocuments { + log.Error().Err(res.Err()).Str("mtknr", reg.Mtknr).Msg("nta with mtknr not found") + } else { + log.Error().Err(res.Err()).Str("mtknr", reg.Mtknr).Msg("error when setting semester on nta") + return res.Err() + } + } else { + log.Debug().Str("mtknr", reg.Mtknr).Str("last semester", db.semester).Msg("last semester set on nta") + } + } + + return nil +} + +func (db *DB) NtasWithRegs(ctx context.Context) ([]*model.Student, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionStudentRegsPerStudentPlanned) findOptions := options.Find() findOptions.SetSort(bson.D{{Key: "nta.name", Value: 1}}) - cur, err := collection.Find(ctx, bson.M{}, findOptions) + cur, err := collection.Find(ctx, bson.D{{Key: "nta", Value: bson.D{{Key: "$ne", Value: nil}}}}, findOptions) if err != nil { log.Error().Err(err).Str("collection", "nta").Msg("MongoDB Find") return nil, err } defer cur.Close(ctx) - ntas := make([]*model.NTAWithRegs, 0) + ntas := make([]*model.Student, 0) err = cur.All(ctx, &ntas) if err != nil { log.Error().Err(err).Str("collection", collectionNameNTAs).Msg("Cannot decode to rooms") @@ -67,8 +114,9 @@ func (db *DB) NtasWithRegs(ctx context.Context) ([]*model.NTAWithRegs, error) { return ntas, nil } -func (db *DB) Nta(ctx context.Context, mtknr string) (*model.NTAWithRegs, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameNTAs) +// // Deprecated: remove me +func (db *DB) NtaWithRegs(ctx context.Context, mtknr string) (*model.NTAWithRegs, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionNameNTAs) var nta model.NTAWithRegs res := collection.FindOne(ctx, bson.D{{Key: "nta.mtknr", Value: mtknr}}) @@ -85,8 +133,9 @@ func (db *DB) Nta(ctx context.Context, mtknr string) (*model.NTAWithRegs, error) return &nta, nil } +// // Deprecated: remove me func (db *DB) SaveSemesterNTAs(ctx context.Context, ntaWithRegs []*model.NTAWithRegs) error { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNameNTAs) + collection := db.Client.Database(db.databaseName).Collection(collectionNameNTAs) err := collection.Drop(ctx) if err != nil { @@ -110,7 +159,7 @@ func (db *DB) SaveSemesterNTAs(ctx context.Context, ntaWithRegs []*model.NTAWith } for _, nta := range ntaWithRegs { - err := db.setCurrentSemesterOnNTA(ctx, nta.Nta.Mtknr) + err := db.SetCurrentSemesterOnNTA(ctx, nta.Nta.Mtknr) if err != nil { return err } @@ -119,7 +168,8 @@ func (db *DB) SaveSemesterNTAs(ctx context.Context, ntaWithRegs []*model.NTAWith return nil } -func (db *DB) setCurrentSemesterOnNTA(ctx context.Context, mtknr string) error { +// TODO: when to call? +func (db *DB) SetCurrentSemesterOnNTA(ctx context.Context, mtknr string) error { collection := db.Client.Database("plexams").Collection(collectionNameNTAs) filter := bson.D{{Key: "mtknr", Value: mtknr}} diff --git a/db/plan.go b/db/plan.go index c26eaf9..cf142bd 100644 --- a/db/plan.go +++ b/db/plan.go @@ -11,54 +11,50 @@ import ( "go.mongodb.org/mongo-driver/mongo" ) -func (db *DB) AddExamGroupToSlot(ctx context.Context, dayNumber int, timeNumber int, examGroupCode int) (bool, error) { - if db.ExamGroupIsLocked(ctx, examGroupCode) { - return false, fmt.Errorf("exam group %d is locked", examGroupCode) +func (db *DB) AddExamToSlot(ctx context.Context, planEntry *model.PlanEntry) (bool, error) { + if db.ExamGroupIsLocked(ctx, planEntry.Ancode) { + return false, fmt.Errorf("exam %d is locked", planEntry.Ancode) } - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlan) + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) - _, err := collection.DeleteMany(ctx, bson.D{{Key: "examgroupcode", Value: examGroupCode}}) + _, err := collection.DeleteMany(ctx, bson.D{{Key: "ancode", Value: planEntry.Ancode}}) if err != nil { - log.Error().Err(err).Int("day", dayNumber).Int("time", timeNumber).Int("examGroupCode", examGroupCode). - Msg("cannot rm exam group from plan") + log.Error().Err(err).Int("day", planEntry.DayNumber).Int("time", planEntry.SlotNumber).Int("ancode", planEntry.Ancode). + Msg("cannot rm exam from plan") return false, err } - _, err = collection.InsertOne(ctx, &model.PlanEntry{ - DayNumber: dayNumber, - SlotNumber: timeNumber, - ExamGroupCode: examGroupCode, - }) + _, err = collection.InsertOne(ctx, planEntry) if err != nil { - log.Error().Err(err).Int("day", dayNumber).Int("time", timeNumber).Int("examGroupCode", examGroupCode). - Msg("cannot add exam group to slot") + log.Error().Err(err).Int("day", planEntry.DayNumber).Int("time", planEntry.SlotNumber).Int("ancode", planEntry.Ancode). + Msg("cannot add exam to slot") return false, err } return true, nil } -func (db *DB) RmExamGroupFromSlot(ctx context.Context, examGroupCode int) (bool, error) { - if db.ExamGroupIsLocked(ctx, examGroupCode) { - return false, fmt.Errorf("exam group %d is locked", examGroupCode) +func (db *DB) RmExamGroupFromSlot(ctx context.Context, ancode int) (bool, error) { + if db.ExamGroupIsLocked(ctx, ancode) { + return false, fmt.Errorf("exam %d is locked", ancode) } - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlan) + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) - _, err := collection.DeleteMany(ctx, bson.D{{Key: "examgroupcode", Value: examGroupCode}}) + _, err := collection.DeleteMany(ctx, bson.D{{Key: "ancode", Value: ancode}}) if err != nil { - log.Error().Err(err).Int("examGroupCode", examGroupCode). - Msg("cannot rm exam group from plan") + log.Error().Err(err).Int("ancode", ancode). + Msg("cannot rm exam from plan") return false, err } return true, nil } -func (db *DB) ExamGroupsInSlot(ctx context.Context, day int, time int) ([]*model.ExamGroup, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlan) +func (db *DB) GetExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExam, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) filter := bson.M{ "$and": []bson.M{ @@ -74,39 +70,47 @@ func (db *DB) ExamGroupsInSlot(ctx context.Context, day int, time int) ([]*model defer cur.Close(ctx) planEntries := make([]*model.PlanEntry, 0) - for cur.Next(ctx) { - var planEntry model.PlanEntry - err := cur.Decode(&planEntry) - if err != nil { - log.Error().Err(err).Str("collection", collectionNamePlan).Interface("cur", cur). - Msg("Cannot decode to nta") - return nil, err - } - - planEntries = append(planEntries, &planEntry) - } - - if err := cur.Err(); err != nil { - log.Error().Err(err).Str("collection", collectionNamePlan).Msg("Cursor returned error") + err = cur.All(ctx, &planEntries) + if err != nil { + log.Error().Err(err).Str("collection", collectionNamePlan).Interface("cur", cur). + Msg("Cannot decode to nta") return nil, err } - examGroups := make([]*model.ExamGroup, 0, len(planEntries)) + exams := make([]*model.PlannedExam, 0, len(planEntries)) for _, planEntry := range planEntries { - examGroup, err := db.ExamGroup(ctx, planEntry.ExamGroupCode) + exam, err := db.GetGeneratedExam(ctx, planEntry.Ancode) if err != nil { - log.Error().Err(err).Int("examGroupCode", planEntry.ExamGroupCode).Msg("cannot get exam group") - return examGroups, err + log.Error().Err(err).Int("ancode", planEntry.Ancode).Msg("cannot get exam") + return nil, err } - examGroups = append(examGroups, examGroup) - } - return examGroups, nil + rooms, err := db.PlannedRoomsForAncode(ctx, planEntry.Ancode) + if err != nil { + log.Error().Err(err).Int("ancode", planEntry.Ancode).Msg("cannot get rooms") + return nil, err + } + + exams = append(exams, &model.PlannedExam{ + Ancode: exam.Ancode, + ZpaExam: exam.ZpaExam, + PrimussExams: exam.PrimussExams, + Constraints: exam.Constraints, + Conflicts: exam.Conflicts, + StudentRegsCount: exam.StudentRegsCount, + Ntas: exam.Ntas, + MaxDuration: exam.MaxDuration, + PlanEntry: planEntry, + PlannedRooms: rooms, + }) + } + + return exams, nil } func (db *DB) PlanEntries(ctx context.Context) ([]*model.PlanEntry, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlan) + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) cur, err := collection.Find(ctx, bson.M{}) if err != nil { @@ -116,24 +120,61 @@ func (db *DB) PlanEntries(ctx context.Context) ([]*model.PlanEntry, error) { defer cur.Close(ctx) planEntries := make([]*model.PlanEntry, 0) - for cur.Next(ctx) { - var planEntry model.PlanEntry + err = cur.All(ctx, &planEntries) + if err != nil { + log.Error().Err(err).Str("collection", collectionNamePlan). + Msg("Cannot decode to plan entries") + return nil, err + } - err := cur.Decode(&planEntry) - if err != nil { - log.Error().Err(err).Str("collection", collectionNamePlan).Interface("cur", cur). - Msg("Cannot decode to plan entry") - return nil, err - } + return planEntries, nil +} - planEntries = append(planEntries, &planEntry) +func (db *DB) PlannedAncodes(ctx context.Context) ([]*model.PlanEntry, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) + cur, err := collection.Find(ctx, bson.M{}) + if err != nil { + log.Error().Err(err).Str("collection", collectionNamePlan).Msg("cannot get plan ancode entries") + return nil, err + } + defer cur.Close(ctx) + + planEntries := make([]*model.PlanEntry, 0) + err = cur.All(ctx, &planEntries) + if err != nil { + log.Error().Err(err).Str("collection", collectionNamePlan).Msg("cannot decode plan ancode entries") + return nil, err } return planEntries, nil } +func (db *DB) PlanEntry(ctx context.Context, ancode int) (*model.PlanEntry, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) + + res := collection.FindOne(ctx, bson.D{{Key: "ancode", Value: ancode}}) + if res.Err() != nil { + if res.Err() == mongo.ErrNoDocuments { + return nil, nil + } + log.Error().Err(res.Err()).Str("collection", collectionNamePlan).Msg("MongoDB Find") + return nil, res.Err() + } + var entry model.PlanEntry + + err := res.Decode(&entry) + if err != nil { + log.Error().Err(err).Str("collection", collectionNamePlan). + Msg("Cannot decode to plan entry") + return nil, err + } + + return &entry, nil +} + +// Deprecated: rm me func (db *DB) PlanEntryForExamGroup(ctx context.Context, examGroupCode int) (*model.PlanEntry, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlan) + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) res := collection.FindOne(ctx, bson.D{{Key: "examgroupcode", Value: examGroupCode}}) if res.Err() != nil { @@ -156,17 +197,15 @@ func (db *DB) PlanEntryForExamGroup(ctx context.Context, examGroupCode int) (*mo } func (db *DB) AncodesInPlan(ctx context.Context) ([]int, error) { - examGroups, err := db.ExamGroups(ctx) + exams, err := db.GetGeneratedExams(ctx) if err != nil { - log.Error().Err(err).Msg("cannot get exam groups") + log.Error().Err(err).Msg("cannot get exams") } - ancodes := make([]int, 0) + ancodes := make([]int, 0, len(exams)) - for _, group := range examGroups { - for _, exam := range group.Exams { - ancodes = append(ancodes, exam.Exam.Ancode) - } + for _, exam := range exams { + ancodes = append(ancodes, exam.Ancode) } sort.Ints(ancodes) @@ -174,27 +213,26 @@ func (db *DB) AncodesInPlan(ctx context.Context) ([]int, error) { } func (db *DB) ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error) { - examGroups, err := db.ExamGroups(ctx) + exams, err := db.GetGeneratedExams(ctx) if err != nil { log.Error().Err(err).Msg("cannot get exam groups") } examerMap := make(map[string][]int) - for _, group := range examGroups { - EXAMLOOP: - for _, exam := range group.Exams { - examer, ok := examerMap[exam.Exam.ZpaExam.MainExamer] - if !ok { - examerMap[exam.Exam.ZpaExam.MainExamer] = []int{exam.Exam.ZpaExam.MainExamerID} - } else { - for _, examerID := range examer { - if examerID == exam.Exam.ZpaExam.MainExamerID { - continue EXAMLOOP - } + +EXAMLOOP: + for _, exam := range exams { + examer, ok := examerMap[exam.ZpaExam.MainExamer] + if !ok { + examerMap[exam.ZpaExam.MainExamer] = []int{exam.ZpaExam.MainExamerID} + } else { + for _, examerID := range examer { + if examerID == exam.ZpaExam.MainExamerID { + continue EXAMLOOP } - examer = append(examer, exam.Exam.ZpaExam.MainExamerID) - examerMap[exam.Exam.ZpaExam.MainExamer] = examer } + examer = append(examer, exam.ZpaExam.MainExamerID) + examerMap[exam.ZpaExam.MainExamer] = examer } } @@ -218,7 +256,8 @@ func (db *DB) ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error) { return examer, nil } -func (db *DB) PlanAncodeEntries(ctx context.Context) ([]*model.PlanAncodeEntry, error) { +// Deprecated: rm me +func (db *DB) PlanAncodeEntries(ctx context.Context) ([]*model.PlanEntry, error) { examGroups, err := db.ExamGroups(ctx) if err != nil { log.Error().Err(err).Msg("cannot get exam groups") @@ -234,14 +273,14 @@ func (db *DB) PlanAncodeEntries(ctx context.Context) ([]*model.PlanAncodeEntry, log.Error().Err(err).Msg("cannot get plan entries") } - planAncodeEntries := make([]*model.PlanAncodeEntry, 0) + planAncodeEntries := make([]*model.PlanEntry, 0) for _, planEntry := range planEntries { - examGroup, ok := examGroupMap[planEntry.ExamGroupCode] + examGroup, ok := examGroupMap[planEntry.Ancode] if !ok { - log.Error().Int("exam group code", planEntry.ExamGroupCode).Msg("exam group not found") + log.Error().Int("exam group code", planEntry.Ancode).Msg("exam group not found") } for _, exam := range examGroup.Exams { - planAncodeEntries = append(planAncodeEntries, &model.PlanAncodeEntry{ + planAncodeEntries = append(planAncodeEntries, &model.PlanEntry{ DayNumber: planEntry.DayNumber, SlotNumber: planEntry.SlotNumber, Ancode: exam.Exam.Ancode, @@ -251,57 +290,63 @@ func (db *DB) PlanAncodeEntries(ctx context.Context) ([]*model.PlanAncodeEntry, return planAncodeEntries, nil } -func (db *DB) LockExamGroup(ctx context.Context, examGroupCode int) (*model.PlanEntry, error) { - _, err := db.PlanEntryForExamGroup(ctx, examGroupCode) +func (db *DB) LockExam(ctx context.Context, ancode int) (*model.PlanEntry, error) { + _, err := db.PlanEntry(ctx, ancode) if err != nil { - log.Error().Err(err).Int("exam group code", examGroupCode). + log.Error().Err(err).Int("ancodecode", ancode). Msg("cannot find plan entry") return nil, err } - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlan) + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) - filter := bson.D{{Key: "examgroupcode", Value: examGroupCode}} + filter := bson.D{{Key: "ancode", Value: ancode}} update := bson.D{{Key: "$set", Value: bson.D{{Key: "locked", Value: true}}}} _, err = collection.UpdateOne(ctx, filter, update) if err != nil { - log.Error().Err(err).Int("examgroupcode", examGroupCode). - Msg("cannot lock exam group to slot") + log.Error().Err(err).Int("ancode", ancode). + Msg("cannot lock exam to slot") return nil, err } - return db.PlanEntryForExamGroup(ctx, examGroupCode) + return db.PlanEntry(ctx, ancode) } -func (db *DB) UnlockExamGroup(ctx context.Context, examGroupCode int) (*model.PlanEntry, error) { - _, err := db.PlanEntryForExamGroup(ctx, examGroupCode) +func (db *DB) UnlockExam(ctx context.Context, ancode int) (*model.PlanEntry, error) { + _, err := db.PlanEntry(ctx, ancode) if err != nil { - log.Error().Err(err).Int("exam group code", examGroupCode). + log.Error().Err(err).Int("ancode", ancode). Msg("cannot find plan entry") return nil, err } - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlan) + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) - filter := bson.D{{Key: "examgroupcode", Value: examGroupCode}} + filter := bson.D{{Key: "ancode", Value: ancode}} update := bson.D{{Key: "$set", Value: bson.D{{Key: "locked", Value: false}}}} _, err = collection.UpdateOne(ctx, filter, update) if err != nil { - log.Error().Err(err).Int("examgroupcode", examGroupCode). - Msg("cannot unlock exam group") + log.Error().Err(err).Int("ancode", ancode). + Msg("cannot unlock exam ") return nil, err } - return db.PlanEntryForExamGroup(ctx, examGroupCode) + return db.PlanEntry(ctx, ancode) +} + +func (db *DB) ExamIsLocked(ctx context.Context, ancode int) bool { + p, err := db.PlanEntry(ctx, ancode) + return err == nil && p != nil && p.Locked } +// Deprecated: rm me func (db *DB) ExamGroupIsLocked(ctx context.Context, examGroupCode int) bool { p, err := db.PlanEntryForExamGroup(ctx, examGroupCode) return err == nil && p != nil && p.Locked } func (db *DB) RemoveUnlockedExamGroupsFromPlan(ctx context.Context) (int, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlan) + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) res, err := collection.DeleteMany(ctx, bson.D{{Key: "locked", Value: false}}) @@ -316,7 +361,7 @@ func (db *DB) RemoveUnlockedExamGroupsFromPlan(ctx context.Context) (int, error) } func (db *DB) LockPlan(ctx context.Context) error { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlan) + collection := db.Client.Database(db.databaseName).Collection(collectionNamePlan) res, err := collection.UpdateMany(ctx, bson.D{}, bson.D{{Key: "$set", Value: bson.D{{Key: "locked", Value: true}}}}) @@ -344,13 +389,13 @@ func (db *DB) SavePlanEntriesToBackup(ctx context.Context, planEntries []*model. func (db *DB) savePlanEntries(ctx context.Context, planEntries []*model.PlanEntry, backup bool) error { var collection *mongo.Collection if backup { - collection = db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlanBackup) + collection = db.Client.Database(db.databaseName).Collection(collectionNamePlanBackup) err := collection.Drop(ctx) if err != nil { log.Error().Err(err).Msg("cannot drop backup collection") } } else { - collection = db.Client.Database(databaseName(db.semester)).Collection(collectionNamePlan) + collection = db.Client.Database(db.databaseName).Collection(collectionNamePlan) } entries := make([]interface{}, 0, len(planEntries)) diff --git a/db/plannedExams.go b/db/plannedExams.go index 0c16821..e4042eb 100644 --- a/db/plannedExams.go +++ b/db/plannedExams.go @@ -8,6 +8,7 @@ import ( "go.mongodb.org/mongo-driver/bson" ) +// Deprecated: rm me func (db *DB) ExamsInSlot(ctx context.Context, day int, time int) ([]*model.ExamInPlan, error) { collection := db.getCollectionSemester(collectionExamsInPlan) @@ -34,6 +35,7 @@ func (db *DB) ExamsInSlot(ctx context.Context, day int, time int) ([]*model.Exam return exams, nil } +// Deprecated: rm me func (db *DB) PlannedExamsByMainExamer(ctx context.Context, examerID int) ([]*model.ExamInPlan, error) { collection := db.getCollectionSemester(collectionExamsInPlan) @@ -55,3 +57,5 @@ func (db *DB) PlannedExamsByMainExamer(ctx context.Context, examerID int) ([]*mo return exams, nil } + +// func (db *DB) diff --git a/db/prepare_studentregs.go b/db/prepare_studentregs.go index dce6602..30c68d4 100644 --- a/db/prepare_studentregs.go +++ b/db/prepare_studentregs.go @@ -8,6 +8,7 @@ import ( "github.com/rs/zerolog/log" ) +// Deprecated: rm me part of generated exams func (db *DB) SaveStudentRegsPerAncode(ctx context.Context, studentRegsPerAncode map[int]map[string][]*model.StudentReg, all bool) error { ancodes := make([]int, 0, len(studentRegsPerAncode)) for ancode := range studentRegsPerAncode { @@ -44,7 +45,7 @@ func (db *DB) SaveStudentRegsPerAncode(ctx context.Context, studentRegsPerAncode collectionName = collectionStudentRegsPerAncodeAll } - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionName) + collection := db.Client.Database(db.databaseName).Collection(collectionName) err := collection.Drop(ctx) if err != nil { @@ -63,6 +64,7 @@ func (db *DB) SaveStudentRegsPerAncode(ctx context.Context, studentRegsPerAncode return nil } +// Deprecated: rm me func (db *DB) SaveStudentRegsPerStudent(ctx context.Context, studentRegsPerStudent map[string][]*model.StudentReg, all bool) error { studentRegsSlice := make([]interface{}, 0) @@ -73,6 +75,8 @@ func (db *DB) SaveStudentRegsPerStudent(ctx context.Context, studentRegsPerStude ancodes = append(ancodes, reg.AnCode) } + sort.Ints(ancodes) + studentRegsSlice = append(studentRegsSlice, &model.StudentRegsPerStudent{ Student: &model.Student{ Mtknr: mtknr, @@ -90,7 +94,7 @@ func (db *DB) SaveStudentRegsPerStudent(ctx context.Context, studentRegsPerStude collectionName = collectionStudentRegsPerStudentAll } - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionName) + collection := db.Client.Database(db.databaseName).Collection(collectionName) err := collection.Drop(ctx) if err != nil { @@ -108,3 +112,23 @@ func (db *DB) SaveStudentRegsPerStudent(ctx context.Context, studentRegsPerStude return nil } + +func (db *DB) SaveStudentRegs(ctx context.Context, studentRegs []interface{}) error { + collection := db.Client.Database(db.databaseName).Collection(collectionStudentRegsPerStudentPlanned) + + err := collection.Drop(ctx) + if err != nil { + log.Error().Err(err).Str("collectionName", collectionStudentRegsPerStudentPlanned). + Msg("error while trying to drop the collection") + return err + } + + _, err = collection.InsertMany(ctx, studentRegs) + if err != nil { + log.Error().Err(err).Str("collectionName", collectionStudentRegsPerStudentPlanned). + Msg("error while trying to insert") + return err + } + + return nil +} diff --git a/db/primuss.go b/db/primuss.go index 1641b36..588e17b 100644 --- a/db/primuss.go +++ b/db/primuss.go @@ -5,12 +5,15 @@ import ( "sort" "strings" + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo/options" ) func (db *DB) GetPrograms(ctx context.Context) ([]string, error) { - collectionNames, err := db.Client.Database(databaseName(db.semester)).ListCollectionNames(ctx, + collectionNames, err := db.Client.Database(db.databaseName).ListCollectionNames(ctx, bson.D{primitive.E{ Key: "name", Value: bson.D{ @@ -30,3 +33,77 @@ func (db *DB) GetPrograms(ctx context.Context) ([]string, error) { return programs, err } + +func (db *DB) AddAncode(ctx context.Context, zpaAncode int, program string, primussAncode int) error { + collection := db.Client.Database(db.databaseName).Collection(collectionPrimussAncodes) + + opts := options.Replace().SetUpsert(true) + + _, err := collection.ReplaceOne(ctx, bson.M{"ancode": zpaAncode, "primussancode.program": program}, + model.AddedPrimussAncode{ + Ancode: zpaAncode, + PrimussAncode: model.ZPAPrimussAncodes{ + Program: program, + Ancode: primussAncode, + }, + }, opts) + + if err != nil { + log.Error().Err(err).Int("zpaAncode", zpaAncode).Str("program", program).Int("primussAncode", primussAncode). + Msg("cannot add primuss ancode for zpa ancode") + return err + } + return nil +} + +func (db *DB) GetAddedAncodes(ctx context.Context) (map[int][]model.ZPAPrimussAncodes, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionPrimussAncodes) + + cur, err := collection.Find(ctx, bson.M{}) + if err != nil { + log.Error().Err(err).Msg("cannot get added ancodes") + return nil, err + } + + var addedAncodes []model.AddedPrimussAncode + err = cur.All(ctx, &addedAncodes) + if err != nil { + log.Error().Err(err).Msg("cannot decode added ancodes") + return nil, err + } + + addedAcodesMap := make(map[int][]model.ZPAPrimussAncodes) + for _, addedAncode := range addedAncodes { + addedAncodeEntries, ok := addedAcodesMap[addedAncode.Ancode] + if !ok { + addedAncodeEntries = make([]model.ZPAPrimussAncodes, 0, 1) + } + addedAcodesMap[addedAncode.Ancode] = append(addedAncodeEntries, addedAncode.PrimussAncode) + } + + return addedAcodesMap, nil +} + +func (db *DB) GetAddedAncodesForAncode(ctx context.Context, ancode int) ([]model.ZPAPrimussAncodes, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionPrimussAncodes) + + cur, err := collection.Find(ctx, bson.D{{Key: "ancode", Value: ancode}}) + if err != nil { + log.Error().Err(err).Msg("cannot get added ancodes") + return nil, err + } + + var addedAncodes []model.AddedPrimussAncode + err = cur.All(ctx, &addedAncodes) + if err != nil { + log.Error().Err(err).Msg("cannot decode added ancodes") + return nil, err + } + + added := make([]model.ZPAPrimussAncodes, 0, len(addedAncodes)) + for _, addedAncode := range addedAncodes { + added = append(added, addedAncode.PrimussAncode) + } + + return added, nil +} diff --git a/db/primuss_conflicts.go b/db/primuss_conflicts.go index bb36fb6..425bdad 100644 --- a/db/primuss_conflicts.go +++ b/db/primuss_conflicts.go @@ -2,6 +2,7 @@ package db import ( "context" + "sort" "strconv" "github.com/obcode/plexams.go/graph/model" @@ -38,11 +39,17 @@ func (db *DB) GetPrimussConflictsForAncode(ctx context.Context, program string, return nil, err } + keys := make([]int, 0, len(conflicts.Conflicts)) + for k := range conflicts.Conflicts { + keys = append(keys, k) + } + sort.Ints(keys) + conflictsSlice := make([]*model.Conflict, 0) - for k, v := range conflicts.Conflicts { + for _, k := range keys { conflictsSlice = append(conflictsSlice, &model.Conflict{ AnCode: k, - NumberOfStuds: v, + NumberOfStuds: conflicts.Conflicts[k], }) } diff --git a/db/primuss_exam.go b/db/primuss_exam.go index 94fac60..54b630a 100644 --- a/db/primuss_exam.go +++ b/db/primuss_exam.go @@ -90,11 +90,31 @@ func (db *DB) GetPrimussExams(ctx context.Context) ([]*model.PrimussExamByProgra for _, program := range programs { exams, err := db.getPrimussExams(ctx, program) if err != nil { - return primussExams, err + return nil, err } + + examsWithCount := make([]*model.PrimussExamWithCount, 0, len(exams)) + for _, exam := range exams { + sum, err := db.GetStudentRegsCount(ctx, program, exam.AnCode) + if err != nil { + log.Error().Err(err).Str("program", program).Int("ancode", exam.AnCode). + Msg("cannot get student regs sum") + } + + examsWithCount = append(examsWithCount, &model.PrimussExamWithCount{ + Ancode: exam.AnCode, + Module: exam.Module, + MainExamer: exam.MainExamer, + Program: exam.Program, + ExamType: exam.ExamType, + Presence: exam.Presence, + StudentRegsCount: sum, + }) + } + primussExams = append(primussExams, &model.PrimussExamByProgram{ Program: program, - Exams: exams, + Exams: examsWithCount, }) } @@ -116,20 +136,9 @@ func (db *DB) getPrimussExams(ctx context.Context, program string) ([]*model.Pri } defer cur.Close(ctx) - for cur.Next(ctx) { - var exam model.PrimussExam + err = cur.All(ctx, &exams) - err := cur.Decode(&exam) - if err != nil { - log.Error().Err(err).Str("semester", db.semester).Str("program", program).Interface("cur", cur). - Msg("Cannot decode to exam") - return exams, err - } - - exams = append(exams, &exam) - } - - if err := cur.Err(); err != nil { + if err != nil { log.Error().Err(err).Str("semester", db.semester).Str("program", program).Msg("Cursor returned error") return exams, err } diff --git a/db/primuss_studentregs.go b/db/primuss_studentregs.go index 18505e7..9a80416 100644 --- a/db/primuss_studentregs.go +++ b/db/primuss_studentregs.go @@ -7,15 +7,32 @@ import ( "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" ) func (db *DB) GetPrimussStudentRegsForProgrammAncode(ctx context.Context, program string, ancode int) ([]*model.StudentReg, error) { - studentRegs, err := db.GetPrimussStudentRegsPerAncode(ctx, program) + collection := db.getCollection(program, StudentRegs) + + findOptions := options.Find() + findOptions.SetSort(bson.D{{Key: "name", Value: 1}}) + + cur, err := collection.Find(ctx, bson.D{{Key: "AnCode", Value: ancode}}, findOptions) if err != nil { + log.Error().Err(err).Int("ancode", ancode).Str("program", program).Msg("MongoDB Find (studentregs)") return nil, err } + defer cur.Close(ctx) + + var studentRegs []*model.StudentReg - return studentRegs[ancode], nil + err = cur.All(ctx, &studentRegs) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Str("program", program).Msg("cannot decode to studentregs") + return nil, err + } + + return studentRegs, nil } func (db *DB) GetPrimussStudentRegsPerAncode(ctx context.Context, program string) (map[int][]*model.StudentReg, error) { @@ -50,7 +67,7 @@ func (db *DB) GetPrimussStudentRegsPerAncode(ctx context.Context, program string } for k, v := range studentRegs { - if !db.checkStudentRegsCount(ctx, program, k, len(v)) { + if !db.CheckStudentRegsCount(ctx, program, k, len(v)) { return nil, fmt.Errorf("problem with studentregs, ancode = %d, #studentregs = %d", k, len(v)) } } @@ -167,7 +184,7 @@ type Count struct { Sum int `bson:"Sum"` } -func (db *DB) checkStudentRegsCount(ctx context.Context, program string, ancode, studentRegsCount int) bool { +func (db *DB) CheckStudentRegsCount(ctx context.Context, program string, ancode, studentRegsCount int) bool { // log.Debug().Str("collectionName", collectionName).Int("ancode", ancode).Int("studentRegsCount", studentRegsCount). // Msg("checking count") collection := db.getCollection(program, Counts) @@ -187,6 +204,25 @@ func (db *DB) checkStudentRegsCount(ctx context.Context, program string, ancode, return true } +func (db *DB) GetStudentRegsCount(ctx context.Context, program string, ancode int) (int, error) { + // log.Debug().Str("collectionName", collectionName).Int("ancode", ancode).Int("studentRegsCount", studentRegsCount). + // Msg("checking count") + collection := db.getCollection(program, Counts) + var result Count + res := collection.FindOne(ctx, bson.D{{Key: "AnCo", Value: ancode}, {Key: "Sum", Value: bson.D{{Key: "$ne", Value: ""}}}}) + if res.Err() == mongo.ErrNoDocuments { + return 0, nil + } + err := res.Decode(&result) + if err != nil { + log.Error().Err(err).Str("semester", db.semester).Str("program", program). + Int("ancode", ancode).Msg("error finding count") + return -1, err + } + + return result.Sum, nil +} + func (db *DB) ChangeAncodeInStudentRegsCount(ctx context.Context, program string, ancode, newAncode int) error { collection := db.getCollection(program, Counts) @@ -213,7 +249,7 @@ func (db *DB) ChangeAncodeInStudentRegsCount(ctx context.Context, program string func (db *DB) SetRegsWithErrors(ctx context.Context, regsWithErrors []*model.RegWithError) error { collectionName := "errors-zpa-studentregs" - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionName) + collection := db.Client.Database(db.databaseName).Collection(collectionName) err := collection.Drop(ctx) if err != nil { @@ -238,7 +274,7 @@ func (db *DB) SetRegsWithErrors(ctx context.Context, regsWithErrors []*model.Reg func (db *DB) GetRegsWithErrors(ctx context.Context) ([]*model.RegWithError, error) { collectionName := "errors-zpa-studentregs" - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionName) + collection := db.Client.Database(db.databaseName).Collection(collectionName) regWithErrors := make([]*model.RegWithError, 0) diff --git a/db/rooms.go b/db/rooms.go index bf060fd..af63a24 100644 --- a/db/rooms.go +++ b/db/rooms.go @@ -2,14 +2,41 @@ package db import ( "context" + "fmt" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" ) -func (db *DB) GlobalRooms(ctx context.Context) ([]*model.Room, error) { +func (db *DB) RoomFromName(ctx context.Context, roomName string) (*model.Room, error) { + collection := db.Client.Database("plexams").Collection(collectionRooms) + + res := collection.FindOne(ctx, bson.M{"name": roomName}) + if res.Err() != nil { + if res.Err() == mongo.ErrNoDocuments { + return nil, fmt.Errorf("cannot find room %s", roomName) + } + log.Error().Err(res.Err()).Str("room", roomName).Str("collection", collectionRooms). + Msg("cannot find room") + return nil, res.Err() + } + + var room model.Room + err := res.Decode(&room) + if err != nil { + log.Error().Err(res.Err()).Str("room", roomName).Str("collection", collectionRooms). + Msg("cannot decode room") + + return nil, err + } + + return &room, nil +} + +func (db *DB) Rooms(ctx context.Context) ([]*model.Room, error) { collection := db.Client.Database("plexams").Collection(collectionRooms) findOptions := options.Find() @@ -32,13 +59,8 @@ func (db *DB) GlobalRooms(ctx context.Context) ([]*model.Room, error) { return rooms, nil } -func (db *DB) Rooms(ctx context.Context) ([]*model.Room, error) { - - return nil, nil -} - func (db *DB) SaveRooms(ctx context.Context, slotsWithRooms []*model.SlotWithRooms) error { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionRooms) + collection := db.Client.Database(db.databaseName).Collection(collectionRooms) err := collection.Drop(ctx) if err != nil { @@ -177,7 +199,7 @@ func (db *DB) ChangeRoom(ctx context.Context, ancode int, oldRoom, newRoom *mode } func (db *DB) PlannedRoomNames(ctx context.Context) ([]string, error) { - collection := db.getCollectionSemester(collectionRoomsForExams) + collection := db.getCollectionSemester(collectionRoomsPlanned) rawNames, err := collection.Distinct(ctx, "roomname", bson.D{}) if err != nil { @@ -195,3 +217,138 @@ func (db *DB) PlannedRoomNames(ctx context.Context) ([]string, error) { return names, nil } + +func (db *DB) PlannedRoomNamesInSlot(ctx context.Context, day, slot int) ([]string, error) { + collection := db.getCollectionSemester(collectionRoomsPlanned) + + filter := bson.M{"day": day, "slot": slot} + + rawNames, err := collection.Distinct(ctx, "roomname", filter) + if err != nil { + log.Error().Err(err).Int("day", day).Int("slot", slot).Msg("cannot find roomnames for slot") + return nil, err + } + + names := make([]string, 0, len(rawNames)) + for _, rawName := range rawNames { + name, ok := rawName.(string) + if !ok { + log.Debug().Interface("raw name", rawName).Msg("cannot convert to string") + } + names = append(names, name) + } + + return names, nil +} + +func (db *DB) PlannedRooms(ctx context.Context) ([]*model.PlannedRoom, error) { + collection := db.getCollectionSemester(collectionRoomsPlanned) + + cur, err := collection.Find(ctx, bson.M{}) + if err != nil { + log.Error().Err(err).Msg("cannot find planned rooms") + return nil, err + } + + plannedRooms := make([]*model.PlannedRoom, 0) + err = cur.All(ctx, &plannedRooms) + if err != nil { + log.Error().Err(err).Msg("cannot decode planned rooms") + return nil, err + } + + return plannedRooms, nil +} + +func (db *DB) PlannedRoomsInSlot(ctx context.Context, day, slot int) ([]*model.PlannedRoom, error) { + collection := db.getCollectionSemester(collectionRoomsPlanned) + + filter := bson.M{"day": day, "slot": slot} + + cur, err := collection.Find(ctx, filter) + if err != nil { + log.Error().Err(err).Int("day", day).Int("slot", slot).Msg("cannot find rooms for slot") + return nil, err + } + + plannedRooms := make([]*model.PlannedRoom, 0) + err = cur.All(ctx, &plannedRooms) + if err != nil { + log.Error().Err(err).Int("day", day).Int("slot", slot).Msg("cannot decode rooms for slot") + return nil, err + } + + return plannedRooms, nil +} + +func (db *DB) PlannedRoomsForAncode(ctx context.Context, ancode int) ([]*model.PlannedRoom, error) { + collection := db.getCollectionSemester(collectionRoomsPlanned) + + filter := bson.M{"ancode": ancode} + + cur, err := collection.Find(ctx, filter) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("cannot find rooms for ancode") + return nil, err + } + + plannedRooms := make([]*model.PlannedRoom, 0) + err = cur.All(ctx, &plannedRooms) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("cannot decode rooms for ancode") + return nil, err + } + + return plannedRooms, nil +} + +func (db *DB) ReplaceRoomsForNTA(ctx context.Context, plannedRooms []*model.PlannedRoom) error { + collection := db.getCollectionSemester(collectionRoomsPlanned) + + for _, room := range plannedRooms { + log.Debug().Int("day", room.Day).Int("slot", room.Slot).Int("ancode", room.Ancode). + Msg("replacing room") + + filter := bson.M{ + "$and": []bson.M{ + {"ancode": room.Ancode}, + {"ntamtknr": room.NtaMtknr}, + }, + } + opts := options.Replace().SetUpsert(true) + + _, err := collection.ReplaceOne(ctx, filter, room, opts) + + if err != nil { + log.Error().Err(err).Int("day", room.Day).Int("slot", room.Slot).Int("ancode", room.Ancode). + Msg("cannot replace room") + return err + } + } + + return nil +} + +func (db *DB) ReplaceNonNTARooms(ctx context.Context, plannedRooms []*model.PlannedRoom) error { + collection := db.getCollectionSemester(collectionRoomsPlanned) + + _, err := collection.DeleteMany(ctx, bson.M{"handicaproomalone": false}) + if err != nil { + log.Error().Err(err).Msg("cannot delete non NTA rooms") + return err + } + + roomsInterface := make([]interface{}, 0, len(plannedRooms)) + + for _, room := range plannedRooms { + roomsInterface = append(roomsInterface, room) + } + + _, err = collection.InsertMany(ctx, roomsInterface) + if err != nil { + log.Error().Err(err).Msg("cannot insert non NTA rooms") + return err + } + + return nil +} diff --git a/db/studentregs.go b/db/studentregs.go index 8dee194..2c817f2 100644 --- a/db/studentregs.go +++ b/db/studentregs.go @@ -2,14 +2,18 @@ package db import ( "context" + "sort" + set "github.com/deckarep/golang-set/v2" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo/options" ) func (db *DB) GetStudentRegsPerAncodePlanned(ctx context.Context) ([]*model.StudentRegsPerAncode, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionStudentRegsPerAncodePlanned) + collection := db.Client.Database(db.databaseName).Collection(collectionStudentRegsPerAncodePlanned) studentRegs := make([]*model.StudentRegsPerAncode, 0) @@ -41,17 +45,20 @@ func (db *DB) GetStudentRegsPerAncodePlanned(ctx context.Context) ([]*model.Stud return studentRegs, nil } -func (db *DB) StudentRegsPerStudentPlanned(ctx context.Context) ([]*model.StudentRegsPerStudent, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionStudentRegsPerStudentPlanned) +func (db *DB) StudentRegsPerStudentPlanned(ctx context.Context) ([]*model.Student, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionStudentRegsPerStudentPlanned) - cur, err := collection.Find(ctx, bson.M{}) + findOptions := options.Find() + findOptions.SetSort(bson.D{{Key: "name", Value: 1}}) + + cur, err := collection.Find(ctx, bson.M{}, findOptions) if err != nil { log.Error().Err(err).Str("semester", db.semester).Msg("MongoDB Find") return nil, err } defer cur.Close(ctx) - studentRegs := make([]*model.StudentRegsPerStudent, 0) + studentRegs := make([]*model.Student, 0) err = cur.All(ctx, &studentRegs) if err != nil { @@ -64,7 +71,7 @@ func (db *DB) StudentRegsPerStudentPlanned(ctx context.Context) ([]*model.Studen } func (db *DB) StudentRegsPerStudentAll(ctx context.Context) ([]*model.StudentRegsPerStudent, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionStudentRegsPerStudentAll) + collection := db.Client.Database(db.databaseName).Collection(collectionStudentRegsPerStudentAll) cur, err := collection.Find(ctx, bson.M{}) if err != nil { @@ -84,3 +91,141 @@ func (db *DB) StudentRegsPerStudentAll(ctx context.Context) ([]*model.StudentReg return studentRegs, nil } + +func (db *DB) StudentByMtknr(ctx context.Context, mtknr string, ntas map[string]*model.NTA) (*model.Student, error) { + collectionNames, err := db.studentRegsCollectionNames(ctx) + + if err != nil { + log.Error().Err(err).Msg("cannot get student regs collections") + return nil, err + } + + var student *model.Student + + for _, collectionName := range collectionNames { + log.Debug().Str("collection", collectionName).Str("mtkntr", mtknr). + Msg("searching for student in collection") + + collection := db.Client.Database(db.databaseName).Collection(collectionName) + + cur, err := collection.Find(ctx, bson.D{{Key: "MTKNR", Value: mtknr}}) + if err != nil { + log.Error().Err(err).Str("collection", collectionName).Str("mtkntr", mtknr). + Msg("error while searching for student in collection") + } + defer cur.Close(ctx) + + var results []*model.StudentReg + + err = cur.All(ctx, &results) + if err != nil { + log.Error().Err(err).Str("collection", collectionName).Str("mtkntr", mtknr). + Msg("error while decoding student from collection") + } + + if len(results) > 0 { + log.Debug().Interface("regs", results).Str("collection", collectionName).Str("mtkntr", mtknr). + Msg("found regs for student") + + var regs []int + + if student != nil && (student.Program != results[0].Program || + student.Group != results[0].Group || + student.Name != results[0].Name) { + log.Error().Str("collection", collectionName).Str("mtkntr", mtknr). + Msg("found student in more than one programs") + } + + if student != nil { + regs = student.Regs + } else { + regs = make([]int, 0, len(results)) + } + + for _, res := range results { + regs = append(regs, res.AnCode) + } + + sort.Ints(regs) + + var nta *model.NTA + + if ntas == nil { + nta, err = db.Nta(ctx, mtknr) + if err != nil { + log.Error().Err(err).Str("mtknr", mtknr).Msg("error while checking nta") + } + } else { + nta = ntas[mtknr] + } + + student = &model.Student{ + Mtknr: mtknr, + Program: results[0].Program, + Group: results[0].Group, + Name: results[0].Name, + Regs: regs, + Nta: nta, + } + + } + + } + + return student, nil +} + +func (db *DB) StudentsByName(ctx context.Context, regex string) ([]*model.Student, error) { + collectionNames, err := db.studentRegsCollectionNames(ctx) + + if err != nil { + log.Error().Err(err).Msg("cannot get student regs collections") + return nil, err + } + + studentMtknrs := set.NewSet[string]() + + for _, collectionName := range collectionNames { + collection := db.Client.Database(db.databaseName).Collection(collectionName) + + cur, err := collection.Find(ctx, bson.D{{Key: "name", Value: bson.D{ + primitive.E{Key: "$regex", + Value: primitive.Regex{Pattern: regex}, + }}}}) + if err != nil { + log.Error().Err(err).Str("collection", collectionName).Str("regex", regex). + Msg("error while searching for student in collection") + } + defer cur.Close(ctx) + + for cur.Next(ctx) { + mtknr := cur.Current.Lookup("MTKNR").StringValue() + studentMtknrs.Add(mtknr) + } + } + + students := make([]*model.Student, 0, studentMtknrs.Cardinality()) + + for _, mtknr := range studentMtknrs.ToSlice() { + student, err := db.StudentByMtknr(ctx, mtknr, nil) + if err != nil { + log.Error().Err(err).Str("mtknr", mtknr).Msg("error while trying to get student") + } else { + students = append(students, student) + } + } + + return students, nil +} + +func (db *DB) studentRegsCollectionNames(ctx context.Context) ([]string, error) { + return db.Client.Database(db.databaseName).ListCollectionNames(ctx, + bson.D{primitive.E{ + Key: "name", + Value: bson.D{ + primitive.E{Key: "$regex", + Value: primitive.Regex{Pattern: "studentregs_..$"}, + }, + }, + }}) +} diff --git a/db/zpa.go b/db/zpa.go index 6ed8396..8503586 100644 --- a/db/zpa.go +++ b/db/zpa.go @@ -11,7 +11,7 @@ import ( ) func (db *DB) GetTeacher(ctx context.Context, id int) (*model.Teacher, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection("teachers") + collection := db.Client.Database(db.databaseName).Collection("teachers") var teacher model.Teacher @@ -43,7 +43,7 @@ func isInvigilator(teacher model.Teacher, semester string) bool { } func (db *DB) getTeachers(ctx context.Context, predicate func(model.Teacher) bool) ([]*model.Teacher, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection("teachers") + collection := db.Client.Database(db.databaseName).Collection("teachers") teachers := make([]*model.Teacher, 0) @@ -78,7 +78,7 @@ func (db *DB) getTeachers(ctx context.Context, predicate func(model.Teacher) boo } func (db *DB) CacheTeachers(teachers []*model.Teacher, semester string) error { - collection := db.Client.Database(databaseName(semester)).Collection("teachers") + collection := db.Client.Database(db.databaseName).Collection("teachers") teachersIntf := make([]interface{}, 0, len(teachers)) diff --git a/db/zpa_exams.go b/db/zpa_exams.go index 40d10ba..9d81ba3 100644 --- a/db/zpa_exams.go +++ b/db/zpa_exams.go @@ -2,96 +2,18 @@ package db import ( "context" + "sort" "time" + set "github.com/deckarep/golang-set/v2" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo/options" ) -func (db *DB) GetZPAExamsToPlan(ctx context.Context) ([]*model.ZPAExam, error) { - ancodes, err := db.getZpaAnCodesFromCollection(ctx, collectionToPlan) - if err != nil { - return nil, err - } - - exams := make([]*model.ZPAExam, 0) - - for _, ancode := range ancodes { - exam, err := db.GetZpaExamByAncode(ctx, ancode.Ancode) - if err != nil { - log.Error().Err(err).Str("semester", db.semester). - Int("ancode", ancode.Ancode).Msg("zpa exam with ancode not found") - } else { - exams = append(exams, exam) - } - } - - return exams, nil -} - -func (db *DB) GetZPAExamsNotToPlan(ctx context.Context) ([]*model.ZPAExam, error) { - ancodes, err := db.getZpaAnCodesFromCollection(ctx, collectionNotToPlan) - if err != nil { - return nil, err - } - - exams := make([]*model.ZPAExam, 0) - - for _, ancode := range ancodes { - exam, err := db.GetZpaExamByAncode(ctx, ancode.Ancode) - if err != nil { - log.Error().Err(err).Str("semester", db.semester). - Int("ancode", ancode.Ancode).Msg("zpa exam with ancode not found") - } else { - exams = append(exams, exam) - } - } - - return exams, nil -} - -func (db *DB) GetZpaAncodesPlanned(ctx context.Context) ([]*model.AnCode, error) { - return db.getZpaAnCodesFromCollection(ctx, collectionToPlan) -} - -func (db *DB) getZpaAnCodesFromCollection(ctx context.Context, collectionName string) ([]*model.AnCode, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionName) - ancodes := make([]*model.AnCode, 0) - findOptions := options.Find() - findOptions.SetSort(bson.D{{Key: "ancode", Value: 1}}) - - cur, err := collection.Find(ctx, bson.M{}, findOptions) - if err != nil { - log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionName).Msg("MongoDB Find") - return ancodes, err - } - defer cur.Close(ctx) - - for cur.Next(ctx) { - var ancode model.AnCode - - err := cur.Decode(&ancode) - if err != nil { - log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionName).Interface("cur", cur). - Msg("Cannot decode to exam") - return ancodes, err - } - - ancodes = append(ancodes, &ancode) - } - - if err := cur.Err(); err != nil { - log.Error().Err(err).Str("semester", db.semester).Str("collection", collectionName).Msg("Cursor returned error") - return ancodes, err - } - - return ancodes, nil -} - func (db *DB) GetZPAExams(ctx context.Context) ([]*model.ZPAExam, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection(collectionAll) + collection := db.Client.Database(db.databaseName).Collection(collectionAll) exams := make([]*model.ZPAExam, 0) @@ -105,6 +27,12 @@ func (db *DB) GetZPAExams(ctx context.Context) ([]*model.ZPAExam, error) { } defer cur.Close(ctx) + addedAncodes, err := db.GetAddedAncodes(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get added ancodes") + return nil, err + } + for cur.Next(ctx) { var exam model.ZPAExam @@ -115,6 +43,19 @@ func (db *DB) GetZPAExams(ctx context.Context) ([]*model.ZPAExam, error) { return exams, err } + db.cleanupPrimussAncodes(&exam) + addedAncodesForAncode, ok := addedAncodes[exam.AnCode] + + if ok { + err := db.addAddedAncodesToExam(ctx, &exam, addedAncodesForAncode) + if err != nil { + log.Error().Err(err).Int("ancode", exam.AnCode). + Interface("added ancodes", addedAncodesForAncode). + Msg("error when trying to add added ancodes to exam") + return nil, err + } + } + exams = append(exams, &exam) } @@ -127,7 +68,7 @@ func (db *DB) GetZPAExams(ctx context.Context) ([]*model.ZPAExam, error) { } func (db *DB) GetZpaExamByAncode(ctx context.Context, ancode int) (*model.ZPAExam, error) { - collection := db.Client.Database(databaseName(db.semester)).Collection("zpaexams") + collection := db.Client.Database(db.databaseName).Collection("zpaexams") var result model.ZPAExam err := collection.FindOne(ctx, bson.D{{Key: "ancode", Value: ancode}}).Decode(&result) @@ -137,11 +78,27 @@ func (db *DB) GetZpaExamByAncode(ctx context.Context, ancode int) (*model.ZPAExa return nil, err } + db.cleanupPrimussAncodes(&result) + addedAncodes, err := db.GetAddedAncodesForAncode(ctx, result.AnCode) + if err != nil { + log.Error().Err(err).Str("semester", db.semester). + Int("ancode", ancode).Msg("cannot get added ancodes") + return nil, err + } + if addedAncodes != nil { + err := db.addAddedAncodesToExam(ctx, &result, addedAncodes) + if err != nil { + log.Error().Err(err).Str("semester", db.semester). + Int("ancode", ancode).Msg("cannot add added ancodes") + return nil, err + } + } + return &result, nil } func (db *DB) CacheZPAExams(exams []*model.ZPAExam) error { - collection := db.Client.Database(databaseName(db.semester)).Collection("zpaexams") + collection := db.Client.Database(db.databaseName).Collection("zpaexams") examsIntf := make([]interface{}, 0, len(exams)) @@ -166,105 +123,279 @@ func (db *DB) CacheZPAExams(exams []*model.ZPAExam) error { return nil } -func (db *DB) SetZPAExamsToPlan(ctx context.Context, exams []*model.ZPAExam) error { - return db.setZPAExams(ctx, exams, collectionToPlan) +type ExamToPlanType struct { + Ancode int + ToPlan bool } -func (db *DB) SetZPAExamsNotToPlan(ctx context.Context, exams []*model.ZPAExam) error { - return db.setZPAExams(ctx, exams, collectionNotToPlan) -} +func (db *DB) SetZPAExamsToPlan(ctx context.Context, examsToPlan, examsNotToPlan []*model.ZPAExam) error { + exams := make([]*ExamToPlanType, 0, len(examsToPlan)+len(examsNotToPlan)) -func (db *DB) setZPAExams(ctx context.Context, exams []*model.ZPAExam, toCollection string) error { - collection := db.Client.Database(databaseName(db.semester)).Collection(toCollection) + log.Debug().Interface("examsToPlan", examsToPlan).Interface("examsNotToPlan", examsNotToPlan).Msg("inserting exams to plan") - examsIntf := make([]interface{}, 0, len(exams)) + for _, examToPlan := range examsToPlan { + exams = append(exams, &ExamToPlanType{Ancode: examToPlan.AnCode, ToPlan: true}) + } - for _, v := range exams { - examsIntf = append(examsIntf, v) + for _, examNotToPlan := range examsNotToPlan { + exams = append(exams, &ExamToPlanType{Ancode: examNotToPlan.AnCode, ToPlan: false}) } + collection := db.Client.Database(db.databaseName).Collection(collectionToPlan) + err := collection.Drop(ctx) if err != nil { return err } + log.Debug().Interface("exams", exams).Msg("inserting exams to plan") + + examsIntf := make([]interface{}, 0, len(exams)) + for _, exam := range exams { + examsIntf = append(examsIntf, exam) + } + res, err := collection.InsertMany(ctx, examsIntf) if err != nil { return err } - log.Debug().Str("semester", db.semester).Str("collection", toCollection). - Int("documents", len(res.InsertedIDs)).Msg("inserted zpaexams") + log.Debug().Str("semester", db.semester).Str("collection", collectionToPlan). + Int("documents", len(res.InsertedIDs)).Msg("inserted zpaexams to plan and not to plan") return nil } -func (db *DB) AddZpaExamToPlan(ctx context.Context, ancode int, unknown bool) (bool, error) { - exam, err := db.GetZpaExamByAncode(ctx, ancode) +func (db *DB) AddZpaExamToPlan(ctx context.Context, ancode int) (bool, error) { + return db.addZpaExamToPlanOrNot(ctx, ancode, true) +} + +func (db *DB) RmZpaExamFromPlan(ctx context.Context, ancode int) (bool, error) { + return db.addZpaExamToPlanOrNot(ctx, ancode, false) +} + +func (db *DB) addZpaExamToPlanOrNot(ctx context.Context, ancode int, toPlan bool) (bool, error) { + collection := db.Client.Database(db.databaseName).Collection(collectionToPlan) + + replaceOptions := options.Replace() + replaceOptions.SetUpsert(true) + + res, err := collection.ReplaceOne(ctx, bson.D{{Key: "ancode", Value: ancode}}, + ExamToPlanType{Ancode: ancode, ToPlan: toPlan}, replaceOptions) + + log.Debug().Interface("res", res).Msg("changing exam to plan value") + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Bool("toPlan", toPlan).Msg("cannot replace exam to plan") return false, err } - // maybe rm exam from not to plan - if !unknown { - collectionNot := db.Client.Database(databaseName(db.semester)).Collection(collectionNotToPlan) + return true, nil +} - res, err := collectionNot.DeleteOne(ctx, bson.D{{Key: "ancode", Value: ancode}}) - if err != nil { - log.Error().Err(err).Str("semester", db.semester). - Int("ancode", ancode).Msg("cannot remove ZPA exam from not planned exams") - return false, err - } - if res.DeletedCount != 1 { - log.Error().Err(err).Str("semester", db.semester). - Int("ancode", ancode).Int64("deletedCount", res.DeletedCount).Msg("not removed exactly one ZPA exam from not planned exams") - } +func (db *DB) GetZPAExamsToPlan(ctx context.Context) ([]*model.ZPAExam, error) { + log.Debug().Msg("getting zpa exams to plan") + toPlan := true + return db.getZPAExamsPlannedOrNot(ctx, &toPlan) +} + +func (db *DB) GetZPAExamsNotToPlan(ctx context.Context) ([]*model.ZPAExam, error) { + log.Debug().Msg("getting zpa exams not to plan") + toPlan := false + return db.getZPAExamsPlannedOrNot(ctx, &toPlan) +} + +func (db *DB) GetZPAExamsPlannedOrNotPlanned(ctx context.Context) ([]*model.ZPAExam, error) { + return db.getZPAExamsPlannedOrNot(ctx, nil) +} + +func (db *DB) getZPAExamsPlannedOrNot(ctx context.Context, toPlan *bool) ([]*model.ZPAExam, error) { + log.Debug().Interface("toPlan", toPlan).Msg("getting zpam exams") + + ancodeSet, err := db.getZpaAncodesPlannedOrNot(ctx, toPlan) + if err != nil { + log.Error().Err(err).Msg("cannot get ancodes planned") + return nil, err } - // add exam to to plan - collectionTo := db.Client.Database(databaseName(db.semester)).Collection(collectionToPlan) + // log.Debug().Interface("ancodes", ancodeSet).Msg("got ancodes to plan") - _, err = collectionTo.InsertOne(ctx, exam) + zpaExams, err := db.GetZPAExams(ctx) if err != nil { - log.Error().Err(err).Str("semester", db.semester). - Int("ancode", ancode).Msg("cannot add ZPA exam to planned exams") - return false, err + log.Error().Err(err).Msg("cannot get zpa exams") + return nil, err } - return true, nil + addedAncodes, err := db.GetAddedAncodes(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get added ancodes") + return nil, err + } + + exams := make([]*model.ZPAExam, 0, (*ancodeSet).Cardinality()) + + for _, zpaExam := range zpaExams { + if (*ancodeSet).Contains(zpaExam.AnCode) { + db.cleanupPrimussAncodes(zpaExam) + addedAncodesForAncode, ok := addedAncodes[zpaExam.AnCode] + + if ok { + err := db.addAddedAncodesToExam(ctx, zpaExam, addedAncodesForAncode) + if err != nil { + log.Error().Err(err).Int("ancode", zpaExam.AnCode). + Interface("added ancodes", addedAncodesForAncode). + Msg("error when trying to add added ancodes to exam") + return nil, err + } + } + + exams = append(exams, zpaExam) + } + } + + // log.Debug().Interface("exams", exams).Msg("found exams to plan") + + return exams, nil +} + +func (db *DB) GetZpaAncodesPlanned(ctx context.Context) (*set.Set[int], error) { + toPlan := true + return db.getZpaAncodesPlannedOrNot(ctx, &toPlan) +} + +func (db *DB) GetZpaAncodesNotPlanned(ctx context.Context) (*set.Set[int], error) { + toPlan := false + return db.getZpaAncodesPlannedOrNot(ctx, &toPlan) +} + +func (db *DB) GetZpaAncodesPlannedOrNotPlanned(ctx context.Context) (*set.Set[int], error) { + return db.getZpaAncodesPlannedOrNot(ctx, nil) } -func (db *DB) RmZpaExamFromPlan(ctx context.Context, ancode int, unknown bool) (bool, error) { - exam, err := db.GetZpaExamByAncode(ctx, ancode) +func (db *DB) getZpaAncodesPlannedOrNot(ctx context.Context, toPlan *bool) (*set.Set[int], error) { + collection := db.Client.Database(db.databaseName).Collection(collectionToPlan) + + filter := bson.D{} + if toPlan != nil { + filter = bson.D{{Key: "toplan", Value: toPlan}} + } + + cur, err := collection.Find(ctx, filter) if err != nil { - return false, err + log.Error().Err(err).Interface("toPlan", toPlan).Msg("cannot get zpa exams to plan") + return nil, err } + defer cur.Close(ctx) - // maybe rm exam from not to plan - if !unknown { - collectionTo := db.Client.Database(databaseName(db.semester)).Collection(collectionToPlan) + result := make([]*ExamToPlanType, 0) - res, err := collectionTo.DeleteOne(ctx, bson.D{{Key: "ancode", Value: ancode}}) + err = cur.All(ctx, &result) + if err != nil { + log.Error().Err(err).Interface("toPlan", toPlan).Msg("cannot decode from cursor") + return nil, err + } + + resultSet := set.NewSet[int]() + for _, examToPlan := range result { + resultSet.Add(examToPlan.Ancode) + } + + return &resultSet, nil +} + +func (db *DB) cleanupPrimussAncodes(zpaExam *model.ZPAExam) { + programs := set.NewSet[string]() + + ancodesMap := make(map[string]int) + for _, group := range zpaExam.Groups { + ancodesMap[group[:2]] = -1 + programs.Add(group[:2]) + } + + for _, primussAncode := range zpaExam.PrimussAncodes { + if programs.Contains(primussAncode.Program) { + ancodesMap[primussAncode.Program] = primussAncode.Ancode + } + } + + programSlice := programs.ToSlice() + sort.Strings(programSlice) + + newPrimussAncodes := make([]model.ZPAPrimussAncodes, 0, len(ancodesMap)) + + for _, program := range programSlice { + newPrimussAncodes = append(newPrimussAncodes, model.ZPAPrimussAncodes{ + Program: program, + Ancode: ancodesMap[program], + }) + } + + zpaExam.PrimussAncodes = newPrimussAncodes +} + +func (db *DB) addAddedAncodesToExam(ctx context.Context, zpaExam *model.ZPAExam, addedAncodesForAncode []model.ZPAPrimussAncodes) error { + if addedAncodesForAncode == nil { + var err error + addedAncodesForAncode, err = db.GetAddedAncodesForAncode(ctx, zpaExam.AnCode) if err != nil { - log.Error().Err(err).Str("semester", db.semester). - Int("ancode", ancode).Msg("cannot remove ZPA exam from planned exams") - return false, err + log.Error().Err(err).Int("ancode", zpaExam.AnCode).Msg("cannot get added ancodes") + return err } - if res.DeletedCount != 1 { - log.Error().Err(err).Str("semester", db.semester). - Int("ancode", ancode).Int64("deletedCount", res.DeletedCount).Msg("not removed exactly one ZPA exam from planned exams") + if len(addedAncodesForAncode) == 0 { + return nil } } - // add exam to to plan - collectionNot := db.Client.Database(databaseName(db.semester)).Collection(collectionNotToPlan) + allPrimussAncodes := append(zpaExam.PrimussAncodes, addedAncodesForAncode...) - _, err = collectionNot.InsertOne(ctx, exam) - if err != nil { - log.Error().Err(err).Str("semester", db.semester). - Int("ancode", ancode).Msg("cannot add ZPA exam to not planned exams") - return false, err + ancodesMap := make(map[string]int) + programs := set.NewSet[string]() + for _, primussAncode := range allPrimussAncodes { + ancodesMap[primussAncode.Program] = primussAncode.Ancode + programs.Add(primussAncode.Program) } - return true, nil + programSlice := programs.ToSlice() + sort.Strings(programSlice) + + newPrimussAncodes := make([]model.ZPAPrimussAncodes, 0, len(ancodesMap)) + + for _, program := range programSlice { + newPrimussAncodes = append(newPrimussAncodes, model.ZPAPrimussAncodes{ + Program: program, + Ancode: ancodesMap[program], + }) + } + + zpaExam.PrimussAncodes = newPrimussAncodes + + // rmNewAncodes := make([]model.ZPAPrimussAncodes, 0, len(zpaExam.PrimussAncodes)) + // OUTER: + // for _, ancode := range zpaExam.PrimussAncodes { + // for _, newAncode := range addedAncodesForAncode { + // if ancode.Program == newAncode.Program { + // break OUTER + // } + // } + // rmNewAncodes = append(rmNewAncodes, ancode) + // } + // zpaExam.PrimussAncodes = append(rmNewAncodes, addedAncodesForAncode...) + + // // add dummy ancodes if no ancode for group is present + // OUTER2: + // for _, group := range zpaExam.Groups { + // groupShort := group[:2] + // for _, ancodes := range zpaExam.PrimussAncodes { + // if ancodes.Program == groupShort { + // break OUTER2 + // } + // } + // zpaExam.PrimussAncodes = append(zpaExam.PrimussAncodes, + // model.ZPAPrimussAncodes{ + // Program: groupShort, + // Ancode: -1, + // }) + // } + + return nil } diff --git a/go.mod b/go.mod index 6696740..4d8d9b5 100644 --- a/go.mod +++ b/go.mod @@ -9,11 +9,14 @@ require ( github.com/gookit/color v1.5.3 github.com/johnfercher/maroto v0.42.0 github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible + github.com/jszwec/csvutil v1.8.0 + github.com/logrusorgru/aurora v2.0.3+incompatible github.com/mitchellh/go-homedir v1.1.0 github.com/rs/cors v1.9.0 github.com/rs/zerolog v1.29.1 github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.16.0 + github.com/theckman/yacspin v0.13.12 github.com/vektah/gqlparser/v2 v2.5.6 go.mongodb.org/mongo-driver v1.12.0 ) @@ -22,6 +25,7 @@ require ( github.com/agnivade/levenshtein v1.1.1 // indirect github.com/boombuler/barcode v1.0.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.3.0 // indirect @@ -34,9 +38,11 @@ require ( github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/montanaflynn/stats v0.6.6 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245 // indirect github.com/spf13/afero v1.9.5 // indirect diff --git a/go.sum b/go.sum index a345627..49cbcbd 100644 --- a/go.sum +++ b/go.sum @@ -73,6 +73,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= @@ -162,6 +164,8 @@ github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jszwec/csvutil v1.8.0 h1:G7vS2LGdpZZDH1HmHeNbxOaJ/ZnJlpwGFvOkTkJzzNk= +github.com/jszwec/csvutil v1.8.0/go.mod h1:/E4ONrmGkwmWsk9ae9jpXnv9QT8pLHEPcCirMFhxG9I= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.16.2 h1:jgbatWHfRlPYiK85qgevsZTHviWXKwB1TTiKdz5PtRc= github.com/jung-kurt/gofpdf v1.16.2/go.mod h1:1hl7y57EsiPAkLbOwzpzqgx1A30nQCk/YmFV8S2vmK0= @@ -176,15 +180,21 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8= +github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -204,6 +214,8 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= @@ -246,6 +258,8 @@ github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gt github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/theckman/yacspin v0.13.12 h1:CdZ57+n0U6JMuh2xqjnjRq5Haj6v1ner2djtLQRzJr4= +github.com/theckman/yacspin v0.13.12/go.mod h1:Rd2+oG2LmQi5f3zC3yeZAOl245z8QOvrH4OPOJNZxLg= github.com/urfave/cli/v2 v2.25.5 h1:d0NIAyhh5shGscroL7ek/Ya9QYQE0KNabJgiUinIQkc= github.com/urfave/cli/v2 v2.25.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/vektah/gqlparser/v2 v2.5.6 h1:Ou14T0N1s191eRMZ1gARVqohcbe1e8FrcONScsq8cRU= @@ -393,6 +407,7 @@ golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/graph/exam.graphqls b/graph/exam.graphqls index 54d4c22..345c0c8 100644 --- a/graph/exam.graphqls +++ b/graph/exam.graphqls @@ -1,3 +1,22 @@ +extend type Query { + connectedExam(ancode: Int!): ConnectedExam + connectedExams: [ConnectedExam!]! + + externalExams: [ExternalExam!]! + + generatedExams: [GeneratedExam!]! + generatedExam(ancode: Int!): GeneratedExam + + plannedExams: [PlannedExam!]! + plannedExam(ancode: Int!): PlannedExam + + conflictingAncodes(ancode: Int!): [Conflict!] + + exam(ancode: Int!): Exam + exams: [Exam!]! +} + +# Deprecated: remove me input AdditionalExamInput { ancode: Int! module: String! @@ -7,6 +26,7 @@ input AdditionalExamInput { groups: [String!]! } +# Deprecated: remove me type AdditionalExam { ancode: Int! module: String! @@ -17,6 +37,7 @@ type AdditionalExam { groups: [String!]! } +# Deprecated: remove me type ExamWithRegs { ancode: Int! zpaExam: ZPAExam! @@ -45,17 +66,20 @@ type RoomConstraints { seb: Boolean! } +# Deprecated: remove me type ExamToPlan { exam: ExamWithRegs! constraints: Constraints } +# Deprecated: remove me type PlannedExamWithNTA { exam: ExamWithRegs! constraints: Constraints nta: [NTAWithRegs!] } +# Deprecated: remove me type ExamInPlan { exam: ExamWithRegs! constraints: Constraints @@ -64,8 +88,70 @@ type ExamInPlan { } type ExamWithRegsAndRooms { - exam: ExamInPlan! - normalRegs: [StudentReg!]! - ntaRegs: [NTAWithRegs!]! - rooms: [RoomForExam!]! + exam: PlannedExam! + normalRegsMtknr: [String!]! + ntas: [NTA!]! + rooms: [PlannedRoom!]! +} + +type ExternalExam { + ancode: Int! + program: String! + module: String! + mainExamer: String! + duration: Int! +} + +type ConnectedExam { + zpaExam: ZPAExam! + primussExams: [PrimussExam!]! + otherPrimussExams: [PrimussExam!]! + errors: [String!]! +} + +type GeneratedExam { + ancode: Int! + zpaExam: ZPAExam! + mainExamer: Teacher! + primussExams: [EnhancedPrimussExam!]! + constraints: Constraints + conflicts: [ZPAConflict!]! + studentRegsCount: Int! + ntas: [NTA!]! + maxDuration: Int! +} + +type ZPAConflict { + ancode: Int! + numberOfStuds: Int! + primussAncodes: [PrimussExamAncode!]! +} + +type PlannedExam { + ancode: Int! + zpaExam: ZPAExam! + mainExamer: Teacher! + primussExams: [EnhancedPrimussExam!]! + constraints: Constraints + conflicts: [ZPAConflict!]! + studentRegsCount: Int! + ntas: [NTA!]! + maxDuration: Int! + planEntry: PlanEntry + plannedRooms: [PlannedRoom!] +} + +type Exam { + ancode: Int! + zpaExam: ZPAExam + externalExam: ExternalExam + primussExams: [PrimussExam!]! + studentRegs: [StudentRegsPerAncodeAndProgram!]! + conflicts: [ConflictsPerProgramAncode!]! + connectErrors: [String!]! + constraints: Constraints + regularStudents: [Student!] + ntaStudents: [Student!] + slot: Slot + rooms: [RoomForExam!] } diff --git a/graph/exam.resolvers.go b/graph/exam.resolvers.go new file mode 100644 index 0000000..ab63aac --- /dev/null +++ b/graph/exam.resolvers.go @@ -0,0 +1,99 @@ +package graph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.34 + +import ( + "context" + "fmt" + + "github.com/obcode/plexams.go/graph/generated" + "github.com/obcode/plexams.go/graph/model" +) + +// MainExamer is the resolver for the mainExamer field. +func (r *generatedExamResolver) MainExamer(ctx context.Context, obj *model.GeneratedExam) (*model.Teacher, error) { + return r.plexams.GetTeacher(ctx, obj.ZpaExam.MainExamerID) +} + +// MainExamer is the resolver for the mainExamer field. +func (r *plannedExamResolver) MainExamer(ctx context.Context, obj *model.PlannedExam) (*model.Teacher, error) { + return r.plexams.GetTeacher(ctx, obj.ZpaExam.MainExamerID) +} + +// ConnectedExam is the resolver for the connectedExam field. +func (r *queryResolver) ConnectedExam(ctx context.Context, ancode int) (*model.ConnectedExam, error) { + return r.plexams.GetConnectedExam(ctx, ancode) +} + +// ConnectedExams is the resolver for the connectedExams field. +func (r *queryResolver) ConnectedExams(ctx context.Context) ([]*model.ConnectedExam, error) { + return r.plexams.GetConnectedExams(ctx) +} + +// ExternalExams is the resolver for the externalExams field. +func (r *queryResolver) ExternalExams(ctx context.Context) ([]*model.ExternalExam, error) { + return r.plexams.ExternalExams(ctx) +} + +// GeneratedExams is the resolver for the generatedExams field. +func (r *queryResolver) GeneratedExams(ctx context.Context) ([]*model.GeneratedExam, error) { + return r.plexams.GeneratedExams(ctx) +} + +// GeneratedExam is the resolver for the generatedExam field. +func (r *queryResolver) GeneratedExam(ctx context.Context, ancode int) (*model.GeneratedExam, error) { + return r.plexams.GeneratedExam(ctx, ancode) +} + +// PlannedExams is the resolver for the plannedExams field. +func (r *queryResolver) PlannedExams(ctx context.Context) ([]*model.PlannedExam, error) { + return r.plexams.PlannedExams(ctx) +} + +// PlannedExam is the resolver for the plannedExam field. +func (r *queryResolver) PlannedExam(ctx context.Context, ancode int) (*model.PlannedExam, error) { + return r.plexams.PlannedExam(ctx, ancode) +} + +// ConflictingAncodes is the resolver for the conflictingAncodes field. +func (r *queryResolver) ConflictingAncodes(ctx context.Context, ancode int) ([]*model.Conflict, error) { + return r.plexams.ConflictingAncodes(ctx, ancode) +} + +// Exam is the resolver for the exam field. +func (r *queryResolver) Exam(ctx context.Context, ancode int) (*model.Exam, error) { + exam, err := r.plexams.CachedExam(ctx, ancode) + if err != nil || exam == nil { + return r.plexams.Exam(ctx, ancode) + } + return exam, err +} + +// Exams is the resolver for the exams field. +func (r *queryResolver) Exams(ctx context.Context) ([]*model.Exam, error) { + return r.plexams.CachedExams(ctx) +} + +// GeneratedExam returns generated.GeneratedExamResolver implementation. +func (r *Resolver) GeneratedExam() generated.GeneratedExamResolver { return &generatedExamResolver{r} } + +// PlannedExam returns generated.PlannedExamResolver implementation. +func (r *Resolver) PlannedExam() generated.PlannedExamResolver { return &plannedExamResolver{r} } + +type generatedExamResolver struct{ *Resolver } +type plannedExamResolver struct{ *Resolver } + +// !!! WARNING !!! +// The code below was going to be deleted when updating resolvers. It has been copied here so you have +// one last chance to move it out of harms way if you want. There are two reasons this happens: +// - When renaming or deleting a resolver the old code will be put in here. You can safely delete +// it when you're done. +// - You have helper methods in this file. Move them out to keep these resolver files clean. +func (r *plannedExamResolver) PlanEntry(ctx context.Context, obj *model.PlannedExam) (*model.PlanEntry, error) { + panic(fmt.Errorf("not implemented: PlanEntry - planEntry")) +} +func (r *plannedExamResolver) PlannedRooms(ctx context.Context, obj *model.PlannedExam) ([]*model.PlannedRoom, error) { + panic(fmt.Errorf("not implemented: PlannedRooms - plannedRooms")) +} diff --git a/graph/generated/generated.go b/graph/generated/generated.go index c98a47b..75c37d1 100644 --- a/graph/generated/generated.go +++ b/graph/generated/generated.go @@ -37,8 +37,11 @@ type Config struct { } type ResolverRoot interface { + GeneratedExam() GeneratedExamResolver Mutation() MutationResolver - PrimussExam() PrimussExamResolver + PlanEntry() PlanEntryResolver + PlannedExam() PlannedExamResolver + PlannedRoom() PlannedRoomResolver Query() QueryResolver RoomForExam() RoomForExamResolver } @@ -78,6 +81,12 @@ type ComplexityRoot struct { Module func(childComplexity int) int } + ConflictsPerProgramAncode struct { + Ancode func(childComplexity int) int + Conflicts func(childComplexity int) int + Program func(childComplexity int) int + } + ConnectedExam struct { Errors func(childComplexity int) int OtherPrimussExams func(childComplexity int) int @@ -97,6 +106,28 @@ type ComplexityRoot struct { SameSlot func(childComplexity int) int } + EnhancedPrimussExam struct { + Conflicts func(childComplexity int) int + Exam func(childComplexity int) int + Ntas func(childComplexity int) int + StudentRegs func(childComplexity int) int + } + + Exam struct { + Ancode func(childComplexity int) int + Conflicts func(childComplexity int) int + ConnectErrors func(childComplexity int) int + Constraints func(childComplexity int) int + ExternalExam func(childComplexity int) int + NtaStudents func(childComplexity int) int + PrimussExams func(childComplexity int) int + RegularStudents func(childComplexity int) int + Rooms func(childComplexity int) int + Slot func(childComplexity int) int + StudentRegs func(childComplexity int) int + ZpaExam func(childComplexity int) int + } + ExamDay struct { Date func(childComplexity int) int Number func(childComplexity int) int @@ -149,10 +180,10 @@ type ComplexityRoot struct { } ExamWithRegsAndRooms struct { - Exam func(childComplexity int) int - NormalRegs func(childComplexity int) int - NtaRegs func(childComplexity int) int - Rooms func(childComplexity int) int + Exam func(childComplexity int) int + NormalRegsMtknr func(childComplexity int) int + Ntas func(childComplexity int) int + Rooms func(childComplexity int) int } ExamerInPlan struct { @@ -160,10 +191,30 @@ type ComplexityRoot struct { MainExamerID func(childComplexity int) int } + ExternalExam struct { + Ancode func(childComplexity int) int + Duration func(childComplexity int) int + MainExamer func(childComplexity int) int + Module func(childComplexity int) int + Program func(childComplexity int) int + } + FK07Program struct { Name func(childComplexity int) int } + GeneratedExam struct { + Ancode func(childComplexity int) int + Conflicts func(childComplexity int) int + Constraints func(childComplexity int) int + MainExamer func(childComplexity int) int + MaxDuration func(childComplexity int) int + Ntas func(childComplexity int) int + PrimussExams func(childComplexity int) int + StudentRegsCount func(childComplexity int) int + ZpaExam func(childComplexity int) int + } + Invigilation struct { Duration func(childComplexity int) int InvigilatorID func(childComplexity int) int @@ -228,9 +279,10 @@ type ComplexityRoot struct { Mutation struct { AddAdditionalExam func(childComplexity int, exam model.AdditionalExamInput) int AddExamGroupToSlot func(childComplexity int, day int, time int, examGroupCode int) int + AddExamToSlot func(childComplexity int, day int, time int, ancode int) int AddNta func(childComplexity int, input model.NTAInput) int AddRoomToExam func(childComplexity int, input model.RoomForExamInput) int - AddZpaExamToPlan func(childComplexity int, ancode int, unknown bool) int + AddZpaExamToPlan func(childComplexity int, ancode int) int ExahmRooms func(childComplexity int, ancode int) int ExcludeDays func(childComplexity int, ancode int, days []string) int Lab func(childComplexity int, ancode int) int @@ -238,10 +290,10 @@ type ComplexityRoot struct { Online func(childComplexity int, ancode int) int PlacesWithSockets func(childComplexity int, ancode int) int PossibleDays func(childComplexity int, ancode int, days []string) int - PrepareExams func(childComplexity int, input []*model.PrimussExamInput) int RemovePrimussExam func(childComplexity int, input *model.PrimussExamInput) int + RmExamFromSlot func(childComplexity int, ancode int) int RmExamGroupFromSlot func(childComplexity int, examGroupCode int) int - RmZpaExamFromPlan func(childComplexity int, ancode int, unknown bool) int + RmZpaExamFromPlan func(childComplexity int, ancode int) int SameSlot func(childComplexity int, ancode int, ancodes []int) int Seb func(childComplexity int, ancode int) int SetSemester func(childComplexity int, input string) int @@ -251,6 +303,7 @@ type ComplexityRoot struct { NTA struct { Compensation func(childComplexity int) int DeltaDurationPercent func(childComplexity int) int + Email func(childComplexity int) int Exams func(childComplexity int) int From func(childComplexity int) int LastSemester func(childComplexity int) int @@ -288,21 +341,60 @@ type ComplexityRoot struct { Slots func(childComplexity int) int } + PlanEntry struct { + Ancode func(childComplexity int) int + DayNumber func(childComplexity int) int + Locked func(childComplexity int) int + SlotNumber func(childComplexity int) int + Starttime func(childComplexity int) int + } + + PlannedExam struct { + Ancode func(childComplexity int) int + Conflicts func(childComplexity int) int + Constraints func(childComplexity int) int + MainExamer func(childComplexity int) int + MaxDuration func(childComplexity int) int + Ntas func(childComplexity int) int + PlanEntry func(childComplexity int) int + PlannedRooms func(childComplexity int) int + PrimussExams func(childComplexity int) int + StudentRegsCount func(childComplexity int) int + ZpaExam func(childComplexity int) int + } + PlannedExamWithNTA struct { Constraints func(childComplexity int) int Exam func(childComplexity int) int Nta func(childComplexity int) int } + PlannedRoom struct { + Ancode func(childComplexity int) int + Day func(childComplexity int) int + Duration func(childComplexity int) int + Handicap func(childComplexity int) int + HandicapRoomAlone func(childComplexity int) int + NtaMtknr func(childComplexity int) int + Reserve func(childComplexity int) int + Room func(childComplexity int) int + Slot func(childComplexity int) int + StudentsInRoom func(childComplexity int) int + } + PrimussExam struct { - AnCode func(childComplexity int) int - Conflicts func(childComplexity int) int - ExamType func(childComplexity int) int - MainExamer func(childComplexity int) int - Module func(childComplexity int) int - Presence func(childComplexity int) int - Program func(childComplexity int) int - StudentRegs func(childComplexity int) int + AnCode func(childComplexity int) int + ExamType func(childComplexity int) int + MainExamer func(childComplexity int) int + Module func(childComplexity int) int + Presence func(childComplexity int) int + Program func(childComplexity int) int + } + + PrimussExamAncode struct { + Ancode func(childComplexity int) int + NumberOfStuds func(childComplexity int) int + Program func(childComplexity int) int } PrimussExamByProgram struct { @@ -310,29 +402,44 @@ type ComplexityRoot struct { Program func(childComplexity int) int } + PrimussExamWithCount struct { + Ancode func(childComplexity int) int + ExamType func(childComplexity int) int + MainExamer func(childComplexity int) int + Module func(childComplexity int) int + Presence func(childComplexity int) int + Program func(childComplexity int) int + StudentRegsCount func(childComplexity int) int + } + Query struct { AdditionalExams func(childComplexity int) int AllProgramsInPlan func(childComplexity int) int AllSemesterNames func(childComplexity int) int - AllowedSlots func(childComplexity int, examGroupCode int) int + AllowedSlots func(childComplexity int, ancode int) int AncodesInPlan func(childComplexity int) int - AwkwardSlots func(childComplexity int, examGroupCode int) int - ConflictingGroupCodes func(childComplexity int, examGroupCode int) int + AwkwardSlots func(childComplexity int, ancode int) int + ConflictingAncodes func(childComplexity int, ancode int) int ConnectedExam func(childComplexity int, ancode int) int ConnectedExams func(childComplexity int) int ConstraintForAncode func(childComplexity int, ancode int) int DayOkForInvigilator func(childComplexity int, day int, invigilatorID int) int + Exam func(childComplexity int, ancode int) int ExamGroup func(childComplexity int, examGroupCode int) int ExamGroups func(childComplexity int) int - ExamGroupsInSlot func(childComplexity int, day int, time int) int ExamGroupsWithoutSlot func(childComplexity int) int ExamWithRegs func(childComplexity int, ancode int) int ExamerInPlan func(childComplexity int) int + Exams func(childComplexity int) int ExamsInPlan func(childComplexity int) int ExamsInSlot func(childComplexity int, day int, time int) int ExamsInSlotWithRooms func(childComplexity int, day int, time int) int ExamsWithRegs func(childComplexity int) int + ExamsWithoutSlot func(childComplexity int) int + ExternalExams func(childComplexity int) int Fk07programs func(childComplexity int) int + GeneratedExam func(childComplexity int, ancode int) int + GeneratedExams func(childComplexity int) int InvigilatorTodos func(childComplexity int) int Invigilators func(childComplexity int) int InvigilatorsForDay func(childComplexity int, day int) int @@ -342,9 +449,12 @@ type ComplexityRoot struct { Ntas func(childComplexity int) int NtasWithRegs func(childComplexity int) int NtasWithRegsByTeacher func(childComplexity int) int + PlannedExam func(childComplexity int, ancode int) int + PlannedExams func(childComplexity int) int PlannedExamsInSlot func(childComplexity int, day int, time int) int PlannedRoomNames func(childComplexity int) int PlannedRoomNamesInSlot func(childComplexity int, day int, time int) int + PlannedRoomsInSlot func(childComplexity int, day int, time int) int PrimussExam func(childComplexity int, program string, ancode int) int PrimussExams func(childComplexity int) int PrimussExamsForAnCode func(childComplexity int, ancode int) int @@ -354,8 +464,11 @@ type ComplexityRoot struct { RoomsWithInvigilationsForSlot func(childComplexity int, day int, time int) int Semester func(childComplexity int) int SemesterConfig func(childComplexity int) int + StudentByMtknr func(childComplexity int, mtknr string) int StudentRegsForProgram func(childComplexity int, program string) int StudentRegsImportErrors func(childComplexity int) int + Students func(childComplexity int) int + StudentsByName func(childComplexity int, regex string) int Teacher func(childComplexity int, id int) int Teachers func(childComplexity int, fromZpa *bool) int Workflow func(childComplexity int) int @@ -463,7 +576,9 @@ type ComplexityRoot struct { Group func(childComplexity int) int Mtknr func(childComplexity int) int Name func(childComplexity int) int + Nta func(childComplexity int) int Program func(childComplexity int) int + Regs func(childComplexity int) int } StudentReg struct { @@ -481,6 +596,7 @@ type ComplexityRoot struct { } StudentRegsPerAncodeAndProgram struct { + Ancode func(childComplexity int) int Program func(childComplexity int) int StudentRegs func(childComplexity int) int } @@ -503,6 +619,12 @@ type ComplexityRoot struct { Shortname func(childComplexity int) int } + ZPAConflict struct { + Ancode func(childComplexity int) int + NumberOfStuds func(childComplexity int) int + PrimussAncodes func(childComplexity int) int + } + ZPAExam struct { AnCode func(childComplexity int) int Duration func(childComplexity int) int @@ -513,6 +635,7 @@ type ComplexityRoot struct { MainExamer func(childComplexity int) int MainExamerID func(childComplexity int) int Module func(childComplexity int) int + PrimussAncodes func(childComplexity int) int Semester func(childComplexity int) int ZpaID func(childComplexity int) int } @@ -532,6 +655,11 @@ type ComplexityRoot struct { Teacher func(childComplexity int) int } + ZPAPrimussAncodes struct { + Ancode func(childComplexity int) int + Program func(childComplexity int) int + } + ZPAStudentReg struct { AnCode func(childComplexity int) int Mtknr func(childComplexity int) int @@ -547,14 +675,16 @@ type ComplexityRoot struct { } } +type GeneratedExamResolver interface { + MainExamer(ctx context.Context, obj *model.GeneratedExam) (*model.Teacher, error) +} type MutationResolver interface { SetSemester(ctx context.Context, input string) (*model.Semester, error) ZpaExamsToPlan(ctx context.Context, input []int) ([]*model.ZPAExam, error) - AddZpaExamToPlan(ctx context.Context, ancode int, unknown bool) (bool, error) - RmZpaExamFromPlan(ctx context.Context, ancode int, unknown bool) (bool, error) + AddZpaExamToPlan(ctx context.Context, ancode int) (bool, error) + RmZpaExamFromPlan(ctx context.Context, ancode int) (bool, error) AddAdditionalExam(ctx context.Context, exam model.AdditionalExamInput) (bool, error) RemovePrimussExam(ctx context.Context, input *model.PrimussExamInput) (bool, error) - PrepareExams(ctx context.Context, input []*model.PrimussExamInput) (bool, error) AddNta(ctx context.Context, input model.NTAInput) (*model.NTA, error) NotPlannedByMe(ctx context.Context, ancode int) (bool, error) ExcludeDays(ctx context.Context, ancode int, days []string) (bool, error) @@ -568,10 +698,17 @@ type MutationResolver interface { AddExamGroupToSlot(ctx context.Context, day int, time int, examGroupCode int) (bool, error) RmExamGroupFromSlot(ctx context.Context, examGroupCode int) (bool, error) AddRoomToExam(ctx context.Context, input model.RoomForExamInput) (bool, error) + AddExamToSlot(ctx context.Context, day int, time int, ancode int) (bool, error) + RmExamFromSlot(ctx context.Context, ancode int) (bool, error) +} +type PlanEntryResolver interface { + Starttime(ctx context.Context, obj *model.PlanEntry) (*time.Time, error) +} +type PlannedExamResolver interface { + MainExamer(ctx context.Context, obj *model.PlannedExam) (*model.Teacher, error) } -type PrimussExamResolver interface { - StudentRegs(ctx context.Context, obj *model.PrimussExam) ([]*model.StudentReg, error) - Conflicts(ctx context.Context, obj *model.PrimussExam) (*model.Conflicts, error) +type PlannedRoomResolver interface { + Room(ctx context.Context, obj *model.PlannedRoom) (*model.Room, error) } type QueryResolver interface { Workflow(ctx context.Context) ([]*model.Step, error) @@ -579,57 +716,68 @@ type QueryResolver interface { AllSemesterNames(ctx context.Context) ([]*model.Semester, error) Semester(ctx context.Context) (*model.Semester, error) SemesterConfig(ctx context.Context) (*model.SemesterConfig, error) - Teacher(ctx context.Context, id int) (*model.Teacher, error) - Teachers(ctx context.Context, fromZpa *bool) ([]*model.Teacher, error) - Invigilators(ctx context.Context) ([]*model.ZPAInvigilator, error) - Fk07programs(ctx context.Context) ([]*model.FK07Program, error) - ZpaExams(ctx context.Context, fromZpa *bool) ([]*model.ZPAExam, error) - ZpaExamsByType(ctx context.Context) ([]*model.ZPAExamsForType, error) - ZpaExamsToPlan(ctx context.Context) ([]*model.ZPAExam, error) - ZpaExamsNotToPlan(ctx context.Context) ([]*model.ZPAExam, error) - ZpaExamsPlaningStatusUnknown(ctx context.Context) ([]*model.ZPAExam, error) - ZpaExam(ctx context.Context, ancode int) (*model.ZPAExam, error) - ZpaAnCodes(ctx context.Context) ([]*model.AnCode, error) - StudentRegsImportErrors(ctx context.Context) ([]*model.RegWithError, error) AdditionalExams(ctx context.Context) ([]*model.AdditionalExam, error) - PrimussExams(ctx context.Context) ([]*model.PrimussExamByProgram, error) PrimussExam(ctx context.Context, program string, ancode int) (*model.PrimussExam, error) PrimussExamsForAnCode(ctx context.Context, ancode int) ([]*model.PrimussExam, error) StudentRegsForProgram(ctx context.Context, program string) ([]*model.StudentReg, error) - ConnectedExam(ctx context.Context, ancode int) (*model.ConnectedExam, error) - ConnectedExams(ctx context.Context) ([]*model.ConnectedExam, error) ExamWithRegs(ctx context.Context, ancode int) (*model.ExamWithRegs, error) ExamsWithRegs(ctx context.Context) ([]*model.ExamWithRegs, error) ConstraintForAncode(ctx context.Context, ancode int) (*model.Constraints, error) ZpaExamsToPlanWithConstraints(ctx context.Context) ([]*model.ZPAExamWithConstraints, error) ExamGroups(ctx context.Context) ([]*model.ExamGroup, error) ExamGroup(ctx context.Context, examGroupCode int) (*model.ExamGroup, error) - ConflictingGroupCodes(ctx context.Context, examGroupCode int) ([]*model.ExamGroupConflict, error) - Ntas(ctx context.Context) ([]*model.NTA, error) - NtasWithRegs(ctx context.Context) ([]*model.NTAWithRegs, error) NtasWithRegsByTeacher(ctx context.Context) ([]*model.NTAWithRegsByExamAndTeacher, error) Nta(ctx context.Context, mtknr string) (*model.NTAWithRegs, error) - AllowedSlots(ctx context.Context, examGroupCode int) ([]*model.Slot, error) - AwkwardSlots(ctx context.Context, examGroupCode int) ([]*model.Slot, error) - ExamGroupsInSlot(ctx context.Context, day int, time int) ([]*model.ExamGroup, error) ExamGroupsWithoutSlot(ctx context.Context) ([]*model.ExamGroup, error) - AllProgramsInPlan(ctx context.Context) ([]string, error) - AncodesInPlan(ctx context.Context) ([]int, error) - ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error) PlannedExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExamWithNta, error) ExamsInPlan(ctx context.Context) ([]*model.ExamInPlan, error) - ExamsInSlot(ctx context.Context, day int, time int) ([]*model.ExamInPlan, error) ExamsInSlotWithRooms(ctx context.Context, day int, time int) ([]*model.ExamWithRegsAndRooms, error) - Rooms(ctx context.Context) ([]*model.Room, error) RoomsWithConstraints(ctx context.Context, handicap bool, lab bool, placesWithSocket bool, exahm *bool) ([]*model.Room, error) RoomsForSlot(ctx context.Context, day int, time int) (*model.SlotWithRooms, error) - PlannedRoomNames(ctx context.Context) ([]string, error) - PlannedRoomNamesInSlot(ctx context.Context, day int, time int) ([]string, error) - InvigilatorsWithReq(ctx context.Context) ([]*model.Invigilator, error) + DayOkForInvigilator(ctx context.Context, day int, invigilatorID int) (*bool, error) + ConnectedExam(ctx context.Context, ancode int) (*model.ConnectedExam, error) + ConnectedExams(ctx context.Context) ([]*model.ConnectedExam, error) + ExternalExams(ctx context.Context) ([]*model.ExternalExam, error) + GeneratedExams(ctx context.Context) ([]*model.GeneratedExam, error) + GeneratedExam(ctx context.Context, ancode int) (*model.GeneratedExam, error) + PlannedExams(ctx context.Context) ([]*model.PlannedExam, error) + PlannedExam(ctx context.Context, ancode int) (*model.PlannedExam, error) + ConflictingAncodes(ctx context.Context, ancode int) ([]*model.Conflict, error) + Exam(ctx context.Context, ancode int) (*model.Exam, error) + Exams(ctx context.Context) ([]*model.Exam, error) InvigilatorTodos(ctx context.Context) (*model.InvigilationTodos, error) + InvigilatorsWithReq(ctx context.Context) ([]*model.Invigilator, error) RoomsWithInvigilationsForSlot(ctx context.Context, day int, time int) (*model.InvigilationSlot, error) InvigilatorsForDay(ctx context.Context, day int) (*model.InvigilatorsForDay, error) - DayOkForInvigilator(ctx context.Context, day int, invigilatorID int) (*bool, error) + Ntas(ctx context.Context) ([]*model.NTA, error) + NtasWithRegs(ctx context.Context) ([]*model.Student, error) + AllProgramsInPlan(ctx context.Context) ([]string, error) + AncodesInPlan(ctx context.Context) ([]int, error) + ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error) + ExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExam, error) + ExamsWithoutSlot(ctx context.Context) ([]*model.PlannedExam, error) + AllowedSlots(ctx context.Context, ancode int) ([]*model.Slot, error) + AwkwardSlots(ctx context.Context, ancode int) ([]*model.Slot, error) + PrimussExams(ctx context.Context) ([]*model.PrimussExamByProgram, error) + Rooms(ctx context.Context) ([]*model.Room, error) + PlannedRoomNames(ctx context.Context) ([]string, error) + PlannedRoomNamesInSlot(ctx context.Context, day int, time int) ([]string, error) + PlannedRoomsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedRoom, error) + StudentByMtknr(ctx context.Context, mtknr string) (*model.Student, error) + StudentsByName(ctx context.Context, regex string) ([]*model.Student, error) + Students(ctx context.Context) ([]*model.Student, error) + Teacher(ctx context.Context, id int) (*model.Teacher, error) + Teachers(ctx context.Context, fromZpa *bool) ([]*model.Teacher, error) + Invigilators(ctx context.Context) ([]*model.ZPAInvigilator, error) + Fk07programs(ctx context.Context) ([]*model.FK07Program, error) + ZpaExams(ctx context.Context, fromZpa *bool) ([]*model.ZPAExam, error) + ZpaExamsByType(ctx context.Context) ([]*model.ZPAExamsForType, error) + ZpaExamsToPlan(ctx context.Context) ([]*model.ZPAExam, error) + ZpaExamsNotToPlan(ctx context.Context) ([]*model.ZPAExam, error) + ZpaExamsPlaningStatusUnknown(ctx context.Context) ([]*model.ZPAExam, error) + ZpaExam(ctx context.Context, ancode int) (*model.ZPAExam, error) + ZpaAnCodes(ctx context.Context) ([]*model.AnCode, error) + StudentRegsImportErrors(ctx context.Context) ([]*model.RegWithError, error) } type RoomForExamResolver interface { Room(ctx context.Context, obj *model.RoomForExam) (*model.Room, error) @@ -762,6 +910,27 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Conflicts.Module(childComplexity), true + case "ConflictsPerProgramAncode.ancode": + if e.complexity.ConflictsPerProgramAncode.Ancode == nil { + break + } + + return e.complexity.ConflictsPerProgramAncode.Ancode(childComplexity), true + + case "ConflictsPerProgramAncode.conflicts": + if e.complexity.ConflictsPerProgramAncode.Conflicts == nil { + break + } + + return e.complexity.ConflictsPerProgramAncode.Conflicts(childComplexity), true + + case "ConflictsPerProgramAncode.program": + if e.complexity.ConflictsPerProgramAncode.Program == nil { + break + } + + return e.complexity.ConflictsPerProgramAncode.Program(childComplexity), true + case "ConnectedExam.errors": if e.complexity.ConnectedExam.Errors == nil { break @@ -853,6 +1022,118 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Constraints.SameSlot(childComplexity), true + case "EnhancedPrimussExam.conflicts": + if e.complexity.EnhancedPrimussExam.Conflicts == nil { + break + } + + return e.complexity.EnhancedPrimussExam.Conflicts(childComplexity), true + + case "EnhancedPrimussExam.exam": + if e.complexity.EnhancedPrimussExam.Exam == nil { + break + } + + return e.complexity.EnhancedPrimussExam.Exam(childComplexity), true + + case "EnhancedPrimussExam.ntas": + if e.complexity.EnhancedPrimussExam.Ntas == nil { + break + } + + return e.complexity.EnhancedPrimussExam.Ntas(childComplexity), true + + case "EnhancedPrimussExam.studentRegs": + if e.complexity.EnhancedPrimussExam.StudentRegs == nil { + break + } + + return e.complexity.EnhancedPrimussExam.StudentRegs(childComplexity), true + + case "Exam.ancode": + if e.complexity.Exam.Ancode == nil { + break + } + + return e.complexity.Exam.Ancode(childComplexity), true + + case "Exam.conflicts": + if e.complexity.Exam.Conflicts == nil { + break + } + + return e.complexity.Exam.Conflicts(childComplexity), true + + case "Exam.connectErrors": + if e.complexity.Exam.ConnectErrors == nil { + break + } + + return e.complexity.Exam.ConnectErrors(childComplexity), true + + case "Exam.constraints": + if e.complexity.Exam.Constraints == nil { + break + } + + return e.complexity.Exam.Constraints(childComplexity), true + + case "Exam.externalExam": + if e.complexity.Exam.ExternalExam == nil { + break + } + + return e.complexity.Exam.ExternalExam(childComplexity), true + + case "Exam.ntaStudents": + if e.complexity.Exam.NtaStudents == nil { + break + } + + return e.complexity.Exam.NtaStudents(childComplexity), true + + case "Exam.primussExams": + if e.complexity.Exam.PrimussExams == nil { + break + } + + return e.complexity.Exam.PrimussExams(childComplexity), true + + case "Exam.regularStudents": + if e.complexity.Exam.RegularStudents == nil { + break + } + + return e.complexity.Exam.RegularStudents(childComplexity), true + + case "Exam.rooms": + if e.complexity.Exam.Rooms == nil { + break + } + + return e.complexity.Exam.Rooms(childComplexity), true + + case "Exam.slot": + if e.complexity.Exam.Slot == nil { + break + } + + return e.complexity.Exam.Slot(childComplexity), true + + case "Exam.studentRegs": + if e.complexity.Exam.StudentRegs == nil { + break + } + + return e.complexity.Exam.StudentRegs(childComplexity), true + + case "Exam.zpaExam": + if e.complexity.Exam.ZpaExam == nil { + break + } + + return e.complexity.Exam.ZpaExam(childComplexity), true + case "ExamDay.date": if e.complexity.ExamDay.Date == nil { break @@ -1070,19 +1351,19 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ExamWithRegsAndRooms.Exam(childComplexity), true - case "ExamWithRegsAndRooms.normalRegs": - if e.complexity.ExamWithRegsAndRooms.NormalRegs == nil { + case "ExamWithRegsAndRooms.normalRegsMtknr": + if e.complexity.ExamWithRegsAndRooms.NormalRegsMtknr == nil { break } - return e.complexity.ExamWithRegsAndRooms.NormalRegs(childComplexity), true + return e.complexity.ExamWithRegsAndRooms.NormalRegsMtknr(childComplexity), true - case "ExamWithRegsAndRooms.ntaRegs": - if e.complexity.ExamWithRegsAndRooms.NtaRegs == nil { + case "ExamWithRegsAndRooms.ntas": + if e.complexity.ExamWithRegsAndRooms.Ntas == nil { break } - return e.complexity.ExamWithRegsAndRooms.NtaRegs(childComplexity), true + return e.complexity.ExamWithRegsAndRooms.Ntas(childComplexity), true case "ExamWithRegsAndRooms.rooms": if e.complexity.ExamWithRegsAndRooms.Rooms == nil { @@ -1105,6 +1386,41 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ExamerInPlan.MainExamerID(childComplexity), true + case "ExternalExam.ancode": + if e.complexity.ExternalExam.Ancode == nil { + break + } + + return e.complexity.ExternalExam.Ancode(childComplexity), true + + case "ExternalExam.duration": + if e.complexity.ExternalExam.Duration == nil { + break + } + + return e.complexity.ExternalExam.Duration(childComplexity), true + + case "ExternalExam.mainExamer": + if e.complexity.ExternalExam.MainExamer == nil { + break + } + + return e.complexity.ExternalExam.MainExamer(childComplexity), true + + case "ExternalExam.module": + if e.complexity.ExternalExam.Module == nil { + break + } + + return e.complexity.ExternalExam.Module(childComplexity), true + + case "ExternalExam.program": + if e.complexity.ExternalExam.Program == nil { + break + } + + return e.complexity.ExternalExam.Program(childComplexity), true + case "FK07Program.name": if e.complexity.FK07Program.Name == nil { break @@ -1112,6 +1428,69 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.FK07Program.Name(childComplexity), true + case "GeneratedExam.ancode": + if e.complexity.GeneratedExam.Ancode == nil { + break + } + + return e.complexity.GeneratedExam.Ancode(childComplexity), true + + case "GeneratedExam.conflicts": + if e.complexity.GeneratedExam.Conflicts == nil { + break + } + + return e.complexity.GeneratedExam.Conflicts(childComplexity), true + + case "GeneratedExam.constraints": + if e.complexity.GeneratedExam.Constraints == nil { + break + } + + return e.complexity.GeneratedExam.Constraints(childComplexity), true + + case "GeneratedExam.mainExamer": + if e.complexity.GeneratedExam.MainExamer == nil { + break + } + + return e.complexity.GeneratedExam.MainExamer(childComplexity), true + + case "GeneratedExam.maxDuration": + if e.complexity.GeneratedExam.MaxDuration == nil { + break + } + + return e.complexity.GeneratedExam.MaxDuration(childComplexity), true + + case "GeneratedExam.ntas": + if e.complexity.GeneratedExam.Ntas == nil { + break + } + + return e.complexity.GeneratedExam.Ntas(childComplexity), true + + case "GeneratedExam.primussExams": + if e.complexity.GeneratedExam.PrimussExams == nil { + break + } + + return e.complexity.GeneratedExam.PrimussExams(childComplexity), true + + case "GeneratedExam.studentRegsCount": + if e.complexity.GeneratedExam.StudentRegsCount == nil { + break + } + + return e.complexity.GeneratedExam.StudentRegsCount(childComplexity), true + + case "GeneratedExam.zpaExam": + if e.complexity.GeneratedExam.ZpaExam == nil { + break + } + + return e.complexity.GeneratedExam.ZpaExam(childComplexity), true + case "Invigilation.duration": if e.complexity.Invigilation.Duration == nil { break @@ -1416,6 +1795,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.AddExamGroupToSlot(childComplexity, args["day"].(int), args["time"].(int), args["examGroupCode"].(int)), true + case "Mutation.addExamToSlot": + if e.complexity.Mutation.AddExamToSlot == nil { + break + } + + args, err := ec.field_Mutation_addExamToSlot_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.AddExamToSlot(childComplexity, args["day"].(int), args["time"].(int), args["ancode"].(int)), true + case "Mutation.addNTA": if e.complexity.Mutation.AddNta == nil { break @@ -1450,7 +1841,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.AddZpaExamToPlan(childComplexity, args["ancode"].(int), args["unknown"].(bool)), true + return e.complexity.Mutation.AddZpaExamToPlan(childComplexity, args["ancode"].(int)), true case "Mutation.exahmRooms": if e.complexity.Mutation.ExahmRooms == nil { @@ -1536,29 +1927,29 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.PossibleDays(childComplexity, args["ancode"].(int), args["days"].([]string)), true - case "Mutation.prepareExams": - if e.complexity.Mutation.PrepareExams == nil { + case "Mutation.removePrimussExam": + if e.complexity.Mutation.RemovePrimussExam == nil { break } - args, err := ec.field_Mutation_prepareExams_args(context.TODO(), rawArgs) + args, err := ec.field_Mutation_removePrimussExam_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.PrepareExams(childComplexity, args["input"].([]*model.PrimussExamInput)), true + return e.complexity.Mutation.RemovePrimussExam(childComplexity, args["input"].(*model.PrimussExamInput)), true - case "Mutation.removePrimussExam": - if e.complexity.Mutation.RemovePrimussExam == nil { + case "Mutation.rmExamFromSlot": + if e.complexity.Mutation.RmExamFromSlot == nil { break } - args, err := ec.field_Mutation_removePrimussExam_args(context.TODO(), rawArgs) + args, err := ec.field_Mutation_rmExamFromSlot_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.RemovePrimussExam(childComplexity, args["input"].(*model.PrimussExamInput)), true + return e.complexity.Mutation.RmExamFromSlot(childComplexity, args["ancode"].(int)), true case "Mutation.rmExamGroupFromSlot": if e.complexity.Mutation.RmExamGroupFromSlot == nil { @@ -1582,7 +1973,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.RmZpaExamFromPlan(childComplexity, args["ancode"].(int), args["unknown"].(bool)), true + return e.complexity.Mutation.RmZpaExamFromPlan(childComplexity, args["ancode"].(int)), true case "Mutation.sameSlot": if e.complexity.Mutation.SameSlot == nil { @@ -1646,6 +2037,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.NTA.DeltaDurationPercent(childComplexity), true + case "NTA.email": + if e.complexity.NTA.Email == nil { + break + } + + return e.complexity.NTA.Email(childComplexity), true + case "NTA.exams": if e.complexity.NTA.Exams == nil { break @@ -1786,6 +2184,118 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Plan.Slots(childComplexity), true + case "PlanEntry.ancode": + if e.complexity.PlanEntry.Ancode == nil { + break + } + + return e.complexity.PlanEntry.Ancode(childComplexity), true + + case "PlanEntry.dayNumber": + if e.complexity.PlanEntry.DayNumber == nil { + break + } + + return e.complexity.PlanEntry.DayNumber(childComplexity), true + + case "PlanEntry.locked": + if e.complexity.PlanEntry.Locked == nil { + break + } + + return e.complexity.PlanEntry.Locked(childComplexity), true + + case "PlanEntry.slotNumber": + if e.complexity.PlanEntry.SlotNumber == nil { + break + } + + return e.complexity.PlanEntry.SlotNumber(childComplexity), true + + case "PlanEntry.starttime": + if e.complexity.PlanEntry.Starttime == nil { + break + } + + return e.complexity.PlanEntry.Starttime(childComplexity), true + + case "PlannedExam.ancode": + if e.complexity.PlannedExam.Ancode == nil { + break + } + + return e.complexity.PlannedExam.Ancode(childComplexity), true + + case "PlannedExam.conflicts": + if e.complexity.PlannedExam.Conflicts == nil { + break + } + + return e.complexity.PlannedExam.Conflicts(childComplexity), true + + case "PlannedExam.constraints": + if e.complexity.PlannedExam.Constraints == nil { + break + } + + return e.complexity.PlannedExam.Constraints(childComplexity), true + + case "PlannedExam.mainExamer": + if e.complexity.PlannedExam.MainExamer == nil { + break + } + + return e.complexity.PlannedExam.MainExamer(childComplexity), true + + case "PlannedExam.maxDuration": + if e.complexity.PlannedExam.MaxDuration == nil { + break + } + + return e.complexity.PlannedExam.MaxDuration(childComplexity), true + + case "PlannedExam.ntas": + if e.complexity.PlannedExam.Ntas == nil { + break + } + + return e.complexity.PlannedExam.Ntas(childComplexity), true + + case "PlannedExam.planEntry": + if e.complexity.PlannedExam.PlanEntry == nil { + break + } + + return e.complexity.PlannedExam.PlanEntry(childComplexity), true + + case "PlannedExam.plannedRooms": + if e.complexity.PlannedExam.PlannedRooms == nil { + break + } + + return e.complexity.PlannedExam.PlannedRooms(childComplexity), true + + case "PlannedExam.primussExams": + if e.complexity.PlannedExam.PrimussExams == nil { + break + } + + return e.complexity.PlannedExam.PrimussExams(childComplexity), true + + case "PlannedExam.studentRegsCount": + if e.complexity.PlannedExam.StudentRegsCount == nil { + break + } + + return e.complexity.PlannedExam.StudentRegsCount(childComplexity), true + + case "PlannedExam.zpaExam": + if e.complexity.PlannedExam.ZpaExam == nil { + break + } + + return e.complexity.PlannedExam.ZpaExam(childComplexity), true + case "PlannedExamWithNTA.constraints": if e.complexity.PlannedExamWithNTA.Constraints == nil { break @@ -1807,19 +2317,82 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.PlannedExamWithNTA.Nta(childComplexity), true - case "PrimussExam.ancode": - if e.complexity.PrimussExam.AnCode == nil { + case "PlannedRoom.ancode": + if e.complexity.PlannedRoom.Ancode == nil { break } - return e.complexity.PrimussExam.AnCode(childComplexity), true + return e.complexity.PlannedRoom.Ancode(childComplexity), true - case "PrimussExam.conflicts": - if e.complexity.PrimussExam.Conflicts == nil { + case "PlannedRoom.day": + if e.complexity.PlannedRoom.Day == nil { break } - return e.complexity.PrimussExam.Conflicts(childComplexity), true + return e.complexity.PlannedRoom.Day(childComplexity), true + + case "PlannedRoom.duration": + if e.complexity.PlannedRoom.Duration == nil { + break + } + + return e.complexity.PlannedRoom.Duration(childComplexity), true + + case "PlannedRoom.handicap": + if e.complexity.PlannedRoom.Handicap == nil { + break + } + + return e.complexity.PlannedRoom.Handicap(childComplexity), true + + case "PlannedRoom.handicapRoomAlone": + if e.complexity.PlannedRoom.HandicapRoomAlone == nil { + break + } + + return e.complexity.PlannedRoom.HandicapRoomAlone(childComplexity), true + + case "PlannedRoom.ntaMtknr": + if e.complexity.PlannedRoom.NtaMtknr == nil { + break + } + + return e.complexity.PlannedRoom.NtaMtknr(childComplexity), true + + case "PlannedRoom.reserve": + if e.complexity.PlannedRoom.Reserve == nil { + break + } + + return e.complexity.PlannedRoom.Reserve(childComplexity), true + + case "PlannedRoom.room": + if e.complexity.PlannedRoom.Room == nil { + break + } + + return e.complexity.PlannedRoom.Room(childComplexity), true + + case "PlannedRoom.slot": + if e.complexity.PlannedRoom.Slot == nil { + break + } + + return e.complexity.PlannedRoom.Slot(childComplexity), true + + case "PlannedRoom.studentsInRoom": + if e.complexity.PlannedRoom.StudentsInRoom == nil { + break + } + + return e.complexity.PlannedRoom.StudentsInRoom(childComplexity), true + + case "PrimussExam.ancode": + if e.complexity.PrimussExam.AnCode == nil { + break + } + + return e.complexity.PrimussExam.AnCode(childComplexity), true case "PrimussExam.examType": if e.complexity.PrimussExam.ExamType == nil { @@ -1856,12 +2429,26 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.PrimussExam.Program(childComplexity), true - case "PrimussExam.studentRegs": - if e.complexity.PrimussExam.StudentRegs == nil { + case "PrimussExamAncode.ancode": + if e.complexity.PrimussExamAncode.Ancode == nil { + break + } + + return e.complexity.PrimussExamAncode.Ancode(childComplexity), true + + case "PrimussExamAncode.numberOfStuds": + if e.complexity.PrimussExamAncode.NumberOfStuds == nil { + break + } + + return e.complexity.PrimussExamAncode.NumberOfStuds(childComplexity), true + + case "PrimussExamAncode.program": + if e.complexity.PrimussExamAncode.Program == nil { break } - return e.complexity.PrimussExam.StudentRegs(childComplexity), true + return e.complexity.PrimussExamAncode.Program(childComplexity), true case "PrimussExamByProgram.exams": if e.complexity.PrimussExamByProgram.Exams == nil { @@ -1877,6 +2464,55 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.PrimussExamByProgram.Program(childComplexity), true + case "PrimussExamWithCount.ancode": + if e.complexity.PrimussExamWithCount.Ancode == nil { + break + } + + return e.complexity.PrimussExamWithCount.Ancode(childComplexity), true + + case "PrimussExamWithCount.examType": + if e.complexity.PrimussExamWithCount.ExamType == nil { + break + } + + return e.complexity.PrimussExamWithCount.ExamType(childComplexity), true + + case "PrimussExamWithCount.mainExamer": + if e.complexity.PrimussExamWithCount.MainExamer == nil { + break + } + + return e.complexity.PrimussExamWithCount.MainExamer(childComplexity), true + + case "PrimussExamWithCount.module": + if e.complexity.PrimussExamWithCount.Module == nil { + break + } + + return e.complexity.PrimussExamWithCount.Module(childComplexity), true + + case "PrimussExamWithCount.presence": + if e.complexity.PrimussExamWithCount.Presence == nil { + break + } + + return e.complexity.PrimussExamWithCount.Presence(childComplexity), true + + case "PrimussExamWithCount.program": + if e.complexity.PrimussExamWithCount.Program == nil { + break + } + + return e.complexity.PrimussExamWithCount.Program(childComplexity), true + + case "PrimussExamWithCount.studentRegsCount": + if e.complexity.PrimussExamWithCount.StudentRegsCount == nil { + break + } + + return e.complexity.PrimussExamWithCount.StudentRegsCount(childComplexity), true + case "Query.additionalExams": if e.complexity.Query.AdditionalExams == nil { break @@ -1908,7 +2544,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.AllowedSlots(childComplexity, args["examGroupCode"].(int)), true + return e.complexity.Query.AllowedSlots(childComplexity, args["ancode"].(int)), true case "Query.ancodesInPlan": if e.complexity.Query.AncodesInPlan == nil { @@ -1927,19 +2563,19 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.AwkwardSlots(childComplexity, args["examGroupCode"].(int)), true + return e.complexity.Query.AwkwardSlots(childComplexity, args["ancode"].(int)), true - case "Query.conflictingGroupCodes": - if e.complexity.Query.ConflictingGroupCodes == nil { + case "Query.conflictingAncodes": + if e.complexity.Query.ConflictingAncodes == nil { break } - args, err := ec.field_Query_conflictingGroupCodes_args(context.TODO(), rawArgs) + args, err := ec.field_Query_conflictingAncodes_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Query.ConflictingGroupCodes(childComplexity, args["examGroupCode"].(int)), true + return e.complexity.Query.ConflictingAncodes(childComplexity, args["ancode"].(int)), true case "Query.connectedExam": if e.complexity.Query.ConnectedExam == nil { @@ -1984,6 +2620,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.DayOkForInvigilator(childComplexity, args["day"].(int), args["invigilatorID"].(int)), true + case "Query.exam": + if e.complexity.Query.Exam == nil { + break + } + + args, err := ec.field_Query_exam_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.Exam(childComplexity, args["ancode"].(int)), true + case "Query.examGroup": if e.complexity.Query.ExamGroup == nil { break @@ -2003,18 +2651,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.ExamGroups(childComplexity), true - case "Query.examGroupsInSlot": - if e.complexity.Query.ExamGroupsInSlot == nil { - break - } - - args, err := ec.field_Query_examGroupsInSlot_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.ExamGroupsInSlot(childComplexity, args["day"].(int), args["time"].(int)), true - case "Query.examGroupsWithoutSlot": if e.complexity.Query.ExamGroupsWithoutSlot == nil { break @@ -2041,6 +2677,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.ExamerInPlan(childComplexity), true + case "Query.exams": + if e.complexity.Query.Exams == nil { + break + } + + return e.complexity.Query.Exams(childComplexity), true + case "Query.examsInPlan": if e.complexity.Query.ExamsInPlan == nil { break @@ -2079,6 +2722,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.ExamsWithRegs(childComplexity), true + case "Query.examsWithoutSlot": + if e.complexity.Query.ExamsWithoutSlot == nil { + break + } + + return e.complexity.Query.ExamsWithoutSlot(childComplexity), true + + case "Query.externalExams": + if e.complexity.Query.ExternalExams == nil { + break + } + + return e.complexity.Query.ExternalExams(childComplexity), true + case "Query.fk07programs": if e.complexity.Query.Fk07programs == nil { break @@ -2086,6 +2743,25 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Fk07programs(childComplexity), true + case "Query.generatedExam": + if e.complexity.Query.GeneratedExam == nil { + break + } + + args, err := ec.field_Query_generatedExam_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GeneratedExam(childComplexity, args["ancode"].(int)), true + + case "Query.generatedExams": + if e.complexity.Query.GeneratedExams == nil { + break + } + + return e.complexity.Query.GeneratedExams(childComplexity), true + case "Query.invigilatorTodos": if e.complexity.Query.InvigilatorTodos == nil { break @@ -2159,6 +2835,25 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.NtasWithRegsByTeacher(childComplexity), true + case "Query.plannedExam": + if e.complexity.Query.PlannedExam == nil { + break + } + + args, err := ec.field_Query_plannedExam_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.PlannedExam(childComplexity, args["ancode"].(int)), true + + case "Query.plannedExams": + if e.complexity.Query.PlannedExams == nil { + break + } + + return e.complexity.Query.PlannedExams(childComplexity), true + case "Query.plannedExamsInSlot": if e.complexity.Query.PlannedExamsInSlot == nil { break @@ -2190,6 +2885,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.PlannedRoomNamesInSlot(childComplexity, args["day"].(int), args["time"].(int)), true + case "Query.plannedRoomsInSlot": + if e.complexity.Query.PlannedRoomsInSlot == nil { + break + } + + args, err := ec.field_Query_plannedRoomsInSlot_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.PlannedRoomsInSlot(childComplexity, args["day"].(int), args["time"].(int)), true + case "Query.primussExam": if e.complexity.Query.PrimussExam == nil { break @@ -2278,6 +2985,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.SemesterConfig(childComplexity), true + case "Query.studentByMtknr": + if e.complexity.Query.StudentByMtknr == nil { + break + } + + args, err := ec.field_Query_studentByMtknr_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.StudentByMtknr(childComplexity, args["mtknr"].(string)), true + case "Query.studentRegsForProgram": if e.complexity.Query.StudentRegsForProgram == nil { break @@ -2297,6 +3016,25 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.StudentRegsImportErrors(childComplexity), true + case "Query.students": + if e.complexity.Query.Students == nil { + break + } + + return e.complexity.Query.Students(childComplexity), true + + case "Query.studentsByName": + if e.complexity.Query.StudentsByName == nil { + break + } + + args, err := ec.field_Query_studentsByName_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.StudentsByName(childComplexity, args["regex"].(string)), true + case "Query.teacher": if e.complexity.Query.Teacher == nil { break @@ -2772,6 +3510,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Student.Name(childComplexity), true + case "Student.nta": + if e.complexity.Student.Nta == nil { + break + } + + return e.complexity.Student.Nta(childComplexity), true + case "Student.program": if e.complexity.Student.Program == nil { break @@ -2779,6 +3524,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Student.Program(childComplexity), true + case "Student.regs": + if e.complexity.Student.Regs == nil { + break + } + + return e.complexity.Student.Regs(childComplexity), true + case "StudentReg.ancode": if e.complexity.StudentReg.AnCode == nil { break @@ -2835,6 +3587,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.StudentRegsPerAncode.PerProgram(childComplexity), true + case "StudentRegsPerAncodeAndProgram.ancode": + if e.complexity.StudentRegsPerAncodeAndProgram.Ancode == nil { + break + } + + return e.complexity.StudentRegsPerAncodeAndProgram.Ancode(childComplexity), true + case "StudentRegsPerAncodeAndProgram.program": if e.complexity.StudentRegsPerAncodeAndProgram.Program == nil { break @@ -2933,6 +3692,27 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Teacher.Shortname(childComplexity), true + case "ZPAConflict.ancode": + if e.complexity.ZPAConflict.Ancode == nil { + break + } + + return e.complexity.ZPAConflict.Ancode(childComplexity), true + + case "ZPAConflict.numberOfStuds": + if e.complexity.ZPAConflict.NumberOfStuds == nil { + break + } + + return e.complexity.ZPAConflict.NumberOfStuds(childComplexity), true + + case "ZPAConflict.primussAncodes": + if e.complexity.ZPAConflict.PrimussAncodes == nil { + break + } + + return e.complexity.ZPAConflict.PrimussAncodes(childComplexity), true + case "ZPAExam.ancode": if e.complexity.ZPAExam.AnCode == nil { break @@ -2996,6 +3776,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ZPAExam.Module(childComplexity), true + case "ZPAExam.primussAncodes": + if e.complexity.ZPAExam.PrimussAncodes == nil { + break + } + + return e.complexity.ZPAExam.PrimussAncodes(childComplexity), true + case "ZPAExam.semester": if e.complexity.ZPAExam.Semester == nil { break @@ -3052,6 +3839,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ZPAInvigilator.Teacher(childComplexity), true + case "ZPAPrimussAncodes.ancode": + if e.complexity.ZPAPrimussAncodes.Ancode == nil { + break + } + + return e.complexity.ZPAPrimussAncodes.Ancode(childComplexity), true + + case "ZPAPrimussAncodes.program": + if e.complexity.ZPAPrimussAncodes.Program == nil { + break + } + + return e.complexity.ZPAPrimussAncodes.Program(childComplexity), true + case "ZPAStudentReg.ancode": if e.complexity.ZPAStudentReg.AnCode == nil { break @@ -3217,7 +4018,26 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er } var sources = []*ast.Source{ - {Name: "../exam.graphqls", Input: `input AdditionalExamInput { + {Name: "../exam.graphqls", Input: `extend type Query { + connectedExam(ancode: Int!): ConnectedExam + connectedExams: [ConnectedExam!]! + + externalExams: [ExternalExam!]! + + generatedExams: [GeneratedExam!]! + generatedExam(ancode: Int!): GeneratedExam + + plannedExams: [PlannedExam!]! + plannedExam(ancode: Int!): PlannedExam + + conflictingAncodes(ancode: Int!): [Conflict!] + + exam(ancode: Int!): Exam + exams: [Exam!]! +} + +# Deprecated: remove me +input AdditionalExamInput { ancode: Int! module: String! mainExamerID: Int! @@ -3226,6 +4046,7 @@ var sources = []*ast.Source{ groups: [String!]! } +# Deprecated: remove me type AdditionalExam { ancode: Int! module: String! @@ -3236,6 +4057,7 @@ type AdditionalExam { groups: [String!]! } +# Deprecated: remove me type ExamWithRegs { ancode: Int! zpaExam: ZPAExam! @@ -3264,17 +4086,20 @@ type RoomConstraints { seb: Boolean! } +# Deprecated: remove me type ExamToPlan { exam: ExamWithRegs! constraints: Constraints } +# Deprecated: remove me type PlannedExamWithNTA { exam: ExamWithRegs! constraints: Constraints nta: [NTAWithRegs!] } +# Deprecated: remove me type ExamInPlan { exam: ExamWithRegs! constraints: Constraints @@ -3283,13 +4108,82 @@ type ExamInPlan { } type ExamWithRegsAndRooms { - exam: ExamInPlan! - normalRegs: [StudentReg!]! - ntaRegs: [NTAWithRegs!]! - rooms: [RoomForExam!]! + exam: PlannedExam! + normalRegsMtknr: [String!]! + ntas: [NTA!]! + rooms: [PlannedRoom!]! +} + +type ExternalExam { + ancode: Int! + program: String! + module: String! + mainExamer: String! + duration: Int! +} + +type ConnectedExam { + zpaExam: ZPAExam! + primussExams: [PrimussExam!]! + otherPrimussExams: [PrimussExam!]! + errors: [String!]! +} + +type GeneratedExam { + ancode: Int! + zpaExam: ZPAExam! + mainExamer: Teacher! + primussExams: [EnhancedPrimussExam!]! + constraints: Constraints + conflicts: [ZPAConflict!]! + studentRegsCount: Int! + ntas: [NTA!]! + maxDuration: Int! +} + +type ZPAConflict { + ancode: Int! + numberOfStuds: Int! + primussAncodes: [PrimussExamAncode!]! +} + +type PlannedExam { + ancode: Int! + zpaExam: ZPAExam! + mainExamer: Teacher! + primussExams: [EnhancedPrimussExam!]! + constraints: Constraints + conflicts: [ZPAConflict!]! + studentRegsCount: Int! + ntas: [NTA!]! + maxDuration: Int! + planEntry: PlanEntry + plannedRooms: [PlannedRoom!] +} + +type Exam { + ancode: Int! + zpaExam: ZPAExam + externalExam: ExternalExam + primussExams: [PrimussExam!]! + studentRegs: [StudentRegsPerAncodeAndProgram!]! + conflicts: [ConflictsPerProgramAncode!]! + connectErrors: [String!]! + constraints: Constraints + regularStudents: [Student!] + ntaStudents: [Student!] + slot: Slot + rooms: [RoomForExam!] } `, BuiltIn: false}, - {Name: "../invigilation.graphqls", Input: `type Invigilation { + {Name: "../invigilation.graphqls", Input: `extend type Query { + invigilatorTodos: InvigilationTodos + invigilatorsWithReq: [Invigilator!]! + roomsWithInvigilationsForSlot(day: Int!, time: Int!): InvigilationSlot + invigilatorsForDay(day: Int!): InvigilatorsForDay +} + +type Invigilation { roomName: String duration: Int! invigilatorID: Int! @@ -3367,13 +4261,13 @@ type RoomWithInvigilator { setSemester(input: String!): Semester! # Prepare ZPA-Exams zpaExamsToPlan(input: [Int!]!): [ZPAExam!]! - addZpaExamToPlan(ancode: Int!, unknown: Boolean!): Boolean! - rmZpaExamFromPlan(ancode: Int!, unknown: Boolean!): Boolean! + addZpaExamToPlan(ancode: Int!): Boolean! + rmZpaExamFromPlan(ancode: Int!): Boolean! # Additional Exams addAdditionalExam(exam: AdditionalExamInput!): Boolean! # Primuss removePrimussExam(input: PrimussExamInput): Boolean! - prepareExams(input: [PrimussExamInput!]!): Boolean! + # prepareExams(input: [PrimussExamInput!]!): Boolean! addNTA(input: NTAInput!): NTA! # Contraints notPlannedByMe(ancode: Int!): Boolean! @@ -3392,7 +4286,12 @@ type RoomWithInvigilator { addRoomToExam(input: RoomForExamInput!): Boolean! } `, BuiltIn: false}, - {Name: "../nta.graphqls", Input: `type NTAExam { + {Name: "../nta.graphqls", Input: `extend type Query { + ntas: [NTA!] + ntasWithRegs: [Student!] +} + +type NTAExam { semester: String! ancode: String! module: String! @@ -3401,6 +4300,7 @@ type RoomWithInvigilator { type NTA { name: String! + email: String mtknr: String! compensation: String! deltaDurationPercent: Int! @@ -3414,6 +4314,7 @@ type NTA { input NTAInput { name: String! + email: String mtknr: String! compensation: String! deltaDurationPercent: Int! @@ -3438,7 +4339,24 @@ type NTAWithRegsByExam { ntas: [NTAWithRegs!] } `, BuiltIn: false}, - {Name: "../plan.graphqls", Input: `type SemesterConfig { + {Name: "../plan.graphqls", Input: `extend type Query { + allProgramsInPlan: [String!] + ancodesInPlan: [Int!] + examerInPlan: [ExamerInPlan!] + + examsInSlot(day: Int!, time: Int!): [PlannedExam!] + examsWithoutSlot: [PlannedExam!]! + + allowedSlots(ancode: Int!): [Slot!] + awkwardSlots(ancode: Int!): [Slot!]! # slots before or after a conflict +} + +extend type Mutation { + addExamToSlot(day: Int!, time: Int!, ancode: Int!): Boolean! + rmExamFromSlot(ancode: Int!): Boolean! +} + +type SemesterConfig { days: [ExamDay!]! starttimes: [Starttime!]! slots: [Slot!]! @@ -3501,26 +4419,60 @@ type ExamerInPlan { mainExamer: String! mainExamerID: Int! } + +# TODO: remove starttime!!! +type PlanEntry { + dayNumber: Int! + slotNumber: Int! + starttime: Time! + ancode: Int! + locked: Boolean! +} `, BuiltIn: false}, - {Name: "../primuss.graphqls", Input: `type PrimussExam { + {Name: "../primuss.graphqls", Input: `extend type Query { + primussExams: [PrimussExamByProgram] +} + +type PrimussExam { ancode: Int! module: String! mainExamer: String! program: String! examType: String! presence: String! +} + +type EnhancedPrimussExam { + exam: PrimussExam! studentRegs: [StudentReg!]! - conflicts: Conflicts! + conflicts: [Conflict!]! + ntas: [NTA!]! } -input PrimussExamInput { +type PrimussExamWithCount { ancode: Int! + module: String! + mainExamer: String! program: String! + examType: String! + presence: String! + studentRegsCount: Int! } type PrimussExamByProgram { program: String! - exams: [PrimussExam!]! + exams: [PrimussExamWithCount!]! +} + +type PrimussExamAncode { + ancode: Int! + program: String! + numberOfStuds: Int! +} + +input PrimussExamInput { + ancode: Int! + program: String! } type StudentReg { @@ -3549,11 +4501,10 @@ type ConflictPerProgram { conflicts: [Conflict!]! } -type ConnectedExam { - zpaExam: ZPAExam! - primussExams: [PrimussExam!]! - otherPrimussExams: [PrimussExam!]! - errors: [String!]! +type ConflictsPerProgramAncode { + program: String! + ancode: Int! + conflicts: Conflicts } `, BuiltIn: false}, {Name: "../query.graphqls", Input: `type Query { @@ -3562,29 +4513,13 @@ type ConnectedExam { allSemesterNames: [Semester!]! semester: Semester! semesterConfig: SemesterConfig! - # ZPA - teacher(id: Int!): Teacher - teachers(fromZPA: Boolean): [Teacher!]! - invigilators: [ZPAInvigilator!]! - fk07programs: [FK07Program!]! - zpaExams(fromZPA: Boolean): [ZPAExam!]! - zpaExamsByType: [ZPAExamsForType!]! - zpaExamsToPlan: [ZPAExam!]! - zpaExamsNotToPlan: [ZPAExam!]! - zpaExamsPlaningStatusUnknown: [ZPAExam!]! - zpaExam(ancode: Int!): ZPAExam - zpaAnCodes: [AnCode] - studentRegsImportErrors: [RegWithError!]! # Additional Exams additionalExams: [AdditionalExam!]! # Primuss - primussExams: [PrimussExamByProgram] primussExam(program: String!, ancode: Int!): PrimussExam! primussExamsForAnCode(ancode: Int!): [PrimussExam!] studentRegsForProgram(program: String!): [StudentReg!] - # Exams connected - connectedExam(ancode: Int!): ConnectedExam - connectedExams: [ConnectedExam!]! + # exam with regs examWithRegs(ancode: Int!): ExamWithRegs examsWithRegs: [ExamWithRegs!] @@ -3594,27 +4529,20 @@ type ConnectedExam { # exam groups examGroups: [ExamGroup!]! examGroup(examGroupCode: Int!): ExamGroup - conflictingGroupCodes(examGroupCode: Int!): [ExamGroupConflict!] # NTAs - ntas: [NTA!] - ntasWithRegs: [NTAWithRegs!] ntasWithRegsByTeacher: [NTAWithRegsByExamAndTeacher!] nta(mtknr: String!): NTAWithRegs + # Plan - allowedSlots(examGroupCode: Int!): [Slot!] - awkwardSlots(examGroupCode: Int!): [Slot!]! # slots before or after a conflict - examGroupsInSlot(day: Int!, time: Int!): [ExamGroup!] examGroupsWithoutSlot: [ExamGroup!] - allProgramsInPlan: [String!] - ancodesInPlan: [Int!] - examerInPlan: [ExamerInPlan!] + # PlannedExamsWithNTA plannedExamsInSlot(day: Int!, time: Int!): [PlannedExamWithNTA!] examsInPlan: [ExamInPlan!] - examsInSlot(day: Int!, time: Int!): [ExamInPlan!] + # examsInSlot(day: Int!, time: Int!): [ExamInPlan!] # Rooms examsInSlotWithRooms(day: Int!, time: Int!): [ExamWithRegsAndRooms!] - rooms: [Room!]! + # rooms: [Room!]! roomsWithConstraints( handicap: Boolean! lab: Boolean! @@ -3622,17 +4550,19 @@ type ConnectedExam { exahm: Boolean ): [Room!]! roomsForSlot(day: Int!, time: Int!): SlotWithRooms - plannedRoomNames: [String!] - plannedRoomNamesInSlot(day: Int!, time: Int!): [String!] + # Invigilators - invigilatorsWithReq: [Invigilator!]! - invigilatorTodos: InvigilationTodos - roomsWithInvigilationsForSlot(day: Int!, time: Int!): InvigilationSlot - invigilatorsForDay(day: Int!): InvigilatorsForDay dayOkForInvigilator(day: Int!, invigilatorID: Int!): Boolean } `, BuiltIn: false}, - {Name: "../room.graphqls", Input: `type Room { + {Name: "../room.graphqls", Input: `extend type Query { + rooms: [Room!]! + plannedRoomNames: [String!] + plannedRoomNamesInSlot(day: Int!, time: Int!): [String!] + plannedRoomsInSlot(day: Int!, time: Int!): [PlannedRoom!] +} + +type Room { name: String! seats: Int! handicap: Boolean! @@ -3652,6 +4582,36 @@ type SlotWithRooms { ntaRooms: [Room!]! } +type PlannedRoom { + day: Int! + slot: Int! + room: Room! + ancode: Int! + duration: Int! + handicap: Boolean! + handicapRoomAlone: Boolean! + reserve: Boolean! + studentsInRoom: [String!]! + ntaMtknr: String +} + +# type EnhancedPlannedRoom { +# day: Int! +# slot: Int! +# roomName: String! +# room: Room! +# ancode: Int! +# exam: GeneratedExam! +# duration: Int! +# handicap: Boolean! +# handicapRoomAlone: Boolean! +# reserve: Boolean! +# studentsInRoom: [String!]! +# ntaMtknr: String +# ntaInRoom: NTA +# } + +# Deprecated: rm me type RoomForExam { ancode: Int! room: Room @@ -3662,6 +4622,7 @@ type RoomForExam { students: [StudentReg!]! } +# Deprecated: rm me input RoomForExamInput { ancode: Int! day: Int! @@ -3674,7 +4635,7 @@ input RoomForExamInput { } type RoomAndExam { - room: RoomForExam! + room: PlannedRoom! exam: ZPAExam! } `, BuiltIn: false}, @@ -3686,7 +4647,13 @@ type AnCode { ancode: Int! } `, BuiltIn: false}, - {Name: "../studentregs.graphqls", Input: `type StudentRegsPerStudent { + {Name: "../studentregs.graphqls", Input: `extend type Query { + studentByMtknr(mtknr: String!): Student + studentsByName(regex: String!): [Student!]! + students: [Student!]! +} + +type StudentRegsPerStudent { student: Student! ancodes: [Int!]! } @@ -3698,6 +4665,7 @@ type StudentRegsPerAncode { type StudentRegsPerAncodeAndProgram { program: String! + ancode: Int! studentRegs: [StudentReg!]! } @@ -3706,6 +4674,8 @@ type Student { program: String! group: String! name: String! + regs: [Int!]! + nta: NTA } `, BuiltIn: false}, {Name: "../workflow.graphqls", Input: `scalar Time @@ -3717,7 +4687,22 @@ type Step { deadline: Time } `, BuiltIn: false}, - {Name: "../zpa.graphqls", Input: `type ZPAExam { + {Name: "../zpa.graphqls", Input: `extend type Query { + teacher(id: Int!): Teacher + teachers(fromZPA: Boolean): [Teacher!]! + invigilators: [ZPAInvigilator!]! + fk07programs: [FK07Program!]! + zpaExams(fromZPA: Boolean): [ZPAExam!]! + zpaExamsByType: [ZPAExamsForType!]! + zpaExamsToPlan: [ZPAExam!]! + zpaExamsNotToPlan: [ZPAExam!]! + zpaExamsPlaningStatusUnknown: [ZPAExam!]! + zpaExam(ancode: Int!): ZPAExam + zpaAnCodes: [AnCode] + studentRegsImportErrors: [RegWithError!]! +} + +type ZPAExam { zpaID: Int! semester: String! ancode: Int! @@ -3729,6 +4714,12 @@ type Step { duration: Int! isRepeaterExam: Boolean! groups: [String!]! + primussAncodes: [ZPAPrimussAncodes!]! +} + +type ZPAPrimussAncodes { + program: String! + ancode: Int! } type ZPAExamsForType { @@ -3759,6 +4750,7 @@ type FK07Program { name: String! } +# Deprecated: remove me type ZPAExamWithConstraints { zpaExam: ZPAExam! constraints: Constraints # == nil if no constraint @@ -3832,6 +4824,39 @@ func (ec *executionContext) field_Mutation_addExamGroupToSlot_args(ctx context.C return args, nil } +func (ec *executionContext) field_Mutation_addExamToSlot_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 int + if tmp, ok := rawArgs["day"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("day")) + arg0, err = ec.unmarshalNInt2int(ctx, tmp) + if err != nil { + return nil, err + } + } + args["day"] = arg0 + var arg1 int + if tmp, ok := rawArgs["time"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("time")) + arg1, err = ec.unmarshalNInt2int(ctx, tmp) + if err != nil { + return nil, err + } + } + args["time"] = arg1 + var arg2 int + if tmp, ok := rawArgs["ancode"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ancode")) + arg2, err = ec.unmarshalNInt2int(ctx, tmp) + if err != nil { + return nil, err + } + } + args["ancode"] = arg2 + return args, nil +} + func (ec *executionContext) field_Mutation_addNTA_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -3874,15 +4899,6 @@ func (ec *executionContext) field_Mutation_addZpaExamToPlan_args(ctx context.Con } } args["ancode"] = arg0 - var arg1 bool - if tmp, ok := rawArgs["unknown"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("unknown")) - arg1, err = ec.unmarshalNBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["unknown"] = arg1 return args, nil } @@ -4009,13 +5025,13 @@ func (ec *executionContext) field_Mutation_possibleDays_args(ctx context.Context return args, nil } -func (ec *executionContext) field_Mutation_prepareExams_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_removePrimussExam_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 []*model.PrimussExamInput + var arg0 *model.PrimussExamInput if tmp, ok := rawArgs["input"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNPrimussExamInput2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamInputᚄ(ctx, tmp) + arg0, err = ec.unmarshalOPrimussExamInput2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamInput(ctx, tmp) if err != nil { return nil, err } @@ -4024,18 +5040,18 @@ func (ec *executionContext) field_Mutation_prepareExams_args(ctx context.Context return args, nil } -func (ec *executionContext) field_Mutation_removePrimussExam_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_rmExamFromSlot_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.PrimussExamInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalOPrimussExamInput2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamInput(ctx, tmp) + var arg0 int + if tmp, ok := rawArgs["ancode"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ancode")) + arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err } } - args["input"] = arg0 + args["ancode"] = arg0 return args, nil } @@ -4066,15 +5082,6 @@ func (ec *executionContext) field_Mutation_rmZpaExamFromPlan_args(ctx context.Co } } args["ancode"] = arg0 - var arg1 bool - if tmp, ok := rawArgs["unknown"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("unknown")) - arg1, err = ec.unmarshalNBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["unknown"] = arg1 return args, nil } @@ -4166,14 +5173,14 @@ func (ec *executionContext) field_Query_allowedSlots_args(ctx context.Context, r var err error args := map[string]interface{}{} var arg0 int - if tmp, ok := rawArgs["examGroupCode"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("examGroupCode")) + if tmp, ok := rawArgs["ancode"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ancode")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err } } - args["examGroupCode"] = arg0 + args["ancode"] = arg0 return args, nil } @@ -4181,29 +5188,29 @@ func (ec *executionContext) field_Query_awkwardSlots_args(ctx context.Context, r var err error args := map[string]interface{}{} var arg0 int - if tmp, ok := rawArgs["examGroupCode"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("examGroupCode")) + if tmp, ok := rawArgs["ancode"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ancode")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err } } - args["examGroupCode"] = arg0 + args["ancode"] = arg0 return args, nil } -func (ec *executionContext) field_Query_conflictingGroupCodes_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_conflictingAncodes_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 int - if tmp, ok := rawArgs["examGroupCode"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("examGroupCode")) + if tmp, ok := rawArgs["ancode"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ancode")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err } } - args["examGroupCode"] = arg0 + args["ancode"] = arg0 return args, nil } @@ -4276,31 +5283,22 @@ func (ec *executionContext) field_Query_examGroup_args(ctx context.Context, rawA return args, nil } -func (ec *executionContext) field_Query_examGroupsInSlot_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_examWithRegs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 int - if tmp, ok := rawArgs["day"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("day")) + if tmp, ok := rawArgs["ancode"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ancode")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err } } - args["day"] = arg0 - var arg1 int - if tmp, ok := rawArgs["time"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("time")) - arg1, err = ec.unmarshalNInt2int(ctx, tmp) - if err != nil { - return nil, err - } - } - args["time"] = arg1 + args["ancode"] = arg0 return args, nil } -func (ec *executionContext) field_Query_examWithRegs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_exam_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 int @@ -4363,6 +5361,21 @@ func (ec *executionContext) field_Query_examsInSlot_args(ctx context.Context, ra return args, nil } +func (ec *executionContext) field_Query_generatedExam_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 int + if tmp, ok := rawArgs["ancode"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ancode")) + arg0, err = ec.unmarshalNInt2int(ctx, tmp) + if err != nil { + return nil, err + } + } + args["ancode"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query_invigilatorsForDay_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -4393,6 +5406,21 @@ func (ec *executionContext) field_Query_nta_args(ctx context.Context, rawArgs ma return args, nil } +func (ec *executionContext) field_Query_plannedExam_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 int + if tmp, ok := rawArgs["ancode"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ancode")) + arg0, err = ec.unmarshalNInt2int(ctx, tmp) + if err != nil { + return nil, err + } + } + args["ancode"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query_plannedExamsInSlot_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -4441,6 +5469,30 @@ func (ec *executionContext) field_Query_plannedRoomNamesInSlot_args(ctx context. return args, nil } +func (ec *executionContext) field_Query_plannedRoomsInSlot_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 int + if tmp, ok := rawArgs["day"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("day")) + arg0, err = ec.unmarshalNInt2int(ctx, tmp) + if err != nil { + return nil, err + } + } + args["day"] = arg0 + var arg1 int + if tmp, ok := rawArgs["time"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("time")) + arg1, err = ec.unmarshalNInt2int(ctx, tmp) + if err != nil { + return nil, err + } + } + args["time"] = arg1 + return args, nil +} + func (ec *executionContext) field_Query_primussExam_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -4570,6 +5622,21 @@ func (ec *executionContext) field_Query_roomsWithInvigilationsForSlot_args(ctx c return args, nil } +func (ec *executionContext) field_Query_studentByMtknr_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["mtknr"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mtknr")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["mtknr"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query_studentRegsForProgram_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -4585,6 +5652,21 @@ func (ec *executionContext) field_Query_studentRegsForProgram_args(ctx context.C return args, nil } +func (ec *executionContext) field_Query_studentsByName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["regex"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("regex")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["regex"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query_teacher_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -5399,6 +6481,145 @@ func (ec *executionContext) fieldContext_Conflicts_conflicts(ctx context.Context return fc, nil } +func (ec *executionContext) _ConflictsPerProgramAncode_program(ctx context.Context, field graphql.CollectedField, obj *model.ConflictsPerProgramAncode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConflictsPerProgramAncode_program(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Program, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ConflictsPerProgramAncode_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ConflictsPerProgramAncode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ConflictsPerProgramAncode_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ConflictsPerProgramAncode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConflictsPerProgramAncode_ancode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ancode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ConflictsPerProgramAncode_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ConflictsPerProgramAncode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ConflictsPerProgramAncode_conflicts(ctx context.Context, field graphql.CollectedField, obj *model.ConflictsPerProgramAncode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ConflictsPerProgramAncode_conflicts(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Conflicts, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Conflicts) + fc.Result = res + return ec.marshalOConflicts2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflicts(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ConflictsPerProgramAncode_conflicts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ConflictsPerProgramAncode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "ancode": + return ec.fieldContext_Conflicts_ancode(ctx, field) + case "module": + return ec.fieldContext_Conflicts_module(ctx, field) + case "mainExamer": + return ec.fieldContext_Conflicts_mainExamer(ctx, field) + case "conflicts": + return ec.fieldContext_Conflicts_conflicts(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Conflicts", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _ConnectedExam_zpaExam(ctx context.Context, field graphql.CollectedField, obj *model.ConnectedExam) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ConnectedExam_zpaExam(ctx, field) if err != nil { @@ -5460,6 +6681,8 @@ func (ec *executionContext) fieldContext_ConnectedExam_zpaExam(ctx context.Conte return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) case "groups": return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, @@ -5518,10 +6741,6 @@ func (ec *executionContext) fieldContext_ConnectedExam_primussExams(ctx context. return ec.fieldContext_PrimussExam_examType(ctx, field) case "presence": return ec.fieldContext_PrimussExam_presence(ctx, field) - case "studentRegs": - return ec.fieldContext_PrimussExam_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_PrimussExam_conflicts(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) }, @@ -5580,10 +6799,6 @@ func (ec *executionContext) fieldContext_ConnectedExam_otherPrimussExams(ctx con return ec.fieldContext_PrimussExam_examType(ctx, field) case "presence": return ec.fieldContext_PrimussExam_presence(ctx, field) - case "studentRegs": - return ec.fieldContext_PrimussExam_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_PrimussExam_conflicts(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) }, @@ -6023,8 +7238,8 @@ func (ec *executionContext) fieldContext_Constraints_roomConstraints(ctx context return fc, nil } -func (ec *executionContext) _ExamDay_number(ctx context.Context, field graphql.CollectedField, obj *model.ExamDay) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamDay_number(ctx, field) +func (ec *executionContext) _EnhancedPrimussExam_exam(ctx context.Context, field graphql.CollectedField, obj *model.EnhancedPrimussExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EnhancedPrimussExam_exam(ctx, field) if err != nil { return graphql.Null } @@ -6037,7 +7252,7 @@ func (ec *executionContext) _ExamDay_number(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Number, nil + return obj.Exam, nil }) if err != nil { ec.Error(ctx, err) @@ -6049,26 +7264,40 @@ func (ec *executionContext) _ExamDay_number(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.PrimussExam) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNPrimussExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamDay_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_EnhancedPrimussExam_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamDay", + Object: "EnhancedPrimussExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_PrimussExam_ancode(ctx, field) + case "module": + return ec.fieldContext_PrimussExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_PrimussExam_mainExamer(ctx, field) + case "program": + return ec.fieldContext_PrimussExam_program(ctx, field) + case "examType": + return ec.fieldContext_PrimussExam_examType(ctx, field) + case "presence": + return ec.fieldContext_PrimussExam_presence(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamDay_date(ctx context.Context, field graphql.CollectedField, obj *model.ExamDay) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamDay_date(ctx, field) +func (ec *executionContext) _EnhancedPrimussExam_studentRegs(ctx context.Context, field graphql.CollectedField, obj *model.EnhancedPrimussExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EnhancedPrimussExam_studentRegs(ctx, field) if err != nil { return graphql.Null } @@ -6081,7 +7310,7 @@ func (ec *executionContext) _ExamDay_date(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Date, nil + return obj.StudentRegs, nil }) if err != nil { ec.Error(ctx, err) @@ -6093,26 +7322,40 @@ func (ec *executionContext) _ExamDay_date(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.([]*model.StudentReg) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamDay_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_EnhancedPrimussExam_studentRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamDay", + Object: "EnhancedPrimussExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "mtknr": + return ec.fieldContext_StudentReg_mtknr(ctx, field) + case "ancode": + return ec.fieldContext_StudentReg_ancode(ctx, field) + case "program": + return ec.fieldContext_StudentReg_program(ctx, field) + case "group": + return ec.fieldContext_StudentReg_group(ctx, field) + case "name": + return ec.fieldContext_StudentReg_name(ctx, field) + case "presence": + return ec.fieldContext_StudentReg_presence(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type StudentReg", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroup_examGroupCode(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroup) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroup_examGroupCode(ctx, field) +func (ec *executionContext) _EnhancedPrimussExam_conflicts(ctx context.Context, field graphql.CollectedField, obj *model.EnhancedPrimussExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EnhancedPrimussExam_conflicts(ctx, field) if err != nil { return graphql.Null } @@ -6125,7 +7368,7 @@ func (ec *executionContext) _ExamGroup_examGroupCode(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExamGroupCode, nil + return obj.Conflicts, nil }) if err != nil { ec.Error(ctx, err) @@ -6137,26 +7380,32 @@ func (ec *executionContext) _ExamGroup_examGroupCode(ctx context.Context, field } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.Conflict) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroup_examGroupCode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_EnhancedPrimussExam_conflicts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroup", + Object: "EnhancedPrimussExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_Conflict_ancode(ctx, field) + case "numberOfStuds": + return ec.fieldContext_Conflict_numberOfStuds(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Conflict", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroup_exams(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroup) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroup_exams(ctx, field) +func (ec *executionContext) _EnhancedPrimussExam_ntas(ctx context.Context, field graphql.CollectedField, obj *model.EnhancedPrimussExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_EnhancedPrimussExam_ntas(ctx, field) if err != nil { return graphql.Null } @@ -6169,7 +7418,7 @@ func (ec *executionContext) _ExamGroup_exams(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exams, nil + return obj.Ntas, nil }) if err != nil { ec.Error(ctx, err) @@ -6181,32 +7430,50 @@ func (ec *executionContext) _ExamGroup_exams(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.([]*model.ExamToPlan) + res := resTmp.([]*model.NTA) fc.Result = res - return ec.marshalNExamToPlan2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamToPlanᚄ(ctx, field.Selections, res) + return ec.marshalNNTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroup_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_EnhancedPrimussExam_ntas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroup", + Object: "EnhancedPrimussExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "exam": - return ec.fieldContext_ExamToPlan_exam(ctx, field) - case "constraints": - return ec.fieldContext_ExamToPlan_constraints(ctx, field) + case "name": + return ec.fieldContext_NTA_name(ctx, field) + case "email": + return ec.fieldContext_NTA_email(ctx, field) + case "mtknr": + return ec.fieldContext_NTA_mtknr(ctx, field) + case "compensation": + return ec.fieldContext_NTA_compensation(ctx, field) + case "deltaDurationPercent": + return ec.fieldContext_NTA_deltaDurationPercent(ctx, field) + case "needsRoomAlone": + return ec.fieldContext_NTA_needsRoomAlone(ctx, field) + case "program": + return ec.fieldContext_NTA_program(ctx, field) + case "from": + return ec.fieldContext_NTA_from(ctx, field) + case "until": + return ec.fieldContext_NTA_until(ctx, field) + case "lastSemester": + return ec.fieldContext_NTA_lastSemester(ctx, field) + case "exams": + return ec.fieldContext_NTA_exams(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ExamToPlan", field.Name) + return nil, fmt.Errorf("no field named %q was found under type NTA", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroup_examGroupInfo(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroup) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) +func (ec *executionContext) _Exam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_ancode(ctx, field) if err != nil { return graphql.Null } @@ -6219,59 +7486,38 @@ func (ec *executionContext) _ExamGroup_examGroupInfo(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExamGroupInfo, nil + return obj.Ancode, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.ExamGroupInfo) + res := resTmp.(int) fc.Result = res - return ec.marshalOExamGroupInfo2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupInfo(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroup_examGroupInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroup", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "notPlannedByMe": - return ec.fieldContext_ExamGroupInfo_notPlannedByMe(ctx, field) - case "excludeDays": - return ec.fieldContext_ExamGroupInfo_excludeDays(ctx, field) - case "possibleDays": - return ec.fieldContext_ExamGroupInfo_possibleDays(ctx, field) - case "fixedDay": - return ec.fieldContext_ExamGroupInfo_fixedDay(ctx, field) - case "fixedSlot": - return ec.fieldContext_ExamGroupInfo_fixedSlot(ctx, field) - case "possibleSlots": - return ec.fieldContext_ExamGroupInfo_possibleSlots(ctx, field) - case "conflicts": - return ec.fieldContext_ExamGroupInfo_conflicts(ctx, field) - case "studentRegs": - return ec.fieldContext_ExamGroupInfo_studentRegs(ctx, field) - case "programs": - return ec.fieldContext_ExamGroupInfo_programs(ctx, field) - case "maxDuration": - return ec.fieldContext_ExamGroupInfo_maxDuration(ctx, field) - case "maxDurationNTA": - return ec.fieldContext_ExamGroupInfo_maxDurationNTA(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamGroupInfo", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamGroupConflict_examGroupCode(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupConflict) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupConflict_examGroupCode(ctx, field) +func (ec *executionContext) _Exam_zpaExam(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_zpaExam(ctx, field) if err != nil { return graphql.Null } @@ -6284,38 +7530,61 @@ func (ec *executionContext) _ExamGroupConflict_examGroupCode(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExamGroupCode, nil + return obj.ZpaExam, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.ZPAExam) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupConflict_examGroupCode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_zpaExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupConflict", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroupConflict_count(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupConflict) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupConflict_count(ctx, field) +func (ec *executionContext) _Exam_externalExam(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_externalExam(ctx, field) if err != nil { return graphql.Null } @@ -6328,38 +7597,47 @@ func (ec *executionContext) _ExamGroupConflict_count(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Count, nil + return obj.ExternalExam, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.ExternalExam) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOExternalExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExternalExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupConflict_count(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_externalExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupConflict", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_ExternalExam_ancode(ctx, field) + case "program": + return ec.fieldContext_ExternalExam_program(ctx, field) + case "module": + return ec.fieldContext_ExternalExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ExternalExam_mainExamer(ctx, field) + case "duration": + return ec.fieldContext_ExternalExam_duration(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExternalExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroupInfo_notPlannedByMe(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_notPlannedByMe(ctx, field) +func (ec *executionContext) _Exam_primussExams(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_primussExams(ctx, field) if err != nil { return graphql.Null } @@ -6372,7 +7650,7 @@ func (ec *executionContext) _ExamGroupInfo_notPlannedByMe(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.NotPlannedByMe, nil + return obj.PrimussExams, nil }) if err != nil { ec.Error(ctx, err) @@ -6384,26 +7662,40 @@ func (ec *executionContext) _ExamGroupInfo_notPlannedByMe(ctx context.Context, f } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.PrimussExam) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_notPlannedByMe(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_primussExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_PrimussExam_ancode(ctx, field) + case "module": + return ec.fieldContext_PrimussExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_PrimussExam_mainExamer(ctx, field) + case "program": + return ec.fieldContext_PrimussExam_program(ctx, field) + case "examType": + return ec.fieldContext_PrimussExam_examType(ctx, field) + case "presence": + return ec.fieldContext_PrimussExam_presence(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroupInfo_excludeDays(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_excludeDays(ctx, field) +func (ec *executionContext) _Exam_studentRegs(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_studentRegs(ctx, field) if err != nil { return graphql.Null } @@ -6416,35 +7708,46 @@ func (ec *executionContext) _ExamGroupInfo_excludeDays(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExcludeDays, nil + return obj.StudentRegs, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]int) + res := resTmp.([]*model.StudentRegsPerAncodeAndProgram) fc.Result = res - return ec.marshalOInt2ᚕintᚄ(ctx, field.Selections, res) + return ec.marshalNStudentRegsPerAncodeAndProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgramᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_excludeDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_studentRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "program": + return ec.fieldContext_StudentRegsPerAncodeAndProgram_program(ctx, field) + case "ancode": + return ec.fieldContext_StudentRegsPerAncodeAndProgram_ancode(ctx, field) + case "studentRegs": + return ec.fieldContext_StudentRegsPerAncodeAndProgram_studentRegs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type StudentRegsPerAncodeAndProgram", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroupInfo_possibleDays(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_possibleDays(ctx, field) +func (ec *executionContext) _Exam_conflicts(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_conflicts(ctx, field) if err != nil { return graphql.Null } @@ -6457,35 +7760,46 @@ func (ec *executionContext) _ExamGroupInfo_possibleDays(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PossibleDays, nil + return obj.Conflicts, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]int) + res := resTmp.([]*model.ConflictsPerProgramAncode) fc.Result = res - return ec.marshalOInt2ᚕintᚄ(ctx, field.Selections, res) + return ec.marshalNConflictsPerProgramAncode2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictsPerProgramAncodeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_possibleDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_conflicts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "program": + return ec.fieldContext_ConflictsPerProgramAncode_program(ctx, field) + case "ancode": + return ec.fieldContext_ConflictsPerProgramAncode_ancode(ctx, field) + case "conflicts": + return ec.fieldContext_ConflictsPerProgramAncode_conflicts(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConflictsPerProgramAncode", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroupInfo_fixedDay(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_fixedDay(ctx, field) +func (ec *executionContext) _Exam_connectErrors(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_connectErrors(ctx, field) if err != nil { return graphql.Null } @@ -6498,35 +7812,38 @@ func (ec *executionContext) _ExamGroupInfo_fixedDay(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.FixedDay, nil + return obj.ConnectErrors, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*int) + res := resTmp.([]string) fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_fixedDay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_connectErrors(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamGroupInfo_fixedSlot(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_fixedSlot(ctx, field) +func (ec *executionContext) _Exam_constraints(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_constraints(ctx, field) if err != nil { return graphql.Null } @@ -6539,7 +7856,7 @@ func (ec *executionContext) _ExamGroupInfo_fixedSlot(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.FixedSlot, nil + return obj.Constraints, nil }) if err != nil { ec.Error(ctx, err) @@ -6548,34 +7865,46 @@ func (ec *executionContext) _ExamGroupInfo_fixedSlot(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*model.Slot) + res := resTmp.(*model.Constraints) fc.Result = res - return ec.marshalOSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx, field.Selections, res) + return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_fixedSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "dayNumber": - return ec.fieldContext_Slot_dayNumber(ctx, field) - case "slotNumber": - return ec.fieldContext_Slot_slotNumber(ctx, field) - case "starttime": - return ec.fieldContext_Slot_starttime(ctx, field) + case "ancode": + return ec.fieldContext_Constraints_ancode(ctx, field) + case "notPlannedByMe": + return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) + case "excludeDays": + return ec.fieldContext_Constraints_excludeDays(ctx, field) + case "possibleDays": + return ec.fieldContext_Constraints_possibleDays(ctx, field) + case "fixedDay": + return ec.fieldContext_Constraints_fixedDay(ctx, field) + case "fixedTime": + return ec.fieldContext_Constraints_fixedTime(ctx, field) + case "sameSlot": + return ec.fieldContext_Constraints_sameSlot(ctx, field) + case "online": + return ec.fieldContext_Constraints_online(ctx, field) + case "roomConstraints": + return ec.fieldContext_Constraints_roomConstraints(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroupInfo_possibleSlots(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_possibleSlots(ctx, field) +func (ec *executionContext) _Exam_regularStudents(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_regularStudents(ctx, field) if err != nil { return graphql.Null } @@ -6588,7 +7917,7 @@ func (ec *executionContext) _ExamGroupInfo_possibleSlots(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PossibleSlots, nil + return obj.RegularStudents, nil }) if err != nil { ec.Error(ctx, err) @@ -6597,34 +7926,40 @@ func (ec *executionContext) _ExamGroupInfo_possibleSlots(ctx context.Context, fi if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.Slot) + res := resTmp.([]*model.Student) fc.Result = res - return ec.marshalOSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx, field.Selections, res) + return ec.marshalOStudent2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_possibleSlots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_regularStudents(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "dayNumber": - return ec.fieldContext_Slot_dayNumber(ctx, field) - case "slotNumber": - return ec.fieldContext_Slot_slotNumber(ctx, field) - case "starttime": - return ec.fieldContext_Slot_starttime(ctx, field) + case "mtknr": + return ec.fieldContext_Student_mtknr(ctx, field) + case "program": + return ec.fieldContext_Student_program(ctx, field) + case "group": + return ec.fieldContext_Student_group(ctx, field) + case "name": + return ec.fieldContext_Student_name(ctx, field) + case "regs": + return ec.fieldContext_Student_regs(ctx, field) + case "nta": + return ec.fieldContext_Student_nta(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Student", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroupInfo_conflicts(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_conflicts(ctx, field) +func (ec *executionContext) _Exam_ntaStudents(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_ntaStudents(ctx, field) if err != nil { return graphql.Null } @@ -6637,7 +7972,7 @@ func (ec *executionContext) _ExamGroupInfo_conflicts(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Conflicts, nil + return obj.NtaStudents, nil }) if err != nil { ec.Error(ctx, err) @@ -6646,32 +7981,40 @@ func (ec *executionContext) _ExamGroupInfo_conflicts(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.ExamGroupConflict) + res := resTmp.([]*model.Student) fc.Result = res - return ec.marshalOExamGroupConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupConflict(ctx, field.Selections, res) + return ec.marshalOStudent2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_conflicts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_ntaStudents(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "examGroupCode": - return ec.fieldContext_ExamGroupConflict_examGroupCode(ctx, field) - case "count": - return ec.fieldContext_ExamGroupConflict_count(ctx, field) + case "mtknr": + return ec.fieldContext_Student_mtknr(ctx, field) + case "program": + return ec.fieldContext_Student_program(ctx, field) + case "group": + return ec.fieldContext_Student_group(ctx, field) + case "name": + return ec.fieldContext_Student_name(ctx, field) + case "regs": + return ec.fieldContext_Student_regs(ctx, field) + case "nta": + return ec.fieldContext_Student_nta(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ExamGroupConflict", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Student", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroupInfo_studentRegs(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_studentRegs(ctx, field) +func (ec *executionContext) _Exam_slot(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_slot(ctx, field) if err != nil { return graphql.Null } @@ -6684,38 +8027,43 @@ func (ec *executionContext) _ExamGroupInfo_studentRegs(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.StudentRegs, nil + return obj.Slot, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.Slot) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_studentRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_slot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } + switch field.Name { + case "dayNumber": + return ec.fieldContext_Slot_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_Slot_slotNumber(ctx, field) + case "starttime": + return ec.fieldContext_Slot_starttime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) + }, + } return fc, nil } -func (ec *executionContext) _ExamGroupInfo_programs(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_programs(ctx, field) +func (ec *executionContext) _Exam_rooms(ctx context.Context, field graphql.CollectedField, obj *model.Exam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Exam_rooms(ctx, field) if err != nil { return graphql.Null } @@ -6728,38 +8076,51 @@ func (ec *executionContext) _ExamGroupInfo_programs(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Programs, nil + return obj.Rooms, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]string) + res := resTmp.([]*model.RoomForExam) fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalORoomForExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_programs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Exam_rooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "Exam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_RoomForExam_ancode(ctx, field) + case "room": + return ec.fieldContext_RoomForExam_room(ctx, field) + case "seatsPlanned": + return ec.fieldContext_RoomForExam_seatsPlanned(ctx, field) + case "duration": + return ec.fieldContext_RoomForExam_duration(ctx, field) + case "handicap": + return ec.fieldContext_RoomForExam_handicap(ctx, field) + case "reserve": + return ec.fieldContext_RoomForExam_reserve(ctx, field) + case "students": + return ec.fieldContext_RoomForExam_students(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RoomForExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamGroupInfo_maxDuration(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_maxDuration(ctx, field) +func (ec *executionContext) _ExamDay_number(ctx context.Context, field graphql.CollectedField, obj *model.ExamDay) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamDay_number(ctx, field) if err != nil { return graphql.Null } @@ -6772,7 +8133,7 @@ func (ec *executionContext) _ExamGroupInfo_maxDuration(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MaxDuration, nil + return obj.Number, nil }) if err != nil { ec.Error(ctx, err) @@ -6789,9 +8150,9 @@ func (ec *executionContext) _ExamGroupInfo_maxDuration(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_maxDuration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamDay_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "ExamDay", Field: field, IsMethod: false, IsResolver: false, @@ -6802,8 +8163,8 @@ func (ec *executionContext) fieldContext_ExamGroupInfo_maxDuration(ctx context.C return fc, nil } -func (ec *executionContext) _ExamGroupInfo_maxDurationNTA(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamGroupInfo_maxDurationNTA(ctx, field) +func (ec *executionContext) _ExamDay_date(ctx context.Context, field graphql.CollectedField, obj *model.ExamDay) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamDay_date(ctx, field) if err != nil { return graphql.Null } @@ -6816,35 +8177,38 @@ func (ec *executionContext) _ExamGroupInfo_maxDurationNTA(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MaxDurationNta, nil + return obj.Date, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*int) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamGroupInfo_maxDurationNTA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamDay_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamGroupInfo", + Object: "ExamDay", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamInPlan_exam(ctx context.Context, field graphql.CollectedField, obj *model.ExamInPlan) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamInPlan_exam(ctx, field) +func (ec *executionContext) _ExamGroup_examGroupCode(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroup) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroup_examGroupCode(ctx, field) if err != nil { return graphql.Null } @@ -6857,7 +8221,7 @@ func (ec *executionContext) _ExamInPlan_exam(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exam, nil + return obj.ExamGroupCode, nil }) if err != nil { ec.Error(ctx, err) @@ -6869,40 +8233,26 @@ func (ec *executionContext) _ExamInPlan_exam(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(*model.ExamWithRegs) + res := resTmp.(int) fc.Result = res - return ec.marshalNExamWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegs(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamInPlan_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroup_examGroupCode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamInPlan", + Object: "ExamGroup", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_ExamWithRegs_ancode(ctx, field) - case "zpaExam": - return ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) - case "primussExams": - return ec.fieldContext_ExamWithRegs_primussExams(ctx, field) - case "studentRegs": - return ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_ExamWithRegs_conflicts(ctx, field) - case "connectErrors": - return ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamWithRegs", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamInPlan_constraints(ctx context.Context, field graphql.CollectedField, obj *model.ExamInPlan) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamInPlan_constraints(ctx, field) +func (ec *executionContext) _ExamGroup_exams(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroup) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroup_exams(ctx, field) if err != nil { return graphql.Null } @@ -6915,55 +8265,44 @@ func (ec *executionContext) _ExamInPlan_constraints(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Constraints, nil + return obj.Exams, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Constraints) + res := resTmp.([]*model.ExamToPlan) fc.Result = res - return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) + return ec.marshalNExamToPlan2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamToPlanᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamInPlan_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroup_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamInPlan", + Object: "ExamGroup", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "ancode": - return ec.fieldContext_Constraints_ancode(ctx, field) - case "notPlannedByMe": - return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) - case "excludeDays": - return ec.fieldContext_Constraints_excludeDays(ctx, field) - case "possibleDays": - return ec.fieldContext_Constraints_possibleDays(ctx, field) - case "fixedDay": - return ec.fieldContext_Constraints_fixedDay(ctx, field) - case "fixedTime": - return ec.fieldContext_Constraints_fixedTime(ctx, field) - case "sameSlot": - return ec.fieldContext_Constraints_sameSlot(ctx, field) - case "online": - return ec.fieldContext_Constraints_online(ctx, field) - case "roomConstraints": - return ec.fieldContext_Constraints_roomConstraints(ctx, field) + case "exam": + return ec.fieldContext_ExamToPlan_exam(ctx, field) + case "constraints": + return ec.fieldContext_ExamToPlan_constraints(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ExamToPlan", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamInPlan_nta(ctx context.Context, field graphql.CollectedField, obj *model.ExamInPlan) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamInPlan_nta(ctx, field) +func (ec *executionContext) _ExamGroup_examGroupInfo(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroup) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) if err != nil { return graphql.Null } @@ -6976,7 +8315,7 @@ func (ec *executionContext) _ExamInPlan_nta(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Nta, nil + return obj.ExamGroupInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -6985,32 +8324,50 @@ func (ec *executionContext) _ExamInPlan_nta(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.NTAWithRegs) + res := resTmp.(*model.ExamGroupInfo) fc.Result = res - return ec.marshalONTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsᚄ(ctx, field.Selections, res) + return ec.marshalOExamGroupInfo2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamInPlan_nta(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroup_examGroupInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamInPlan", + Object: "ExamGroup", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "nta": - return ec.fieldContext_NTAWithRegs_nta(ctx, field) - case "regs": - return ec.fieldContext_NTAWithRegs_regs(ctx, field) + case "notPlannedByMe": + return ec.fieldContext_ExamGroupInfo_notPlannedByMe(ctx, field) + case "excludeDays": + return ec.fieldContext_ExamGroupInfo_excludeDays(ctx, field) + case "possibleDays": + return ec.fieldContext_ExamGroupInfo_possibleDays(ctx, field) + case "fixedDay": + return ec.fieldContext_ExamGroupInfo_fixedDay(ctx, field) + case "fixedSlot": + return ec.fieldContext_ExamGroupInfo_fixedSlot(ctx, field) + case "possibleSlots": + return ec.fieldContext_ExamGroupInfo_possibleSlots(ctx, field) + case "conflicts": + return ec.fieldContext_ExamGroupInfo_conflicts(ctx, field) + case "studentRegs": + return ec.fieldContext_ExamGroupInfo_studentRegs(ctx, field) + case "programs": + return ec.fieldContext_ExamGroupInfo_programs(ctx, field) + case "maxDuration": + return ec.fieldContext_ExamGroupInfo_maxDuration(ctx, field) + case "maxDurationNTA": + return ec.fieldContext_ExamGroupInfo_maxDurationNTA(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type NTAWithRegs", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ExamGroupInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamInPlan_slot(ctx context.Context, field graphql.CollectedField, obj *model.ExamInPlan) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamInPlan_slot(ctx, field) +func (ec *executionContext) _ExamGroupConflict_examGroupCode(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupConflict) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupConflict_examGroupCode(ctx, field) if err != nil { return graphql.Null } @@ -7023,43 +8380,38 @@ func (ec *executionContext) _ExamInPlan_slot(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Slot, nil + return obj.ExamGroupCode, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Slot) + res := resTmp.(int) fc.Result = res - return ec.marshalOSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamInPlan_slot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupConflict_examGroupCode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamInPlan", + Object: "ExamGroupConflict", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "dayNumber": - return ec.fieldContext_Slot_dayNumber(ctx, field) - case "slotNumber": - return ec.fieldContext_Slot_slotNumber(ctx, field) - case "starttime": - return ec.fieldContext_Slot_starttime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamToPlan_exam(ctx context.Context, field graphql.CollectedField, obj *model.ExamToPlan) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamToPlan_exam(ctx, field) +func (ec *executionContext) _ExamGroupConflict_count(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupConflict) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupConflict_count(ctx, field) if err != nil { return graphql.Null } @@ -7072,7 +8424,7 @@ func (ec *executionContext) _ExamToPlan_exam(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exam, nil + return obj.Count, nil }) if err != nil { ec.Error(ctx, err) @@ -7084,40 +8436,26 @@ func (ec *executionContext) _ExamToPlan_exam(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(*model.ExamWithRegs) + res := resTmp.(int) fc.Result = res - return ec.marshalNExamWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegs(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamToPlan_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupConflict_count(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamToPlan", + Object: "ExamGroupConflict", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_ExamWithRegs_ancode(ctx, field) - case "zpaExam": - return ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) - case "primussExams": - return ec.fieldContext_ExamWithRegs_primussExams(ctx, field) - case "studentRegs": - return ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_ExamWithRegs_conflicts(ctx, field) - case "connectErrors": - return ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamWithRegs", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamToPlan_constraints(ctx context.Context, field graphql.CollectedField, obj *model.ExamToPlan) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamToPlan_constraints(ctx, field) +func (ec *executionContext) _ExamGroupInfo_notPlannedByMe(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_notPlannedByMe(ctx, field) if err != nil { return graphql.Null } @@ -7130,55 +8468,38 @@ func (ec *executionContext) _ExamToPlan_constraints(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Constraints, nil + return obj.NotPlannedByMe, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Constraints) + res := resTmp.(bool) fc.Result = res - return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamToPlan_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_notPlannedByMe(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamToPlan", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_Constraints_ancode(ctx, field) - case "notPlannedByMe": - return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) - case "excludeDays": - return ec.fieldContext_Constraints_excludeDays(ctx, field) - case "possibleDays": - return ec.fieldContext_Constraints_possibleDays(ctx, field) - case "fixedDay": - return ec.fieldContext_Constraints_fixedDay(ctx, field) - case "fixedTime": - return ec.fieldContext_Constraints_fixedTime(ctx, field) - case "sameSlot": - return ec.fieldContext_Constraints_sameSlot(ctx, field) - case "online": - return ec.fieldContext_Constraints_online(ctx, field) - case "roomConstraints": - return ec.fieldContext_Constraints_roomConstraints(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamWithRegs_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamWithRegs_ancode(ctx, field) +func (ec *executionContext) _ExamGroupInfo_excludeDays(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_excludeDays(ctx, field) if err != nil { return graphql.Null } @@ -7191,26 +8512,23 @@ func (ec *executionContext) _ExamWithRegs_ancode(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Ancode, nil + return obj.ExcludeDays, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]int) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOInt2ᚕintᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamWithRegs_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_excludeDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamWithRegs", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, @@ -7221,8 +8539,8 @@ func (ec *executionContext) fieldContext_ExamWithRegs_ancode(ctx context.Context return fc, nil } -func (ec *executionContext) _ExamWithRegs_zpaExam(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) +func (ec *executionContext) _ExamGroupInfo_possibleDays(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_possibleDays(ctx, field) if err != nil { return graphql.Null } @@ -7235,62 +8553,35 @@ func (ec *executionContext) _ExamWithRegs_zpaExam(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ZpaExam, nil + return obj.PossibleDays, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*model.ZPAExam) + res := resTmp.([]int) fc.Result = res - return ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) + return ec.marshalOInt2ᚕintᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamWithRegs_zpaExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_possibleDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamWithRegs", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "zpaID": - return ec.fieldContext_ZPAExam_zpaID(ctx, field) - case "semester": - return ec.fieldContext_ZPAExam_semester(ctx, field) - case "ancode": - return ec.fieldContext_ZPAExam_ancode(ctx, field) - case "module": - return ec.fieldContext_ZPAExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_ZPAExam_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) - case "examType": - return ec.fieldContext_ZPAExam_examType(ctx, field) - case "examTypeFull": - return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) - case "duration": - return ec.fieldContext_ZPAExam_duration(ctx, field) - case "isRepeaterExam": - return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) - case "groups": - return ec.fieldContext_ZPAExam_groups(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamWithRegs_primussExams(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamWithRegs_primussExams(ctx, field) +func (ec *executionContext) _ExamGroupInfo_fixedDay(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_fixedDay(ctx, field) if err != nil { return graphql.Null } @@ -7303,56 +8594,35 @@ func (ec *executionContext) _ExamWithRegs_primussExams(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PrimussExams, nil + return obj.FixedDay, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.PrimussExam) + res := resTmp.(*int) fc.Result = res - return ec.marshalNPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamᚄ(ctx, field.Selections, res) + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamWithRegs_primussExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_fixedDay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamWithRegs", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_PrimussExam_ancode(ctx, field) - case "module": - return ec.fieldContext_PrimussExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_PrimussExam_mainExamer(ctx, field) - case "program": - return ec.fieldContext_PrimussExam_program(ctx, field) - case "examType": - return ec.fieldContext_PrimussExam_examType(ctx, field) - case "presence": - return ec.fieldContext_PrimussExam_presence(ctx, field) - case "studentRegs": - return ec.fieldContext_PrimussExam_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_PrimussExam_conflicts(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamWithRegs_studentRegs(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) +func (ec *executionContext) _ExamGroupInfo_fixedSlot(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_fixedSlot(ctx, field) if err != nil { return graphql.Null } @@ -7365,44 +8635,43 @@ func (ec *executionContext) _ExamWithRegs_studentRegs(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.StudentRegs, nil + return obj.FixedSlot, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.StudentRegsPerAncodeAndProgram) + res := resTmp.(*model.Slot) fc.Result = res - return ec.marshalNStudentRegsPerAncodeAndProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgramᚄ(ctx, field.Selections, res) + return ec.marshalOSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamWithRegs_studentRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_fixedSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamWithRegs", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "program": - return ec.fieldContext_StudentRegsPerAncodeAndProgram_program(ctx, field) - case "studentRegs": - return ec.fieldContext_StudentRegsPerAncodeAndProgram_studentRegs(ctx, field) + case "dayNumber": + return ec.fieldContext_Slot_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_Slot_slotNumber(ctx, field) + case "starttime": + return ec.fieldContext_Slot_starttime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type StudentRegsPerAncodeAndProgram", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamWithRegs_conflicts(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamWithRegs_conflicts(ctx, field) +func (ec *executionContext) _ExamGroupInfo_possibleSlots(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_possibleSlots(ctx, field) if err != nil { return graphql.Null } @@ -7415,44 +8684,43 @@ func (ec *executionContext) _ExamWithRegs_conflicts(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Conflicts, nil + return obj.PossibleSlots, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.ConflictPerProgram) + res := resTmp.([]*model.Slot) fc.Result = res - return ec.marshalNConflictPerProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictPerProgramᚄ(ctx, field.Selections, res) + return ec.marshalOSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamWithRegs_conflicts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_possibleSlots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamWithRegs", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "program": - return ec.fieldContext_ConflictPerProgram_program(ctx, field) - case "conflicts": - return ec.fieldContext_ConflictPerProgram_conflicts(ctx, field) + case "dayNumber": + return ec.fieldContext_Slot_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_Slot_slotNumber(ctx, field) + case "starttime": + return ec.fieldContext_Slot_starttime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ConflictPerProgram", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamWithRegs_connectErrors(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) +func (ec *executionContext) _ExamGroupInfo_conflicts(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_conflicts(ctx, field) if err != nil { return graphql.Null } @@ -7465,38 +8733,41 @@ func (ec *executionContext) _ExamWithRegs_connectErrors(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ConnectErrors, nil + return obj.Conflicts, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]string) + res := resTmp.([]*model.ExamGroupConflict) fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalOExamGroupConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupConflict(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamWithRegs_connectErrors(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_conflicts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamWithRegs", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "examGroupCode": + return ec.fieldContext_ExamGroupConflict_examGroupCode(ctx, field) + case "count": + return ec.fieldContext_ExamGroupConflict_count(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExamGroupConflict", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamWithRegsAndRooms_exam(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegsAndRooms) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamWithRegsAndRooms_exam(ctx, field) +func (ec *executionContext) _ExamGroupInfo_studentRegs(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_studentRegs(ctx, field) if err != nil { return graphql.Null } @@ -7509,7 +8780,7 @@ func (ec *executionContext) _ExamWithRegsAndRooms_exam(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exam, nil + return obj.StudentRegs, nil }) if err != nil { ec.Error(ctx, err) @@ -7521,36 +8792,26 @@ func (ec *executionContext) _ExamWithRegsAndRooms_exam(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(*model.ExamInPlan) + res := resTmp.(int) fc.Result = res - return ec.marshalNExamInPlan2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamInPlan(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamWithRegsAndRooms_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_studentRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamWithRegsAndRooms", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "exam": - return ec.fieldContext_ExamInPlan_exam(ctx, field) - case "constraints": - return ec.fieldContext_ExamInPlan_constraints(ctx, field) - case "nta": - return ec.fieldContext_ExamInPlan_nta(ctx, field) - case "slot": - return ec.fieldContext_ExamInPlan_slot(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamInPlan", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamWithRegsAndRooms_normalRegs(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegsAndRooms) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamWithRegsAndRooms_normalRegs(ctx, field) +func (ec *executionContext) _ExamGroupInfo_programs(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_programs(ctx, field) if err != nil { return graphql.Null } @@ -7563,7 +8824,7 @@ func (ec *executionContext) _ExamWithRegsAndRooms_normalRegs(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.NormalRegs, nil + return obj.Programs, nil }) if err != nil { ec.Error(ctx, err) @@ -7575,40 +8836,26 @@ func (ec *executionContext) _ExamWithRegsAndRooms_normalRegs(ctx context.Context } return graphql.Null } - res := resTmp.([]*model.StudentReg) + res := resTmp.([]string) fc.Result = res - return ec.marshalNStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamWithRegsAndRooms_normalRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_programs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamWithRegsAndRooms", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "mtknr": - return ec.fieldContext_StudentReg_mtknr(ctx, field) - case "ancode": - return ec.fieldContext_StudentReg_ancode(ctx, field) - case "program": - return ec.fieldContext_StudentReg_program(ctx, field) - case "group": - return ec.fieldContext_StudentReg_group(ctx, field) - case "name": - return ec.fieldContext_StudentReg_name(ctx, field) - case "presence": - return ec.fieldContext_StudentReg_presence(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type StudentReg", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamWithRegsAndRooms_ntaRegs(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegsAndRooms) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamWithRegsAndRooms_ntaRegs(ctx, field) +func (ec *executionContext) _ExamGroupInfo_maxDuration(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_maxDuration(ctx, field) if err != nil { return graphql.Null } @@ -7621,7 +8868,7 @@ func (ec *executionContext) _ExamWithRegsAndRooms_ntaRegs(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.NtaRegs, nil + return obj.MaxDuration, nil }) if err != nil { ec.Error(ctx, err) @@ -7633,32 +8880,26 @@ func (ec *executionContext) _ExamWithRegsAndRooms_ntaRegs(ctx context.Context, f } return graphql.Null } - res := resTmp.([]*model.NTAWithRegs) + res := resTmp.(int) fc.Result = res - return ec.marshalNNTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamWithRegsAndRooms_ntaRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_maxDuration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamWithRegsAndRooms", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "nta": - return ec.fieldContext_NTAWithRegs_nta(ctx, field) - case "regs": - return ec.fieldContext_NTAWithRegs_regs(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NTAWithRegs", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamWithRegsAndRooms_rooms(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegsAndRooms) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamWithRegsAndRooms_rooms(ctx, field) +func (ec *executionContext) _ExamGroupInfo_maxDurationNTA(ctx context.Context, field graphql.CollectedField, obj *model.ExamGroupInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamGroupInfo_maxDurationNTA(ctx, field) if err != nil { return graphql.Null } @@ -7671,54 +8912,35 @@ func (ec *executionContext) _ExamWithRegsAndRooms_rooms(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Rooms, nil + return obj.MaxDurationNta, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.RoomForExam) + res := resTmp.(*int) fc.Result = res - return ec.marshalNRoomForExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExamᚄ(ctx, field.Selections, res) + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamWithRegsAndRooms_rooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamGroupInfo_maxDurationNTA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamWithRegsAndRooms", + Object: "ExamGroupInfo", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_RoomForExam_ancode(ctx, field) - case "room": - return ec.fieldContext_RoomForExam_room(ctx, field) - case "seatsPlanned": - return ec.fieldContext_RoomForExam_seatsPlanned(ctx, field) - case "duration": - return ec.fieldContext_RoomForExam_duration(ctx, field) - case "handicap": - return ec.fieldContext_RoomForExam_handicap(ctx, field) - case "reserve": - return ec.fieldContext_RoomForExam_reserve(ctx, field) - case "students": - return ec.fieldContext_RoomForExam_students(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type RoomForExam", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ExamerInPlan_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.ExamerInPlan) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamerInPlan_mainExamer(ctx, field) +func (ec *executionContext) _ExamInPlan_exam(ctx context.Context, field graphql.CollectedField, obj *model.ExamInPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamInPlan_exam(ctx, field) if err != nil { return graphql.Null } @@ -7731,7 +8953,7 @@ func (ec *executionContext) _ExamerInPlan_mainExamer(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MainExamer, nil + return obj.Exam, nil }) if err != nil { ec.Error(ctx, err) @@ -7743,26 +8965,40 @@ func (ec *executionContext) _ExamerInPlan_mainExamer(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.ExamWithRegs) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNExamWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegs(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamerInPlan_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamInPlan_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamerInPlan", + Object: "ExamInPlan", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_ExamWithRegs_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) + case "primussExams": + return ec.fieldContext_ExamWithRegs_primussExams(ctx, field) + case "studentRegs": + return ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) + case "conflicts": + return ec.fieldContext_ExamWithRegs_conflicts(ctx, field) + case "connectErrors": + return ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExamWithRegs", field.Name) }, } return fc, nil } -func (ec *executionContext) _ExamerInPlan_mainExamerID(ctx context.Context, field graphql.CollectedField, obj *model.ExamerInPlan) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamerInPlan_mainExamerID(ctx, field) +func (ec *executionContext) _ExamInPlan_constraints(ctx context.Context, field graphql.CollectedField, obj *model.ExamInPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamInPlan_constraints(ctx, field) if err != nil { return graphql.Null } @@ -7775,38 +9011,55 @@ func (ec *executionContext) _ExamerInPlan_mainExamerID(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MainExamerID, nil + return obj.Constraints, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.Constraints) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExamerInPlan_mainExamerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamInPlan_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ExamerInPlan", + Object: "ExamInPlan", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_Constraints_ancode(ctx, field) + case "notPlannedByMe": + return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) + case "excludeDays": + return ec.fieldContext_Constraints_excludeDays(ctx, field) + case "possibleDays": + return ec.fieldContext_Constraints_possibleDays(ctx, field) + case "fixedDay": + return ec.fieldContext_Constraints_fixedDay(ctx, field) + case "fixedTime": + return ec.fieldContext_Constraints_fixedTime(ctx, field) + case "sameSlot": + return ec.fieldContext_Constraints_sameSlot(ctx, field) + case "online": + return ec.fieldContext_Constraints_online(ctx, field) + case "roomConstraints": + return ec.fieldContext_Constraints_roomConstraints(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) }, } return fc, nil } -func (ec *executionContext) _FK07Program_name(ctx context.Context, field graphql.CollectedField, obj *model.FK07Program) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_FK07Program_name(ctx, field) +func (ec *executionContext) _ExamInPlan_nta(ctx context.Context, field graphql.CollectedField, obj *model.ExamInPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamInPlan_nta(ctx, field) if err != nil { return graphql.Null } @@ -7819,38 +9072,41 @@ func (ec *executionContext) _FK07Program_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Nta, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.NTAWithRegs) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalONTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FK07Program_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamInPlan_nta(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "FK07Program", + Object: "ExamInPlan", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "nta": + return ec.fieldContext_NTAWithRegs_nta(ctx, field) + case "regs": + return ec.fieldContext_NTAWithRegs_regs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NTAWithRegs", field.Name) }, } return fc, nil } -func (ec *executionContext) _Invigilation_roomName(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Invigilation_roomName(ctx, field) +func (ec *executionContext) _ExamInPlan_slot(ctx context.Context, field graphql.CollectedField, obj *model.ExamInPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamInPlan_slot(ctx, field) if err != nil { return graphql.Null } @@ -7863,7 +9119,7 @@ func (ec *executionContext) _Invigilation_roomName(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.RoomName, nil + return obj.Slot, nil }) if err != nil { ec.Error(ctx, err) @@ -7872,26 +9128,34 @@ func (ec *executionContext) _Invigilation_roomName(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.Slot) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Invigilation_roomName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamInPlan_slot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Invigilation", + Object: "ExamInPlan", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "dayNumber": + return ec.fieldContext_Slot_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_Slot_slotNumber(ctx, field) + case "starttime": + return ec.fieldContext_Slot_starttime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) }, } return fc, nil } -func (ec *executionContext) _Invigilation_duration(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Invigilation_duration(ctx, field) +func (ec *executionContext) _ExamToPlan_exam(ctx context.Context, field graphql.CollectedField, obj *model.ExamToPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamToPlan_exam(ctx, field) if err != nil { return graphql.Null } @@ -7904,7 +9168,7 @@ func (ec *executionContext) _Invigilation_duration(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Duration, nil + return obj.Exam, nil }) if err != nil { ec.Error(ctx, err) @@ -7916,26 +9180,40 @@ func (ec *executionContext) _Invigilation_duration(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.ExamWithRegs) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNExamWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegs(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Invigilation_duration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamToPlan_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Invigilation", + Object: "ExamToPlan", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_ExamWithRegs_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) + case "primussExams": + return ec.fieldContext_ExamWithRegs_primussExams(ctx, field) + case "studentRegs": + return ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) + case "conflicts": + return ec.fieldContext_ExamWithRegs_conflicts(ctx, field) + case "connectErrors": + return ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExamWithRegs", field.Name) }, } return fc, nil } -func (ec *executionContext) _Invigilation_invigilatorID(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Invigilation_invigilatorID(ctx, field) +func (ec *executionContext) _ExamToPlan_constraints(ctx context.Context, field graphql.CollectedField, obj *model.ExamToPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamToPlan_constraints(ctx, field) if err != nil { return graphql.Null } @@ -7948,38 +9226,55 @@ func (ec *executionContext) _Invigilation_invigilatorID(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.InvigilatorID, nil + return obj.Constraints, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.Constraints) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Invigilation_invigilatorID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamToPlan_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Invigilation", + Object: "ExamToPlan", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_Constraints_ancode(ctx, field) + case "notPlannedByMe": + return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) + case "excludeDays": + return ec.fieldContext_Constraints_excludeDays(ctx, field) + case "possibleDays": + return ec.fieldContext_Constraints_possibleDays(ctx, field) + case "fixedDay": + return ec.fieldContext_Constraints_fixedDay(ctx, field) + case "fixedTime": + return ec.fieldContext_Constraints_fixedTime(ctx, field) + case "sameSlot": + return ec.fieldContext_Constraints_sameSlot(ctx, field) + case "online": + return ec.fieldContext_Constraints_online(ctx, field) + case "roomConstraints": + return ec.fieldContext_Constraints_roomConstraints(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) }, } return fc, nil } -func (ec *executionContext) _Invigilation_slot(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Invigilation_slot(ctx, field) +func (ec *executionContext) _ExamWithRegs_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamWithRegs_ancode(ctx, field) if err != nil { return graphql.Null } @@ -7992,7 +9287,7 @@ func (ec *executionContext) _Invigilation_slot(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Slot, nil + return obj.Ancode, nil }) if err != nil { ec.Error(ctx, err) @@ -8004,34 +9299,26 @@ func (ec *executionContext) _Invigilation_slot(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(*model.Slot) + res := resTmp.(int) fc.Result = res - return ec.marshalNSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Invigilation_slot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamWithRegs_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Invigilation", + Object: "ExamWithRegs", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "dayNumber": - return ec.fieldContext_Slot_dayNumber(ctx, field) - case "slotNumber": - return ec.fieldContext_Slot_slotNumber(ctx, field) - case "starttime": - return ec.fieldContext_Slot_starttime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Invigilation_isReserve(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Invigilation_isReserve(ctx, field) +func (ec *executionContext) _ExamWithRegs_zpaExam(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) if err != nil { return graphql.Null } @@ -8044,7 +9331,7 @@ func (ec *executionContext) _Invigilation_isReserve(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsReserve, nil + return obj.ZpaExam, nil }) if err != nil { ec.Error(ctx, err) @@ -8056,26 +9343,52 @@ func (ec *executionContext) _Invigilation_isReserve(ctx context.Context, field g } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.ZPAExam) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Invigilation_isReserve(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamWithRegs_zpaExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Invigilation", + Object: "ExamWithRegs", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _Invigilation_isSelfInvigilation(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Invigilation_isSelfInvigilation(ctx, field) +func (ec *executionContext) _ExamWithRegs_primussExams(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamWithRegs_primussExams(ctx, field) if err != nil { return graphql.Null } @@ -8088,7 +9401,7 @@ func (ec *executionContext) _Invigilation_isSelfInvigilation(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsSelfInvigilation, nil + return obj.PrimussExams, nil }) if err != nil { ec.Error(ctx, err) @@ -8100,26 +9413,40 @@ func (ec *executionContext) _Invigilation_isSelfInvigilation(ctx context.Context } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.PrimussExam) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Invigilation_isSelfInvigilation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamWithRegs_primussExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Invigilation", + Object: "ExamWithRegs", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_PrimussExam_ancode(ctx, field) + case "module": + return ec.fieldContext_PrimussExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_PrimussExam_mainExamer(ctx, field) + case "program": + return ec.fieldContext_PrimussExam_program(ctx, field) + case "examType": + return ec.fieldContext_PrimussExam_examType(ctx, field) + case "presence": + return ec.fieldContext_PrimussExam_presence(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilationSlot_reserve(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationSlot) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilationSlot_reserve(ctx, field) +func (ec *executionContext) _ExamWithRegs_studentRegs(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) if err != nil { return graphql.Null } @@ -8132,57 +9459,46 @@ func (ec *executionContext) _InvigilationSlot_reserve(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Reserve, nil + return obj.StudentRegs, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Teacher) + res := resTmp.([]*model.StudentRegsPerAncodeAndProgram) fc.Result = res - return ec.marshalOTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) + return ec.marshalNStudentRegsPerAncodeAndProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgramᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilationSlot_reserve(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamWithRegs_studentRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilationSlot", + Object: "ExamWithRegs", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "shortname": - return ec.fieldContext_Teacher_shortname(ctx, field) - case "fullname": - return ec.fieldContext_Teacher_fullname(ctx, field) - case "isProf": - return ec.fieldContext_Teacher_isProf(ctx, field) - case "isLBA": - return ec.fieldContext_Teacher_isLBA(ctx, field) - case "isProfHC": - return ec.fieldContext_Teacher_isProfHC(ctx, field) - case "isStaff": - return ec.fieldContext_Teacher_isStaff(ctx, field) - case "lastSemester": - return ec.fieldContext_Teacher_lastSemester(ctx, field) - case "fk": - return ec.fieldContext_Teacher_fk(ctx, field) - case "id": - return ec.fieldContext_Teacher_id(ctx, field) - case "email": - return ec.fieldContext_Teacher_email(ctx, field) + case "program": + return ec.fieldContext_StudentRegsPerAncodeAndProgram_program(ctx, field) + case "ancode": + return ec.fieldContext_StudentRegsPerAncodeAndProgram_ancode(ctx, field) + case "studentRegs": + return ec.fieldContext_StudentRegsPerAncodeAndProgram_studentRegs(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + return nil, fmt.Errorf("no field named %q was found under type StudentRegsPerAncodeAndProgram", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilationSlot_roomsWithInvigilators(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationSlot) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilationSlot_roomsWithInvigilators(ctx, field) +func (ec *executionContext) _ExamWithRegs_conflicts(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamWithRegs_conflicts(ctx, field) if err != nil { return graphql.Null } @@ -8195,7 +9511,7 @@ func (ec *executionContext) _InvigilationSlot_roomsWithInvigilators(ctx context. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.RoomsWithInvigilators, nil + return obj.Conflicts, nil }) if err != nil { ec.Error(ctx, err) @@ -8207,38 +9523,32 @@ func (ec *executionContext) _InvigilationSlot_roomsWithInvigilators(ctx context. } return graphql.Null } - res := resTmp.([]*model.RoomWithInvigilator) + res := resTmp.([]*model.ConflictPerProgram) fc.Result = res - return ec.marshalNRoomWithInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomWithInvigilatorᚄ(ctx, field.Selections, res) + return ec.marshalNConflictPerProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictPerProgramᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilationSlot_roomsWithInvigilators(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamWithRegs_conflicts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilationSlot", + Object: "ExamWithRegs", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext_RoomWithInvigilator_name(ctx, field) - case "maxDuration": - return ec.fieldContext_RoomWithInvigilator_maxDuration(ctx, field) - case "studentCount": - return ec.fieldContext_RoomWithInvigilator_studentCount(ctx, field) - case "roomAndExams": - return ec.fieldContext_RoomWithInvigilator_roomAndExams(ctx, field) - case "invigilator": - return ec.fieldContext_RoomWithInvigilator_invigilator(ctx, field) + case "program": + return ec.fieldContext_ConflictPerProgram_program(ctx, field) + case "conflicts": + return ec.fieldContext_ConflictPerProgram_conflicts(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type RoomWithInvigilator", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ConflictPerProgram", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilationTodos_sumExamRooms(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilationTodos_sumExamRooms(ctx, field) +func (ec *executionContext) _ExamWithRegs_connectErrors(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegs) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) if err != nil { return graphql.Null } @@ -8251,7 +9561,7 @@ func (ec *executionContext) _InvigilationTodos_sumExamRooms(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SumExamRooms, nil + return obj.ConnectErrors, nil }) if err != nil { ec.Error(ctx, err) @@ -8263,26 +9573,26 @@ func (ec *executionContext) _InvigilationTodos_sumExamRooms(ctx context.Context, } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilationTodos_sumExamRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamWithRegs_connectErrors(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilationTodos", + Object: "ExamWithRegs", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilationTodos_sumReserve(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilationTodos_sumReserve(ctx, field) +func (ec *executionContext) _ExamWithRegsAndRooms_exam(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegsAndRooms) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamWithRegsAndRooms_exam(ctx, field) if err != nil { return graphql.Null } @@ -8295,7 +9605,7 @@ func (ec *executionContext) _InvigilationTodos_sumReserve(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SumReserve, nil + return obj.Exam, nil }) if err != nil { ec.Error(ctx, err) @@ -8307,26 +9617,50 @@ func (ec *executionContext) _InvigilationTodos_sumReserve(ctx context.Context, f } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.PlannedExam) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNPlannedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilationTodos_sumReserve(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamWithRegsAndRooms_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilationTodos", + Object: "ExamWithRegsAndRooms", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_PlannedExam_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_PlannedExam_zpaExam(ctx, field) + case "mainExamer": + return ec.fieldContext_PlannedExam_mainExamer(ctx, field) + case "primussExams": + return ec.fieldContext_PlannedExam_primussExams(ctx, field) + case "constraints": + return ec.fieldContext_PlannedExam_constraints(ctx, field) + case "conflicts": + return ec.fieldContext_PlannedExam_conflicts(ctx, field) + case "studentRegsCount": + return ec.fieldContext_PlannedExam_studentRegsCount(ctx, field) + case "ntas": + return ec.fieldContext_PlannedExam_ntas(ctx, field) + case "maxDuration": + return ec.fieldContext_PlannedExam_maxDuration(ctx, field) + case "planEntry": + return ec.fieldContext_PlannedExam_planEntry(ctx, field) + case "plannedRooms": + return ec.fieldContext_PlannedExam_plannedRooms(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PlannedExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilationTodos_sumOtherContributions(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilationTodos_sumOtherContributions(ctx, field) +func (ec *executionContext) _ExamWithRegsAndRooms_normalRegsMtknr(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegsAndRooms) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamWithRegsAndRooms_normalRegsMtknr(ctx, field) if err != nil { return graphql.Null } @@ -8339,7 +9673,7 @@ func (ec *executionContext) _InvigilationTodos_sumOtherContributions(ctx context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SumOtherContributions, nil + return obj.NormalRegsMtknr, nil }) if err != nil { ec.Error(ctx, err) @@ -8351,26 +9685,26 @@ func (ec *executionContext) _InvigilationTodos_sumOtherContributions(ctx context } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilationTodos_sumOtherContributions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamWithRegsAndRooms_normalRegsMtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilationTodos", + Object: "ExamWithRegsAndRooms", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilationTodos_sumOtherContributionsOvertimeCutted(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilationTodos_sumOtherContributionsOvertimeCutted(ctx, field) +func (ec *executionContext) _ExamWithRegsAndRooms_ntas(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegsAndRooms) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamWithRegsAndRooms_ntas(ctx, field) if err != nil { return graphql.Null } @@ -8383,7 +9717,7 @@ func (ec *executionContext) _InvigilationTodos_sumOtherContributionsOvertimeCutt }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SumOtherContributionsOvertimeCutted, nil + return obj.Ntas, nil }) if err != nil { ec.Error(ctx, err) @@ -8395,26 +9729,50 @@ func (ec *executionContext) _InvigilationTodos_sumOtherContributionsOvertimeCutt } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.NTA) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNNTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilationTodos_sumOtherContributionsOvertimeCutted(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamWithRegsAndRooms_ntas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilationTodos", + Object: "ExamWithRegsAndRooms", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext_NTA_name(ctx, field) + case "email": + return ec.fieldContext_NTA_email(ctx, field) + case "mtknr": + return ec.fieldContext_NTA_mtknr(ctx, field) + case "compensation": + return ec.fieldContext_NTA_compensation(ctx, field) + case "deltaDurationPercent": + return ec.fieldContext_NTA_deltaDurationPercent(ctx, field) + case "needsRoomAlone": + return ec.fieldContext_NTA_needsRoomAlone(ctx, field) + case "program": + return ec.fieldContext_NTA_program(ctx, field) + case "from": + return ec.fieldContext_NTA_from(ctx, field) + case "until": + return ec.fieldContext_NTA_until(ctx, field) + case "lastSemester": + return ec.fieldContext_NTA_lastSemester(ctx, field) + case "exams": + return ec.fieldContext_NTA_exams(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NTA", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilationTodos_invigilatorCount(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilationTodos_invigilatorCount(ctx, field) +func (ec *executionContext) _ExamWithRegsAndRooms_rooms(ctx context.Context, field graphql.CollectedField, obj *model.ExamWithRegsAndRooms) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamWithRegsAndRooms_rooms(ctx, field) if err != nil { return graphql.Null } @@ -8427,7 +9785,7 @@ func (ec *executionContext) _InvigilationTodos_invigilatorCount(ctx context.Cont }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.InvigilatorCount, nil + return obj.Rooms, nil }) if err != nil { ec.Error(ctx, err) @@ -8439,26 +9797,48 @@ func (ec *executionContext) _InvigilationTodos_invigilatorCount(ctx context.Cont } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.PlannedRoom) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNPlannedRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedRoomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilationTodos_invigilatorCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamWithRegsAndRooms_rooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilationTodos", + Object: "ExamWithRegsAndRooms", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "day": + return ec.fieldContext_PlannedRoom_day(ctx, field) + case "slot": + return ec.fieldContext_PlannedRoom_slot(ctx, field) + case "room": + return ec.fieldContext_PlannedRoom_room(ctx, field) + case "ancode": + return ec.fieldContext_PlannedRoom_ancode(ctx, field) + case "duration": + return ec.fieldContext_PlannedRoom_duration(ctx, field) + case "handicap": + return ec.fieldContext_PlannedRoom_handicap(ctx, field) + case "handicapRoomAlone": + return ec.fieldContext_PlannedRoom_handicapRoomAlone(ctx, field) + case "reserve": + return ec.fieldContext_PlannedRoom_reserve(ctx, field) + case "studentsInRoom": + return ec.fieldContext_PlannedRoom_studentsInRoom(ctx, field) + case "ntaMtknr": + return ec.fieldContext_PlannedRoom_ntaMtknr(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PlannedRoom", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilationTodos_todoPerInvigilator(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilationTodos_todoPerInvigilator(ctx, field) +func (ec *executionContext) _ExamerInPlan_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.ExamerInPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamerInPlan_mainExamer(ctx, field) if err != nil { return graphql.Null } @@ -8471,7 +9851,7 @@ func (ec *executionContext) _InvigilationTodos_todoPerInvigilator(ctx context.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TodoPerInvigilator, nil + return obj.MainExamer, nil }) if err != nil { ec.Error(ctx, err) @@ -8483,26 +9863,26 @@ func (ec *executionContext) _InvigilationTodos_todoPerInvigilator(ctx context.Co } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilationTodos_todoPerInvigilator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamerInPlan_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilationTodos", + Object: "ExamerInPlan", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilationTodos_todoPerInvigilatorOvertimeCutted(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilationTodos_todoPerInvigilatorOvertimeCutted(ctx, field) +func (ec *executionContext) _ExamerInPlan_mainExamerID(ctx context.Context, field graphql.CollectedField, obj *model.ExamerInPlan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExamerInPlan_mainExamerID(ctx, field) if err != nil { return graphql.Null } @@ -8515,7 +9895,7 @@ func (ec *executionContext) _InvigilationTodos_todoPerInvigilatorOvertimeCutted( }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TodoPerInvigilatorOvertimeCutted, nil + return obj.MainExamerID, nil }) if err != nil { ec.Error(ctx, err) @@ -8532,9 +9912,9 @@ func (ec *executionContext) _InvigilationTodos_todoPerInvigilatorOvertimeCutted( return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilationTodos_todoPerInvigilatorOvertimeCutted(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExamerInPlan_mainExamerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilationTodos", + Object: "ExamerInPlan", Field: field, IsMethod: false, IsResolver: false, @@ -8545,8 +9925,8 @@ func (ec *executionContext) fieldContext_InvigilationTodos_todoPerInvigilatorOve return fc, nil } -func (ec *executionContext) _InvigilationTodos_invigilators(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilationTodos_invigilators(ctx, field) +func (ec *executionContext) _ExternalExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ExternalExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExternalExam_ancode(ctx, field) if err != nil { return graphql.Null } @@ -8559,7 +9939,7 @@ func (ec *executionContext) _InvigilationTodos_invigilators(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Invigilators, nil + return obj.Ancode, nil }) if err != nil { ec.Error(ctx, err) @@ -8571,34 +9951,26 @@ func (ec *executionContext) _InvigilationTodos_invigilators(ctx context.Context, } return graphql.Null } - res := resTmp.([]*model.Invigilator) + res := resTmp.(int) fc.Result = res - return ec.marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilationTodos_invigilators(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExternalExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilationTodos", + Object: "ExternalExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "teacher": - return ec.fieldContext_Invigilator_teacher(ctx, field) - case "requirements": - return ec.fieldContext_Invigilator_requirements(ctx, field) - case "todos": - return ec.fieldContext_Invigilator_todos(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Invigilator", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Invigilator_teacher(ctx context.Context, field graphql.CollectedField, obj *model.Invigilator) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Invigilator_teacher(ctx, field) +func (ec *executionContext) _ExternalExam_program(ctx context.Context, field graphql.CollectedField, obj *model.ExternalExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExternalExam_program(ctx, field) if err != nil { return graphql.Null } @@ -8611,7 +9983,7 @@ func (ec *executionContext) _Invigilator_teacher(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Teacher, nil + return obj.Program, nil }) if err != nil { ec.Error(ctx, err) @@ -8623,48 +9995,26 @@ func (ec *executionContext) _Invigilator_teacher(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*model.Teacher) + res := resTmp.(string) fc.Result = res - return ec.marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Invigilator_teacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExternalExam_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Invigilator", + Object: "ExternalExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "shortname": - return ec.fieldContext_Teacher_shortname(ctx, field) - case "fullname": - return ec.fieldContext_Teacher_fullname(ctx, field) - case "isProf": - return ec.fieldContext_Teacher_isProf(ctx, field) - case "isLBA": - return ec.fieldContext_Teacher_isLBA(ctx, field) - case "isProfHC": - return ec.fieldContext_Teacher_isProfHC(ctx, field) - case "isStaff": - return ec.fieldContext_Teacher_isStaff(ctx, field) - case "lastSemester": - return ec.fieldContext_Teacher_lastSemester(ctx, field) - case "fk": - return ec.fieldContext_Teacher_fk(ctx, field) - case "id": - return ec.fieldContext_Teacher_id(ctx, field) - case "email": - return ec.fieldContext_Teacher_email(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Invigilator_requirements(ctx context.Context, field graphql.CollectedField, obj *model.Invigilator) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Invigilator_requirements(ctx, field) +func (ec *executionContext) _ExternalExam_module(ctx context.Context, field graphql.CollectedField, obj *model.ExternalExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExternalExam_module(ctx, field) if err != nil { return graphql.Null } @@ -8677,65 +10027,38 @@ func (ec *executionContext) _Invigilator_requirements(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Requirements, nil + return obj.Module, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.InvigilatorRequirements) + res := resTmp.(string) fc.Result = res - return ec.marshalOInvigilatorRequirements2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorRequirements(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Invigilator_requirements(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExternalExam_module(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Invigilator", + Object: "ExternalExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "excludedDates": - return ec.fieldContext_InvigilatorRequirements_excludedDates(ctx, field) - case "excludedDays": - return ec.fieldContext_InvigilatorRequirements_excludedDays(ctx, field) - case "examDateTimes": - return ec.fieldContext_InvigilatorRequirements_examDateTimes(ctx, field) - case "examDays": - return ec.fieldContext_InvigilatorRequirements_examDays(ctx, field) - case "partTime": - return ec.fieldContext_InvigilatorRequirements_partTime(ctx, field) - case "oralExamsContribution": - return ec.fieldContext_InvigilatorRequirements_oralExamsContribution(ctx, field) - case "liveCodingContribution": - return ec.fieldContext_InvigilatorRequirements_liveCodingContribution(ctx, field) - case "masterContribution": - return ec.fieldContext_InvigilatorRequirements_masterContribution(ctx, field) - case "freeSemester": - return ec.fieldContext_InvigilatorRequirements_freeSemester(ctx, field) - case "overtimeLastSemester": - return ec.fieldContext_InvigilatorRequirements_overtimeLastSemester(ctx, field) - case "overtimeThisSemester": - return ec.fieldContext_InvigilatorRequirements_overtimeThisSemester(ctx, field) - case "allContributions": - return ec.fieldContext_InvigilatorRequirements_allContributions(ctx, field) - case "factor": - return ec.fieldContext_InvigilatorRequirements_factor(ctx, field) - case "onlyInSlots": - return ec.fieldContext_InvigilatorRequirements_onlyInSlots(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type InvigilatorRequirements", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Invigilator_todos(ctx context.Context, field graphql.CollectedField, obj *model.Invigilator) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Invigilator_todos(ctx, field) +func (ec *executionContext) _ExternalExam_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.ExternalExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExternalExam_mainExamer(ctx, field) if err != nil { return graphql.Null } @@ -8748,47 +10071,38 @@ func (ec *executionContext) _Invigilator_todos(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Todos, nil + return obj.MainExamer, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.InvigilatorTodos) + res := resTmp.(string) fc.Result = res - return ec.marshalOInvigilatorTodos2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorTodos(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Invigilator_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExternalExam_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Invigilator", + Object: "ExternalExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "totalMinutes": - return ec.fieldContext_InvigilatorTodos_totalMinutes(ctx, field) - case "doingMinutes": - return ec.fieldContext_InvigilatorTodos_doingMinutes(ctx, field) - case "enough": - return ec.fieldContext_InvigilatorTodos_enough(ctx, field) - case "invigilationDays": - return ec.fieldContext_InvigilatorTodos_invigilationDays(ctx, field) - case "invigilations": - return ec.fieldContext_InvigilatorTodos_invigilations(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type InvigilatorTodos", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_excludedDates(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_excludedDates(ctx, field) +func (ec *executionContext) _ExternalExam_duration(ctx context.Context, field graphql.CollectedField, obj *model.ExternalExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExternalExam_duration(ctx, field) if err != nil { return graphql.Null } @@ -8801,7 +10115,7 @@ func (ec *executionContext) _InvigilatorRequirements_excludedDates(ctx context.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExcludedDates, nil + return obj.Duration, nil }) if err != nil { ec.Error(ctx, err) @@ -8813,26 +10127,26 @@ func (ec *executionContext) _InvigilatorRequirements_excludedDates(ctx context.C } return graphql.Null } - res := resTmp.([]*time.Time) + res := resTmp.(int) fc.Result = res - return ec.marshalNTime2ᚕᚖtimeᚐTimeᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_excludedDates(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExternalExam_duration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "ExternalExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_excludedDays(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_excludedDays(ctx, field) +func (ec *executionContext) _FK07Program_name(ctx context.Context, field graphql.CollectedField, obj *model.FK07Program) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FK07Program_name(ctx, field) if err != nil { return graphql.Null } @@ -8845,7 +10159,7 @@ func (ec *executionContext) _InvigilatorRequirements_excludedDays(ctx context.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExcludedDays, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -8857,26 +10171,26 @@ func (ec *executionContext) _InvigilatorRequirements_excludedDays(ctx context.Co } return graphql.Null } - res := resTmp.([]int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2ᚕintᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_excludedDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FK07Program_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "FK07Program", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_examDateTimes(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_examDateTimes(ctx, field) +func (ec *executionContext) _GeneratedExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.GeneratedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GeneratedExam_ancode(ctx, field) if err != nil { return graphql.Null } @@ -8889,7 +10203,7 @@ func (ec *executionContext) _InvigilatorRequirements_examDateTimes(ctx context.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExamDateTimes, nil + return obj.Ancode, nil }) if err != nil { ec.Error(ctx, err) @@ -8901,26 +10215,26 @@ func (ec *executionContext) _InvigilatorRequirements_examDateTimes(ctx context.C } return graphql.Null } - res := resTmp.([]*time.Time) + res := resTmp.(int) fc.Result = res - return ec.marshalNTime2ᚕᚖtimeᚐTimeᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_examDateTimes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GeneratedExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "GeneratedExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_examDays(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_examDays(ctx, field) +func (ec *executionContext) _GeneratedExam_zpaExam(ctx context.Context, field graphql.CollectedField, obj *model.GeneratedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GeneratedExam_zpaExam(ctx, field) if err != nil { return graphql.Null } @@ -8933,7 +10247,7 @@ func (ec *executionContext) _InvigilatorRequirements_examDays(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExamDays, nil + return obj.ZpaExam, nil }) if err != nil { ec.Error(ctx, err) @@ -8945,26 +10259,52 @@ func (ec *executionContext) _InvigilatorRequirements_examDays(ctx context.Contex } return graphql.Null } - res := resTmp.([]int) + res := resTmp.(*model.ZPAExam) fc.Result = res - return ec.marshalNInt2ᚕintᚄ(ctx, field.Selections, res) + return ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_examDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GeneratedExam_zpaExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "GeneratedExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_partTime(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_partTime(ctx, field) +func (ec *executionContext) _GeneratedExam_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.GeneratedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GeneratedExam_mainExamer(ctx, field) if err != nil { return graphql.Null } @@ -8977,7 +10317,7 @@ func (ec *executionContext) _InvigilatorRequirements_partTime(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PartTime, nil + return ec.resolvers.GeneratedExam().MainExamer(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8989,26 +10329,48 @@ func (ec *executionContext) _InvigilatorRequirements_partTime(ctx context.Contex } return graphql.Null } - res := resTmp.(float64) + res := resTmp.(*model.Teacher) fc.Result = res - return ec.marshalNFloat2float64(ctx, field.Selections, res) + return ec.marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_partTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GeneratedExam_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "GeneratedExam", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Float does not have child fields") + switch field.Name { + case "shortname": + return ec.fieldContext_Teacher_shortname(ctx, field) + case "fullname": + return ec.fieldContext_Teacher_fullname(ctx, field) + case "isProf": + return ec.fieldContext_Teacher_isProf(ctx, field) + case "isLBA": + return ec.fieldContext_Teacher_isLBA(ctx, field) + case "isProfHC": + return ec.fieldContext_Teacher_isProfHC(ctx, field) + case "isStaff": + return ec.fieldContext_Teacher_isStaff(ctx, field) + case "lastSemester": + return ec.fieldContext_Teacher_lastSemester(ctx, field) + case "fk": + return ec.fieldContext_Teacher_fk(ctx, field) + case "id": + return ec.fieldContext_Teacher_id(ctx, field) + case "email": + return ec.fieldContext_Teacher_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_oralExamsContribution(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_oralExamsContribution(ctx, field) +func (ec *executionContext) _GeneratedExam_primussExams(ctx context.Context, field graphql.CollectedField, obj *model.GeneratedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GeneratedExam_primussExams(ctx, field) if err != nil { return graphql.Null } @@ -9021,7 +10383,7 @@ func (ec *executionContext) _InvigilatorRequirements_oralExamsContribution(ctx c }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.OralExamsContribution, nil + return obj.PrimussExams, nil }) if err != nil { ec.Error(ctx, err) @@ -9033,26 +10395,36 @@ func (ec *executionContext) _InvigilatorRequirements_oralExamsContribution(ctx c } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.EnhancedPrimussExam) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNEnhancedPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐEnhancedPrimussExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_oralExamsContribution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GeneratedExam_primussExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "GeneratedExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "exam": + return ec.fieldContext_EnhancedPrimussExam_exam(ctx, field) + case "studentRegs": + return ec.fieldContext_EnhancedPrimussExam_studentRegs(ctx, field) + case "conflicts": + return ec.fieldContext_EnhancedPrimussExam_conflicts(ctx, field) + case "ntas": + return ec.fieldContext_EnhancedPrimussExam_ntas(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EnhancedPrimussExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_liveCodingContribution(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_liveCodingContribution(ctx, field) +func (ec *executionContext) _GeneratedExam_constraints(ctx context.Context, field graphql.CollectedField, obj *model.GeneratedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GeneratedExam_constraints(ctx, field) if err != nil { return graphql.Null } @@ -9065,38 +10437,55 @@ func (ec *executionContext) _InvigilatorRequirements_liveCodingContribution(ctx }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LiveCodingContribution, nil + return obj.Constraints, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.Constraints) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_liveCodingContribution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GeneratedExam_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "GeneratedExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_Constraints_ancode(ctx, field) + case "notPlannedByMe": + return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) + case "excludeDays": + return ec.fieldContext_Constraints_excludeDays(ctx, field) + case "possibleDays": + return ec.fieldContext_Constraints_possibleDays(ctx, field) + case "fixedDay": + return ec.fieldContext_Constraints_fixedDay(ctx, field) + case "fixedTime": + return ec.fieldContext_Constraints_fixedTime(ctx, field) + case "sameSlot": + return ec.fieldContext_Constraints_sameSlot(ctx, field) + case "online": + return ec.fieldContext_Constraints_online(ctx, field) + case "roomConstraints": + return ec.fieldContext_Constraints_roomConstraints(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_masterContribution(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_masterContribution(ctx, field) +func (ec *executionContext) _GeneratedExam_conflicts(ctx context.Context, field graphql.CollectedField, obj *model.GeneratedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GeneratedExam_conflicts(ctx, field) if err != nil { return graphql.Null } @@ -9109,7 +10498,7 @@ func (ec *executionContext) _InvigilatorRequirements_masterContribution(ctx cont }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MasterContribution, nil + return obj.Conflicts, nil }) if err != nil { ec.Error(ctx, err) @@ -9121,26 +10510,34 @@ func (ec *executionContext) _InvigilatorRequirements_masterContribution(ctx cont } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.ZPAConflict) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNZPAConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAConflictᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_masterContribution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GeneratedExam_conflicts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "GeneratedExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_ZPAConflict_ancode(ctx, field) + case "numberOfStuds": + return ec.fieldContext_ZPAConflict_numberOfStuds(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAConflict_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAConflict", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_freeSemester(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_freeSemester(ctx, field) +func (ec *executionContext) _GeneratedExam_studentRegsCount(ctx context.Context, field graphql.CollectedField, obj *model.GeneratedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GeneratedExam_studentRegsCount(ctx, field) if err != nil { return graphql.Null } @@ -9153,7 +10550,7 @@ func (ec *executionContext) _InvigilatorRequirements_freeSemester(ctx context.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.FreeSemester, nil + return obj.StudentRegsCount, nil }) if err != nil { ec.Error(ctx, err) @@ -9165,26 +10562,26 @@ func (ec *executionContext) _InvigilatorRequirements_freeSemester(ctx context.Co } return graphql.Null } - res := resTmp.(float64) + res := resTmp.(int) fc.Result = res - return ec.marshalNFloat2float64(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_freeSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GeneratedExam_studentRegsCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "GeneratedExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Float does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_overtimeLastSemester(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_overtimeLastSemester(ctx, field) +func (ec *executionContext) _GeneratedExam_ntas(ctx context.Context, field graphql.CollectedField, obj *model.GeneratedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GeneratedExam_ntas(ctx, field) if err != nil { return graphql.Null } @@ -9197,7 +10594,7 @@ func (ec *executionContext) _InvigilatorRequirements_overtimeLastSemester(ctx co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.OvertimeLastSemester, nil + return obj.Ntas, nil }) if err != nil { ec.Error(ctx, err) @@ -9209,26 +10606,50 @@ func (ec *executionContext) _InvigilatorRequirements_overtimeLastSemester(ctx co } return graphql.Null } - res := resTmp.(float64) + res := resTmp.([]*model.NTA) fc.Result = res - return ec.marshalNFloat2float64(ctx, field.Selections, res) + return ec.marshalNNTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_overtimeLastSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GeneratedExam_ntas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "GeneratedExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Float does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext_NTA_name(ctx, field) + case "email": + return ec.fieldContext_NTA_email(ctx, field) + case "mtknr": + return ec.fieldContext_NTA_mtknr(ctx, field) + case "compensation": + return ec.fieldContext_NTA_compensation(ctx, field) + case "deltaDurationPercent": + return ec.fieldContext_NTA_deltaDurationPercent(ctx, field) + case "needsRoomAlone": + return ec.fieldContext_NTA_needsRoomAlone(ctx, field) + case "program": + return ec.fieldContext_NTA_program(ctx, field) + case "from": + return ec.fieldContext_NTA_from(ctx, field) + case "until": + return ec.fieldContext_NTA_until(ctx, field) + case "lastSemester": + return ec.fieldContext_NTA_lastSemester(ctx, field) + case "exams": + return ec.fieldContext_NTA_exams(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NTA", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_overtimeThisSemester(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_overtimeThisSemester(ctx, field) +func (ec *executionContext) _GeneratedExam_maxDuration(ctx context.Context, field graphql.CollectedField, obj *model.GeneratedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GeneratedExam_maxDuration(ctx, field) if err != nil { return graphql.Null } @@ -9241,7 +10662,7 @@ func (ec *executionContext) _InvigilatorRequirements_overtimeThisSemester(ctx co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.OvertimeThisSemester, nil + return obj.MaxDuration, nil }) if err != nil { ec.Error(ctx, err) @@ -9253,26 +10674,26 @@ func (ec *executionContext) _InvigilatorRequirements_overtimeThisSemester(ctx co } return graphql.Null } - res := resTmp.(float64) + res := resTmp.(int) fc.Result = res - return ec.marshalNFloat2float64(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_overtimeThisSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GeneratedExam_maxDuration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "GeneratedExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Float does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_allContributions(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_allContributions(ctx, field) +func (ec *executionContext) _Invigilation_roomName(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invigilation_roomName(ctx, field) if err != nil { return graphql.Null } @@ -9285,38 +10706,35 @@ func (ec *executionContext) _InvigilatorRequirements_allContributions(ctx contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AllContributions, nil + return obj.RoomName, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_allContributions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invigilation_roomName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "Invigilation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_factor(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_factor(ctx, field) +func (ec *executionContext) _Invigilation_duration(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invigilation_duration(ctx, field) if err != nil { return graphql.Null } @@ -9329,7 +10747,7 @@ func (ec *executionContext) _InvigilatorRequirements_factor(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Factor, nil + return obj.Duration, nil }) if err != nil { ec.Error(ctx, err) @@ -9341,26 +10759,26 @@ func (ec *executionContext) _InvigilatorRequirements_factor(ctx context.Context, } return graphql.Null } - res := resTmp.(float64) + res := resTmp.(int) fc.Result = res - return ec.marshalNFloat2float64(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_factor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invigilation_duration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "Invigilation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Float does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorRequirements_onlyInSlots(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorRequirements_onlyInSlots(ctx, field) +func (ec *executionContext) _Invigilation_invigilatorID(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invigilation_invigilatorID(ctx, field) if err != nil { return graphql.Null } @@ -9373,7 +10791,7 @@ func (ec *executionContext) _InvigilatorRequirements_onlyInSlots(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.OnlyInSlots, nil + return obj.InvigilatorID, nil }) if err != nil { ec.Error(ctx, err) @@ -9385,34 +10803,26 @@ func (ec *executionContext) _InvigilatorRequirements_onlyInSlots(ctx context.Con } return graphql.Null } - res := resTmp.([]*model.Slot) + res := resTmp.(int) fc.Result = res - return ec.marshalNSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorRequirements_onlyInSlots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invigilation_invigilatorID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorRequirements", + Object: "Invigilation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "dayNumber": - return ec.fieldContext_Slot_dayNumber(ctx, field) - case "slotNumber": - return ec.fieldContext_Slot_slotNumber(ctx, field) - case "starttime": - return ec.fieldContext_Slot_starttime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorTodos_totalMinutes(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorTodos_totalMinutes(ctx, field) +func (ec *executionContext) _Invigilation_slot(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invigilation_slot(ctx, field) if err != nil { return graphql.Null } @@ -9425,7 +10835,7 @@ func (ec *executionContext) _InvigilatorTodos_totalMinutes(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalMinutes, nil + return obj.Slot, nil }) if err != nil { ec.Error(ctx, err) @@ -9437,26 +10847,34 @@ func (ec *executionContext) _InvigilatorTodos_totalMinutes(ctx context.Context, } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.Slot) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorTodos_totalMinutes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invigilation_slot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorTodos", + Object: "Invigilation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "dayNumber": + return ec.fieldContext_Slot_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_Slot_slotNumber(ctx, field) + case "starttime": + return ec.fieldContext_Slot_starttime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilatorTodos_doingMinutes(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorTodos_doingMinutes(ctx, field) +func (ec *executionContext) _Invigilation_isReserve(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invigilation_isReserve(ctx, field) if err != nil { return graphql.Null } @@ -9469,7 +10887,7 @@ func (ec *executionContext) _InvigilatorTodos_doingMinutes(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DoingMinutes, nil + return obj.IsReserve, nil }) if err != nil { ec.Error(ctx, err) @@ -9481,26 +10899,26 @@ func (ec *executionContext) _InvigilatorTodos_doingMinutes(ctx context.Context, } return graphql.Null } - res := resTmp.(int) + res := resTmp.(bool) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorTodos_doingMinutes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invigilation_isReserve(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorTodos", + Object: "Invigilation", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorTodos_enough(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorTodos_enough(ctx, field) +func (ec *executionContext) _Invigilation_isSelfInvigilation(ctx context.Context, field graphql.CollectedField, obj *model.Invigilation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invigilation_isSelfInvigilation(ctx, field) if err != nil { return graphql.Null } @@ -9513,7 +10931,7 @@ func (ec *executionContext) _InvigilatorTodos_enough(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Enough, nil + return obj.IsSelfInvigilation, nil }) if err != nil { ec.Error(ctx, err) @@ -9530,9 +10948,9 @@ func (ec *executionContext) _InvigilatorTodos_enough(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorTodos_enough(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invigilation_isSelfInvigilation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorTodos", + Object: "Invigilation", Field: field, IsMethod: false, IsResolver: false, @@ -9543,8 +10961,8 @@ func (ec *executionContext) fieldContext_InvigilatorTodos_enough(ctx context.Con return fc, nil } -func (ec *executionContext) _InvigilatorTodos_invigilationDays(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorTodos_invigilationDays(ctx, field) +func (ec *executionContext) _InvigilationSlot_reserve(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationSlot) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilationSlot_reserve(ctx, field) if err != nil { return graphql.Null } @@ -9557,7 +10975,7 @@ func (ec *executionContext) _InvigilatorTodos_invigilationDays(ctx context.Conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.InvigilationDays, nil + return obj.Reserve, nil }) if err != nil { ec.Error(ctx, err) @@ -9566,26 +10984,48 @@ func (ec *executionContext) _InvigilatorTodos_invigilationDays(ctx context.Conte if resTmp == nil { return graphql.Null } - res := resTmp.([]int) + res := resTmp.(*model.Teacher) fc.Result = res - return ec.marshalOInt2ᚕintᚄ(ctx, field.Selections, res) + return ec.marshalOTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorTodos_invigilationDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilationSlot_reserve(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorTodos", + Object: "InvigilationSlot", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _InvigilatorTodos_invigilations(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorTodos) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorTodos_invigilations(ctx, field) + switch field.Name { + case "shortname": + return ec.fieldContext_Teacher_shortname(ctx, field) + case "fullname": + return ec.fieldContext_Teacher_fullname(ctx, field) + case "isProf": + return ec.fieldContext_Teacher_isProf(ctx, field) + case "isLBA": + return ec.fieldContext_Teacher_isLBA(ctx, field) + case "isProfHC": + return ec.fieldContext_Teacher_isProfHC(ctx, field) + case "isStaff": + return ec.fieldContext_Teacher_isStaff(ctx, field) + case "lastSemester": + return ec.fieldContext_Teacher_lastSemester(ctx, field) + case "fk": + return ec.fieldContext_Teacher_fk(ctx, field) + case "id": + return ec.fieldContext_Teacher_id(ctx, field) + case "email": + return ec.fieldContext_Teacher_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InvigilationSlot_roomsWithInvigilators(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationSlot) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilationSlot_roomsWithInvigilators(ctx, field) if err != nil { return graphql.Null } @@ -9598,49 +11038,50 @@ func (ec *executionContext) _InvigilatorTodos_invigilations(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Invigilations, nil + return obj.RoomsWithInvigilators, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.Invigilation) + res := resTmp.([]*model.RoomWithInvigilator) fc.Result = res - return ec.marshalOInvigilation2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilationᚄ(ctx, field.Selections, res) + return ec.marshalNRoomWithInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomWithInvigilatorᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorTodos_invigilations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilationSlot_roomsWithInvigilators(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorTodos", + Object: "InvigilationSlot", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "roomName": - return ec.fieldContext_Invigilation_roomName(ctx, field) - case "duration": - return ec.fieldContext_Invigilation_duration(ctx, field) - case "invigilatorID": - return ec.fieldContext_Invigilation_invigilatorID(ctx, field) - case "slot": - return ec.fieldContext_Invigilation_slot(ctx, field) - case "isReserve": - return ec.fieldContext_Invigilation_isReserve(ctx, field) - case "isSelfInvigilation": - return ec.fieldContext_Invigilation_isSelfInvigilation(ctx, field) + case "name": + return ec.fieldContext_RoomWithInvigilator_name(ctx, field) + case "maxDuration": + return ec.fieldContext_RoomWithInvigilator_maxDuration(ctx, field) + case "studentCount": + return ec.fieldContext_RoomWithInvigilator_studentCount(ctx, field) + case "roomAndExams": + return ec.fieldContext_RoomWithInvigilator_roomAndExams(ctx, field) + case "invigilator": + return ec.fieldContext_RoomWithInvigilator_invigilator(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Invigilation", field.Name) + return nil, fmt.Errorf("no field named %q was found under type RoomWithInvigilator", field.Name) }, } return fc, nil } -func (ec *executionContext) _InvigilatorsForDay_want(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorsForDay) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorsForDay_want(ctx, field) +func (ec *executionContext) _InvigilationTodos_sumExamRooms(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilationTodos_sumExamRooms(ctx, field) if err != nil { return graphql.Null } @@ -9653,7 +11094,7 @@ func (ec *executionContext) _InvigilatorsForDay_want(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Want, nil + return obj.SumExamRooms, nil }) if err != nil { ec.Error(ctx, err) @@ -9665,34 +11106,26 @@ func (ec *executionContext) _InvigilatorsForDay_want(ctx context.Context, field } return graphql.Null } - res := resTmp.([]*model.Invigilator) + res := resTmp.(int) fc.Result = res - return ec.marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorsForDay_want(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilationTodos_sumExamRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorsForDay", + Object: "InvigilationTodos", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "teacher": - return ec.fieldContext_Invigilator_teacher(ctx, field) - case "requirements": - return ec.fieldContext_Invigilator_requirements(ctx, field) - case "todos": - return ec.fieldContext_Invigilator_todos(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Invigilator", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _InvigilatorsForDay_can(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorsForDay) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_InvigilatorsForDay_can(ctx, field) +func (ec *executionContext) _InvigilationTodos_sumReserve(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilationTodos_sumReserve(ctx, field) if err != nil { return graphql.Null } @@ -9705,7 +11138,7 @@ func (ec *executionContext) _InvigilatorsForDay_can(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Can, nil + return obj.SumReserve, nil }) if err != nil { ec.Error(ctx, err) @@ -9717,34 +11150,26 @@ func (ec *executionContext) _InvigilatorsForDay_can(ctx context.Context, field g } return graphql.Null } - res := resTmp.([]*model.Invigilator) + res := resTmp.(int) fc.Result = res - return ec.marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InvigilatorsForDay_can(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilationTodos_sumReserve(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "InvigilatorsForDay", + Object: "InvigilationTodos", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "teacher": - return ec.fieldContext_Invigilator_teacher(ctx, field) - case "requirements": - return ec.fieldContext_Invigilator_requirements(ctx, field) - case "todos": - return ec.fieldContext_Invigilator_todos(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Invigilator", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Mutation_setSemester(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_setSemester(ctx, field) +func (ec *executionContext) _InvigilationTodos_sumOtherContributions(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilationTodos_sumOtherContributions(ctx, field) if err != nil { return graphql.Null } @@ -9757,7 +11182,7 @@ func (ec *executionContext) _Mutation_setSemester(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().SetSemester(rctx, fc.Args["input"].(string)) + return obj.SumOtherContributions, nil }) if err != nil { ec.Error(ctx, err) @@ -9769,41 +11194,26 @@ func (ec *executionContext) _Mutation_setSemester(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(*model.Semester) + res := resTmp.(int) fc.Result = res - return ec.marshalNSemester2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemester(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_setSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilationTodos_sumOtherContributions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilationTodos", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Semester_id(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Semester", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_setSemester_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_zpaExamsToPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_zpaExamsToPlan(ctx, field) +func (ec *executionContext) _InvigilationTodos_sumOtherContributionsOvertimeCutted(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilationTodos_sumOtherContributionsOvertimeCutted(ctx, field) if err != nil { return graphql.Null } @@ -9816,7 +11226,7 @@ func (ec *executionContext) _Mutation_zpaExamsToPlan(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().ZpaExamsToPlan(rctx, fc.Args["input"].([]int)) + return obj.SumOtherContributionsOvertimeCutted, nil }) if err != nil { ec.Error(ctx, err) @@ -9828,61 +11238,26 @@ func (ec *executionContext) _Mutation_zpaExamsToPlan(ctx context.Context, field } return graphql.Null } - res := resTmp.([]*model.ZPAExam) + res := resTmp.(int) fc.Result = res - return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_zpaExamsToPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilationTodos_sumOtherContributionsOvertimeCutted(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilationTodos", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "zpaID": - return ec.fieldContext_ZPAExam_zpaID(ctx, field) - case "semester": - return ec.fieldContext_ZPAExam_semester(ctx, field) - case "ancode": - return ec.fieldContext_ZPAExam_ancode(ctx, field) - case "module": - return ec.fieldContext_ZPAExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_ZPAExam_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) - case "examType": - return ec.fieldContext_ZPAExam_examType(ctx, field) - case "examTypeFull": - return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) - case "duration": - return ec.fieldContext_ZPAExam_duration(ctx, field) - case "isRepeaterExam": - return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) - case "groups": - return ec.fieldContext_ZPAExam_groups(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_zpaExamsToPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_addZpaExamToPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_addZpaExamToPlan(ctx, field) +func (ec *executionContext) _InvigilationTodos_invigilatorCount(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilationTodos_invigilatorCount(ctx, field) if err != nil { return graphql.Null } @@ -9895,7 +11270,7 @@ func (ec *executionContext) _Mutation_addZpaExamToPlan(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().AddZpaExamToPlan(rctx, fc.Args["ancode"].(int), fc.Args["unknown"].(bool)) + return obj.InvigilatorCount, nil }) if err != nil { ec.Error(ctx, err) @@ -9907,37 +11282,26 @@ func (ec *executionContext) _Mutation_addZpaExamToPlan(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_addZpaExamToPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilationTodos_invigilatorCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilationTodos", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_addZpaExamToPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_rmZpaExamFromPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_rmZpaExamFromPlan(ctx, field) +func (ec *executionContext) _InvigilationTodos_todoPerInvigilator(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilationTodos_todoPerInvigilator(ctx, field) if err != nil { return graphql.Null } @@ -9950,7 +11314,7 @@ func (ec *executionContext) _Mutation_rmZpaExamFromPlan(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().RmZpaExamFromPlan(rctx, fc.Args["ancode"].(int), fc.Args["unknown"].(bool)) + return obj.TodoPerInvigilator, nil }) if err != nil { ec.Error(ctx, err) @@ -9962,37 +11326,26 @@ func (ec *executionContext) _Mutation_rmZpaExamFromPlan(ctx context.Context, fie } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_rmZpaExamFromPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilationTodos_todoPerInvigilator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilationTodos", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_rmZpaExamFromPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_addAdditionalExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_addAdditionalExam(ctx, field) +func (ec *executionContext) _InvigilationTodos_todoPerInvigilatorOvertimeCutted(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilationTodos_todoPerInvigilatorOvertimeCutted(ctx, field) if err != nil { return graphql.Null } @@ -10005,7 +11358,7 @@ func (ec *executionContext) _Mutation_addAdditionalExam(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().AddAdditionalExam(rctx, fc.Args["exam"].(model.AdditionalExamInput)) + return obj.TodoPerInvigilatorOvertimeCutted, nil }) if err != nil { ec.Error(ctx, err) @@ -10017,37 +11370,26 @@ func (ec *executionContext) _Mutation_addAdditionalExam(ctx context.Context, fie } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_addAdditionalExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilationTodos_todoPerInvigilatorOvertimeCutted(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilationTodos", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_addAdditionalExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_removePrimussExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_removePrimussExam(ctx, field) +func (ec *executionContext) _InvigilationTodos_invigilators(ctx context.Context, field graphql.CollectedField, obj *model.InvigilationTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilationTodos_invigilators(ctx, field) if err != nil { return graphql.Null } @@ -10060,7 +11402,7 @@ func (ec *executionContext) _Mutation_removePrimussExam(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().RemovePrimussExam(rctx, fc.Args["input"].(*model.PrimussExamInput)) + return obj.Invigilators, nil }) if err != nil { ec.Error(ctx, err) @@ -10072,37 +11414,34 @@ func (ec *executionContext) _Mutation_removePrimussExam(ctx context.Context, fie } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.Invigilator) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_removePrimussExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilationTodos_invigilators(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilationTodos", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "teacher": + return ec.fieldContext_Invigilator_teacher(ctx, field) + case "requirements": + return ec.fieldContext_Invigilator_requirements(ctx, field) + case "todos": + return ec.fieldContext_Invigilator_todos(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invigilator", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_removePrimussExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_prepareExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_prepareExams(ctx, field) +func (ec *executionContext) _Invigilator_teacher(ctx context.Context, field graphql.CollectedField, obj *model.Invigilator) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invigilator_teacher(ctx, field) if err != nil { return graphql.Null } @@ -10115,7 +11454,7 @@ func (ec *executionContext) _Mutation_prepareExams(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().PrepareExams(rctx, fc.Args["input"].([]*model.PrimussExamInput)) + return obj.Teacher, nil }) if err != nil { ec.Error(ctx, err) @@ -10127,37 +11466,48 @@ func (ec *executionContext) _Mutation_prepareExams(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.Teacher) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_prepareExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invigilator_teacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Invigilator", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "shortname": + return ec.fieldContext_Teacher_shortname(ctx, field) + case "fullname": + return ec.fieldContext_Teacher_fullname(ctx, field) + case "isProf": + return ec.fieldContext_Teacher_isProf(ctx, field) + case "isLBA": + return ec.fieldContext_Teacher_isLBA(ctx, field) + case "isProfHC": + return ec.fieldContext_Teacher_isProfHC(ctx, field) + case "isStaff": + return ec.fieldContext_Teacher_isStaff(ctx, field) + case "lastSemester": + return ec.fieldContext_Teacher_lastSemester(ctx, field) + case "fk": + return ec.fieldContext_Teacher_fk(ctx, field) + case "id": + return ec.fieldContext_Teacher_id(ctx, field) + case "email": + return ec.fieldContext_Teacher_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_prepareExams_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_addNTA(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_addNTA(ctx, field) +func (ec *executionContext) _Invigilator_requirements(ctx context.Context, field graphql.CollectedField, obj *model.Invigilator) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invigilator_requirements(ctx, field) if err != nil { return graphql.Null } @@ -10170,71 +11520,65 @@ func (ec *executionContext) _Mutation_addNTA(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().AddNta(rctx, fc.Args["input"].(model.NTAInput)) + return obj.Requirements, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*model.NTA) + res := resTmp.(*model.InvigilatorRequirements) fc.Result = res - return ec.marshalNNTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx, field.Selections, res) + return ec.marshalOInvigilatorRequirements2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorRequirements(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_addNTA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invigilator_requirements(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Invigilator", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext_NTA_name(ctx, field) - case "mtknr": - return ec.fieldContext_NTA_mtknr(ctx, field) - case "compensation": - return ec.fieldContext_NTA_compensation(ctx, field) - case "deltaDurationPercent": - return ec.fieldContext_NTA_deltaDurationPercent(ctx, field) - case "needsRoomAlone": - return ec.fieldContext_NTA_needsRoomAlone(ctx, field) - case "program": - return ec.fieldContext_NTA_program(ctx, field) - case "from": - return ec.fieldContext_NTA_from(ctx, field) - case "until": - return ec.fieldContext_NTA_until(ctx, field) - case "lastSemester": - return ec.fieldContext_NTA_lastSemester(ctx, field) - case "exams": - return ec.fieldContext_NTA_exams(ctx, field) + case "excludedDates": + return ec.fieldContext_InvigilatorRequirements_excludedDates(ctx, field) + case "excludedDays": + return ec.fieldContext_InvigilatorRequirements_excludedDays(ctx, field) + case "examDateTimes": + return ec.fieldContext_InvigilatorRequirements_examDateTimes(ctx, field) + case "examDays": + return ec.fieldContext_InvigilatorRequirements_examDays(ctx, field) + case "partTime": + return ec.fieldContext_InvigilatorRequirements_partTime(ctx, field) + case "oralExamsContribution": + return ec.fieldContext_InvigilatorRequirements_oralExamsContribution(ctx, field) + case "liveCodingContribution": + return ec.fieldContext_InvigilatorRequirements_liveCodingContribution(ctx, field) + case "masterContribution": + return ec.fieldContext_InvigilatorRequirements_masterContribution(ctx, field) + case "freeSemester": + return ec.fieldContext_InvigilatorRequirements_freeSemester(ctx, field) + case "overtimeLastSemester": + return ec.fieldContext_InvigilatorRequirements_overtimeLastSemester(ctx, field) + case "overtimeThisSemester": + return ec.fieldContext_InvigilatorRequirements_overtimeThisSemester(ctx, field) + case "allContributions": + return ec.fieldContext_InvigilatorRequirements_allContributions(ctx, field) + case "factor": + return ec.fieldContext_InvigilatorRequirements_factor(ctx, field) + case "onlyInSlots": + return ec.fieldContext_InvigilatorRequirements_onlyInSlots(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type NTA", field.Name) + return nil, fmt.Errorf("no field named %q was found under type InvigilatorRequirements", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_addNTA_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_notPlannedByMe(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_notPlannedByMe(ctx, field) +func (ec *executionContext) _Invigilator_todos(ctx context.Context, field graphql.CollectedField, obj *model.Invigilator) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Invigilator_todos(ctx, field) if err != nil { return graphql.Null } @@ -10247,49 +11591,47 @@ func (ec *executionContext) _Mutation_notPlannedByMe(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().NotPlannedByMe(rctx, fc.Args["ancode"].(int)) + return obj.Todos, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.InvigilatorTodos) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOInvigilatorTodos2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorTodos(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_notPlannedByMe(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Invigilator_todos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Invigilator", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "totalMinutes": + return ec.fieldContext_InvigilatorTodos_totalMinutes(ctx, field) + case "doingMinutes": + return ec.fieldContext_InvigilatorTodos_doingMinutes(ctx, field) + case "enough": + return ec.fieldContext_InvigilatorTodos_enough(ctx, field) + case "invigilationDays": + return ec.fieldContext_InvigilatorTodos_invigilationDays(ctx, field) + case "invigilations": + return ec.fieldContext_InvigilatorTodos_invigilations(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InvigilatorTodos", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_notPlannedByMe_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_excludeDays(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_excludeDays(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_excludedDates(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_excludedDates(ctx, field) if err != nil { return graphql.Null } @@ -10302,7 +11644,7 @@ func (ec *executionContext) _Mutation_excludeDays(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().ExcludeDays(rctx, fc.Args["ancode"].(int), fc.Args["days"].([]string)) + return obj.ExcludedDates, nil }) if err != nil { ec.Error(ctx, err) @@ -10314,37 +11656,26 @@ func (ec *executionContext) _Mutation_excludeDays(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*time.Time) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNTime2ᚕᚖtimeᚐTimeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_excludeDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_excludedDates(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Time does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_excludeDays_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_possibleDays(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_possibleDays(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_excludedDays(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_excludedDays(ctx, field) if err != nil { return graphql.Null } @@ -10357,7 +11688,7 @@ func (ec *executionContext) _Mutation_possibleDays(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().PossibleDays(rctx, fc.Args["ancode"].(int), fc.Args["days"].([]string)) + return obj.ExcludedDays, nil }) if err != nil { ec.Error(ctx, err) @@ -10369,37 +11700,26 @@ func (ec *executionContext) _Mutation_possibleDays(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2ᚕintᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_possibleDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_excludedDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_possibleDays_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_sameSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_sameSlot(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_examDateTimes(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_examDateTimes(ctx, field) if err != nil { return graphql.Null } @@ -10412,7 +11732,7 @@ func (ec *executionContext) _Mutation_sameSlot(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().SameSlot(rctx, fc.Args["ancode"].(int), fc.Args["ancodes"].([]int)) + return obj.ExamDateTimes, nil }) if err != nil { ec.Error(ctx, err) @@ -10424,37 +11744,26 @@ func (ec *executionContext) _Mutation_sameSlot(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*time.Time) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNTime2ᚕᚖtimeᚐTimeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_sameSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_examDateTimes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Time does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_sameSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_placesWithSockets(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_placesWithSockets(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_examDays(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_examDays(ctx, field) if err != nil { return graphql.Null } @@ -10467,7 +11776,7 @@ func (ec *executionContext) _Mutation_placesWithSockets(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().PlacesWithSockets(rctx, fc.Args["ancode"].(int)) + return obj.ExamDays, nil }) if err != nil { ec.Error(ctx, err) @@ -10479,37 +11788,26 @@ func (ec *executionContext) _Mutation_placesWithSockets(ctx context.Context, fie } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2ᚕintᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_placesWithSockets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_examDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_placesWithSockets_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_lab(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_lab(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_partTime(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_partTime(ctx, field) if err != nil { return graphql.Null } @@ -10522,7 +11820,7 @@ func (ec *executionContext) _Mutation_lab(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().Lab(rctx, fc.Args["ancode"].(int)) + return obj.PartTime, nil }) if err != nil { ec.Error(ctx, err) @@ -10534,37 +11832,26 @@ func (ec *executionContext) _Mutation_lab(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(float64) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_lab(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_partTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Float does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_lab_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_exahmRooms(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_exahmRooms(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_oralExamsContribution(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_oralExamsContribution(ctx, field) if err != nil { return graphql.Null } @@ -10577,7 +11864,7 @@ func (ec *executionContext) _Mutation_exahmRooms(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().ExahmRooms(rctx, fc.Args["ancode"].(int)) + return obj.OralExamsContribution, nil }) if err != nil { ec.Error(ctx, err) @@ -10589,37 +11876,26 @@ func (ec *executionContext) _Mutation_exahmRooms(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_exahmRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_oralExamsContribution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_exahmRooms_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_seb(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_seb(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_liveCodingContribution(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_liveCodingContribution(ctx, field) if err != nil { return graphql.Null } @@ -10632,7 +11908,7 @@ func (ec *executionContext) _Mutation_seb(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().Seb(rctx, fc.Args["ancode"].(int)) + return obj.LiveCodingContribution, nil }) if err != nil { ec.Error(ctx, err) @@ -10644,37 +11920,26 @@ func (ec *executionContext) _Mutation_seb(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_seb(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_liveCodingContribution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_seb_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_online(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_online(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_masterContribution(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_masterContribution(ctx, field) if err != nil { return graphql.Null } @@ -10687,7 +11952,7 @@ func (ec *executionContext) _Mutation_online(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().Online(rctx, fc.Args["ancode"].(int)) + return obj.MasterContribution, nil }) if err != nil { ec.Error(ctx, err) @@ -10699,37 +11964,26 @@ func (ec *executionContext) _Mutation_online(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_online(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_masterContribution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_online_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_addExamGroupToSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_addExamGroupToSlot(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_freeSemester(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_freeSemester(ctx, field) if err != nil { return graphql.Null } @@ -10742,7 +11996,7 @@ func (ec *executionContext) _Mutation_addExamGroupToSlot(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().AddExamGroupToSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int), fc.Args["examGroupCode"].(int)) + return obj.FreeSemester, nil }) if err != nil { ec.Error(ctx, err) @@ -10754,37 +12008,26 @@ func (ec *executionContext) _Mutation_addExamGroupToSlot(ctx context.Context, fi } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(float64) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_addExamGroupToSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_freeSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Float does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_addExamGroupToSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_rmExamGroupFromSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_rmExamGroupFromSlot(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_overtimeLastSemester(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_overtimeLastSemester(ctx, field) if err != nil { return graphql.Null } @@ -10797,7 +12040,7 @@ func (ec *executionContext) _Mutation_rmExamGroupFromSlot(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().RmExamGroupFromSlot(rctx, fc.Args["examGroupCode"].(int)) + return obj.OvertimeLastSemester, nil }) if err != nil { ec.Error(ctx, err) @@ -10809,37 +12052,26 @@ func (ec *executionContext) _Mutation_rmExamGroupFromSlot(ctx context.Context, f } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(float64) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_rmExamGroupFromSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_overtimeLastSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Float does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_rmExamGroupFromSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_addRoomToExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_addRoomToExam(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_overtimeThisSemester(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_overtimeThisSemester(ctx, field) if err != nil { return graphql.Null } @@ -10852,7 +12084,7 @@ func (ec *executionContext) _Mutation_addRoomToExam(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().AddRoomToExam(rctx, fc.Args["input"].(model.RoomForExamInput)) + return obj.OvertimeThisSemester, nil }) if err != nil { ec.Error(ctx, err) @@ -10864,37 +12096,26 @@ func (ec *executionContext) _Mutation_addRoomToExam(ctx context.Context, field g } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(float64) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_addRoomToExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_overtimeThisSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "InvigilatorRequirements", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Float does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_addRoomToExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _NTA_name(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTA_name(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_allContributions(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_allContributions(ctx, field) if err != nil { return graphql.Null } @@ -10907,7 +12128,7 @@ func (ec *executionContext) _NTA_name(ctx context.Context, field graphql.Collect }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.AllContributions, nil }) if err != nil { ec.Error(ctx, err) @@ -10919,26 +12140,26 @@ func (ec *executionContext) _NTA_name(ctx context.Context, field graphql.Collect } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTA_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_allContributions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTA", + Object: "InvigilatorRequirements", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _NTA_mtknr(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTA_mtknr(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_factor(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_factor(ctx, field) if err != nil { return graphql.Null } @@ -10951,7 +12172,7 @@ func (ec *executionContext) _NTA_mtknr(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Mtknr, nil + return obj.Factor, nil }) if err != nil { ec.Error(ctx, err) @@ -10963,26 +12184,26 @@ func (ec *executionContext) _NTA_mtknr(ctx context.Context, field graphql.Collec } return graphql.Null } - res := resTmp.(string) + res := resTmp.(float64) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTA_mtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_factor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTA", + Object: "InvigilatorRequirements", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Float does not have child fields") }, } return fc, nil } -func (ec *executionContext) _NTA_compensation(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTA_compensation(ctx, field) +func (ec *executionContext) _InvigilatorRequirements_onlyInSlots(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorRequirements) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorRequirements_onlyInSlots(ctx, field) if err != nil { return graphql.Null } @@ -10995,7 +12216,7 @@ func (ec *executionContext) _NTA_compensation(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Compensation, nil + return obj.OnlyInSlots, nil }) if err != nil { ec.Error(ctx, err) @@ -11007,26 +12228,34 @@ func (ec *executionContext) _NTA_compensation(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.Slot) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTA_compensation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorRequirements_onlyInSlots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTA", + Object: "InvigilatorRequirements", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "dayNumber": + return ec.fieldContext_Slot_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_Slot_slotNumber(ctx, field) + case "starttime": + return ec.fieldContext_Slot_starttime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) }, } return fc, nil } -func (ec *executionContext) _NTA_deltaDurationPercent(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTA_deltaDurationPercent(ctx, field) +func (ec *executionContext) _InvigilatorTodos_totalMinutes(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorTodos_totalMinutes(ctx, field) if err != nil { return graphql.Null } @@ -11039,7 +12268,7 @@ func (ec *executionContext) _NTA_deltaDurationPercent(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeltaDurationPercent, nil + return obj.TotalMinutes, nil }) if err != nil { ec.Error(ctx, err) @@ -11056,9 +12285,9 @@ func (ec *executionContext) _NTA_deltaDurationPercent(ctx context.Context, field return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTA_deltaDurationPercent(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorTodos_totalMinutes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTA", + Object: "InvigilatorTodos", Field: field, IsMethod: false, IsResolver: false, @@ -11069,8 +12298,8 @@ func (ec *executionContext) fieldContext_NTA_deltaDurationPercent(ctx context.Co return fc, nil } -func (ec *executionContext) _NTA_needsRoomAlone(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTA_needsRoomAlone(ctx, field) +func (ec *executionContext) _InvigilatorTodos_doingMinutes(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorTodos_doingMinutes(ctx, field) if err != nil { return graphql.Null } @@ -11083,7 +12312,7 @@ func (ec *executionContext) _NTA_needsRoomAlone(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.NeedsRoomAlone, nil + return obj.DoingMinutes, nil }) if err != nil { ec.Error(ctx, err) @@ -11095,26 +12324,26 @@ func (ec *executionContext) _NTA_needsRoomAlone(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTA_needsRoomAlone(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorTodos_doingMinutes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTA", + Object: "InvigilatorTodos", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _NTA_program(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTA_program(ctx, field) +func (ec *executionContext) _InvigilatorTodos_enough(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorTodos_enough(ctx, field) if err != nil { return graphql.Null } @@ -11127,7 +12356,7 @@ func (ec *executionContext) _NTA_program(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Program, nil + return obj.Enough, nil }) if err != nil { ec.Error(ctx, err) @@ -11139,26 +12368,26 @@ func (ec *executionContext) _NTA_program(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTA_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorTodos_enough(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTA", + Object: "InvigilatorTodos", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _NTA_from(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTA_from(ctx, field) +func (ec *executionContext) _InvigilatorTodos_invigilationDays(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorTodos_invigilationDays(ctx, field) if err != nil { return graphql.Null } @@ -11171,38 +12400,35 @@ func (ec *executionContext) _NTA_from(ctx context.Context, field graphql.Collect }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.From, nil + return obj.InvigilationDays, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOInt2ᚕintᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTA_from(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorTodos_invigilationDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTA", + Object: "InvigilatorTodos", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _NTA_until(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTA_until(ctx, field) +func (ec *executionContext) _InvigilatorTodos_invigilations(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorTodos) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorTodos_invigilations(ctx, field) if err != nil { return graphql.Null } @@ -11215,38 +12441,49 @@ func (ec *executionContext) _NTA_until(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Until, nil + return obj.Invigilations, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.Invigilation) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOInvigilation2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilationᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTA_until(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorTodos_invigilations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTA", + Object: "InvigilatorTodos", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "roomName": + return ec.fieldContext_Invigilation_roomName(ctx, field) + case "duration": + return ec.fieldContext_Invigilation_duration(ctx, field) + case "invigilatorID": + return ec.fieldContext_Invigilation_invigilatorID(ctx, field) + case "slot": + return ec.fieldContext_Invigilation_slot(ctx, field) + case "isReserve": + return ec.fieldContext_Invigilation_isReserve(ctx, field) + case "isSelfInvigilation": + return ec.fieldContext_Invigilation_isSelfInvigilation(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invigilation", field.Name) }, } return fc, nil } -func (ec *executionContext) _NTA_lastSemester(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTA_lastSemester(ctx, field) +func (ec *executionContext) _InvigilatorsForDay_want(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorsForDay) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorsForDay_want(ctx, field) if err != nil { return graphql.Null } @@ -11259,35 +12496,46 @@ func (ec *executionContext) _NTA_lastSemester(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LastSemester, nil + return obj.Want, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]*model.Invigilator) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTA_lastSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorsForDay_want(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTA", + Object: "InvigilatorsForDay", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} + switch field.Name { + case "teacher": + return ec.fieldContext_Invigilator_teacher(ctx, field) + case "requirements": + return ec.fieldContext_Invigilator_requirements(ctx, field) + case "todos": + return ec.fieldContext_Invigilator_todos(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Invigilator", field.Name) + }, + } + return fc, nil +} -func (ec *executionContext) _NTA_exams(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTA_exams(ctx, field) +func (ec *executionContext) _InvigilatorsForDay_can(ctx context.Context, field graphql.CollectedField, obj *model.InvigilatorsForDay) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InvigilatorsForDay_can(ctx, field) if err != nil { return graphql.Null } @@ -11300,7 +12548,7 @@ func (ec *executionContext) _NTA_exams(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exams, nil + return obj.Can, nil }) if err != nil { ec.Error(ctx, err) @@ -11312,36 +12560,34 @@ func (ec *executionContext) _NTA_exams(ctx context.Context, field graphql.Collec } return graphql.Null } - res := resTmp.([]*model.NTAExam) + res := resTmp.([]*model.Invigilator) fc.Result = res - return ec.marshalNNTAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAExamᚄ(ctx, field.Selections, res) + return ec.marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTA_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InvigilatorsForDay_can(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTA", + Object: "InvigilatorsForDay", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "semester": - return ec.fieldContext_NTAExam_semester(ctx, field) - case "ancode": - return ec.fieldContext_NTAExam_ancode(ctx, field) - case "module": - return ec.fieldContext_NTAExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_NTAExam_mainExamer(ctx, field) + case "teacher": + return ec.fieldContext_Invigilator_teacher(ctx, field) + case "requirements": + return ec.fieldContext_Invigilator_requirements(ctx, field) + case "todos": + return ec.fieldContext_Invigilator_todos(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type NTAExam", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Invigilator", field.Name) }, } return fc, nil } -func (ec *executionContext) _NTAExam_semester(ctx context.Context, field graphql.CollectedField, obj *model.NTAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTAExam_semester(ctx, field) +func (ec *executionContext) _Mutation_setSemester(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_setSemester(ctx, field) if err != nil { return graphql.Null } @@ -11354,7 +12600,7 @@ func (ec *executionContext) _NTAExam_semester(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Semester, nil + return ec.resolvers.Mutation().SetSemester(rctx, fc.Args["input"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -11366,26 +12612,41 @@ func (ec *executionContext) _NTAExam_semester(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.Semester) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNSemester2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemester(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTAExam_semester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_setSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTAExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_Semester_id(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Semester", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_setSemester_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _NTAExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.NTAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTAExam_ancode(ctx, field) +func (ec *executionContext) _Mutation_zpaExamsToPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_zpaExamsToPlan(ctx, field) if err != nil { return graphql.Null } @@ -11398,7 +12659,7 @@ func (ec *executionContext) _NTAExam_ancode(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AnCode, nil + return ec.resolvers.Mutation().ZpaExamsToPlan(rctx, fc.Args["input"].([]int)) }) if err != nil { ec.Error(ctx, err) @@ -11410,26 +12671,63 @@ func (ec *executionContext) _NTAExam_ancode(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.ZPAExam) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTAExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_zpaExamsToPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTAExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_zpaExamsToPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _NTAExam_module(ctx context.Context, field graphql.CollectedField, obj *model.NTAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTAExam_module(ctx, field) +func (ec *executionContext) _Mutation_addZpaExamToPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_addZpaExamToPlan(ctx, field) if err != nil { return graphql.Null } @@ -11442,7 +12740,7 @@ func (ec *executionContext) _NTAExam_module(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Module, nil + return ec.resolvers.Mutation().AddZpaExamToPlan(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -11454,26 +12752,37 @@ func (ec *executionContext) _NTAExam_module(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTAExam_module(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_addZpaExamToPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTAExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_addZpaExamToPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _NTAExam_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.NTAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTAExam_mainExamer(ctx, field) +func (ec *executionContext) _Mutation_rmZpaExamFromPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_rmZpaExamFromPlan(ctx, field) if err != nil { return graphql.Null } @@ -11486,7 +12795,7 @@ func (ec *executionContext) _NTAExam_mainExamer(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MainExamer, nil + return ec.resolvers.Mutation().RmZpaExamFromPlan(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -11498,26 +12807,37 @@ func (ec *executionContext) _NTAExam_mainExamer(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTAExam_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_rmZpaExamFromPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTAExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_rmZpaExamFromPlan_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _NTAWithRegs_nta(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTAWithRegs_nta(ctx, field) +func (ec *executionContext) _Mutation_addAdditionalExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_addAdditionalExam(ctx, field) if err != nil { return graphql.Null } @@ -11530,7 +12850,7 @@ func (ec *executionContext) _NTAWithRegs_nta(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Nta, nil + return ec.resolvers.Mutation().AddAdditionalExam(rctx, fc.Args["exam"].(model.AdditionalExamInput)) }) if err != nil { ec.Error(ctx, err) @@ -11542,48 +12862,37 @@ func (ec *executionContext) _NTAWithRegs_nta(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(*model.NTA) + res := resTmp.(bool) fc.Result = res - return ec.marshalNNTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTAWithRegs_nta(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_addAdditionalExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTAWithRegs", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_NTA_name(ctx, field) - case "mtknr": - return ec.fieldContext_NTA_mtknr(ctx, field) - case "compensation": - return ec.fieldContext_NTA_compensation(ctx, field) - case "deltaDurationPercent": - return ec.fieldContext_NTA_deltaDurationPercent(ctx, field) - case "needsRoomAlone": - return ec.fieldContext_NTA_needsRoomAlone(ctx, field) - case "program": - return ec.fieldContext_NTA_program(ctx, field) - case "from": - return ec.fieldContext_NTA_from(ctx, field) - case "until": - return ec.fieldContext_NTA_until(ctx, field) - case "lastSemester": - return ec.fieldContext_NTA_lastSemester(ctx, field) - case "exams": - return ec.fieldContext_NTA_exams(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NTA", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_addAdditionalExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _NTAWithRegs_regs(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTAWithRegs_regs(ctx, field) +func (ec *executionContext) _Mutation_removePrimussExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_removePrimussExam(ctx, field) if err != nil { return graphql.Null } @@ -11596,41 +12905,49 @@ func (ec *executionContext) _NTAWithRegs_regs(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Regs, nil + return ec.resolvers.Mutation().RemovePrimussExam(rctx, fc.Args["input"].(*model.PrimussExamInput)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.StudentRegsPerStudent) + res := resTmp.(bool) fc.Result = res - return ec.marshalOStudentRegsPerStudent2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerStudent(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTAWithRegs_regs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_removePrimussExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTAWithRegs", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "student": - return ec.fieldContext_StudentRegsPerStudent_student(ctx, field) - case "ancodes": - return ec.fieldContext_StudentRegsPerStudent_ancodes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type StudentRegsPerStudent", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_removePrimussExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _NTAWithRegsByExam_exam(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegsByExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTAWithRegsByExam_exam(ctx, field) +func (ec *executionContext) _Mutation_addNTA(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_addNTA(ctx, field) if err != nil { return graphql.Null } @@ -11643,7 +12960,7 @@ func (ec *executionContext) _NTAWithRegsByExam_exam(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exam, nil + return ec.resolvers.Mutation().AddNta(rctx, fc.Args["input"].(model.NTAInput)) }) if err != nil { ec.Error(ctx, err) @@ -11655,50 +12972,61 @@ func (ec *executionContext) _NTAWithRegsByExam_exam(ctx context.Context, field g } return graphql.Null } - res := resTmp.(*model.ZPAExam) + res := resTmp.(*model.NTA) fc.Result = res - return ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) + return ec.marshalNNTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTAWithRegsByExam_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_addNTA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTAWithRegsByExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "zpaID": - return ec.fieldContext_ZPAExam_zpaID(ctx, field) - case "semester": - return ec.fieldContext_ZPAExam_semester(ctx, field) - case "ancode": - return ec.fieldContext_ZPAExam_ancode(ctx, field) - case "module": - return ec.fieldContext_ZPAExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_ZPAExam_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) - case "examType": - return ec.fieldContext_ZPAExam_examType(ctx, field) - case "examTypeFull": - return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) - case "duration": - return ec.fieldContext_ZPAExam_duration(ctx, field) - case "isRepeaterExam": - return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) - case "groups": - return ec.fieldContext_ZPAExam_groups(ctx, field) + case "name": + return ec.fieldContext_NTA_name(ctx, field) + case "email": + return ec.fieldContext_NTA_email(ctx, field) + case "mtknr": + return ec.fieldContext_NTA_mtknr(ctx, field) + case "compensation": + return ec.fieldContext_NTA_compensation(ctx, field) + case "deltaDurationPercent": + return ec.fieldContext_NTA_deltaDurationPercent(ctx, field) + case "needsRoomAlone": + return ec.fieldContext_NTA_needsRoomAlone(ctx, field) + case "program": + return ec.fieldContext_NTA_program(ctx, field) + case "from": + return ec.fieldContext_NTA_from(ctx, field) + case "until": + return ec.fieldContext_NTA_until(ctx, field) + case "lastSemester": + return ec.fieldContext_NTA_lastSemester(ctx, field) + case "exams": + return ec.fieldContext_NTA_exams(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + return nil, fmt.Errorf("no field named %q was found under type NTA", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_addNTA_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _NTAWithRegsByExam_ntas(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegsByExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTAWithRegsByExam_ntas(ctx, field) +func (ec *executionContext) _Mutation_notPlannedByMe(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_notPlannedByMe(ctx, field) if err != nil { return graphql.Null } @@ -11711,41 +13039,49 @@ func (ec *executionContext) _NTAWithRegsByExam_ntas(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Ntas, nil + return ec.resolvers.Mutation().NotPlannedByMe(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.NTAWithRegs) + res := resTmp.(bool) fc.Result = res - return ec.marshalONTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTAWithRegsByExam_ntas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_notPlannedByMe(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTAWithRegsByExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "nta": - return ec.fieldContext_NTAWithRegs_nta(ctx, field) - case "regs": - return ec.fieldContext_NTAWithRegs_regs(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NTAWithRegs", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_notPlannedByMe_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _NTAWithRegsByExamAndTeacher_teacher(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegsByExamAndTeacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTAWithRegsByExamAndTeacher_teacher(ctx, field) +func (ec *executionContext) _Mutation_excludeDays(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_excludeDays(ctx, field) if err != nil { return graphql.Null } @@ -11758,7 +13094,7 @@ func (ec *executionContext) _NTAWithRegsByExamAndTeacher_teacher(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Teacher, nil + return ec.resolvers.Mutation().ExcludeDays(rctx, fc.Args["ancode"].(int), fc.Args["days"].([]string)) }) if err != nil { ec.Error(ctx, err) @@ -11770,48 +13106,37 @@ func (ec *executionContext) _NTAWithRegsByExamAndTeacher_teacher(ctx context.Con } return graphql.Null } - res := resTmp.(*model.Teacher) + res := resTmp.(bool) fc.Result = res - return ec.marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTAWithRegsByExamAndTeacher_teacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_excludeDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTAWithRegsByExamAndTeacher", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "shortname": - return ec.fieldContext_Teacher_shortname(ctx, field) - case "fullname": - return ec.fieldContext_Teacher_fullname(ctx, field) - case "isProf": - return ec.fieldContext_Teacher_isProf(ctx, field) - case "isLBA": - return ec.fieldContext_Teacher_isLBA(ctx, field) - case "isProfHC": - return ec.fieldContext_Teacher_isProfHC(ctx, field) - case "isStaff": - return ec.fieldContext_Teacher_isStaff(ctx, field) - case "lastSemester": - return ec.fieldContext_Teacher_lastSemester(ctx, field) - case "fk": - return ec.fieldContext_Teacher_fk(ctx, field) - case "id": - return ec.fieldContext_Teacher_id(ctx, field) - case "email": - return ec.fieldContext_Teacher_email(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_excludeDays_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _NTAWithRegsByExamAndTeacher_exams(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegsByExamAndTeacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_NTAWithRegsByExamAndTeacher_exams(ctx, field) +func (ec *executionContext) _Mutation_possibleDays(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_possibleDays(ctx, field) if err != nil { return graphql.Null } @@ -11824,41 +13149,49 @@ func (ec *executionContext) _NTAWithRegsByExamAndTeacher_exams(ctx context.Conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exams, nil + return ec.resolvers.Mutation().PossibleDays(rctx, fc.Args["ancode"].(int), fc.Args["days"].([]string)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.NTAWithRegsByExam) + res := resTmp.(bool) fc.Result = res - return ec.marshalONTAWithRegsByExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsByExamᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_NTAWithRegsByExamAndTeacher_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_possibleDays(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "NTAWithRegsByExamAndTeacher", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "exam": - return ec.fieldContext_NTAWithRegsByExam_exam(ctx, field) - case "ntas": - return ec.fieldContext_NTAWithRegsByExam_ntas(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NTAWithRegsByExam", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_possibleDays_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Plan_semesterConfig(ctx context.Context, field graphql.CollectedField, obj *model.Plan) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Plan_semesterConfig(ctx, field) +func (ec *executionContext) _Mutation_sameSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_sameSlot(ctx, field) if err != nil { return graphql.Null } @@ -11871,45 +13204,49 @@ func (ec *executionContext) _Plan_semesterConfig(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SemesterConfig, nil + return ec.resolvers.Mutation().SameSlot(rctx, fc.Args["ancode"].(int), fc.Args["ancodes"].([]int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.SemesterConfig) + res := resTmp.(bool) fc.Result = res - return ec.marshalOSemesterConfig2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterConfig(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Plan_semesterConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_sameSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Plan", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "days": - return ec.fieldContext_SemesterConfig_days(ctx, field) - case "starttimes": - return ec.fieldContext_SemesterConfig_starttimes(ctx, field) - case "slots": - return ec.fieldContext_SemesterConfig_slots(ctx, field) - case "goSlots": - return ec.fieldContext_SemesterConfig_goSlots(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SemesterConfig", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_sameSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Plan_slots(ctx context.Context, field graphql.CollectedField, obj *model.Plan) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Plan_slots(ctx, field) +func (ec *executionContext) _Mutation_placesWithSockets(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_placesWithSockets(ctx, field) if err != nil { return graphql.Null } @@ -11922,43 +13259,49 @@ func (ec *executionContext) _Plan_slots(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Slots, nil + return ec.resolvers.Mutation().PlacesWithSockets(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.SlotWithExamGroups) + res := resTmp.(bool) fc.Result = res - return ec.marshalOSlotWithExamGroups2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotWithExamGroups(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Plan_slots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_placesWithSockets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Plan", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "dayNumber": - return ec.fieldContext_SlotWithExamGroups_dayNumber(ctx, field) - case "slotNumber": - return ec.fieldContext_SlotWithExamGroups_slotNumber(ctx, field) - case "examGroups": - return ec.fieldContext_SlotWithExamGroups_examGroups(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SlotWithExamGroups", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_placesWithSockets_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _PlannedExamWithNTA_exam(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExamWithNta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PlannedExamWithNTA_exam(ctx, field) +func (ec *executionContext) _Mutation_lab(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_lab(ctx, field) if err != nil { return graphql.Null } @@ -11971,7 +13314,7 @@ func (ec *executionContext) _PlannedExamWithNTA_exam(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exam, nil + return ec.resolvers.Mutation().Lab(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -11983,40 +13326,37 @@ func (ec *executionContext) _PlannedExamWithNTA_exam(ctx context.Context, field } return graphql.Null } - res := resTmp.(*model.ExamWithRegs) + res := resTmp.(bool) fc.Result = res - return ec.marshalNExamWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegs(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PlannedExamWithNTA_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_lab(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PlannedExamWithNTA", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_ExamWithRegs_ancode(ctx, field) - case "zpaExam": - return ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) - case "primussExams": - return ec.fieldContext_ExamWithRegs_primussExams(ctx, field) - case "studentRegs": - return ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_ExamWithRegs_conflicts(ctx, field) - case "connectErrors": - return ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamWithRegs", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_lab_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _PlannedExamWithNTA_constraints(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExamWithNta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PlannedExamWithNTA_constraints(ctx, field) +func (ec *executionContext) _Mutation_exahmRooms(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_exahmRooms(ctx, field) if err != nil { return graphql.Null } @@ -12029,55 +13369,49 @@ func (ec *executionContext) _PlannedExamWithNTA_constraints(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Constraints, nil + return ec.resolvers.Mutation().ExahmRooms(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Constraints) + res := resTmp.(bool) fc.Result = res - return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PlannedExamWithNTA_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_exahmRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PlannedExamWithNTA", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_Constraints_ancode(ctx, field) - case "notPlannedByMe": - return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) - case "excludeDays": - return ec.fieldContext_Constraints_excludeDays(ctx, field) - case "possibleDays": - return ec.fieldContext_Constraints_possibleDays(ctx, field) - case "fixedDay": - return ec.fieldContext_Constraints_fixedDay(ctx, field) - case "fixedTime": - return ec.fieldContext_Constraints_fixedTime(ctx, field) - case "sameSlot": - return ec.fieldContext_Constraints_sameSlot(ctx, field) - case "online": - return ec.fieldContext_Constraints_online(ctx, field) - case "roomConstraints": - return ec.fieldContext_Constraints_roomConstraints(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_exahmRooms_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _PlannedExamWithNTA_nta(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExamWithNta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PlannedExamWithNTA_nta(ctx, field) +func (ec *executionContext) _Mutation_seb(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_seb(ctx, field) if err != nil { return graphql.Null } @@ -12090,41 +13424,49 @@ func (ec *executionContext) _PlannedExamWithNTA_nta(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Nta, nil + return ec.resolvers.Mutation().Seb(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.NTAWithRegs) + res := resTmp.(bool) fc.Result = res - return ec.marshalONTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PlannedExamWithNTA_nta(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_seb(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PlannedExamWithNTA", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "nta": - return ec.fieldContext_NTAWithRegs_nta(ctx, field) - case "regs": - return ec.fieldContext_NTAWithRegs_regs(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NTAWithRegs", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_seb_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _PrimussExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PrimussExam_ancode(ctx, field) +func (ec *executionContext) _Mutation_online(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_online(ctx, field) if err != nil { return graphql.Null } @@ -12137,7 +13479,7 @@ func (ec *executionContext) _PrimussExam_ancode(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AnCode, nil + return ec.resolvers.Mutation().Online(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -12149,26 +13491,37 @@ func (ec *executionContext) _PrimussExam_ancode(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(int) + res := resTmp.(bool) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PrimussExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_online(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PrimussExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_online_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _PrimussExam_module(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PrimussExam_module(ctx, field) +func (ec *executionContext) _Mutation_addExamGroupToSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_addExamGroupToSlot(ctx, field) if err != nil { return graphql.Null } @@ -12181,7 +13534,7 @@ func (ec *executionContext) _PrimussExam_module(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Module, nil + return ec.resolvers.Mutation().AddExamGroupToSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int), fc.Args["examGroupCode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -12193,26 +13546,37 @@ func (ec *executionContext) _PrimussExam_module(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PrimussExam_module(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_addExamGroupToSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PrimussExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_addExamGroupToSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _PrimussExam_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PrimussExam_mainExamer(ctx, field) +func (ec *executionContext) _Mutation_rmExamGroupFromSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_rmExamGroupFromSlot(ctx, field) if err != nil { return graphql.Null } @@ -12225,7 +13589,7 @@ func (ec *executionContext) _PrimussExam_mainExamer(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MainExamer, nil + return ec.resolvers.Mutation().RmExamGroupFromSlot(rctx, fc.Args["examGroupCode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -12237,26 +13601,37 @@ func (ec *executionContext) _PrimussExam_mainExamer(ctx context.Context, field g } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PrimussExam_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_rmExamGroupFromSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PrimussExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_rmExamGroupFromSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _PrimussExam_program(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PrimussExam_program(ctx, field) +func (ec *executionContext) _Mutation_addRoomToExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_addRoomToExam(ctx, field) if err != nil { return graphql.Null } @@ -12269,7 +13644,7 @@ func (ec *executionContext) _PrimussExam_program(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Program, nil + return ec.resolvers.Mutation().AddRoomToExam(rctx, fc.Args["input"].(model.RoomForExamInput)) }) if err != nil { ec.Error(ctx, err) @@ -12281,26 +13656,37 @@ func (ec *executionContext) _PrimussExam_program(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PrimussExam_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_addRoomToExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PrimussExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_addRoomToExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _PrimussExam_examType(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PrimussExam_examType(ctx, field) +func (ec *executionContext) _Mutation_addExamToSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_addExamToSlot(ctx, field) if err != nil { return graphql.Null } @@ -12313,7 +13699,7 @@ func (ec *executionContext) _PrimussExam_examType(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExamType, nil + return ec.resolvers.Mutation().AddExamToSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int), fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -12325,26 +13711,37 @@ func (ec *executionContext) _PrimussExam_examType(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PrimussExam_examType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_addExamToSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PrimussExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_addExamToSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _PrimussExam_presence(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PrimussExam_presence(ctx, field) +func (ec *executionContext) _Mutation_rmExamFromSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_rmExamFromSlot(ctx, field) if err != nil { return graphql.Null } @@ -12357,7 +13754,7 @@ func (ec *executionContext) _PrimussExam_presence(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Presence, nil + return ec.resolvers.Mutation().RmExamFromSlot(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -12369,26 +13766,37 @@ func (ec *executionContext) _PrimussExam_presence(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PrimussExam_presence(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_rmExamFromSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PrimussExam", + Object: "Mutation", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_rmExamFromSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _PrimussExam_studentRegs(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PrimussExam_studentRegs(ctx, field) +func (ec *executionContext) _NTA_name(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_name(ctx, field) if err != nil { return graphql.Null } @@ -12401,7 +13809,7 @@ func (ec *executionContext) _PrimussExam_studentRegs(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.PrimussExam().StudentRegs(rctx, obj) + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -12413,40 +13821,26 @@ func (ec *executionContext) _PrimussExam_studentRegs(ctx context.Context, field } return graphql.Null } - res := resTmp.([]*model.StudentReg) + res := resTmp.(string) fc.Result = res - return ec.marshalNStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PrimussExam_studentRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PrimussExam", + Object: "NTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "mtknr": - return ec.fieldContext_StudentReg_mtknr(ctx, field) - case "ancode": - return ec.fieldContext_StudentReg_ancode(ctx, field) - case "program": - return ec.fieldContext_StudentReg_program(ctx, field) - case "group": - return ec.fieldContext_StudentReg_group(ctx, field) - case "name": - return ec.fieldContext_StudentReg_name(ctx, field) - case "presence": - return ec.fieldContext_StudentReg_presence(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type StudentReg", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PrimussExam_conflicts(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PrimussExam_conflicts(ctx, field) +func (ec *executionContext) _NTA_email(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_email(ctx, field) if err != nil { return graphql.Null } @@ -12459,48 +13853,35 @@ func (ec *executionContext) _PrimussExam_conflicts(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.PrimussExam().Conflicts(rctx, obj) + return obj.Email, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*model.Conflicts) + res := resTmp.(*string) fc.Result = res - return ec.marshalNConflicts2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflicts(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PrimussExam_conflicts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PrimussExam", + Object: "NTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_Conflicts_ancode(ctx, field) - case "module": - return ec.fieldContext_Conflicts_module(ctx, field) - case "mainExamer": - return ec.fieldContext_Conflicts_mainExamer(ctx, field) - case "conflicts": - return ec.fieldContext_Conflicts_conflicts(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Conflicts", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _PrimussExamByProgram_program(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamByProgram) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PrimussExamByProgram_program(ctx, field) +func (ec *executionContext) _NTA_mtknr(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_mtknr(ctx, field) if err != nil { return graphql.Null } @@ -12513,7 +13894,7 @@ func (ec *executionContext) _PrimussExamByProgram_program(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Program, nil + return obj.Mtknr, nil }) if err != nil { ec.Error(ctx, err) @@ -12530,9 +13911,9 @@ func (ec *executionContext) _PrimussExamByProgram_program(ctx context.Context, f return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PrimussExamByProgram_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_mtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PrimussExamByProgram", + Object: "NTA", Field: field, IsMethod: false, IsResolver: false, @@ -12543,8 +13924,8 @@ func (ec *executionContext) fieldContext_PrimussExamByProgram_program(ctx contex return fc, nil } -func (ec *executionContext) _PrimussExamByProgram_exams(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamByProgram) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PrimussExamByProgram_exams(ctx, field) +func (ec *executionContext) _NTA_compensation(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_compensation(ctx, field) if err != nil { return graphql.Null } @@ -12557,7 +13938,7 @@ func (ec *executionContext) _PrimussExamByProgram_exams(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exams, nil + return obj.Compensation, nil }) if err != nil { ec.Error(ctx, err) @@ -12569,44 +13950,26 @@ func (ec *executionContext) _PrimussExamByProgram_exams(ctx context.Context, fie } return graphql.Null } - res := resTmp.([]*model.PrimussExam) + res := resTmp.(string) fc.Result = res - return ec.marshalNPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PrimussExamByProgram_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_compensation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "PrimussExamByProgram", + Object: "NTA", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_PrimussExam_ancode(ctx, field) - case "module": - return ec.fieldContext_PrimussExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_PrimussExam_mainExamer(ctx, field) - case "program": - return ec.fieldContext_PrimussExam_program(ctx, field) - case "examType": - return ec.fieldContext_PrimussExam_examType(ctx, field) - case "presence": - return ec.fieldContext_PrimussExam_presence(ctx, field) - case "studentRegs": - return ec.fieldContext_PrimussExam_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_PrimussExam_conflicts(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_workflow(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_workflow(ctx, field) +func (ec *executionContext) _NTA_deltaDurationPercent(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_deltaDurationPercent(ctx, field) if err != nil { return graphql.Null } @@ -12619,7 +13982,7 @@ func (ec *executionContext) _Query_workflow(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Workflow(rctx) + return obj.DeltaDurationPercent, nil }) if err != nil { ec.Error(ctx, err) @@ -12631,37 +13994,27 @@ func (ec *executionContext) _Query_workflow(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]*model.Step) + res := resTmp.(int) fc.Result = res - return ec.marshalNStep2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStepᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_workflow(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_deltaDurationPercent(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "number": - return ec.fieldContext_Step_number(ctx, field) - case "name": - return ec.fieldContext_Step_name(ctx, field) - case "done": - return ec.fieldContext_Step_done(ctx, field) - case "deadline": - return ec.fieldContext_Step_deadline(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Step", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_nextDeadline(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_nextDeadline(ctx, field) - if err != nil { +func (ec *executionContext) _NTA_needsRoomAlone(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_needsRoomAlone(ctx, field) + if err != nil { return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) @@ -12673,45 +14026,38 @@ func (ec *executionContext) _Query_nextDeadline(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().NextDeadline(rctx) + return obj.NeedsRoomAlone, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Step) + res := resTmp.(bool) fc.Result = res - return ec.marshalOStep2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStep(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_nextDeadline(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_needsRoomAlone(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "number": - return ec.fieldContext_Step_number(ctx, field) - case "name": - return ec.fieldContext_Step_name(ctx, field) - case "done": - return ec.fieldContext_Step_done(ctx, field) - case "deadline": - return ec.fieldContext_Step_deadline(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Step", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_allSemesterNames(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allSemesterNames(ctx, field) +func (ec *executionContext) _NTA_program(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_program(ctx, field) if err != nil { return graphql.Null } @@ -12724,7 +14070,7 @@ func (ec *executionContext) _Query_allSemesterNames(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllSemesterNames(rctx) + return obj.Program, nil }) if err != nil { ec.Error(ctx, err) @@ -12736,30 +14082,26 @@ func (ec *executionContext) _Query_allSemesterNames(ctx context.Context, field g } return graphql.Null } - res := resTmp.([]*model.Semester) + res := resTmp.(string) fc.Result = res - return ec.marshalNSemester2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_allSemesterNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Semester_id(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Semester", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_semester(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_semester(ctx, field) +func (ec *executionContext) _NTA_from(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_from(ctx, field) if err != nil { return graphql.Null } @@ -12772,7 +14114,7 @@ func (ec *executionContext) _Query_semester(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Semester(rctx) + return obj.From, nil }) if err != nil { ec.Error(ctx, err) @@ -12784,30 +14126,26 @@ func (ec *executionContext) _Query_semester(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(*model.Semester) + res := resTmp.(string) fc.Result = res - return ec.marshalNSemester2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemester(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_semester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_from(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Semester_id(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Semester", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_semesterConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_semesterConfig(ctx, field) +func (ec *executionContext) _NTA_until(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_until(ctx, field) if err != nil { return graphql.Null } @@ -12820,7 +14158,7 @@ func (ec *executionContext) _Query_semesterConfig(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().SemesterConfig(rctx) + return obj.Until, nil }) if err != nil { ec.Error(ctx, err) @@ -12832,36 +14170,26 @@ func (ec *executionContext) _Query_semesterConfig(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(*model.SemesterConfig) + res := resTmp.(string) fc.Result = res - return ec.marshalNSemesterConfig2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterConfig(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_semesterConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_until(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "days": - return ec.fieldContext_SemesterConfig_days(ctx, field) - case "starttimes": - return ec.fieldContext_SemesterConfig_starttimes(ctx, field) - case "slots": - return ec.fieldContext_SemesterConfig_slots(ctx, field) - case "goSlots": - return ec.fieldContext_SemesterConfig_goSlots(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SemesterConfig", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_teacher(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_teacher(ctx, field) +func (ec *executionContext) _NTA_lastSemester(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_lastSemester(ctx, field) if err != nil { return graphql.Null } @@ -12874,7 +14202,7 @@ func (ec *executionContext) _Query_teacher(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Teacher(rctx, fc.Args["id"].(int)) + return obj.LastSemester, nil }) if err != nil { ec.Error(ctx, err) @@ -12883,59 +14211,26 @@ func (ec *executionContext) _Query_teacher(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*model.Teacher) + res := resTmp.(*string) fc.Result = res - return ec.marshalOTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_teacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_lastSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "shortname": - return ec.fieldContext_Teacher_shortname(ctx, field) - case "fullname": - return ec.fieldContext_Teacher_fullname(ctx, field) - case "isProf": - return ec.fieldContext_Teacher_isProf(ctx, field) - case "isLBA": - return ec.fieldContext_Teacher_isLBA(ctx, field) - case "isProfHC": - return ec.fieldContext_Teacher_isProfHC(ctx, field) - case "isStaff": - return ec.fieldContext_Teacher_isStaff(ctx, field) - case "lastSemester": - return ec.fieldContext_Teacher_lastSemester(ctx, field) - case "fk": - return ec.fieldContext_Teacher_fk(ctx, field) - case "id": - return ec.fieldContext_Teacher_id(ctx, field) - case "email": - return ec.fieldContext_Teacher_email(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_teacher_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_teachers(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_teachers(ctx, field) +func (ec *executionContext) _NTA_exams(ctx context.Context, field graphql.CollectedField, obj *model.NTA) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTA_exams(ctx, field) if err != nil { return graphql.Null } @@ -12948,7 +14243,7 @@ func (ec *executionContext) _Query_teachers(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Teachers(rctx, fc.Args["fromZPA"].(*bool)) + return obj.Exams, nil }) if err != nil { ec.Error(ctx, err) @@ -12960,59 +14255,36 @@ func (ec *executionContext) _Query_teachers(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]*model.Teacher) + res := resTmp.([]*model.NTAExam) fc.Result = res - return ec.marshalNTeacher2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacherᚄ(ctx, field.Selections, res) + return ec.marshalNNTAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_teachers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTA_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "shortname": - return ec.fieldContext_Teacher_shortname(ctx, field) - case "fullname": - return ec.fieldContext_Teacher_fullname(ctx, field) - case "isProf": - return ec.fieldContext_Teacher_isProf(ctx, field) - case "isLBA": - return ec.fieldContext_Teacher_isLBA(ctx, field) - case "isProfHC": - return ec.fieldContext_Teacher_isProfHC(ctx, field) - case "isStaff": - return ec.fieldContext_Teacher_isStaff(ctx, field) - case "lastSemester": - return ec.fieldContext_Teacher_lastSemester(ctx, field) - case "fk": - return ec.fieldContext_Teacher_fk(ctx, field) - case "id": - return ec.fieldContext_Teacher_id(ctx, field) - case "email": - return ec.fieldContext_Teacher_email(ctx, field) + case "semester": + return ec.fieldContext_NTAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_NTAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_NTAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_NTAExam_mainExamer(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + return nil, fmt.Errorf("no field named %q was found under type NTAExam", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_teachers_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_invigilators(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_invigilators(ctx, field) +func (ec *executionContext) _NTAExam_semester(ctx context.Context, field graphql.CollectedField, obj *model.NTAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTAExam_semester(ctx, field) if err != nil { return graphql.Null } @@ -13025,7 +14297,7 @@ func (ec *executionContext) _Query_invigilators(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Invigilators(rctx) + return obj.Semester, nil }) if err != nil { ec.Error(ctx, err) @@ -13037,32 +14309,26 @@ func (ec *executionContext) _Query_invigilators(ctx context.Context, field graph } return graphql.Null } - res := resTmp.([]*model.ZPAInvigilator) + res := resTmp.(string) fc.Result = res - return ec.marshalNZPAInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAInvigilatorᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_invigilators(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTAExam_semester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTAExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "teacher": - return ec.fieldContext_ZPAInvigilator_teacher(ctx, field) - case "hasSubmittedRequirements": - return ec.fieldContext_ZPAInvigilator_hasSubmittedRequirements(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ZPAInvigilator", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_fk07programs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_fk07programs(ctx, field) +func (ec *executionContext) _NTAExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.NTAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTAExam_ancode(ctx, field) if err != nil { return graphql.Null } @@ -13075,7 +14341,7 @@ func (ec *executionContext) _Query_fk07programs(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Fk07programs(rctx) + return obj.AnCode, nil }) if err != nil { ec.Error(ctx, err) @@ -13087,30 +14353,26 @@ func (ec *executionContext) _Query_fk07programs(ctx context.Context, field graph } return graphql.Null } - res := resTmp.([]*model.FK07Program) + res := resTmp.(string) fc.Result = res - return ec.marshalNFK07Program2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐFK07Programᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_fk07programs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTAExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTAExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_FK07Program_name(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type FK07Program", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_zpaExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_zpaExams(ctx, field) +func (ec *executionContext) _NTAExam_module(ctx context.Context, field graphql.CollectedField, obj *model.NTAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTAExam_module(ctx, field) if err != nil { return graphql.Null } @@ -13123,7 +14385,7 @@ func (ec *executionContext) _Query_zpaExams(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ZpaExams(rctx, fc.Args["fromZPA"].(*bool)) + return obj.Module, nil }) if err != nil { ec.Error(ctx, err) @@ -13135,61 +14397,26 @@ func (ec *executionContext) _Query_zpaExams(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]*model.ZPAExam) + res := resTmp.(string) fc.Result = res - return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_zpaExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTAExam_module(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTAExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "zpaID": - return ec.fieldContext_ZPAExam_zpaID(ctx, field) - case "semester": - return ec.fieldContext_ZPAExam_semester(ctx, field) - case "ancode": - return ec.fieldContext_ZPAExam_ancode(ctx, field) - case "module": - return ec.fieldContext_ZPAExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_ZPAExam_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) - case "examType": - return ec.fieldContext_ZPAExam_examType(ctx, field) - case "examTypeFull": - return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) - case "duration": - return ec.fieldContext_ZPAExam_duration(ctx, field) - case "isRepeaterExam": - return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) - case "groups": - return ec.fieldContext_ZPAExam_groups(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_zpaExams_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_zpaExamsByType(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_zpaExamsByType(ctx, field) +func (ec *executionContext) _NTAExam_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.NTAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTAExam_mainExamer(ctx, field) if err != nil { return graphql.Null } @@ -13202,7 +14429,7 @@ func (ec *executionContext) _Query_zpaExamsByType(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ZpaExamsByType(rctx) + return obj.MainExamer, nil }) if err != nil { ec.Error(ctx, err) @@ -13214,32 +14441,26 @@ func (ec *executionContext) _Query_zpaExamsByType(ctx context.Context, field gra } return graphql.Null } - res := resTmp.([]*model.ZPAExamsForType) + res := resTmp.(string) fc.Result = res - return ec.marshalNZPAExamsForType2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamsForTypeᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_zpaExamsByType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTAExam_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTAExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "type": - return ec.fieldContext_ZPAExamsForType_type(ctx, field) - case "exams": - return ec.fieldContext_ZPAExamsForType_exams(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ZPAExamsForType", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_zpaExamsToPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_zpaExamsToPlan(ctx, field) +func (ec *executionContext) _NTAWithRegs_nta(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegs) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTAWithRegs_nta(ctx, field) if err != nil { return graphql.Null } @@ -13252,7 +14473,7 @@ func (ec *executionContext) _Query_zpaExamsToPlan(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ZpaExamsToPlan(rctx) + return obj.Nta, nil }) if err != nil { ec.Error(ctx, err) @@ -13264,50 +14485,50 @@ func (ec *executionContext) _Query_zpaExamsToPlan(ctx context.Context, field gra } return graphql.Null } - res := resTmp.([]*model.ZPAExam) + res := resTmp.(*model.NTA) fc.Result = res - return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) + return ec.marshalNNTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_zpaExamsToPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTAWithRegs_nta(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTAWithRegs", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "zpaID": - return ec.fieldContext_ZPAExam_zpaID(ctx, field) - case "semester": - return ec.fieldContext_ZPAExam_semester(ctx, field) - case "ancode": - return ec.fieldContext_ZPAExam_ancode(ctx, field) - case "module": - return ec.fieldContext_ZPAExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_ZPAExam_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) - case "examType": - return ec.fieldContext_ZPAExam_examType(ctx, field) - case "examTypeFull": - return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) - case "duration": - return ec.fieldContext_ZPAExam_duration(ctx, field) - case "isRepeaterExam": - return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) - case "groups": - return ec.fieldContext_ZPAExam_groups(ctx, field) + case "name": + return ec.fieldContext_NTA_name(ctx, field) + case "email": + return ec.fieldContext_NTA_email(ctx, field) + case "mtknr": + return ec.fieldContext_NTA_mtknr(ctx, field) + case "compensation": + return ec.fieldContext_NTA_compensation(ctx, field) + case "deltaDurationPercent": + return ec.fieldContext_NTA_deltaDurationPercent(ctx, field) + case "needsRoomAlone": + return ec.fieldContext_NTA_needsRoomAlone(ctx, field) + case "program": + return ec.fieldContext_NTA_program(ctx, field) + case "from": + return ec.fieldContext_NTA_from(ctx, field) + case "until": + return ec.fieldContext_NTA_until(ctx, field) + case "lastSemester": + return ec.fieldContext_NTA_lastSemester(ctx, field) + case "exams": + return ec.fieldContext_NTA_exams(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + return nil, fmt.Errorf("no field named %q was found under type NTA", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_zpaExamsNotToPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_zpaExamsNotToPlan(ctx, field) +func (ec *executionContext) _NTAWithRegs_regs(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegs) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTAWithRegs_regs(ctx, field) if err != nil { return graphql.Null } @@ -13320,62 +14541,41 @@ func (ec *executionContext) _Query_zpaExamsNotToPlan(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ZpaExamsNotToPlan(rctx) + return obj.Regs, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.ZPAExam) + res := resTmp.(*model.StudentRegsPerStudent) fc.Result = res - return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) + return ec.marshalOStudentRegsPerStudent2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerStudent(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_zpaExamsNotToPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTAWithRegs_regs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTAWithRegs", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "zpaID": - return ec.fieldContext_ZPAExam_zpaID(ctx, field) - case "semester": - return ec.fieldContext_ZPAExam_semester(ctx, field) - case "ancode": - return ec.fieldContext_ZPAExam_ancode(ctx, field) - case "module": - return ec.fieldContext_ZPAExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_ZPAExam_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) - case "examType": - return ec.fieldContext_ZPAExam_examType(ctx, field) - case "examTypeFull": - return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) - case "duration": - return ec.fieldContext_ZPAExam_duration(ctx, field) - case "isRepeaterExam": - return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) - case "groups": - return ec.fieldContext_ZPAExam_groups(ctx, field) + case "student": + return ec.fieldContext_StudentRegsPerStudent_student(ctx, field) + case "ancodes": + return ec.fieldContext_StudentRegsPerStudent_ancodes(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + return nil, fmt.Errorf("no field named %q was found under type StudentRegsPerStudent", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_zpaExamsPlaningStatusUnknown(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_zpaExamsPlaningStatusUnknown(ctx, field) +func (ec *executionContext) _NTAWithRegsByExam_exam(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegsByExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTAWithRegsByExam_exam(ctx, field) if err != nil { return graphql.Null } @@ -13388,7 +14588,7 @@ func (ec *executionContext) _Query_zpaExamsPlaningStatusUnknown(ctx context.Cont }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ZpaExamsPlaningStatusUnknown(rctx) + return obj.Exam, nil }) if err != nil { ec.Error(ctx, err) @@ -13400,17 +14600,17 @@ func (ec *executionContext) _Query_zpaExamsPlaningStatusUnknown(ctx context.Cont } return graphql.Null } - res := resTmp.([]*model.ZPAExam) + res := resTmp.(*model.ZPAExam) fc.Result = res - return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) + return ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_zpaExamsPlaningStatusUnknown(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTAWithRegsByExam_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTAWithRegsByExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "zpaID": @@ -13435,6 +14635,8 @@ func (ec *executionContext) fieldContext_Query_zpaExamsPlaningStatusUnknown(ctx return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) case "groups": return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, @@ -13442,8 +14644,8 @@ func (ec *executionContext) fieldContext_Query_zpaExamsPlaningStatusUnknown(ctx return fc, nil } -func (ec *executionContext) _Query_zpaExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_zpaExam(ctx, field) +func (ec *executionContext) _NTAWithRegsByExam_ntas(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegsByExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTAWithRegsByExam_ntas(ctx, field) if err != nil { return graphql.Null } @@ -13456,7 +14658,7 @@ func (ec *executionContext) _Query_zpaExam(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ZpaExam(rctx, fc.Args["ancode"].(int)) + return obj.Ntas, nil }) if err != nil { ec.Error(ctx, err) @@ -13465,61 +14667,32 @@ func (ec *executionContext) _Query_zpaExam(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(*model.ZPAExam) + res := resTmp.([]*model.NTAWithRegs) fc.Result = res - return ec.marshalOZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) + return ec.marshalONTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_zpaExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTAWithRegsByExam_ntas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTAWithRegsByExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "zpaID": - return ec.fieldContext_ZPAExam_zpaID(ctx, field) - case "semester": - return ec.fieldContext_ZPAExam_semester(ctx, field) - case "ancode": - return ec.fieldContext_ZPAExam_ancode(ctx, field) - case "module": - return ec.fieldContext_ZPAExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_ZPAExam_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) - case "examType": - return ec.fieldContext_ZPAExam_examType(ctx, field) - case "examTypeFull": - return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) - case "duration": - return ec.fieldContext_ZPAExam_duration(ctx, field) - case "isRepeaterExam": - return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) - case "groups": - return ec.fieldContext_ZPAExam_groups(ctx, field) + case "nta": + return ec.fieldContext_NTAWithRegs_nta(ctx, field) + case "regs": + return ec.fieldContext_NTAWithRegs_regs(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + return nil, fmt.Errorf("no field named %q was found under type NTAWithRegs", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_zpaExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_zpaAnCodes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_zpaAnCodes(ctx, field) +func (ec *executionContext) _NTAWithRegsByExamAndTeacher_teacher(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegsByExamAndTeacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTAWithRegsByExamAndTeacher_teacher(ctx, field) if err != nil { return graphql.Null } @@ -13532,39 +14705,60 @@ func (ec *executionContext) _Query_zpaAnCodes(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ZpaAnCodes(rctx) + return obj.Teacher, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.AnCode) + res := resTmp.(*model.Teacher) fc.Result = res - return ec.marshalOAnCode2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAnCode(ctx, field.Selections, res) + return ec.marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_zpaAnCodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTAWithRegsByExamAndTeacher_teacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTAWithRegsByExamAndTeacher", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "ancode": - return ec.fieldContext_AnCode_ancode(ctx, field) + case "shortname": + return ec.fieldContext_Teacher_shortname(ctx, field) + case "fullname": + return ec.fieldContext_Teacher_fullname(ctx, field) + case "isProf": + return ec.fieldContext_Teacher_isProf(ctx, field) + case "isLBA": + return ec.fieldContext_Teacher_isLBA(ctx, field) + case "isProfHC": + return ec.fieldContext_Teacher_isProfHC(ctx, field) + case "isStaff": + return ec.fieldContext_Teacher_isStaff(ctx, field) + case "lastSemester": + return ec.fieldContext_Teacher_lastSemester(ctx, field) + case "fk": + return ec.fieldContext_Teacher_fk(ctx, field) + case "id": + return ec.fieldContext_Teacher_id(ctx, field) + case "email": + return ec.fieldContext_Teacher_email(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type AnCode", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_studentRegsImportErrors(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_studentRegsImportErrors(ctx, field) +func (ec *executionContext) _NTAWithRegsByExamAndTeacher_exams(ctx context.Context, field graphql.CollectedField, obj *model.NTAWithRegsByExamAndTeacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NTAWithRegsByExamAndTeacher_exams(ctx, field) if err != nil { return graphql.Null } @@ -13577,44 +14771,41 @@ func (ec *executionContext) _Query_studentRegsImportErrors(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().StudentRegsImportErrors(rctx) + return obj.Exams, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.RegWithError) + res := resTmp.([]*model.NTAWithRegsByExam) fc.Result = res - return ec.marshalNRegWithError2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRegWithErrorᚄ(ctx, field.Selections, res) + return ec.marshalONTAWithRegsByExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsByExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_studentRegsImportErrors(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_NTAWithRegsByExamAndTeacher_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "NTAWithRegsByExamAndTeacher", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "registration": - return ec.fieldContext_RegWithError_registration(ctx, field) - case "error": - return ec.fieldContext_RegWithError_error(ctx, field) + case "exam": + return ec.fieldContext_NTAWithRegsByExam_exam(ctx, field) + case "ntas": + return ec.fieldContext_NTAWithRegsByExam_ntas(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type RegWithError", field.Name) + return nil, fmt.Errorf("no field named %q was found under type NTAWithRegsByExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_additionalExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_additionalExams(ctx, field) +func (ec *executionContext) _Plan_semesterConfig(ctx context.Context, field graphql.CollectedField, obj *model.Plan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Plan_semesterConfig(ctx, field) if err != nil { return graphql.Null } @@ -13627,54 +14818,45 @@ func (ec *executionContext) _Query_additionalExams(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AdditionalExams(rctx) + return obj.SemesterConfig, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.AdditionalExam) + res := resTmp.(*model.SemesterConfig) fc.Result = res - return ec.marshalNAdditionalExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAdditionalExamᚄ(ctx, field.Selections, res) + return ec.marshalOSemesterConfig2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterConfig(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_additionalExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Plan_semesterConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Plan", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "ancode": - return ec.fieldContext_AdditionalExam_ancode(ctx, field) - case "module": - return ec.fieldContext_AdditionalExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_AdditionalExam_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_AdditionalExam_mainExamerID(ctx, field) - case "duration": - return ec.fieldContext_AdditionalExam_duration(ctx, field) - case "isRepeaterExam": - return ec.fieldContext_AdditionalExam_isRepeaterExam(ctx, field) - case "groups": - return ec.fieldContext_AdditionalExam_groups(ctx, field) + case "days": + return ec.fieldContext_SemesterConfig_days(ctx, field) + case "starttimes": + return ec.fieldContext_SemesterConfig_starttimes(ctx, field) + case "slots": + return ec.fieldContext_SemesterConfig_slots(ctx, field) + case "goSlots": + return ec.fieldContext_SemesterConfig_goSlots(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type AdditionalExam", field.Name) + return nil, fmt.Errorf("no field named %q was found under type SemesterConfig", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_primussExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_primussExams(ctx, field) +func (ec *executionContext) _Plan_slots(ctx context.Context, field graphql.CollectedField, obj *model.Plan) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Plan_slots(ctx, field) if err != nil { return graphql.Null } @@ -13687,7 +14869,7 @@ func (ec *executionContext) _Query_primussExams(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().PrimussExams(rctx) + return obj.Slots, nil }) if err != nil { ec.Error(ctx, err) @@ -13696,32 +14878,34 @@ func (ec *executionContext) _Query_primussExams(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.PrimussExamByProgram) + res := resTmp.([]*model.SlotWithExamGroups) fc.Result = res - return ec.marshalOPrimussExamByProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamByProgram(ctx, field.Selections, res) + return ec.marshalOSlotWithExamGroups2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotWithExamGroups(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_primussExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Plan_slots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Plan", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "program": - return ec.fieldContext_PrimussExamByProgram_program(ctx, field) - case "exams": - return ec.fieldContext_PrimussExamByProgram_exams(ctx, field) + case "dayNumber": + return ec.fieldContext_SlotWithExamGroups_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_SlotWithExamGroups_slotNumber(ctx, field) + case "examGroups": + return ec.fieldContext_SlotWithExamGroups_examGroups(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type PrimussExamByProgram", field.Name) + return nil, fmt.Errorf("no field named %q was found under type SlotWithExamGroups", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_primussExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_primussExam(ctx, field) +func (ec *executionContext) _PlanEntry_dayNumber(ctx context.Context, field graphql.CollectedField, obj *model.PlanEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlanEntry_dayNumber(ctx, field) if err != nil { return graphql.Null } @@ -13734,7 +14918,7 @@ func (ec *executionContext) _Query_primussExam(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().PrimussExam(rctx, fc.Args["program"].(string), fc.Args["ancode"].(int)) + return obj.DayNumber, nil }) if err != nil { ec.Error(ctx, err) @@ -13746,55 +14930,26 @@ func (ec *executionContext) _Query_primussExam(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(*model.PrimussExam) + res := resTmp.(int) fc.Result = res - return ec.marshalNPrimussExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExam(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_primussExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlanEntry_dayNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlanEntry", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_PrimussExam_ancode(ctx, field) - case "module": - return ec.fieldContext_PrimussExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_PrimussExam_mainExamer(ctx, field) - case "program": - return ec.fieldContext_PrimussExam_program(ctx, field) - case "examType": - return ec.fieldContext_PrimussExam_examType(ctx, field) - case "presence": - return ec.fieldContext_PrimussExam_presence(ctx, field) - case "studentRegs": - return ec.fieldContext_PrimussExam_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_PrimussExam_conflicts(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_primussExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_primussExamsForAnCode(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_primussExamsForAnCode(ctx, field) +func (ec *executionContext) _PlanEntry_slotNumber(ctx context.Context, field graphql.CollectedField, obj *model.PlanEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlanEntry_slotNumber(ctx, field) if err != nil { return graphql.Null } @@ -13807,64 +14962,38 @@ func (ec *executionContext) _Query_primussExamsForAnCode(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().PrimussExamsForAnCode(rctx, fc.Args["ancode"].(int)) + return obj.SlotNumber, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.PrimussExam) + res := resTmp.(int) fc.Result = res - return ec.marshalOPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_primussExamsForAnCode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlanEntry_slotNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlanEntry", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_PrimussExam_ancode(ctx, field) - case "module": - return ec.fieldContext_PrimussExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_PrimussExam_mainExamer(ctx, field) - case "program": - return ec.fieldContext_PrimussExam_program(ctx, field) - case "examType": - return ec.fieldContext_PrimussExam_examType(ctx, field) - case "presence": - return ec.fieldContext_PrimussExam_presence(ctx, field) - case "studentRegs": - return ec.fieldContext_PrimussExam_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_PrimussExam_conflicts(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_primussExamsForAnCode_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_studentRegsForProgram(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_studentRegsForProgram(ctx, field) +func (ec *executionContext) _PlanEntry_starttime(ctx context.Context, field graphql.CollectedField, obj *model.PlanEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlanEntry_starttime(ctx, field) if err != nil { return graphql.Null } @@ -13877,60 +15006,38 @@ func (ec *executionContext) _Query_studentRegsForProgram(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().StudentRegsForProgram(rctx, fc.Args["program"].(string)) + return ec.resolvers.PlanEntry().Starttime(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.StudentReg) + res := resTmp.(*time.Time) fc.Result = res - return ec.marshalOStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx, field.Selections, res) + return ec.marshalNTime2ᚖtimeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_studentRegsForProgram(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlanEntry_starttime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlanEntry", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "mtknr": - return ec.fieldContext_StudentReg_mtknr(ctx, field) - case "ancode": - return ec.fieldContext_StudentReg_ancode(ctx, field) - case "program": - return ec.fieldContext_StudentReg_program(ctx, field) - case "group": - return ec.fieldContext_StudentReg_group(ctx, field) - case "name": - return ec.fieldContext_StudentReg_name(ctx, field) - case "presence": - return ec.fieldContext_StudentReg_presence(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type StudentReg", field.Name) + return nil, errors.New("field of type Time does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_studentRegsForProgram_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_connectedExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_connectedExam(ctx, field) +func (ec *executionContext) _PlanEntry_ancode(ctx context.Context, field graphql.CollectedField, obj *model.PlanEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlanEntry_ancode(ctx, field) if err != nil { return graphql.Null } @@ -13943,56 +15050,38 @@ func (ec *executionContext) _Query_connectedExam(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ConnectedExam(rctx, fc.Args["ancode"].(int)) + return obj.Ancode, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.ConnectedExam) + res := resTmp.(int) fc.Result = res - return ec.marshalOConnectedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExam(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_connectedExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlanEntry_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlanEntry", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "zpaExam": - return ec.fieldContext_ConnectedExam_zpaExam(ctx, field) - case "primussExams": - return ec.fieldContext_ConnectedExam_primussExams(ctx, field) - case "otherPrimussExams": - return ec.fieldContext_ConnectedExam_otherPrimussExams(ctx, field) - case "errors": - return ec.fieldContext_ConnectedExam_errors(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ConnectedExam", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_connectedExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_connectedExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_connectedExams(ctx, field) +func (ec *executionContext) _PlanEntry_locked(ctx context.Context, field graphql.CollectedField, obj *model.PlanEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlanEntry_locked(ctx, field) if err != nil { return graphql.Null } @@ -14005,7 +15094,7 @@ func (ec *executionContext) _Query_connectedExams(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ConnectedExams(rctx) + return obj.Locked, nil }) if err != nil { ec.Error(ctx, err) @@ -14017,36 +15106,26 @@ func (ec *executionContext) _Query_connectedExams(ctx context.Context, field gra } return graphql.Null } - res := resTmp.([]*model.ConnectedExam) + res := resTmp.(bool) fc.Result = res - return ec.marshalNConnectedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExamᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_connectedExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlanEntry_locked(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlanEntry", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "zpaExam": - return ec.fieldContext_ConnectedExam_zpaExam(ctx, field) - case "primussExams": - return ec.fieldContext_ConnectedExam_primussExams(ctx, field) - case "otherPrimussExams": - return ec.fieldContext_ConnectedExam_otherPrimussExams(ctx, field) - case "errors": - return ec.fieldContext_ConnectedExam_errors(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ConnectedExam", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_examWithRegs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examWithRegs(ctx, field) +func (ec *executionContext) _PlannedExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_ancode(ctx, field) if err != nil { return graphql.Null } @@ -14059,60 +15138,38 @@ func (ec *executionContext) _Query_examWithRegs(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamWithRegs(rctx, fc.Args["ancode"].(int)) + return obj.Ancode, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.ExamWithRegs) + res := resTmp.(int) fc.Result = res - return ec.marshalOExamWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegs(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_examWithRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_ExamWithRegs_ancode(ctx, field) - case "zpaExam": - return ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) - case "primussExams": - return ec.fieldContext_ExamWithRegs_primussExams(ctx, field) - case "studentRegs": - return ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_ExamWithRegs_conflicts(ctx, field) - case "connectErrors": - return ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamWithRegs", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_examWithRegs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_examsWithRegs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examsWithRegs(ctx, field) +func (ec *executionContext) _PlannedExam_zpaExam(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_zpaExam(ctx, field) if err != nil { return graphql.Null } @@ -14125,49 +15182,64 @@ func (ec *executionContext) _Query_examsWithRegs(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamsWithRegs(rctx) + return obj.ZpaExam, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.ExamWithRegs) + res := resTmp.(*model.ZPAExam) fc.Result = res - return ec.marshalOExamWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegsᚄ(ctx, field.Selections, res) + return ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_examsWithRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_zpaExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) case "ancode": - return ec.fieldContext_ExamWithRegs_ancode(ctx, field) - case "zpaExam": - return ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) - case "primussExams": - return ec.fieldContext_ExamWithRegs_primussExams(ctx, field) - case "studentRegs": - return ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) - case "conflicts": - return ec.fieldContext_ExamWithRegs_conflicts(ctx, field) - case "connectErrors": - return ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ExamWithRegs", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_constraintForAncode(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_constraintForAncode(ctx, field) +func (ec *executionContext) _PlannedExam_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_mainExamer(ctx, field) if err != nil { return graphql.Null } @@ -14180,66 +15252,60 @@ func (ec *executionContext) _Query_constraintForAncode(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ConstraintForAncode(rctx, fc.Args["ancode"].(int)) + return ec.resolvers.PlannedExam().MainExamer(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Constraints) + res := resTmp.(*model.Teacher) fc.Result = res - return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) + return ec.marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_constraintForAncode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "ancode": - return ec.fieldContext_Constraints_ancode(ctx, field) - case "notPlannedByMe": - return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) - case "excludeDays": - return ec.fieldContext_Constraints_excludeDays(ctx, field) - case "possibleDays": - return ec.fieldContext_Constraints_possibleDays(ctx, field) - case "fixedDay": - return ec.fieldContext_Constraints_fixedDay(ctx, field) - case "fixedTime": - return ec.fieldContext_Constraints_fixedTime(ctx, field) - case "sameSlot": - return ec.fieldContext_Constraints_sameSlot(ctx, field) - case "online": - return ec.fieldContext_Constraints_online(ctx, field) - case "roomConstraints": - return ec.fieldContext_Constraints_roomConstraints(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_constraintForAncode_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil + case "shortname": + return ec.fieldContext_Teacher_shortname(ctx, field) + case "fullname": + return ec.fieldContext_Teacher_fullname(ctx, field) + case "isProf": + return ec.fieldContext_Teacher_isProf(ctx, field) + case "isLBA": + return ec.fieldContext_Teacher_isLBA(ctx, field) + case "isProfHC": + return ec.fieldContext_Teacher_isProfHC(ctx, field) + case "isStaff": + return ec.fieldContext_Teacher_isStaff(ctx, field) + case "lastSemester": + return ec.fieldContext_Teacher_lastSemester(ctx, field) + case "fk": + return ec.fieldContext_Teacher_fk(ctx, field) + case "id": + return ec.fieldContext_Teacher_id(ctx, field) + case "email": + return ec.fieldContext_Teacher_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + }, + } + return fc, nil } -func (ec *executionContext) _Query_zpaExamsToPlanWithConstraints(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_zpaExamsToPlanWithConstraints(ctx, field) +func (ec *executionContext) _PlannedExam_primussExams(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_primussExams(ctx, field) if err != nil { return graphql.Null } @@ -14252,7 +15318,7 @@ func (ec *executionContext) _Query_zpaExamsToPlanWithConstraints(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ZpaExamsToPlanWithConstraints(rctx) + return obj.PrimussExams, nil }) if err != nil { ec.Error(ctx, err) @@ -14264,32 +15330,36 @@ func (ec *executionContext) _Query_zpaExamsToPlanWithConstraints(ctx context.Con } return graphql.Null } - res := resTmp.([]*model.ZPAExamWithConstraints) + res := resTmp.([]*model.EnhancedPrimussExam) fc.Result = res - return ec.marshalNZPAExamWithConstraints2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamWithConstraintsᚄ(ctx, field.Selections, res) + return ec.marshalNEnhancedPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐEnhancedPrimussExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_zpaExamsToPlanWithConstraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_primussExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "zpaExam": - return ec.fieldContext_ZPAExamWithConstraints_zpaExam(ctx, field) - case "constraints": - return ec.fieldContext_ZPAExamWithConstraints_constraints(ctx, field) + case "exam": + return ec.fieldContext_EnhancedPrimussExam_exam(ctx, field) + case "studentRegs": + return ec.fieldContext_EnhancedPrimussExam_studentRegs(ctx, field) + case "conflicts": + return ec.fieldContext_EnhancedPrimussExam_conflicts(ctx, field) + case "ntas": + return ec.fieldContext_EnhancedPrimussExam_ntas(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ZPAExamWithConstraints", field.Name) + return nil, fmt.Errorf("no field named %q was found under type EnhancedPrimussExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_examGroups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examGroups(ctx, field) +func (ec *executionContext) _PlannedExam_constraints(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_constraints(ctx, field) if err != nil { return graphql.Null } @@ -14302,46 +15372,55 @@ func (ec *executionContext) _Query_examGroups(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamGroups(rctx) + return obj.Constraints, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.ExamGroup) + res := resTmp.(*model.Constraints) fc.Result = res - return ec.marshalNExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupᚄ(ctx, field.Selections, res) + return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_examGroups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "examGroupCode": - return ec.fieldContext_ExamGroup_examGroupCode(ctx, field) - case "exams": - return ec.fieldContext_ExamGroup_exams(ctx, field) - case "examGroupInfo": - return ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) + case "ancode": + return ec.fieldContext_Constraints_ancode(ctx, field) + case "notPlannedByMe": + return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) + case "excludeDays": + return ec.fieldContext_Constraints_excludeDays(ctx, field) + case "possibleDays": + return ec.fieldContext_Constraints_possibleDays(ctx, field) + case "fixedDay": + return ec.fieldContext_Constraints_fixedDay(ctx, field) + case "fixedTime": + return ec.fieldContext_Constraints_fixedTime(ctx, field) + case "sameSlot": + return ec.fieldContext_Constraints_sameSlot(ctx, field) + case "online": + return ec.fieldContext_Constraints_online(ctx, field) + case "roomConstraints": + return ec.fieldContext_Constraints_roomConstraints(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ExamGroup", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_examGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examGroup(ctx, field) +func (ec *executionContext) _PlannedExam_conflicts(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_conflicts(ctx, field) if err != nil { return graphql.Null } @@ -14354,54 +15433,46 @@ func (ec *executionContext) _Query_examGroup(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamGroup(rctx, fc.Args["examGroupCode"].(int)) + return obj.Conflicts, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.ExamGroup) + res := resTmp.([]*model.ZPAConflict) fc.Result = res - return ec.marshalOExamGroup2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroup(ctx, field.Selections, res) + return ec.marshalNZPAConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAConflictᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_examGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_conflicts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "examGroupCode": - return ec.fieldContext_ExamGroup_examGroupCode(ctx, field) - case "exams": - return ec.fieldContext_ExamGroup_exams(ctx, field) - case "examGroupInfo": - return ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) + case "ancode": + return ec.fieldContext_ZPAConflict_ancode(ctx, field) + case "numberOfStuds": + return ec.fieldContext_ZPAConflict_numberOfStuds(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAConflict_primussAncodes(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ExamGroup", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ZPAConflict", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_examGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_conflictingGroupCodes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_conflictingGroupCodes(ctx, field) +func (ec *executionContext) _PlannedExam_studentRegsCount(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_studentRegsCount(ctx, field) if err != nil { return graphql.Null } @@ -14414,52 +15485,38 @@ func (ec *executionContext) _Query_conflictingGroupCodes(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ConflictingGroupCodes(rctx, fc.Args["examGroupCode"].(int)) + return obj.StudentRegsCount, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.ExamGroupConflict) + res := resTmp.(int) fc.Result = res - return ec.marshalOExamGroupConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupConflictᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_conflictingGroupCodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_studentRegsCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "examGroupCode": - return ec.fieldContext_ExamGroupConflict_examGroupCode(ctx, field) - case "count": - return ec.fieldContext_ExamGroupConflict_count(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamGroupConflict", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_conflictingGroupCodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_ntas(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_ntas(ctx, field) +func (ec *executionContext) _PlannedExam_ntas(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_ntas(ctx, field) if err != nil { return graphql.Null } @@ -14472,30 +15529,35 @@ func (ec *executionContext) _Query_ntas(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Ntas(rctx) + return obj.Ntas, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.([]*model.NTA) fc.Result = res - return ec.marshalONTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAᚄ(ctx, field.Selections, res) + return ec.marshalNNTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_ntas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_ntas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "name": return ec.fieldContext_NTA_name(ctx, field) + case "email": + return ec.fieldContext_NTA_email(ctx, field) case "mtknr": return ec.fieldContext_NTA_mtknr(ctx, field) case "compensation": @@ -14521,8 +15583,8 @@ func (ec *executionContext) fieldContext_Query_ntas(ctx context.Context, field g return fc, nil } -func (ec *executionContext) _Query_ntasWithRegs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_ntasWithRegs(ctx, field) +func (ec *executionContext) _PlannedExam_maxDuration(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_maxDuration(ctx, field) if err != nil { return graphql.Null } @@ -14535,41 +15597,38 @@ func (ec *executionContext) _Query_ntasWithRegs(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().NtasWithRegs(rctx) + return obj.MaxDuration, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.NTAWithRegs) + res := resTmp.(int) fc.Result = res - return ec.marshalONTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_ntasWithRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_maxDuration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "nta": - return ec.fieldContext_NTAWithRegs_nta(ctx, field) - case "regs": - return ec.fieldContext_NTAWithRegs_regs(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type NTAWithRegs", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_ntasWithRegsByTeacher(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_ntasWithRegsByTeacher(ctx, field) +func (ec *executionContext) _PlannedExam_planEntry(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_planEntry(ctx, field) if err != nil { return graphql.Null } @@ -14582,7 +15641,7 @@ func (ec *executionContext) _Query_ntasWithRegsByTeacher(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().NtasWithRegsByTeacher(rctx) + return obj.PlanEntry, nil }) if err != nil { ec.Error(ctx, err) @@ -14591,32 +15650,38 @@ func (ec *executionContext) _Query_ntasWithRegsByTeacher(ctx context.Context, fi if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.NTAWithRegsByExamAndTeacher) + res := resTmp.(*model.PlanEntry) fc.Result = res - return ec.marshalONTAWithRegsByExamAndTeacher2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsByExamAndTeacherᚄ(ctx, field.Selections, res) + return ec.marshalOPlanEntry2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlanEntry(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_ntasWithRegsByTeacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_planEntry(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "teacher": - return ec.fieldContext_NTAWithRegsByExamAndTeacher_teacher(ctx, field) - case "exams": - return ec.fieldContext_NTAWithRegsByExamAndTeacher_exams(ctx, field) + case "dayNumber": + return ec.fieldContext_PlanEntry_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_PlanEntry_slotNumber(ctx, field) + case "starttime": + return ec.fieldContext_PlanEntry_starttime(ctx, field) + case "ancode": + return ec.fieldContext_PlanEntry_ancode(ctx, field) + case "locked": + return ec.fieldContext_PlanEntry_locked(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type NTAWithRegsByExamAndTeacher", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PlanEntry", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_nta(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_nta(ctx, field) +func (ec *executionContext) _PlannedExam_plannedRooms(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExam_plannedRooms(ctx, field) if err != nil { return graphql.Null } @@ -14629,7 +15694,7 @@ func (ec *executionContext) _Query_nta(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Nta(rctx, fc.Args["mtknr"].(string)) + return obj.PlannedRooms, nil }) if err != nil { ec.Error(ctx, err) @@ -14638,43 +15703,48 @@ func (ec *executionContext) _Query_nta(ctx context.Context, field graphql.Collec if resTmp == nil { return graphql.Null } - res := resTmp.(*model.NTAWithRegs) + res := resTmp.([]*model.PlannedRoom) fc.Result = res - return ec.marshalONTAWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegs(ctx, field.Selections, res) + return ec.marshalOPlannedRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedRoomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_nta(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExam_plannedRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "nta": - return ec.fieldContext_NTAWithRegs_nta(ctx, field) - case "regs": - return ec.fieldContext_NTAWithRegs_regs(ctx, field) + case "day": + return ec.fieldContext_PlannedRoom_day(ctx, field) + case "slot": + return ec.fieldContext_PlannedRoom_slot(ctx, field) + case "room": + return ec.fieldContext_PlannedRoom_room(ctx, field) + case "ancode": + return ec.fieldContext_PlannedRoom_ancode(ctx, field) + case "duration": + return ec.fieldContext_PlannedRoom_duration(ctx, field) + case "handicap": + return ec.fieldContext_PlannedRoom_handicap(ctx, field) + case "handicapRoomAlone": + return ec.fieldContext_PlannedRoom_handicapRoomAlone(ctx, field) + case "reserve": + return ec.fieldContext_PlannedRoom_reserve(ctx, field) + case "studentsInRoom": + return ec.fieldContext_PlannedRoom_studentsInRoom(ctx, field) + case "ntaMtknr": + return ec.fieldContext_PlannedRoom_ntaMtknr(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type NTAWithRegs", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PlannedRoom", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_nta_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_allowedSlots(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allowedSlots(ctx, field) +func (ec *executionContext) _PlannedExamWithNTA_exam(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExamWithNta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExamWithNTA_exam(ctx, field) if err != nil { return graphql.Null } @@ -14687,54 +15757,52 @@ func (ec *executionContext) _Query_allowedSlots(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllowedSlots(rctx, fc.Args["examGroupCode"].(int)) + return obj.Exam, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.Slot) + res := resTmp.(*model.ExamWithRegs) fc.Result = res - return ec.marshalOSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx, field.Selections, res) + return ec.marshalNExamWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegs(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_allowedSlots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExamWithNTA_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExamWithNTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "dayNumber": - return ec.fieldContext_Slot_dayNumber(ctx, field) - case "slotNumber": - return ec.fieldContext_Slot_slotNumber(ctx, field) - case "starttime": - return ec.fieldContext_Slot_starttime(ctx, field) + case "ancode": + return ec.fieldContext_ExamWithRegs_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) + case "primussExams": + return ec.fieldContext_ExamWithRegs_primussExams(ctx, field) + case "studentRegs": + return ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) + case "conflicts": + return ec.fieldContext_ExamWithRegs_conflicts(ctx, field) + case "connectErrors": + return ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ExamWithRegs", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_allowedSlots_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_awkwardSlots(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_awkwardSlots(ctx, field) +func (ec *executionContext) _PlannedExamWithNTA_constraints(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExamWithNta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExamWithNTA_constraints(ctx, field) if err != nil { return graphql.Null } @@ -14747,57 +15815,55 @@ func (ec *executionContext) _Query_awkwardSlots(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AwkwardSlots(rctx, fc.Args["examGroupCode"].(int)) + return obj.Constraints, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.Slot) + res := resTmp.(*model.Constraints) fc.Result = res - return ec.marshalNSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx, field.Selections, res) + return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_awkwardSlots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExamWithNTA_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExamWithNTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "dayNumber": - return ec.fieldContext_Slot_dayNumber(ctx, field) - case "slotNumber": - return ec.fieldContext_Slot_slotNumber(ctx, field) - case "starttime": - return ec.fieldContext_Slot_starttime(ctx, field) + case "ancode": + return ec.fieldContext_Constraints_ancode(ctx, field) + case "notPlannedByMe": + return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) + case "excludeDays": + return ec.fieldContext_Constraints_excludeDays(ctx, field) + case "possibleDays": + return ec.fieldContext_Constraints_possibleDays(ctx, field) + case "fixedDay": + return ec.fieldContext_Constraints_fixedDay(ctx, field) + case "fixedTime": + return ec.fieldContext_Constraints_fixedTime(ctx, field) + case "sameSlot": + return ec.fieldContext_Constraints_sameSlot(ctx, field) + case "online": + return ec.fieldContext_Constraints_online(ctx, field) + case "roomConstraints": + return ec.fieldContext_Constraints_roomConstraints(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_awkwardSlots_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_examGroupsInSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examGroupsInSlot(ctx, field) +func (ec *executionContext) _PlannedExamWithNTA_nta(ctx context.Context, field graphql.CollectedField, obj *model.PlannedExamWithNta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedExamWithNTA_nta(ctx, field) if err != nil { return graphql.Null } @@ -14810,7 +15876,7 @@ func (ec *executionContext) _Query_examGroupsInSlot(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamGroupsInSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) + return obj.Nta, nil }) if err != nil { ec.Error(ctx, err) @@ -14819,45 +15885,32 @@ func (ec *executionContext) _Query_examGroupsInSlot(ctx context.Context, field g if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.ExamGroup) + res := resTmp.([]*model.NTAWithRegs) fc.Result = res - return ec.marshalOExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupᚄ(ctx, field.Selections, res) + return ec.marshalONTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_examGroupsInSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedExamWithNTA_nta(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedExamWithNTA", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "examGroupCode": - return ec.fieldContext_ExamGroup_examGroupCode(ctx, field) - case "exams": - return ec.fieldContext_ExamGroup_exams(ctx, field) - case "examGroupInfo": - return ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) + case "nta": + return ec.fieldContext_NTAWithRegs_nta(ctx, field) + case "regs": + return ec.fieldContext_NTAWithRegs_regs(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ExamGroup", field.Name) + return nil, fmt.Errorf("no field named %q was found under type NTAWithRegs", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_examGroupsInSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_examGroupsWithoutSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examGroupsWithoutSlot(ctx, field) +func (ec *executionContext) _PlannedRoom_day(ctx context.Context, field graphql.CollectedField, obj *model.PlannedRoom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedRoom_day(ctx, field) if err != nil { return graphql.Null } @@ -14870,43 +15923,38 @@ func (ec *executionContext) _Query_examGroupsWithoutSlot(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamGroupsWithoutSlot(rctx) + return obj.Day, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.ExamGroup) + res := resTmp.(int) fc.Result = res - return ec.marshalOExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_examGroupsWithoutSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedRoom_day(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedRoom", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "examGroupCode": - return ec.fieldContext_ExamGroup_examGroupCode(ctx, field) - case "exams": - return ec.fieldContext_ExamGroup_exams(ctx, field) - case "examGroupInfo": - return ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamGroup", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_allProgramsInPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_allProgramsInPlan(ctx, field) +func (ec *executionContext) _PlannedRoom_slot(ctx context.Context, field graphql.CollectedField, obj *model.PlannedRoom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedRoom_slot(ctx, field) if err != nil { return graphql.Null } @@ -14919,35 +15967,38 @@ func (ec *executionContext) _Query_allProgramsInPlan(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AllProgramsInPlan(rctx) + return obj.Slot, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]string) + res := resTmp.(int) fc.Result = res - return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_allProgramsInPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedRoom_slot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedRoom", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_ancodesInPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_ancodesInPlan(ctx, field) +func (ec *executionContext) _PlannedRoom_room(ctx context.Context, field graphql.CollectedField, obj *model.PlannedRoom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedRoom_room(ctx, field) if err != nil { return graphql.Null } @@ -14960,35 +16011,56 @@ func (ec *executionContext) _Query_ancodesInPlan(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().AncodesInPlan(rctx) + return ec.resolvers.PlannedRoom().Room(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]int) + res := resTmp.(*model.Room) fc.Result = res - return ec.marshalOInt2ᚕintᚄ(ctx, field.Selections, res) + return ec.marshalNRoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoom(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_ancodesInPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedRoom_room(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedRoom", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext_Room_name(ctx, field) + case "seats": + return ec.fieldContext_Room_seats(ctx, field) + case "handicap": + return ec.fieldContext_Room_handicap(ctx, field) + case "lab": + return ec.fieldContext_Room_lab(ctx, field) + case "placesWithSocket": + return ec.fieldContext_Room_placesWithSocket(ctx, field) + case "needsRequest": + return ec.fieldContext_Room_needsRequest(ctx, field) + case "exahm": + return ec.fieldContext_Room_exahm(ctx, field) + case "seb": + return ec.fieldContext_Room_seb(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) }, } return fc, nil } -func (ec *executionContext) _Query_examerInPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examerInPlan(ctx, field) +func (ec *executionContext) _PlannedRoom_ancode(ctx context.Context, field graphql.CollectedField, obj *model.PlannedRoom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedRoom_ancode(ctx, field) if err != nil { return graphql.Null } @@ -15001,41 +16073,38 @@ func (ec *executionContext) _Query_examerInPlan(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamerInPlan(rctx) + return obj.Ancode, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.ExamerInPlan) + res := resTmp.(int) fc.Result = res - return ec.marshalOExamerInPlan2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamerInPlanᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_examerInPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedRoom_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedRoom", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "mainExamer": - return ec.fieldContext_ExamerInPlan_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_ExamerInPlan_mainExamerID(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamerInPlan", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_plannedExamsInSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_plannedExamsInSlot(ctx, field) +func (ec *executionContext) _PlannedRoom_duration(ctx context.Context, field graphql.CollectedField, obj *model.PlannedRoom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedRoom_duration(ctx, field) if err != nil { return graphql.Null } @@ -15048,54 +16117,38 @@ func (ec *executionContext) _Query_plannedExamsInSlot(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().PlannedExamsInSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) + return obj.Duration, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.PlannedExamWithNta) + res := resTmp.(int) fc.Result = res - return ec.marshalOPlannedExamWithNTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExamWithNtaᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_plannedExamsInSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedRoom_duration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedRoom", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "exam": - return ec.fieldContext_PlannedExamWithNTA_exam(ctx, field) - case "constraints": - return ec.fieldContext_PlannedExamWithNTA_constraints(ctx, field) - case "nta": - return ec.fieldContext_PlannedExamWithNTA_nta(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PlannedExamWithNTA", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_plannedExamsInSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_examsInPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examsInPlan(ctx, field) +func (ec *executionContext) _PlannedRoom_handicap(ctx context.Context, field graphql.CollectedField, obj *model.PlannedRoom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedRoom_handicap(ctx, field) if err != nil { return graphql.Null } @@ -15108,45 +16161,38 @@ func (ec *executionContext) _Query_examsInPlan(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamsInPlan(rctx) + return obj.Handicap, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.ExamInPlan) + res := resTmp.(bool) fc.Result = res - return ec.marshalOExamInPlan2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamInPlanᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_examsInPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedRoom_handicap(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedRoom", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "exam": - return ec.fieldContext_ExamInPlan_exam(ctx, field) - case "constraints": - return ec.fieldContext_ExamInPlan_constraints(ctx, field) - case "nta": - return ec.fieldContext_ExamInPlan_nta(ctx, field) - case "slot": - return ec.fieldContext_ExamInPlan_slot(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamInPlan", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_examsInSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examsInSlot(ctx, field) +func (ec *executionContext) _PlannedRoom_handicapRoomAlone(ctx context.Context, field graphql.CollectedField, obj *model.PlannedRoom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedRoom_handicapRoomAlone(ctx, field) if err != nil { return graphql.Null } @@ -15159,56 +16205,38 @@ func (ec *executionContext) _Query_examsInSlot(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamsInSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) + return obj.HandicapRoomAlone, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.ExamInPlan) + res := resTmp.(bool) fc.Result = res - return ec.marshalOExamInPlan2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamInPlanᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_examsInSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedRoom_handicapRoomAlone(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedRoom", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "exam": - return ec.fieldContext_ExamInPlan_exam(ctx, field) - case "constraints": - return ec.fieldContext_ExamInPlan_constraints(ctx, field) - case "nta": - return ec.fieldContext_ExamInPlan_nta(ctx, field) - case "slot": - return ec.fieldContext_ExamInPlan_slot(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamInPlan", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_examsInSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_examsInSlotWithRooms(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examsInSlotWithRooms(ctx, field) +func (ec *executionContext) _PlannedRoom_reserve(ctx context.Context, field graphql.CollectedField, obj *model.PlannedRoom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedRoom_reserve(ctx, field) if err != nil { return graphql.Null } @@ -15221,56 +16249,38 @@ func (ec *executionContext) _Query_examsInSlotWithRooms(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamsInSlotWithRooms(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) + return obj.Reserve, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]*model.ExamWithRegsAndRooms) + res := resTmp.(bool) fc.Result = res - return ec.marshalOExamWithRegsAndRooms2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegsAndRoomsᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_examsInSlotWithRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedRoom_reserve(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedRoom", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "exam": - return ec.fieldContext_ExamWithRegsAndRooms_exam(ctx, field) - case "normalRegs": - return ec.fieldContext_ExamWithRegsAndRooms_normalRegs(ctx, field) - case "ntaRegs": - return ec.fieldContext_ExamWithRegsAndRooms_ntaRegs(ctx, field) - case "rooms": - return ec.fieldContext_ExamWithRegsAndRooms_rooms(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamWithRegsAndRooms", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_examsInSlotWithRooms_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_rooms(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_rooms(ctx, field) +func (ec *executionContext) _PlannedRoom_studentsInRoom(ctx context.Context, field graphql.CollectedField, obj *model.PlannedRoom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedRoom_studentsInRoom(ctx, field) if err != nil { return graphql.Null } @@ -15283,7 +16293,7 @@ func (ec *executionContext) _Query_rooms(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Rooms(rctx) + return obj.StudentsInRoom, nil }) if err != nil { ec.Error(ctx, err) @@ -15295,44 +16305,26 @@ func (ec *executionContext) _Query_rooms(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.([]*model.Room) + res := resTmp.([]string) fc.Result = res - return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_rooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedRoom_studentsInRoom(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedRoom", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Room_name(ctx, field) - case "seats": - return ec.fieldContext_Room_seats(ctx, field) - case "handicap": - return ec.fieldContext_Room_handicap(ctx, field) - case "lab": - return ec.fieldContext_Room_lab(ctx, field) - case "placesWithSocket": - return ec.fieldContext_Room_placesWithSocket(ctx, field) - case "needsRequest": - return ec.fieldContext_Room_needsRequest(ctx, field) - case "exahm": - return ec.fieldContext_Room_exahm(ctx, field) - case "seb": - return ec.fieldContext_Room_seb(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_roomsWithConstraints(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_roomsWithConstraints(ctx, field) +func (ec *executionContext) _PlannedRoom_ntaMtknr(ctx context.Context, field graphql.CollectedField, obj *model.PlannedRoom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PlannedRoom_ntaMtknr(ctx, field) if err != nil { return graphql.Null } @@ -15345,67 +16337,35 @@ func (ec *executionContext) _Query_roomsWithConstraints(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().RoomsWithConstraints(rctx, fc.Args["handicap"].(bool), fc.Args["lab"].(bool), fc.Args["placesWithSocket"].(bool), fc.Args["exahm"].(*bool)) + return obj.NtaMtknr, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.Room) + res := resTmp.(*string) fc.Result = res - return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_roomsWithConstraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PlannedRoom_ntaMtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PlannedRoom", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Room_name(ctx, field) - case "seats": - return ec.fieldContext_Room_seats(ctx, field) - case "handicap": - return ec.fieldContext_Room_handicap(ctx, field) - case "lab": - return ec.fieldContext_Room_lab(ctx, field) - case "placesWithSocket": - return ec.fieldContext_Room_placesWithSocket(ctx, field) - case "needsRequest": - return ec.fieldContext_Room_needsRequest(ctx, field) - case "exahm": - return ec.fieldContext_Room_exahm(ctx, field) - case "seb": - return ec.fieldContext_Room_seb(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_roomsWithConstraints_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_roomsForSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_roomsForSlot(ctx, field) +func (ec *executionContext) _PrimussExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExam_ancode(ctx, field) if err != nil { return graphql.Null } @@ -15418,60 +16378,38 @@ func (ec *executionContext) _Query_roomsForSlot(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().RoomsForSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) + return obj.AnCode, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.SlotWithRooms) + res := resTmp.(int) fc.Result = res - return ec.marshalOSlotWithRooms2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotWithRooms(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_roomsForSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PrimussExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "dayNumber": - return ec.fieldContext_SlotWithRooms_dayNumber(ctx, field) - case "slotNumber": - return ec.fieldContext_SlotWithRooms_slotNumber(ctx, field) - case "normalRooms": - return ec.fieldContext_SlotWithRooms_normalRooms(ctx, field) - case "exahmRooms": - return ec.fieldContext_SlotWithRooms_exahmRooms(ctx, field) - case "labRooms": - return ec.fieldContext_SlotWithRooms_labRooms(ctx, field) - case "ntaRooms": - return ec.fieldContext_SlotWithRooms_ntaRooms(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SlotWithRooms", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_roomsForSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_plannedRoomNames(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_plannedRoomNames(ctx, field) +func (ec *executionContext) _PrimussExam_module(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExam_module(ctx, field) if err != nil { return graphql.Null } @@ -15484,26 +16422,29 @@ func (ec *executionContext) _Query_plannedRoomNames(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().PlannedRoomNames(rctx) + return obj.Module, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_plannedRoomNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExam_module(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PrimussExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -15511,8 +16452,8 @@ func (ec *executionContext) fieldContext_Query_plannedRoomNames(ctx context.Cont return fc, nil } -func (ec *executionContext) _Query_plannedRoomNamesInSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_plannedRoomNamesInSlot(ctx, field) +func (ec *executionContext) _PrimussExam_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExam_mainExamer(ctx, field) if err != nil { return graphql.Null } @@ -15525,46 +16466,38 @@ func (ec *executionContext) _Query_plannedRoomNamesInSlot(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().PlannedRoomNamesInSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) + return obj.MainExamer, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_plannedRoomNamesInSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExam_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PrimussExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_plannedRoomNamesInSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_invigilatorsWithReq(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_invigilatorsWithReq(ctx, field) +func (ec *executionContext) _PrimussExam_program(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExam_program(ctx, field) if err != nil { return graphql.Null } @@ -15577,7 +16510,7 @@ func (ec *executionContext) _Query_invigilatorsWithReq(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InvigilatorsWithReq(rctx) + return obj.Program, nil }) if err != nil { ec.Error(ctx, err) @@ -15589,34 +16522,26 @@ func (ec *executionContext) _Query_invigilatorsWithReq(ctx context.Context, fiel } return graphql.Null } - res := resTmp.([]*model.Invigilator) + res := resTmp.(string) fc.Result = res - return ec.marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_invigilatorsWithReq(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExam_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PrimussExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "teacher": - return ec.fieldContext_Invigilator_teacher(ctx, field) - case "requirements": - return ec.fieldContext_Invigilator_requirements(ctx, field) - case "todos": - return ec.fieldContext_Invigilator_todos(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Invigilator", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_invigilatorTodos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_invigilatorTodos(ctx, field) +func (ec *executionContext) _PrimussExam_examType(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExam_examType(ctx, field) if err != nil { return graphql.Null } @@ -15629,53 +16554,38 @@ func (ec *executionContext) _Query_invigilatorTodos(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InvigilatorTodos(rctx) + return obj.ExamType, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.InvigilationTodos) + res := resTmp.(string) fc.Result = res - return ec.marshalOInvigilationTodos2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilationTodos(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_invigilatorTodos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExam_examType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PrimussExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "sumExamRooms": - return ec.fieldContext_InvigilationTodos_sumExamRooms(ctx, field) - case "sumReserve": - return ec.fieldContext_InvigilationTodos_sumReserve(ctx, field) - case "sumOtherContributions": - return ec.fieldContext_InvigilationTodos_sumOtherContributions(ctx, field) - case "sumOtherContributionsOvertimeCutted": - return ec.fieldContext_InvigilationTodos_sumOtherContributionsOvertimeCutted(ctx, field) - case "invigilatorCount": - return ec.fieldContext_InvigilationTodos_invigilatorCount(ctx, field) - case "todoPerInvigilator": - return ec.fieldContext_InvigilationTodos_todoPerInvigilator(ctx, field) - case "todoPerInvigilatorOvertimeCutted": - return ec.fieldContext_InvigilationTodos_todoPerInvigilatorOvertimeCutted(ctx, field) - case "invigilators": - return ec.fieldContext_InvigilationTodos_invigilators(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type InvigilationTodos", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Query_roomsWithInvigilationsForSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_roomsWithInvigilationsForSlot(ctx, field) +func (ec *executionContext) _PrimussExam_presence(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExam_presence(ctx, field) if err != nil { return graphql.Null } @@ -15688,52 +16598,38 @@ func (ec *executionContext) _Query_roomsWithInvigilationsForSlot(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().RoomsWithInvigilationsForSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) + return obj.Presence, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.InvigilationSlot) + res := resTmp.(string) fc.Result = res - return ec.marshalOInvigilationSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilationSlot(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_roomsWithInvigilationsForSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExam_presence(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PrimussExam", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "reserve": - return ec.fieldContext_InvigilationSlot_reserve(ctx, field) - case "roomsWithInvigilators": - return ec.fieldContext_InvigilationSlot_roomsWithInvigilators(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type InvigilationSlot", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_roomsWithInvigilationsForSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_invigilatorsForDay(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_invigilatorsForDay(ctx, field) +func (ec *executionContext) _PrimussExamAncode_ancode(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamAncode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamAncode_ancode(ctx, field) if err != nil { return graphql.Null } @@ -15746,52 +16642,38 @@ func (ec *executionContext) _Query_invigilatorsForDay(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().InvigilatorsForDay(rctx, fc.Args["day"].(int)) + return obj.Ancode, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.InvigilatorsForDay) + res := resTmp.(int) fc.Result = res - return ec.marshalOInvigilatorsForDay2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorsForDay(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_invigilatorsForDay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamAncode_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PrimussExamAncode", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "want": - return ec.fieldContext_InvigilatorsForDay_want(ctx, field) - case "can": - return ec.fieldContext_InvigilatorsForDay_can(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type InvigilatorsForDay", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_invigilatorsForDay_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_dayOkForInvigilator(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_dayOkForInvigilator(ctx, field) +func (ec *executionContext) _PrimussExamAncode_program(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamAncode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamAncode_program(ctx, field) if err != nil { return graphql.Null } @@ -15804,46 +16686,38 @@ func (ec *executionContext) _Query_dayOkForInvigilator(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().DayOkForInvigilator(rctx, fc.Args["day"].(int), fc.Args["invigilatorID"].(int)) + return obj.Program, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*bool) + res := resTmp.(string) fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_dayOkForInvigilator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamAncode_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PrimussExamAncode", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_dayOkForInvigilator_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___type(ctx, field) +func (ec *executionContext) _PrimussExamAncode_numberOfStuds(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamAncode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamAncode_numberOfStuds(ctx, field) if err != nil { return graphql.Null } @@ -15856,68 +16730,38 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) + return obj.NumberOfStuds, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(int) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamAncode_numberOfStuds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PrimussExamAncode", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) +func (ec *executionContext) _PrimussExamByProgram_program(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamByProgram) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamByProgram_program(ctx, field) if err != nil { return graphql.Null } @@ -15930,49 +16774,38 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() + return obj.Program, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamByProgram_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "PrimussExamByProgram", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "description": - return ec.fieldContext___Schema_description(ctx, field) - case "types": - return ec.fieldContext___Schema_types(ctx, field) - case "queryType": - return ec.fieldContext___Schema_queryType(ctx, field) - case "mutationType": - return ec.fieldContext___Schema_mutationType(ctx, field) - case "subscriptionType": - return ec.fieldContext___Schema_subscriptionType(ctx, field) - case "directives": - return ec.fieldContext___Schema_directives(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RegWithError_registration(ctx context.Context, field graphql.CollectedField, obj *model.RegWithError) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RegWithError_registration(ctx, field) +func (ec *executionContext) _PrimussExamByProgram_exams(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamByProgram) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamByProgram_exams(ctx, field) if err != nil { return graphql.Null } @@ -15985,7 +16818,7 @@ func (ec *executionContext) _RegWithError_registration(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Registration, nil + return obj.Exams, nil }) if err != nil { ec.Error(ctx, err) @@ -15997,34 +16830,42 @@ func (ec *executionContext) _RegWithError_registration(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(*model.ZPAStudentReg) + res := resTmp.([]*model.PrimussExamWithCount) fc.Result = res - return ec.marshalNZPAStudentReg2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAStudentReg(ctx, field.Selections, res) + return ec.marshalNPrimussExamWithCount2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamWithCountᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RegWithError_registration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamByProgram_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RegWithError", + Object: "PrimussExamByProgram", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "ancode": - return ec.fieldContext_ZPAStudentReg_ancode(ctx, field) - case "mtknr": - return ec.fieldContext_ZPAStudentReg_mtknr(ctx, field) + return ec.fieldContext_PrimussExamWithCount_ancode(ctx, field) + case "module": + return ec.fieldContext_PrimussExamWithCount_module(ctx, field) + case "mainExamer": + return ec.fieldContext_PrimussExamWithCount_mainExamer(ctx, field) case "program": - return ec.fieldContext_ZPAStudentReg_program(ctx, field) + return ec.fieldContext_PrimussExamWithCount_program(ctx, field) + case "examType": + return ec.fieldContext_PrimussExamWithCount_examType(ctx, field) + case "presence": + return ec.fieldContext_PrimussExamWithCount_presence(ctx, field) + case "studentRegsCount": + return ec.fieldContext_PrimussExamWithCount_studentRegsCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ZPAStudentReg", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PrimussExamWithCount", field.Name) }, } return fc, nil } -func (ec *executionContext) _RegWithError_error(ctx context.Context, field graphql.CollectedField, obj *model.RegWithError) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RegWithError_error(ctx, field) +func (ec *executionContext) _PrimussExamWithCount_ancode(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamWithCount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamWithCount_ancode(ctx, field) if err != nil { return graphql.Null } @@ -16037,7 +16878,7 @@ func (ec *executionContext) _RegWithError_error(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Error, nil + return obj.Ancode, nil }) if err != nil { ec.Error(ctx, err) @@ -16049,38 +16890,26 @@ func (ec *executionContext) _RegWithError_error(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(*model.ZPAStudentRegError) + res := resTmp.(int) fc.Result = res - return ec.marshalNZPAStudentRegError2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAStudentRegError(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RegWithError_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamWithCount_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RegWithError", + Object: "PrimussExamWithCount", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "semester": - return ec.fieldContext_ZPAStudentRegError_semester(ctx, field) - case "ancode": - return ec.fieldContext_ZPAStudentRegError_ancode(ctx, field) - case "exam": - return ec.fieldContext_ZPAStudentRegError_exam(ctx, field) - case "mtknr": - return ec.fieldContext_ZPAStudentRegError_mtknr(ctx, field) - case "program": - return ec.fieldContext_ZPAStudentRegError_program(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ZPAStudentRegError", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Room_name(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Room_name(ctx, field) +func (ec *executionContext) _PrimussExamWithCount_module(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamWithCount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamWithCount_module(ctx, field) if err != nil { return graphql.Null } @@ -16093,7 +16922,7 @@ func (ec *executionContext) _Room_name(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Module, nil }) if err != nil { ec.Error(ctx, err) @@ -16110,9 +16939,9 @@ func (ec *executionContext) _Room_name(ctx context.Context, field graphql.Collec return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Room_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamWithCount_module(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Room", + Object: "PrimussExamWithCount", Field: field, IsMethod: false, IsResolver: false, @@ -16123,8 +16952,8 @@ func (ec *executionContext) fieldContext_Room_name(ctx context.Context, field gr return fc, nil } -func (ec *executionContext) _Room_seats(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Room_seats(ctx, field) +func (ec *executionContext) _PrimussExamWithCount_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamWithCount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamWithCount_mainExamer(ctx, field) if err != nil { return graphql.Null } @@ -16137,7 +16966,7 @@ func (ec *executionContext) _Room_seats(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Seats, nil + return obj.MainExamer, nil }) if err != nil { ec.Error(ctx, err) @@ -16149,26 +16978,26 @@ func (ec *executionContext) _Room_seats(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Room_seats(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamWithCount_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Room", + Object: "PrimussExamWithCount", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Room_handicap(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Room_handicap(ctx, field) +func (ec *executionContext) _PrimussExamWithCount_program(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamWithCount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamWithCount_program(ctx, field) if err != nil { return graphql.Null } @@ -16181,7 +17010,7 @@ func (ec *executionContext) _Room_handicap(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Handicap, nil + return obj.Program, nil }) if err != nil { ec.Error(ctx, err) @@ -16193,26 +17022,26 @@ func (ec *executionContext) _Room_handicap(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Room_handicap(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamWithCount_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Room", + Object: "PrimussExamWithCount", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Room_lab(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Room_lab(ctx, field) +func (ec *executionContext) _PrimussExamWithCount_examType(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamWithCount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamWithCount_examType(ctx, field) if err != nil { return graphql.Null } @@ -16225,7 +17054,7 @@ func (ec *executionContext) _Room_lab(ctx context.Context, field graphql.Collect }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Lab, nil + return obj.ExamType, nil }) if err != nil { ec.Error(ctx, err) @@ -16237,26 +17066,26 @@ func (ec *executionContext) _Room_lab(ctx context.Context, field graphql.Collect } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Room_lab(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamWithCount_examType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Room", + Object: "PrimussExamWithCount", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Room_placesWithSocket(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Room_placesWithSocket(ctx, field) +func (ec *executionContext) _PrimussExamWithCount_presence(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamWithCount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamWithCount_presence(ctx, field) if err != nil { return graphql.Null } @@ -16269,7 +17098,7 @@ func (ec *executionContext) _Room_placesWithSocket(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PlacesWithSocket, nil + return obj.Presence, nil }) if err != nil { ec.Error(ctx, err) @@ -16281,26 +17110,26 @@ func (ec *executionContext) _Room_placesWithSocket(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Room_placesWithSocket(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamWithCount_presence(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Room", + Object: "PrimussExamWithCount", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Room_needsRequest(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Room_needsRequest(ctx, field) +func (ec *executionContext) _PrimussExamWithCount_studentRegsCount(ctx context.Context, field graphql.CollectedField, obj *model.PrimussExamWithCount) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PrimussExamWithCount_studentRegsCount(ctx, field) if err != nil { return graphql.Null } @@ -16313,7 +17142,7 @@ func (ec *executionContext) _Room_needsRequest(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.NeedsRequest, nil + return obj.StudentRegsCount, nil }) if err != nil { ec.Error(ctx, err) @@ -16325,26 +17154,26 @@ func (ec *executionContext) _Room_needsRequest(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Room_needsRequest(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PrimussExamWithCount_studentRegsCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Room", + Object: "PrimussExamWithCount", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Room_exahm(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Room_exahm(ctx, field) +func (ec *executionContext) _Query_workflow(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_workflow(ctx, field) if err != nil { return graphql.Null } @@ -16357,7 +17186,7 @@ func (ec *executionContext) _Room_exahm(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exahm, nil + return ec.resolvers.Query().Workflow(rctx) }) if err != nil { ec.Error(ctx, err) @@ -16369,26 +17198,36 @@ func (ec *executionContext) _Room_exahm(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.Step) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNStep2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStepᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Room_exahm(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_workflow(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Room", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "number": + return ec.fieldContext_Step_number(ctx, field) + case "name": + return ec.fieldContext_Step_name(ctx, field) + case "done": + return ec.fieldContext_Step_done(ctx, field) + case "deadline": + return ec.fieldContext_Step_deadline(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Step", field.Name) }, } return fc, nil } -func (ec *executionContext) _Room_seb(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Room_seb(ctx, field) +func (ec *executionContext) _Query_nextDeadline(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_nextDeadline(ctx, field) if err != nil { return graphql.Null } @@ -16401,38 +17240,45 @@ func (ec *executionContext) _Room_seb(ctx context.Context, field graphql.Collect }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Seb, nil + return ec.resolvers.Query().NextDeadline(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.Step) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOStep2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStep(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Room_seb(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_nextDeadline(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Room", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "number": + return ec.fieldContext_Step_number(ctx, field) + case "name": + return ec.fieldContext_Step_name(ctx, field) + case "done": + return ec.fieldContext_Step_done(ctx, field) + case "deadline": + return ec.fieldContext_Step_deadline(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Step", field.Name) }, } return fc, nil } -func (ec *executionContext) _RoomAndExam_room(ctx context.Context, field graphql.CollectedField, obj *model.RoomAndExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomAndExam_room(ctx, field) +func (ec *executionContext) _Query_allSemesterNames(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_allSemesterNames(ctx, field) if err != nil { return graphql.Null } @@ -16445,7 +17291,7 @@ func (ec *executionContext) _RoomAndExam_room(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Room, nil + return ec.resolvers.Query().AllSemesterNames(rctx) }) if err != nil { ec.Error(ctx, err) @@ -16457,42 +17303,30 @@ func (ec *executionContext) _RoomAndExam_room(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(*model.RoomForExam) + res := resTmp.([]*model.Semester) fc.Result = res - return ec.marshalNRoomForExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExam(ctx, field.Selections, res) + return ec.marshalNSemester2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomAndExam_room(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_allSemesterNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomAndExam", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "ancode": - return ec.fieldContext_RoomForExam_ancode(ctx, field) - case "room": - return ec.fieldContext_RoomForExam_room(ctx, field) - case "seatsPlanned": - return ec.fieldContext_RoomForExam_seatsPlanned(ctx, field) - case "duration": - return ec.fieldContext_RoomForExam_duration(ctx, field) - case "handicap": - return ec.fieldContext_RoomForExam_handicap(ctx, field) - case "reserve": - return ec.fieldContext_RoomForExam_reserve(ctx, field) - case "students": - return ec.fieldContext_RoomForExam_students(ctx, field) + case "id": + return ec.fieldContext_Semester_id(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type RoomForExam", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Semester", field.Name) }, } return fc, nil } -func (ec *executionContext) _RoomAndExam_exam(ctx context.Context, field graphql.CollectedField, obj *model.RoomAndExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomAndExam_exam(ctx, field) +func (ec *executionContext) _Query_semester(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_semester(ctx, field) if err != nil { return graphql.Null } @@ -16505,7 +17339,7 @@ func (ec *executionContext) _RoomAndExam_exam(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exam, nil + return ec.resolvers.Query().Semester(rctx) }) if err != nil { ec.Error(ctx, err) @@ -16517,50 +17351,30 @@ func (ec *executionContext) _RoomAndExam_exam(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(*model.ZPAExam) + res := resTmp.(*model.Semester) fc.Result = res - return ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) + return ec.marshalNSemester2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemester(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomAndExam_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_semester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomAndExam", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "zpaID": - return ec.fieldContext_ZPAExam_zpaID(ctx, field) - case "semester": - return ec.fieldContext_ZPAExam_semester(ctx, field) - case "ancode": - return ec.fieldContext_ZPAExam_ancode(ctx, field) - case "module": - return ec.fieldContext_ZPAExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_ZPAExam_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) - case "examType": - return ec.fieldContext_ZPAExam_examType(ctx, field) - case "examTypeFull": - return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) - case "duration": - return ec.fieldContext_ZPAExam_duration(ctx, field) - case "isRepeaterExam": - return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) - case "groups": - return ec.fieldContext_ZPAExam_groups(ctx, field) + case "id": + return ec.fieldContext_Semester_id(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Semester", field.Name) }, } return fc, nil } -func (ec *executionContext) _RoomConstraints_placesWithSocket(ctx context.Context, field graphql.CollectedField, obj *model.RoomConstraints) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomConstraints_placesWithSocket(ctx, field) +func (ec *executionContext) _Query_semesterConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_semesterConfig(ctx, field) if err != nil { return graphql.Null } @@ -16573,7 +17387,7 @@ func (ec *executionContext) _RoomConstraints_placesWithSocket(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PlacesWithSocket, nil + return ec.resolvers.Query().SemesterConfig(rctx) }) if err != nil { ec.Error(ctx, err) @@ -16585,26 +17399,36 @@ func (ec *executionContext) _RoomConstraints_placesWithSocket(ctx context.Contex } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.SemesterConfig) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNSemesterConfig2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterConfig(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomConstraints_placesWithSocket(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_semesterConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomConstraints", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "days": + return ec.fieldContext_SemesterConfig_days(ctx, field) + case "starttimes": + return ec.fieldContext_SemesterConfig_starttimes(ctx, field) + case "slots": + return ec.fieldContext_SemesterConfig_slots(ctx, field) + case "goSlots": + return ec.fieldContext_SemesterConfig_goSlots(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SemesterConfig", field.Name) }, } return fc, nil } -func (ec *executionContext) _RoomConstraints_lab(ctx context.Context, field graphql.CollectedField, obj *model.RoomConstraints) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomConstraints_lab(ctx, field) +func (ec *executionContext) _Query_additionalExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_additionalExams(ctx, field) if err != nil { return graphql.Null } @@ -16617,7 +17441,7 @@ func (ec *executionContext) _RoomConstraints_lab(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Lab, nil + return ec.resolvers.Query().AdditionalExams(rctx) }) if err != nil { ec.Error(ctx, err) @@ -16629,26 +17453,42 @@ func (ec *executionContext) _RoomConstraints_lab(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.AdditionalExam) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNAdditionalExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAdditionalExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomConstraints_lab(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_additionalExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomConstraints", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_AdditionalExam_ancode(ctx, field) + case "module": + return ec.fieldContext_AdditionalExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_AdditionalExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_AdditionalExam_mainExamerID(ctx, field) + case "duration": + return ec.fieldContext_AdditionalExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_AdditionalExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_AdditionalExam_groups(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AdditionalExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _RoomConstraints_exahmRooms(ctx context.Context, field graphql.CollectedField, obj *model.RoomConstraints) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomConstraints_exahmRooms(ctx, field) +func (ec *executionContext) _Query_primussExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_primussExam(ctx, field) if err != nil { return graphql.Null } @@ -16661,7 +17501,7 @@ func (ec *executionContext) _RoomConstraints_exahmRooms(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExahmRooms, nil + return ec.resolvers.Query().PrimussExam(rctx, fc.Args["program"].(string), fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -16673,26 +17513,51 @@ func (ec *executionContext) _RoomConstraints_exahmRooms(ctx context.Context, fie } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.PrimussExam) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNPrimussExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomConstraints_exahmRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_primussExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomConstraints", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_PrimussExam_ancode(ctx, field) + case "module": + return ec.fieldContext_PrimussExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_PrimussExam_mainExamer(ctx, field) + case "program": + return ec.fieldContext_PrimussExam_program(ctx, field) + case "examType": + return ec.fieldContext_PrimussExam_examType(ctx, field) + case "presence": + return ec.fieldContext_PrimussExam_presence(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_primussExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _RoomConstraints_seb(ctx context.Context, field graphql.CollectedField, obj *model.RoomConstraints) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomConstraints_seb(ctx, field) +func (ec *executionContext) _Query_primussExamsForAnCode(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_primussExamsForAnCode(ctx, field) if err != nil { return graphql.Null } @@ -16705,38 +17570,60 @@ func (ec *executionContext) _RoomConstraints_seb(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Seb, nil + return ec.resolvers.Query().PrimussExamsForAnCode(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.PrimussExam) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomConstraints_seb(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_primussExamsForAnCode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomConstraints", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_PrimussExam_ancode(ctx, field) + case "module": + return ec.fieldContext_PrimussExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_PrimussExam_mainExamer(ctx, field) + case "program": + return ec.fieldContext_PrimussExam_program(ctx, field) + case "examType": + return ec.fieldContext_PrimussExam_examType(ctx, field) + case "presence": + return ec.fieldContext_PrimussExam_presence(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PrimussExam", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_primussExamsForAnCode_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _RoomForExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomForExam_ancode(ctx, field) +func (ec *executionContext) _Query_studentRegsForProgram(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_studentRegsForProgram(ctx, field) if err != nil { return graphql.Null } @@ -16749,38 +17636,60 @@ func (ec *executionContext) _RoomForExam_ancode(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Ancode, nil + return ec.resolvers.Query().StudentRegsForProgram(rctx, fc.Args["program"].(string)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.StudentReg) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomForExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_studentRegsForProgram(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomForExam", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "mtknr": + return ec.fieldContext_StudentReg_mtknr(ctx, field) + case "ancode": + return ec.fieldContext_StudentReg_ancode(ctx, field) + case "program": + return ec.fieldContext_StudentReg_program(ctx, field) + case "group": + return ec.fieldContext_StudentReg_group(ctx, field) + case "name": + return ec.fieldContext_StudentReg_name(ctx, field) + case "presence": + return ec.fieldContext_StudentReg_presence(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type StudentReg", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_studentRegsForProgram_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _RoomForExam_room(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomForExam_room(ctx, field) +func (ec *executionContext) _Query_examWithRegs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_examWithRegs(ctx, field) if err != nil { return graphql.Null } @@ -16793,7 +17702,7 @@ func (ec *executionContext) _RoomForExam_room(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.RoomForExam().Room(rctx, obj) + return ec.resolvers.Query().ExamWithRegs(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -16802,44 +17711,51 @@ func (ec *executionContext) _RoomForExam_room(ctx context.Context, field graphql if resTmp == nil { return graphql.Null } - res := resTmp.(*model.Room) + res := resTmp.(*model.ExamWithRegs) fc.Result = res - return ec.marshalORoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoom(ctx, field.Selections, res) + return ec.marshalOExamWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegs(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomForExam_room(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_examWithRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomForExam", + Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext_Room_name(ctx, field) - case "seats": - return ec.fieldContext_Room_seats(ctx, field) - case "handicap": - return ec.fieldContext_Room_handicap(ctx, field) - case "lab": - return ec.fieldContext_Room_lab(ctx, field) - case "placesWithSocket": - return ec.fieldContext_Room_placesWithSocket(ctx, field) - case "needsRequest": - return ec.fieldContext_Room_needsRequest(ctx, field) - case "exahm": - return ec.fieldContext_Room_exahm(ctx, field) - case "seb": - return ec.fieldContext_Room_seb(ctx, field) + case "ancode": + return ec.fieldContext_ExamWithRegs_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) + case "primussExams": + return ec.fieldContext_ExamWithRegs_primussExams(ctx, field) + case "studentRegs": + return ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) + case "conflicts": + return ec.fieldContext_ExamWithRegs_conflicts(ctx, field) + case "connectErrors": + return ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ExamWithRegs", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_examWithRegs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _RoomForExam_seatsPlanned(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomForExam_seatsPlanned(ctx, field) +func (ec *executionContext) _Query_examsWithRegs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_examsWithRegs(ctx, field) if err != nil { return graphql.Null } @@ -16852,38 +17768,49 @@ func (ec *executionContext) _RoomForExam_seatsPlanned(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SeatsPlanned, nil + return ec.resolvers.Query().ExamsWithRegs(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.ExamWithRegs) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOExamWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegsᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomForExam_seatsPlanned(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_examsWithRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomForExam", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_ExamWithRegs_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_ExamWithRegs_zpaExam(ctx, field) + case "primussExams": + return ec.fieldContext_ExamWithRegs_primussExams(ctx, field) + case "studentRegs": + return ec.fieldContext_ExamWithRegs_studentRegs(ctx, field) + case "conflicts": + return ec.fieldContext_ExamWithRegs_conflicts(ctx, field) + case "connectErrors": + return ec.fieldContext_ExamWithRegs_connectErrors(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExamWithRegs", field.Name) }, } return fc, nil } -func (ec *executionContext) _RoomForExam_duration(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomForExam_duration(ctx, field) +func (ec *executionContext) _Query_constraintForAncode(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_constraintForAncode(ctx, field) if err != nil { return graphql.Null } @@ -16896,38 +17823,66 @@ func (ec *executionContext) _RoomForExam_duration(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Duration, nil + return ec.resolvers.Query().ConstraintForAncode(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.Constraints) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomForExam_duration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_constraintForAncode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomForExam", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_Constraints_ancode(ctx, field) + case "notPlannedByMe": + return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) + case "excludeDays": + return ec.fieldContext_Constraints_excludeDays(ctx, field) + case "possibleDays": + return ec.fieldContext_Constraints_possibleDays(ctx, field) + case "fixedDay": + return ec.fieldContext_Constraints_fixedDay(ctx, field) + case "fixedTime": + return ec.fieldContext_Constraints_fixedTime(ctx, field) + case "sameSlot": + return ec.fieldContext_Constraints_sameSlot(ctx, field) + case "online": + return ec.fieldContext_Constraints_online(ctx, field) + case "roomConstraints": + return ec.fieldContext_Constraints_roomConstraints(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_constraintForAncode_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _RoomForExam_handicap(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomForExam_handicap(ctx, field) +func (ec *executionContext) _Query_zpaExamsToPlanWithConstraints(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_zpaExamsToPlanWithConstraints(ctx, field) if err != nil { return graphql.Null } @@ -16940,7 +17895,7 @@ func (ec *executionContext) _RoomForExam_handicap(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Handicap, nil + return ec.resolvers.Query().ZpaExamsToPlanWithConstraints(rctx) }) if err != nil { ec.Error(ctx, err) @@ -16952,26 +17907,32 @@ func (ec *executionContext) _RoomForExam_handicap(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.ZPAExamWithConstraints) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNZPAExamWithConstraints2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamWithConstraintsᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomForExam_handicap(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_zpaExamsToPlanWithConstraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomForExam", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "zpaExam": + return ec.fieldContext_ZPAExamWithConstraints_zpaExam(ctx, field) + case "constraints": + return ec.fieldContext_ZPAExamWithConstraints_constraints(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExamWithConstraints", field.Name) }, } return fc, nil } -func (ec *executionContext) _RoomForExam_reserve(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomForExam_reserve(ctx, field) +func (ec *executionContext) _Query_examGroups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_examGroups(ctx, field) if err != nil { return graphql.Null } @@ -16984,7 +17945,7 @@ func (ec *executionContext) _RoomForExam_reserve(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Reserve, nil + return ec.resolvers.Query().ExamGroups(rctx) }) if err != nil { ec.Error(ctx, err) @@ -16996,26 +17957,34 @@ func (ec *executionContext) _RoomForExam_reserve(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.ExamGroup) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomForExam_reserve(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_examGroups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomForExam", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "examGroupCode": + return ec.fieldContext_ExamGroup_examGroupCode(ctx, field) + case "exams": + return ec.fieldContext_ExamGroup_exams(ctx, field) + case "examGroupInfo": + return ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExamGroup", field.Name) }, } return fc, nil } -func (ec *executionContext) _RoomForExam_students(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomForExam_students(ctx, field) +func (ec *executionContext) _Query_examGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_examGroup(ctx, field) if err != nil { return graphql.Null } @@ -17028,52 +17997,54 @@ func (ec *executionContext) _RoomForExam_students(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Students, nil + return ec.resolvers.Query().ExamGroup(rctx, fc.Args["examGroupCode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.StudentReg) + res := resTmp.(*model.ExamGroup) fc.Result = res - return ec.marshalNStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx, field.Selections, res) + return ec.marshalOExamGroup2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroup(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomForExam_students(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_examGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomForExam", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "mtknr": - return ec.fieldContext_StudentReg_mtknr(ctx, field) - case "ancode": - return ec.fieldContext_StudentReg_ancode(ctx, field) - case "program": - return ec.fieldContext_StudentReg_program(ctx, field) - case "group": - return ec.fieldContext_StudentReg_group(ctx, field) - case "name": - return ec.fieldContext_StudentReg_name(ctx, field) - case "presence": - return ec.fieldContext_StudentReg_presence(ctx, field) + case "examGroupCode": + return ec.fieldContext_ExamGroup_examGroupCode(ctx, field) + case "exams": + return ec.fieldContext_ExamGroup_exams(ctx, field) + case "examGroupInfo": + return ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type StudentReg", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ExamGroup", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_examGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _RoomWithInvigilator_name(ctx context.Context, field graphql.CollectedField, obj *model.RoomWithInvigilator) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomWithInvigilator_name(ctx, field) +func (ec *executionContext) _Query_ntasWithRegsByTeacher(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_ntasWithRegsByTeacher(ctx, field) if err != nil { return graphql.Null } @@ -17086,38 +18057,41 @@ func (ec *executionContext) _RoomWithInvigilator_name(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Query().NtasWithRegsByTeacher(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.NTAWithRegsByExamAndTeacher) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalONTAWithRegsByExamAndTeacher2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsByExamAndTeacherᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomWithInvigilator_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_ntasWithRegsByTeacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomWithInvigilator", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "teacher": + return ec.fieldContext_NTAWithRegsByExamAndTeacher_teacher(ctx, field) + case "exams": + return ec.fieldContext_NTAWithRegsByExamAndTeacher_exams(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NTAWithRegsByExamAndTeacher", field.Name) }, } return fc, nil } -func (ec *executionContext) _RoomWithInvigilator_maxDuration(ctx context.Context, field graphql.CollectedField, obj *model.RoomWithInvigilator) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomWithInvigilator_maxDuration(ctx, field) +func (ec *executionContext) _Query_nta(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_nta(ctx, field) if err != nil { return graphql.Null } @@ -17130,38 +18104,52 @@ func (ec *executionContext) _RoomWithInvigilator_maxDuration(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MaxDuration, nil + return ec.resolvers.Query().Nta(rctx, fc.Args["mtknr"].(string)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.NTAWithRegs) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalONTAWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegs(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomWithInvigilator_maxDuration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_nta(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomWithInvigilator", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "nta": + return ec.fieldContext_NTAWithRegs_nta(ctx, field) + case "regs": + return ec.fieldContext_NTAWithRegs_regs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NTAWithRegs", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_nta_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _RoomWithInvigilator_studentCount(ctx context.Context, field graphql.CollectedField, obj *model.RoomWithInvigilator) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomWithInvigilator_studentCount(ctx, field) +func (ec *executionContext) _Query_examGroupsWithoutSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_examGroupsWithoutSlot(ctx, field) if err != nil { return graphql.Null } @@ -17174,38 +18162,43 @@ func (ec *executionContext) _RoomWithInvigilator_studentCount(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.StudentCount, nil + return ec.resolvers.Query().ExamGroupsWithoutSlot(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.ExamGroup) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomWithInvigilator_studentCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_examGroupsWithoutSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomWithInvigilator", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "examGroupCode": + return ec.fieldContext_ExamGroup_examGroupCode(ctx, field) + case "exams": + return ec.fieldContext_ExamGroup_exams(ctx, field) + case "examGroupInfo": + return ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExamGroup", field.Name) }, } return fc, nil } -func (ec *executionContext) _RoomWithInvigilator_roomAndExams(ctx context.Context, field graphql.CollectedField, obj *model.RoomWithInvigilator) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomWithInvigilator_roomAndExams(ctx, field) +func (ec *executionContext) _Query_plannedExamsInSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_plannedExamsInSlot(ctx, field) if err != nil { return graphql.Null } @@ -17218,44 +18211,54 @@ func (ec *executionContext) _RoomWithInvigilator_roomAndExams(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.RoomAndExams, nil + return ec.resolvers.Query().PlannedExamsInSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.RoomAndExam) + res := resTmp.([]*model.PlannedExamWithNta) fc.Result = res - return ec.marshalNRoomAndExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomAndExamᚄ(ctx, field.Selections, res) + return ec.marshalOPlannedExamWithNTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExamWithNtaᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomWithInvigilator_roomAndExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_plannedExamsInSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomWithInvigilator", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "room": - return ec.fieldContext_RoomAndExam_room(ctx, field) case "exam": - return ec.fieldContext_RoomAndExam_exam(ctx, field) + return ec.fieldContext_PlannedExamWithNTA_exam(ctx, field) + case "constraints": + return ec.fieldContext_PlannedExamWithNTA_constraints(ctx, field) + case "nta": + return ec.fieldContext_PlannedExamWithNTA_nta(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type RoomAndExam", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PlannedExamWithNTA", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_plannedExamsInSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _RoomWithInvigilator_invigilator(ctx context.Context, field graphql.CollectedField, obj *model.RoomWithInvigilator) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RoomWithInvigilator_invigilator(ctx, field) +func (ec *executionContext) _Query_examsInPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_examsInPlan(ctx, field) if err != nil { return graphql.Null } @@ -17268,7 +18271,7 @@ func (ec *executionContext) _RoomWithInvigilator_invigilator(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Invigilator, nil + return ec.resolvers.Query().ExamsInPlan(rctx) }) if err != nil { ec.Error(ctx, err) @@ -17277,48 +18280,36 @@ func (ec *executionContext) _RoomWithInvigilator_invigilator(ctx context.Context if resTmp == nil { return graphql.Null } - res := resTmp.(*model.Teacher) + res := resTmp.([]*model.ExamInPlan) fc.Result = res - return ec.marshalOTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) + return ec.marshalOExamInPlan2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamInPlanᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RoomWithInvigilator_invigilator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_examsInPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RoomWithInvigilator", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "shortname": - return ec.fieldContext_Teacher_shortname(ctx, field) - case "fullname": - return ec.fieldContext_Teacher_fullname(ctx, field) - case "isProf": - return ec.fieldContext_Teacher_isProf(ctx, field) - case "isLBA": - return ec.fieldContext_Teacher_isLBA(ctx, field) - case "isProfHC": - return ec.fieldContext_Teacher_isProfHC(ctx, field) - case "isStaff": - return ec.fieldContext_Teacher_isStaff(ctx, field) - case "lastSemester": - return ec.fieldContext_Teacher_lastSemester(ctx, field) - case "fk": - return ec.fieldContext_Teacher_fk(ctx, field) - case "id": - return ec.fieldContext_Teacher_id(ctx, field) - case "email": - return ec.fieldContext_Teacher_email(ctx, field) + case "exam": + return ec.fieldContext_ExamInPlan_exam(ctx, field) + case "constraints": + return ec.fieldContext_ExamInPlan_constraints(ctx, field) + case "nta": + return ec.fieldContext_ExamInPlan_nta(ctx, field) + case "slot": + return ec.fieldContext_ExamInPlan_slot(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ExamInPlan", field.Name) }, } return fc, nil } -func (ec *executionContext) _Semester_id(ctx context.Context, field graphql.CollectedField, obj *model.Semester) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Semester_id(ctx, field) +func (ec *executionContext) _Query_examsInSlotWithRooms(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_examsInSlotWithRooms(ctx, field) if err != nil { return graphql.Null } @@ -17331,38 +18322,56 @@ func (ec *executionContext) _Semester_id(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return ec.resolvers.Query().ExamsInSlotWithRooms(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.ExamWithRegsAndRooms) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOExamWithRegsAndRooms2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegsAndRoomsᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Semester_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_examsInSlotWithRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Semester", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "exam": + return ec.fieldContext_ExamWithRegsAndRooms_exam(ctx, field) + case "normalRegsMtknr": + return ec.fieldContext_ExamWithRegsAndRooms_normalRegsMtknr(ctx, field) + case "ntas": + return ec.fieldContext_ExamWithRegsAndRooms_ntas(ctx, field) + case "rooms": + return ec.fieldContext_ExamWithRegsAndRooms_rooms(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExamWithRegsAndRooms", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_examsInSlotWithRooms_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _SemesterConfig_days(ctx context.Context, field graphql.CollectedField, obj *model.SemesterConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SemesterConfig_days(ctx, field) +func (ec *executionContext) _Query_roomsWithConstraints(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_roomsWithConstraints(ctx, field) if err != nil { return graphql.Null } @@ -17375,7 +18384,7 @@ func (ec *executionContext) _SemesterConfig_days(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Days, nil + return ec.resolvers.Query().RoomsWithConstraints(rctx, fc.Args["handicap"].(bool), fc.Args["lab"].(bool), fc.Args["placesWithSocket"].(bool), fc.Args["exahm"].(*bool)) }) if err != nil { ec.Error(ctx, err) @@ -17387,34 +18396,57 @@ func (ec *executionContext) _SemesterConfig_days(ctx context.Context, field grap } return graphql.Null } - res := resTmp.([]*model.ExamDay) + res := resTmp.([]*model.Room) fc.Result = res - return ec.marshalNExamDay2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamDayᚄ(ctx, field.Selections, res) + return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SemesterConfig_days(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_roomsWithConstraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SemesterConfig", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "number": - return ec.fieldContext_ExamDay_number(ctx, field) - case "date": - return ec.fieldContext_ExamDay_date(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ExamDay", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _SemesterConfig_starttimes(ctx context.Context, field graphql.CollectedField, obj *model.SemesterConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SemesterConfig_starttimes(ctx, field) - if err != nil { - return graphql.Null + case "name": + return ec.fieldContext_Room_name(ctx, field) + case "seats": + return ec.fieldContext_Room_seats(ctx, field) + case "handicap": + return ec.fieldContext_Room_handicap(ctx, field) + case "lab": + return ec.fieldContext_Room_lab(ctx, field) + case "placesWithSocket": + return ec.fieldContext_Room_placesWithSocket(ctx, field) + case "needsRequest": + return ec.fieldContext_Room_needsRequest(ctx, field) + case "exahm": + return ec.fieldContext_Room_exahm(ctx, field) + case "seb": + return ec.fieldContext_Room_seb(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_roomsWithConstraints_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_roomsForSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_roomsForSlot(ctx, field) + if err != nil { + return graphql.Null } ctx = graphql.WithFieldContext(ctx, fc) defer func() { @@ -17425,44 +18457,60 @@ func (ec *executionContext) _SemesterConfig_starttimes(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Starttimes, nil + return ec.resolvers.Query().RoomsForSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.Starttime) + res := resTmp.(*model.SlotWithRooms) fc.Result = res - return ec.marshalNStarttime2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStarttimeᚄ(ctx, field.Selections, res) + return ec.marshalOSlotWithRooms2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotWithRooms(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SemesterConfig_starttimes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_roomsForSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SemesterConfig", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "number": - return ec.fieldContext_Starttime_number(ctx, field) - case "start": - return ec.fieldContext_Starttime_start(ctx, field) + case "dayNumber": + return ec.fieldContext_SlotWithRooms_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_SlotWithRooms_slotNumber(ctx, field) + case "normalRooms": + return ec.fieldContext_SlotWithRooms_normalRooms(ctx, field) + case "exahmRooms": + return ec.fieldContext_SlotWithRooms_exahmRooms(ctx, field) + case "labRooms": + return ec.fieldContext_SlotWithRooms_labRooms(ctx, field) + case "ntaRooms": + return ec.fieldContext_SlotWithRooms_ntaRooms(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Starttime", field.Name) + return nil, fmt.Errorf("no field named %q was found under type SlotWithRooms", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_roomsForSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _SemesterConfig_slots(ctx context.Context, field graphql.CollectedField, obj *model.SemesterConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SemesterConfig_slots(ctx, field) +func (ec *executionContext) _Query_dayOkForInvigilator(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_dayOkForInvigilator(ctx, field) if err != nil { return graphql.Null } @@ -17475,46 +18523,46 @@ func (ec *executionContext) _SemesterConfig_slots(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Slots, nil + return ec.resolvers.Query().DayOkForInvigilator(rctx, fc.Args["day"].(int), fc.Args["invigilatorID"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.Slot) + res := resTmp.(*bool) fc.Result = res - return ec.marshalNSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SemesterConfig_slots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_dayOkForInvigilator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SemesterConfig", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "dayNumber": - return ec.fieldContext_Slot_dayNumber(ctx, field) - case "slotNumber": - return ec.fieldContext_Slot_slotNumber(ctx, field) - case "starttime": - return ec.fieldContext_Slot_starttime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_dayOkForInvigilator_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _SemesterConfig_goSlots(ctx context.Context, field graphql.CollectedField, obj *model.SemesterConfig) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SemesterConfig_goSlots(ctx, field) +func (ec *executionContext) _Query_connectedExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_connectedExam(ctx, field) if err != nil { return graphql.Null } @@ -17527,7 +18575,7 @@ func (ec *executionContext) _SemesterConfig_goSlots(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.GoSlots, nil + return ec.resolvers.Query().ConnectedExam(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -17536,26 +18584,47 @@ func (ec *executionContext) _SemesterConfig_goSlots(ctx context.Context, field g if resTmp == nil { return graphql.Null } - res := resTmp.([][]int) + res := resTmp.(*model.ConnectedExam) fc.Result = res - return ec.marshalOInt2ᚕᚕintᚄ(ctx, field.Selections, res) + return ec.marshalOConnectedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SemesterConfig_goSlots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_connectedExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SemesterConfig", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "zpaExam": + return ec.fieldContext_ConnectedExam_zpaExam(ctx, field) + case "primussExams": + return ec.fieldContext_ConnectedExam_primussExams(ctx, field) + case "otherPrimussExams": + return ec.fieldContext_ConnectedExam_otherPrimussExams(ctx, field) + case "errors": + return ec.fieldContext_ConnectedExam_errors(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConnectedExam", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_connectedExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Slot_dayNumber(ctx context.Context, field graphql.CollectedField, obj *model.Slot) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Slot_dayNumber(ctx, field) +func (ec *executionContext) _Query_connectedExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_connectedExams(ctx, field) if err != nil { return graphql.Null } @@ -17568,7 +18637,7 @@ func (ec *executionContext) _Slot_dayNumber(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DayNumber, nil + return ec.resolvers.Query().ConnectedExams(rctx) }) if err != nil { ec.Error(ctx, err) @@ -17580,26 +18649,36 @@ func (ec *executionContext) _Slot_dayNumber(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.ConnectedExam) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNConnectedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Slot_dayNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_connectedExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Slot", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "zpaExam": + return ec.fieldContext_ConnectedExam_zpaExam(ctx, field) + case "primussExams": + return ec.fieldContext_ConnectedExam_primussExams(ctx, field) + case "otherPrimussExams": + return ec.fieldContext_ConnectedExam_otherPrimussExams(ctx, field) + case "errors": + return ec.fieldContext_ConnectedExam_errors(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConnectedExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _Slot_slotNumber(ctx context.Context, field graphql.CollectedField, obj *model.Slot) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Slot_slotNumber(ctx, field) +func (ec *executionContext) _Query_externalExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_externalExams(ctx, field) if err != nil { return graphql.Null } @@ -17612,7 +18691,7 @@ func (ec *executionContext) _Slot_slotNumber(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SlotNumber, nil + return ec.resolvers.Query().ExternalExams(rctx) }) if err != nil { ec.Error(ctx, err) @@ -17624,26 +18703,38 @@ func (ec *executionContext) _Slot_slotNumber(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.ExternalExam) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNExternalExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExternalExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Slot_slotNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_externalExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Slot", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_ExternalExam_ancode(ctx, field) + case "program": + return ec.fieldContext_ExternalExam_program(ctx, field) + case "module": + return ec.fieldContext_ExternalExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ExternalExam_mainExamer(ctx, field) + case "duration": + return ec.fieldContext_ExternalExam_duration(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExternalExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _Slot_starttime(ctx context.Context, field graphql.CollectedField, obj *model.Slot) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Slot_starttime(ctx, field) +func (ec *executionContext) _Query_generatedExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_generatedExams(ctx, field) if err != nil { return graphql.Null } @@ -17656,7 +18747,7 @@ func (ec *executionContext) _Slot_starttime(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Starttime, nil + return ec.resolvers.Query().GeneratedExams(rctx) }) if err != nil { ec.Error(ctx, err) @@ -17668,26 +18759,46 @@ func (ec *executionContext) _Slot_starttime(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.([]*model.GeneratedExam) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNGeneratedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐGeneratedExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Slot_starttime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_generatedExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Slot", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_GeneratedExam_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_GeneratedExam_zpaExam(ctx, field) + case "mainExamer": + return ec.fieldContext_GeneratedExam_mainExamer(ctx, field) + case "primussExams": + return ec.fieldContext_GeneratedExam_primussExams(ctx, field) + case "constraints": + return ec.fieldContext_GeneratedExam_constraints(ctx, field) + case "conflicts": + return ec.fieldContext_GeneratedExam_conflicts(ctx, field) + case "studentRegsCount": + return ec.fieldContext_GeneratedExam_studentRegsCount(ctx, field) + case "ntas": + return ec.fieldContext_GeneratedExam_ntas(ctx, field) + case "maxDuration": + return ec.fieldContext_GeneratedExam_maxDuration(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GeneratedExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _SlotWithExamGroups_dayNumber(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithExamGroups) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SlotWithExamGroups_dayNumber(ctx, field) +func (ec *executionContext) _Query_generatedExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_generatedExam(ctx, field) if err != nil { return graphql.Null } @@ -17700,38 +18811,66 @@ func (ec *executionContext) _SlotWithExamGroups_dayNumber(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DayNumber, nil + return ec.resolvers.Query().GeneratedExam(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.GeneratedExam) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOGeneratedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐGeneratedExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SlotWithExamGroups_dayNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_generatedExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SlotWithExamGroups", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_GeneratedExam_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_GeneratedExam_zpaExam(ctx, field) + case "mainExamer": + return ec.fieldContext_GeneratedExam_mainExamer(ctx, field) + case "primussExams": + return ec.fieldContext_GeneratedExam_primussExams(ctx, field) + case "constraints": + return ec.fieldContext_GeneratedExam_constraints(ctx, field) + case "conflicts": + return ec.fieldContext_GeneratedExam_conflicts(ctx, field) + case "studentRegsCount": + return ec.fieldContext_GeneratedExam_studentRegsCount(ctx, field) + case "ntas": + return ec.fieldContext_GeneratedExam_ntas(ctx, field) + case "maxDuration": + return ec.fieldContext_GeneratedExam_maxDuration(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GeneratedExam", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_generatedExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _SlotWithExamGroups_slotNumber(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithExamGroups) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SlotWithExamGroups_slotNumber(ctx, field) +func (ec *executionContext) _Query_plannedExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_plannedExams(ctx, field) if err != nil { return graphql.Null } @@ -17744,7 +18883,7 @@ func (ec *executionContext) _SlotWithExamGroups_slotNumber(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SlotNumber, nil + return ec.resolvers.Query().PlannedExams(rctx) }) if err != nil { ec.Error(ctx, err) @@ -17756,26 +18895,50 @@ func (ec *executionContext) _SlotWithExamGroups_slotNumber(ctx context.Context, } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.PlannedExam) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNPlannedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SlotWithExamGroups_slotNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_plannedExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SlotWithExamGroups", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_PlannedExam_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_PlannedExam_zpaExam(ctx, field) + case "mainExamer": + return ec.fieldContext_PlannedExam_mainExamer(ctx, field) + case "primussExams": + return ec.fieldContext_PlannedExam_primussExams(ctx, field) + case "constraints": + return ec.fieldContext_PlannedExam_constraints(ctx, field) + case "conflicts": + return ec.fieldContext_PlannedExam_conflicts(ctx, field) + case "studentRegsCount": + return ec.fieldContext_PlannedExam_studentRegsCount(ctx, field) + case "ntas": + return ec.fieldContext_PlannedExam_ntas(ctx, field) + case "maxDuration": + return ec.fieldContext_PlannedExam_maxDuration(ctx, field) + case "planEntry": + return ec.fieldContext_PlannedExam_planEntry(ctx, field) + case "plannedRooms": + return ec.fieldContext_PlannedExam_plannedRooms(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PlannedExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _SlotWithExamGroups_examGroups(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithExamGroups) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SlotWithExamGroups_examGroups(ctx, field) +func (ec *executionContext) _Query_plannedExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_plannedExam(ctx, field) if err != nil { return graphql.Null } @@ -17788,7 +18951,7 @@ func (ec *executionContext) _SlotWithExamGroups_examGroups(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExamGroups, nil + return ec.resolvers.Query().PlannedExam(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -17797,34 +18960,61 @@ func (ec *executionContext) _SlotWithExamGroups_examGroups(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.ExamGroup) + res := resTmp.(*model.PlannedExam) fc.Result = res - return ec.marshalOExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroup(ctx, field.Selections, res) + return ec.marshalOPlannedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SlotWithExamGroups_examGroups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_plannedExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SlotWithExamGroups", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "examGroupCode": - return ec.fieldContext_ExamGroup_examGroupCode(ctx, field) - case "exams": - return ec.fieldContext_ExamGroup_exams(ctx, field) - case "examGroupInfo": - return ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) + case "ancode": + return ec.fieldContext_PlannedExam_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_PlannedExam_zpaExam(ctx, field) + case "mainExamer": + return ec.fieldContext_PlannedExam_mainExamer(ctx, field) + case "primussExams": + return ec.fieldContext_PlannedExam_primussExams(ctx, field) + case "constraints": + return ec.fieldContext_PlannedExam_constraints(ctx, field) + case "conflicts": + return ec.fieldContext_PlannedExam_conflicts(ctx, field) + case "studentRegsCount": + return ec.fieldContext_PlannedExam_studentRegsCount(ctx, field) + case "ntas": + return ec.fieldContext_PlannedExam_ntas(ctx, field) + case "maxDuration": + return ec.fieldContext_PlannedExam_maxDuration(ctx, field) + case "planEntry": + return ec.fieldContext_PlannedExam_planEntry(ctx, field) + case "plannedRooms": + return ec.fieldContext_PlannedExam_plannedRooms(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ExamGroup", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PlannedExam", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_plannedExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _SlotWithRooms_dayNumber(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SlotWithRooms_dayNumber(ctx, field) +func (ec *executionContext) _Query_conflictingAncodes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_conflictingAncodes(ctx, field) if err != nil { return graphql.Null } @@ -17837,38 +19027,52 @@ func (ec *executionContext) _SlotWithRooms_dayNumber(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DayNumber, nil + return ec.resolvers.Query().ConflictingAncodes(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.Conflict) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SlotWithRooms_dayNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_conflictingAncodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SlotWithRooms", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_Conflict_ancode(ctx, field) + case "numberOfStuds": + return ec.fieldContext_Conflict_numberOfStuds(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Conflict", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_conflictingAncodes_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _SlotWithRooms_slotNumber(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SlotWithRooms_slotNumber(ctx, field) +func (ec *executionContext) _Query_exam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_exam(ctx, field) if err != nil { return graphql.Null } @@ -17881,38 +19085,72 @@ func (ec *executionContext) _SlotWithRooms_slotNumber(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SlotNumber, nil + return ec.resolvers.Query().Exam(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.Exam) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SlotWithRooms_slotNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SlotWithRooms", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_Exam_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_Exam_zpaExam(ctx, field) + case "externalExam": + return ec.fieldContext_Exam_externalExam(ctx, field) + case "primussExams": + return ec.fieldContext_Exam_primussExams(ctx, field) + case "studentRegs": + return ec.fieldContext_Exam_studentRegs(ctx, field) + case "conflicts": + return ec.fieldContext_Exam_conflicts(ctx, field) + case "connectErrors": + return ec.fieldContext_Exam_connectErrors(ctx, field) + case "constraints": + return ec.fieldContext_Exam_constraints(ctx, field) + case "regularStudents": + return ec.fieldContext_Exam_regularStudents(ctx, field) + case "ntaStudents": + return ec.fieldContext_Exam_ntaStudents(ctx, field) + case "slot": + return ec.fieldContext_Exam_slot(ctx, field) + case "rooms": + return ec.fieldContext_Exam_rooms(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Exam", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_exam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _SlotWithRooms_normalRooms(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SlotWithRooms_normalRooms(ctx, field) +func (ec *executionContext) _Query_exams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_exams(ctx, field) if err != nil { return graphql.Null } @@ -17925,7 +19163,7 @@ func (ec *executionContext) _SlotWithRooms_normalRooms(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.NormalRooms, nil + return ec.resolvers.Query().Exams(rctx) }) if err != nil { ec.Error(ctx, err) @@ -17937,44 +19175,52 @@ func (ec *executionContext) _SlotWithRooms_normalRooms(ctx context.Context, fiel } return graphql.Null } - res := resTmp.([]*model.Room) + res := resTmp.([]*model.Exam) fc.Result = res - return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) + return ec.marshalNExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SlotWithRooms_normalRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SlotWithRooms", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext_Room_name(ctx, field) - case "seats": - return ec.fieldContext_Room_seats(ctx, field) - case "handicap": - return ec.fieldContext_Room_handicap(ctx, field) - case "lab": - return ec.fieldContext_Room_lab(ctx, field) - case "placesWithSocket": - return ec.fieldContext_Room_placesWithSocket(ctx, field) - case "needsRequest": - return ec.fieldContext_Room_needsRequest(ctx, field) - case "exahm": - return ec.fieldContext_Room_exahm(ctx, field) - case "seb": - return ec.fieldContext_Room_seb(ctx, field) + case "ancode": + return ec.fieldContext_Exam_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_Exam_zpaExam(ctx, field) + case "externalExam": + return ec.fieldContext_Exam_externalExam(ctx, field) + case "primussExams": + return ec.fieldContext_Exam_primussExams(ctx, field) + case "studentRegs": + return ec.fieldContext_Exam_studentRegs(ctx, field) + case "conflicts": + return ec.fieldContext_Exam_conflicts(ctx, field) + case "connectErrors": + return ec.fieldContext_Exam_connectErrors(ctx, field) + case "constraints": + return ec.fieldContext_Exam_constraints(ctx, field) + case "regularStudents": + return ec.fieldContext_Exam_regularStudents(ctx, field) + case "ntaStudents": + return ec.fieldContext_Exam_ntaStudents(ctx, field) + case "slot": + return ec.fieldContext_Exam_slot(ctx, field) + case "rooms": + return ec.fieldContext_Exam_rooms(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Exam", field.Name) }, } return fc, nil } -func (ec *executionContext) _SlotWithRooms_exahmRooms(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SlotWithRooms_exahmRooms(ctx, field) +func (ec *executionContext) _Query_invigilatorTodos(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_invigilatorTodos(ctx, field) if err != nil { return graphql.Null } @@ -17987,56 +19233,53 @@ func (ec *executionContext) _SlotWithRooms_exahmRooms(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExahmRooms, nil + return ec.resolvers.Query().InvigilatorTodos(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.Room) + res := resTmp.(*model.InvigilationTodos) fc.Result = res - return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) + return ec.marshalOInvigilationTodos2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilationTodos(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SlotWithRooms_exahmRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_invigilatorTodos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SlotWithRooms", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext_Room_name(ctx, field) - case "seats": - return ec.fieldContext_Room_seats(ctx, field) - case "handicap": - return ec.fieldContext_Room_handicap(ctx, field) - case "lab": - return ec.fieldContext_Room_lab(ctx, field) - case "placesWithSocket": - return ec.fieldContext_Room_placesWithSocket(ctx, field) - case "needsRequest": - return ec.fieldContext_Room_needsRequest(ctx, field) - case "exahm": - return ec.fieldContext_Room_exahm(ctx, field) - case "seb": - return ec.fieldContext_Room_seb(ctx, field) + case "sumExamRooms": + return ec.fieldContext_InvigilationTodos_sumExamRooms(ctx, field) + case "sumReserve": + return ec.fieldContext_InvigilationTodos_sumReserve(ctx, field) + case "sumOtherContributions": + return ec.fieldContext_InvigilationTodos_sumOtherContributions(ctx, field) + case "sumOtherContributionsOvertimeCutted": + return ec.fieldContext_InvigilationTodos_sumOtherContributionsOvertimeCutted(ctx, field) + case "invigilatorCount": + return ec.fieldContext_InvigilationTodos_invigilatorCount(ctx, field) + case "todoPerInvigilator": + return ec.fieldContext_InvigilationTodos_todoPerInvigilator(ctx, field) + case "todoPerInvigilatorOvertimeCutted": + return ec.fieldContext_InvigilationTodos_todoPerInvigilatorOvertimeCutted(ctx, field) + case "invigilators": + return ec.fieldContext_InvigilationTodos_invigilators(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) + return nil, fmt.Errorf("no field named %q was found under type InvigilationTodos", field.Name) }, } return fc, nil } -func (ec *executionContext) _SlotWithRooms_labRooms(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SlotWithRooms_labRooms(ctx, field) +func (ec *executionContext) _Query_invigilatorsWithReq(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_invigilatorsWithReq(ctx, field) if err != nil { return graphql.Null } @@ -18049,7 +19292,7 @@ func (ec *executionContext) _SlotWithRooms_labRooms(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LabRooms, nil + return ec.resolvers.Query().InvigilatorsWithReq(rctx) }) if err != nil { ec.Error(ctx, err) @@ -18061,44 +19304,34 @@ func (ec *executionContext) _SlotWithRooms_labRooms(ctx context.Context, field g } return graphql.Null } - res := resTmp.([]*model.Room) + res := resTmp.([]*model.Invigilator) fc.Result = res - return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) + return ec.marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SlotWithRooms_labRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_invigilatorsWithReq(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SlotWithRooms", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext_Room_name(ctx, field) - case "seats": - return ec.fieldContext_Room_seats(ctx, field) - case "handicap": - return ec.fieldContext_Room_handicap(ctx, field) - case "lab": - return ec.fieldContext_Room_lab(ctx, field) - case "placesWithSocket": - return ec.fieldContext_Room_placesWithSocket(ctx, field) - case "needsRequest": - return ec.fieldContext_Room_needsRequest(ctx, field) - case "exahm": - return ec.fieldContext_Room_exahm(ctx, field) - case "seb": - return ec.fieldContext_Room_seb(ctx, field) + case "teacher": + return ec.fieldContext_Invigilator_teacher(ctx, field) + case "requirements": + return ec.fieldContext_Invigilator_requirements(ctx, field) + case "todos": + return ec.fieldContext_Invigilator_todos(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Invigilator", field.Name) }, } return fc, nil } -func (ec *executionContext) _SlotWithRooms_ntaRooms(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SlotWithRooms_ntaRooms(ctx, field) +func (ec *executionContext) _Query_roomsWithInvigilationsForSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_roomsWithInvigilationsForSlot(ctx, field) if err != nil { return graphql.Null } @@ -18111,56 +19344,52 @@ func (ec *executionContext) _SlotWithRooms_ntaRooms(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.NtaRooms, nil + return ec.resolvers.Query().RoomsWithInvigilationsForSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]*model.Room) + res := resTmp.(*model.InvigilationSlot) fc.Result = res - return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) + return ec.marshalOInvigilationSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilationSlot(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SlotWithRooms_ntaRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_roomsWithInvigilationsForSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SlotWithRooms", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "name": - return ec.fieldContext_Room_name(ctx, field) - case "seats": - return ec.fieldContext_Room_seats(ctx, field) - case "handicap": - return ec.fieldContext_Room_handicap(ctx, field) - case "lab": - return ec.fieldContext_Room_lab(ctx, field) - case "placesWithSocket": - return ec.fieldContext_Room_placesWithSocket(ctx, field) - case "needsRequest": - return ec.fieldContext_Room_needsRequest(ctx, field) - case "exahm": - return ec.fieldContext_Room_exahm(ctx, field) - case "seb": - return ec.fieldContext_Room_seb(ctx, field) + case "reserve": + return ec.fieldContext_InvigilationSlot_reserve(ctx, field) + case "roomsWithInvigilators": + return ec.fieldContext_InvigilationSlot_roomsWithInvigilators(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) + return nil, fmt.Errorf("no field named %q was found under type InvigilationSlot", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_roomsWithInvigilationsForSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Starttime_number(ctx context.Context, field graphql.CollectedField, obj *model.Starttime) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Starttime_number(ctx, field) +func (ec *executionContext) _Query_invigilatorsForDay(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_invigilatorsForDay(ctx, field) if err != nil { return graphql.Null } @@ -18173,38 +19402,52 @@ func (ec *executionContext) _Starttime_number(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Number, nil + return ec.resolvers.Query().InvigilatorsForDay(rctx, fc.Args["day"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.InvigilatorsForDay) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOInvigilatorsForDay2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorsForDay(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Starttime_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_invigilatorsForDay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Starttime", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "want": + return ec.fieldContext_InvigilatorsForDay_want(ctx, field) + case "can": + return ec.fieldContext_InvigilatorsForDay_can(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InvigilatorsForDay", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_invigilatorsForDay_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Starttime_start(ctx context.Context, field graphql.CollectedField, obj *model.Starttime) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Starttime_start(ctx, field) +func (ec *executionContext) _Query_ntas(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_ntas(ctx, field) if err != nil { return graphql.Null } @@ -18217,38 +19460,59 @@ func (ec *executionContext) _Starttime_start(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Start, nil + return ec.resolvers.Query().Ntas(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.NTA) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalONTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Starttime_start(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_ntas(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Starttime", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext_NTA_name(ctx, field) + case "email": + return ec.fieldContext_NTA_email(ctx, field) + case "mtknr": + return ec.fieldContext_NTA_mtknr(ctx, field) + case "compensation": + return ec.fieldContext_NTA_compensation(ctx, field) + case "deltaDurationPercent": + return ec.fieldContext_NTA_deltaDurationPercent(ctx, field) + case "needsRoomAlone": + return ec.fieldContext_NTA_needsRoomAlone(ctx, field) + case "program": + return ec.fieldContext_NTA_program(ctx, field) + case "from": + return ec.fieldContext_NTA_from(ctx, field) + case "until": + return ec.fieldContext_NTA_until(ctx, field) + case "lastSemester": + return ec.fieldContext_NTA_lastSemester(ctx, field) + case "exams": + return ec.fieldContext_NTA_exams(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NTA", field.Name) }, } return fc, nil } -func (ec *executionContext) _Step_number(ctx context.Context, field graphql.CollectedField, obj *model.Step) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Step_number(ctx, field) +func (ec *executionContext) _Query_ntasWithRegs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_ntasWithRegs(ctx, field) if err != nil { return graphql.Null } @@ -18261,38 +19525,49 @@ func (ec *executionContext) _Step_number(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Number, nil + return ec.resolvers.Query().NtasWithRegs(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.Student) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalOStudent2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Step_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_ntasWithRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Step", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "mtknr": + return ec.fieldContext_Student_mtknr(ctx, field) + case "program": + return ec.fieldContext_Student_program(ctx, field) + case "group": + return ec.fieldContext_Student_group(ctx, field) + case "name": + return ec.fieldContext_Student_name(ctx, field) + case "regs": + return ec.fieldContext_Student_regs(ctx, field) + case "nta": + return ec.fieldContext_Student_nta(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Student", field.Name) }, } return fc, nil } -func (ec *executionContext) _Step_name(ctx context.Context, field graphql.CollectedField, obj *model.Step) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Step_name(ctx, field) +func (ec *executionContext) _Query_allProgramsInPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_allProgramsInPlan(ctx, field) if err != nil { return graphql.Null } @@ -18305,29 +19580,26 @@ func (ec *executionContext) _Step_name(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Query().AllProgramsInPlan(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Step_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_allProgramsInPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Step", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -18335,8 +19607,8 @@ func (ec *executionContext) fieldContext_Step_name(ctx context.Context, field gr return fc, nil } -func (ec *executionContext) _Step_done(ctx context.Context, field graphql.CollectedField, obj *model.Step) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Step_done(ctx, field) +func (ec *executionContext) _Query_ancodesInPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_ancodesInPlan(ctx, field) if err != nil { return graphql.Null } @@ -18349,38 +19621,35 @@ func (ec *executionContext) _Step_done(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Done, nil + return ec.resolvers.Query().AncodesInPlan(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOInt2ᚕintᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Step_done(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_ancodesInPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Step", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Step_deadline(ctx context.Context, field graphql.CollectedField, obj *model.Step) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Step_deadline(ctx, field) +func (ec *executionContext) _Query_examerInPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_examerInPlan(ctx, field) if err != nil { return graphql.Null } @@ -18393,7 +19662,7 @@ func (ec *executionContext) _Step_deadline(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Deadline, nil + return ec.resolvers.Query().ExamerInPlan(rctx) }) if err != nil { ec.Error(ctx, err) @@ -18402,26 +19671,32 @@ func (ec *executionContext) _Step_deadline(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.([]*model.ExamerInPlan) fc.Result = res - return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalOExamerInPlan2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamerInPlanᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Step_deadline(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_examerInPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Step", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "mainExamer": + return ec.fieldContext_ExamerInPlan_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ExamerInPlan_mainExamerID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExamerInPlan", field.Name) }, } return fc, nil } -func (ec *executionContext) _Student_mtknr(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Student_mtknr(ctx, field) +func (ec *executionContext) _Query_examsInSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_examsInSlot(ctx, field) if err != nil { return graphql.Null } @@ -18434,38 +19709,70 @@ func (ec *executionContext) _Student_mtknr(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Mtknr, nil + return ec.resolvers.Query().ExamsInSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.PlannedExam) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOPlannedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Student_mtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_examsInSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Student", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_PlannedExam_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_PlannedExam_zpaExam(ctx, field) + case "mainExamer": + return ec.fieldContext_PlannedExam_mainExamer(ctx, field) + case "primussExams": + return ec.fieldContext_PlannedExam_primussExams(ctx, field) + case "constraints": + return ec.fieldContext_PlannedExam_constraints(ctx, field) + case "conflicts": + return ec.fieldContext_PlannedExam_conflicts(ctx, field) + case "studentRegsCount": + return ec.fieldContext_PlannedExam_studentRegsCount(ctx, field) + case "ntas": + return ec.fieldContext_PlannedExam_ntas(ctx, field) + case "maxDuration": + return ec.fieldContext_PlannedExam_maxDuration(ctx, field) + case "planEntry": + return ec.fieldContext_PlannedExam_planEntry(ctx, field) + case "plannedRooms": + return ec.fieldContext_PlannedExam_plannedRooms(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PlannedExam", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_examsInSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Student_program(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Student_program(ctx, field) +func (ec *executionContext) _Query_examsWithoutSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_examsWithoutSlot(ctx, field) if err != nil { return graphql.Null } @@ -18478,7 +19785,7 @@ func (ec *executionContext) _Student_program(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Program, nil + return ec.resolvers.Query().ExamsWithoutSlot(rctx) }) if err != nil { ec.Error(ctx, err) @@ -18490,26 +19797,50 @@ func (ec *executionContext) _Student_program(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.PlannedExam) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNPlannedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Student_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_examsWithoutSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Student", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_PlannedExam_ancode(ctx, field) + case "zpaExam": + return ec.fieldContext_PlannedExam_zpaExam(ctx, field) + case "mainExamer": + return ec.fieldContext_PlannedExam_mainExamer(ctx, field) + case "primussExams": + return ec.fieldContext_PlannedExam_primussExams(ctx, field) + case "constraints": + return ec.fieldContext_PlannedExam_constraints(ctx, field) + case "conflicts": + return ec.fieldContext_PlannedExam_conflicts(ctx, field) + case "studentRegsCount": + return ec.fieldContext_PlannedExam_studentRegsCount(ctx, field) + case "ntas": + return ec.fieldContext_PlannedExam_ntas(ctx, field) + case "maxDuration": + return ec.fieldContext_PlannedExam_maxDuration(ctx, field) + case "planEntry": + return ec.fieldContext_PlannedExam_planEntry(ctx, field) + case "plannedRooms": + return ec.fieldContext_PlannedExam_plannedRooms(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PlannedExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _Student_group(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Student_group(ctx, field) +func (ec *executionContext) _Query_allowedSlots(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_allowedSlots(ctx, field) if err != nil { return graphql.Null } @@ -18522,38 +19853,54 @@ func (ec *executionContext) _Student_group(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Group, nil + return ec.resolvers.Query().AllowedSlots(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.Slot) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Student_group(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_allowedSlots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Student", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "dayNumber": + return ec.fieldContext_Slot_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_Slot_slotNumber(ctx, field) + case "starttime": + return ec.fieldContext_Slot_starttime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_allowedSlots_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Student_name(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Student_name(ctx, field) +func (ec *executionContext) _Query_awkwardSlots(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_awkwardSlots(ctx, field) if err != nil { return graphql.Null } @@ -18566,7 +19913,7 @@ func (ec *executionContext) _Student_name(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Query().AwkwardSlots(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) @@ -18578,26 +19925,45 @@ func (ec *executionContext) _Student_name(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.Slot) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Student_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_awkwardSlots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Student", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "dayNumber": + return ec.fieldContext_Slot_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_Slot_slotNumber(ctx, field) + case "starttime": + return ec.fieldContext_Slot_starttime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_awkwardSlots_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _StudentReg_mtknr(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentReg_mtknr(ctx, field) +func (ec *executionContext) _Query_primussExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_primussExams(ctx, field) if err != nil { return graphql.Null } @@ -18610,38 +19976,41 @@ func (ec *executionContext) _StudentReg_mtknr(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Mtknr, nil + return ec.resolvers.Query().PrimussExams(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.PrimussExamByProgram) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOPrimussExamByProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamByProgram(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentReg_mtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_primussExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentReg", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "program": + return ec.fieldContext_PrimussExamByProgram_program(ctx, field) + case "exams": + return ec.fieldContext_PrimussExamByProgram_exams(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PrimussExamByProgram", field.Name) }, } return fc, nil } -func (ec *executionContext) _StudentReg_ancode(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentReg_ancode(ctx, field) +func (ec *executionContext) _Query_rooms(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_rooms(ctx, field) if err != nil { return graphql.Null } @@ -18654,7 +20023,7 @@ func (ec *executionContext) _StudentReg_ancode(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AnCode, nil + return ec.resolvers.Query().Rooms(rctx) }) if err != nil { ec.Error(ctx, err) @@ -18666,26 +20035,44 @@ func (ec *executionContext) _StudentReg_ancode(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.Room) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentReg_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_rooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentReg", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext_Room_name(ctx, field) + case "seats": + return ec.fieldContext_Room_seats(ctx, field) + case "handicap": + return ec.fieldContext_Room_handicap(ctx, field) + case "lab": + return ec.fieldContext_Room_lab(ctx, field) + case "placesWithSocket": + return ec.fieldContext_Room_placesWithSocket(ctx, field) + case "needsRequest": + return ec.fieldContext_Room_needsRequest(ctx, field) + case "exahm": + return ec.fieldContext_Room_exahm(ctx, field) + case "seb": + return ec.fieldContext_Room_seb(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) }, } return fc, nil } -func (ec *executionContext) _StudentReg_program(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentReg_program(ctx, field) +func (ec *executionContext) _Query_plannedRoomNames(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_plannedRoomNames(ctx, field) if err != nil { return graphql.Null } @@ -18698,29 +20085,26 @@ func (ec *executionContext) _StudentReg_program(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Program, nil + return ec.resolvers.Query().PlannedRoomNames(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentReg_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_plannedRoomNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentReg", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, @@ -18728,8 +20112,8 @@ func (ec *executionContext) fieldContext_StudentReg_program(ctx context.Context, return fc, nil } -func (ec *executionContext) _StudentReg_group(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentReg_group(ctx, field) +func (ec *executionContext) _Query_plannedRoomNamesInSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_plannedRoomNamesInSlot(ctx, field) if err != nil { return graphql.Null } @@ -18742,38 +20126,46 @@ func (ec *executionContext) _StudentReg_group(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Group, nil + return ec.resolvers.Query().PlannedRoomNamesInSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentReg_group(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_plannedRoomNamesInSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentReg", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_plannedRoomNamesInSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _StudentReg_name(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentReg_name(ctx, field) +func (ec *executionContext) _Query_plannedRoomsInSlot(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_plannedRoomsInSlot(ctx, field) if err != nil { return graphql.Null } @@ -18786,38 +20178,68 @@ func (ec *executionContext) _StudentReg_name(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return ec.resolvers.Query().PlannedRoomsInSlot(rctx, fc.Args["day"].(int), fc.Args["time"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.PlannedRoom) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOPlannedRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedRoomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentReg_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_plannedRoomsInSlot(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentReg", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "day": + return ec.fieldContext_PlannedRoom_day(ctx, field) + case "slot": + return ec.fieldContext_PlannedRoom_slot(ctx, field) + case "room": + return ec.fieldContext_PlannedRoom_room(ctx, field) + case "ancode": + return ec.fieldContext_PlannedRoom_ancode(ctx, field) + case "duration": + return ec.fieldContext_PlannedRoom_duration(ctx, field) + case "handicap": + return ec.fieldContext_PlannedRoom_handicap(ctx, field) + case "handicapRoomAlone": + return ec.fieldContext_PlannedRoom_handicapRoomAlone(ctx, field) + case "reserve": + return ec.fieldContext_PlannedRoom_reserve(ctx, field) + case "studentsInRoom": + return ec.fieldContext_PlannedRoom_studentsInRoom(ctx, field) + case "ntaMtknr": + return ec.fieldContext_PlannedRoom_ntaMtknr(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PlannedRoom", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_plannedRoomsInSlot_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _StudentReg_presence(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentReg_presence(ctx, field) +func (ec *executionContext) _Query_studentByMtknr(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_studentByMtknr(ctx, field) if err != nil { return graphql.Null } @@ -18830,38 +20252,60 @@ func (ec *executionContext) _StudentReg_presence(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Presence, nil + return ec.resolvers.Query().StudentByMtknr(rctx, fc.Args["mtknr"].(string)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.Student) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOStudent2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudent(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentReg_presence(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_studentByMtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentReg", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "mtknr": + return ec.fieldContext_Student_mtknr(ctx, field) + case "program": + return ec.fieldContext_Student_program(ctx, field) + case "group": + return ec.fieldContext_Student_group(ctx, field) + case "name": + return ec.fieldContext_Student_name(ctx, field) + case "regs": + return ec.fieldContext_Student_regs(ctx, field) + case "nta": + return ec.fieldContext_Student_nta(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Student", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_studentByMtknr_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _StudentRegsPerAncode_ancode(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerAncode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentRegsPerAncode_ancode(ctx, field) +func (ec *executionContext) _Query_studentsByName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_studentsByName(ctx, field) if err != nil { return graphql.Null } @@ -18874,7 +20318,7 @@ func (ec *executionContext) _StudentRegsPerAncode_ancode(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Ancode, nil + return ec.resolvers.Query().StudentsByName(rctx, fc.Args["regex"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -18886,26 +20330,51 @@ func (ec *executionContext) _StudentRegsPerAncode_ancode(ctx context.Context, fi } return graphql.Null } - res := resTmp.(int) + res := resTmp.([]*model.Student) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNStudent2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentRegsPerAncode_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_studentsByName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentRegsPerAncode", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "mtknr": + return ec.fieldContext_Student_mtknr(ctx, field) + case "program": + return ec.fieldContext_Student_program(ctx, field) + case "group": + return ec.fieldContext_Student_group(ctx, field) + case "name": + return ec.fieldContext_Student_name(ctx, field) + case "regs": + return ec.fieldContext_Student_regs(ctx, field) + case "nta": + return ec.fieldContext_Student_nta(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Student", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_studentsByName_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _StudentRegsPerAncode_perProgram(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerAncode) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentRegsPerAncode_perProgram(ctx, field) +func (ec *executionContext) _Query_students(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_students(ctx, field) if err != nil { return graphql.Null } @@ -18918,7 +20387,7 @@ func (ec *executionContext) _StudentRegsPerAncode_perProgram(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PerProgram, nil + return ec.resolvers.Query().Students(rctx) }) if err != nil { ec.Error(ctx, err) @@ -18930,32 +20399,40 @@ func (ec *executionContext) _StudentRegsPerAncode_perProgram(ctx context.Context } return graphql.Null } - res := resTmp.([]*model.StudentRegsPerAncodeAndProgram) + res := resTmp.([]*model.Student) fc.Result = res - return ec.marshalNStudentRegsPerAncodeAndProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgramᚄ(ctx, field.Selections, res) + return ec.marshalNStudent2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentRegsPerAncode_perProgram(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_students(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentRegsPerAncode", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "mtknr": + return ec.fieldContext_Student_mtknr(ctx, field) case "program": - return ec.fieldContext_StudentRegsPerAncodeAndProgram_program(ctx, field) - case "studentRegs": - return ec.fieldContext_StudentRegsPerAncodeAndProgram_studentRegs(ctx, field) + return ec.fieldContext_Student_program(ctx, field) + case "group": + return ec.fieldContext_Student_group(ctx, field) + case "name": + return ec.fieldContext_Student_name(ctx, field) + case "regs": + return ec.fieldContext_Student_regs(ctx, field) + case "nta": + return ec.fieldContext_Student_nta(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type StudentRegsPerAncodeAndProgram", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Student", field.Name) }, } return fc, nil } -func (ec *executionContext) _StudentRegsPerAncodeAndProgram_program(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerAncodeAndProgram) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentRegsPerAncodeAndProgram_program(ctx, field) +func (ec *executionContext) _Query_teacher(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_teacher(ctx, field) if err != nil { return graphql.Null } @@ -18968,38 +20445,68 @@ func (ec *executionContext) _StudentRegsPerAncodeAndProgram_program(ctx context. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Program, nil + return ec.resolvers.Query().Teacher(rctx, fc.Args["id"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.Teacher) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentRegsPerAncodeAndProgram_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_teacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentRegsPerAncodeAndProgram", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "shortname": + return ec.fieldContext_Teacher_shortname(ctx, field) + case "fullname": + return ec.fieldContext_Teacher_fullname(ctx, field) + case "isProf": + return ec.fieldContext_Teacher_isProf(ctx, field) + case "isLBA": + return ec.fieldContext_Teacher_isLBA(ctx, field) + case "isProfHC": + return ec.fieldContext_Teacher_isProfHC(ctx, field) + case "isStaff": + return ec.fieldContext_Teacher_isStaff(ctx, field) + case "lastSemester": + return ec.fieldContext_Teacher_lastSemester(ctx, field) + case "fk": + return ec.fieldContext_Teacher_fk(ctx, field) + case "id": + return ec.fieldContext_Teacher_id(ctx, field) + case "email": + return ec.fieldContext_Teacher_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_teacher_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _StudentRegsPerAncodeAndProgram_studentRegs(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerAncodeAndProgram) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentRegsPerAncodeAndProgram_studentRegs(ctx, field) +func (ec *executionContext) _Query_teachers(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_teachers(ctx, field) if err != nil { return graphql.Null } @@ -19012,7 +20519,7 @@ func (ec *executionContext) _StudentRegsPerAncodeAndProgram_studentRegs(ctx cont }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.StudentRegs, nil + return ec.resolvers.Query().Teachers(rctx, fc.Args["fromZPA"].(*bool)) }) if err != nil { ec.Error(ctx, err) @@ -19024,40 +20531,59 @@ func (ec *executionContext) _StudentRegsPerAncodeAndProgram_studentRegs(ctx cont } return graphql.Null } - res := resTmp.([]*model.StudentReg) + res := resTmp.([]*model.Teacher) fc.Result = res - return ec.marshalNStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx, field.Selections, res) + return ec.marshalNTeacher2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacherᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentRegsPerAncodeAndProgram_studentRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_teachers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentRegsPerAncodeAndProgram", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "mtknr": - return ec.fieldContext_StudentReg_mtknr(ctx, field) - case "ancode": - return ec.fieldContext_StudentReg_ancode(ctx, field) - case "program": - return ec.fieldContext_StudentReg_program(ctx, field) - case "group": - return ec.fieldContext_StudentReg_group(ctx, field) - case "name": - return ec.fieldContext_StudentReg_name(ctx, field) - case "presence": - return ec.fieldContext_StudentReg_presence(ctx, field) + case "shortname": + return ec.fieldContext_Teacher_shortname(ctx, field) + case "fullname": + return ec.fieldContext_Teacher_fullname(ctx, field) + case "isProf": + return ec.fieldContext_Teacher_isProf(ctx, field) + case "isLBA": + return ec.fieldContext_Teacher_isLBA(ctx, field) + case "isProfHC": + return ec.fieldContext_Teacher_isProfHC(ctx, field) + case "isStaff": + return ec.fieldContext_Teacher_isStaff(ctx, field) + case "lastSemester": + return ec.fieldContext_Teacher_lastSemester(ctx, field) + case "fk": + return ec.fieldContext_Teacher_fk(ctx, field) + case "id": + return ec.fieldContext_Teacher_id(ctx, field) + case "email": + return ec.fieldContext_Teacher_email(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type StudentReg", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_teachers_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _StudentRegsPerStudent_student(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerStudent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentRegsPerStudent_student(ctx, field) +func (ec *executionContext) _Query_invigilators(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_invigilators(ctx, field) if err != nil { return graphql.Null } @@ -19070,7 +20596,7 @@ func (ec *executionContext) _StudentRegsPerStudent_student(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Student, nil + return ec.resolvers.Query().Invigilators(rctx) }) if err != nil { ec.Error(ctx, err) @@ -19082,36 +20608,32 @@ func (ec *executionContext) _StudentRegsPerStudent_student(ctx context.Context, } return graphql.Null } - res := resTmp.(*model.Student) + res := resTmp.([]*model.ZPAInvigilator) fc.Result = res - return ec.marshalNStudent2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudent(ctx, field.Selections, res) + return ec.marshalNZPAInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAInvigilatorᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentRegsPerStudent_student(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_invigilators(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentRegsPerStudent", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "mtknr": - return ec.fieldContext_Student_mtknr(ctx, field) - case "program": - return ec.fieldContext_Student_program(ctx, field) - case "group": - return ec.fieldContext_Student_group(ctx, field) - case "name": - return ec.fieldContext_Student_name(ctx, field) + case "teacher": + return ec.fieldContext_ZPAInvigilator_teacher(ctx, field) + case "hasSubmittedRequirements": + return ec.fieldContext_ZPAInvigilator_hasSubmittedRequirements(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Student", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ZPAInvigilator", field.Name) }, } return fc, nil } -func (ec *executionContext) _StudentRegsPerStudent_ancodes(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerStudent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_StudentRegsPerStudent_ancodes(ctx, field) +func (ec *executionContext) _Query_fk07programs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_fk07programs(ctx, field) if err != nil { return graphql.Null } @@ -19124,7 +20646,7 @@ func (ec *executionContext) _StudentRegsPerStudent_ancodes(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Ancodes, nil + return ec.resolvers.Query().Fk07programs(rctx) }) if err != nil { ec.Error(ctx, err) @@ -19136,26 +20658,30 @@ func (ec *executionContext) _StudentRegsPerStudent_ancodes(ctx context.Context, } return graphql.Null } - res := resTmp.([]int) + res := resTmp.([]*model.FK07Program) fc.Result = res - return ec.marshalNInt2ᚕintᚄ(ctx, field.Selections, res) + return ec.marshalNFK07Program2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐFK07Programᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StudentRegsPerStudent_ancodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_fk07programs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "StudentRegsPerStudent", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext_FK07Program_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type FK07Program", field.Name) }, } return fc, nil } -func (ec *executionContext) _Teacher_shortname(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Teacher_shortname(ctx, field) +func (ec *executionContext) _Query_zpaExams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_zpaExams(ctx, field) if err != nil { return graphql.Null } @@ -19168,7 +20694,7 @@ func (ec *executionContext) _Teacher_shortname(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Shortname, nil + return ec.resolvers.Query().ZpaExams(rctx, fc.Args["fromZPA"].(*bool)) }) if err != nil { ec.Error(ctx, err) @@ -19180,26 +20706,63 @@ func (ec *executionContext) _Teacher_shortname(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.ZPAExam) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Teacher_shortname(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_zpaExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Teacher", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_zpaExams_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Teacher_fullname(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Teacher_fullname(ctx, field) +func (ec *executionContext) _Query_zpaExamsByType(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_zpaExamsByType(ctx, field) if err != nil { return graphql.Null } @@ -19212,7 +20775,7 @@ func (ec *executionContext) _Teacher_fullname(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Fullname, nil + return ec.resolvers.Query().ZpaExamsByType(rctx) }) if err != nil { ec.Error(ctx, err) @@ -19224,26 +20787,32 @@ func (ec *executionContext) _Teacher_fullname(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.ZPAExamsForType) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNZPAExamsForType2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamsForTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Teacher_fullname(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_zpaExamsByType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Teacher", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "type": + return ec.fieldContext_ZPAExamsForType_type(ctx, field) + case "exams": + return ec.fieldContext_ZPAExamsForType_exams(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExamsForType", field.Name) }, } return fc, nil } -func (ec *executionContext) _Teacher_isProf(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Teacher_isProf(ctx, field) +func (ec *executionContext) _Query_zpaExamsToPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_zpaExamsToPlan(ctx, field) if err != nil { return graphql.Null } @@ -19256,7 +20825,7 @@ func (ec *executionContext) _Teacher_isProf(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsProf, nil + return ec.resolvers.Query().ZpaExamsToPlan(rctx) }) if err != nil { ec.Error(ctx, err) @@ -19268,26 +20837,52 @@ func (ec *executionContext) _Teacher_isProf(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.ZPAExam) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Teacher_isProf(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_zpaExamsToPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Teacher", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _Teacher_isLBA(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Teacher_isLBA(ctx, field) +func (ec *executionContext) _Query_zpaExamsNotToPlan(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_zpaExamsNotToPlan(ctx, field) if err != nil { return graphql.Null } @@ -19300,7 +20895,7 @@ func (ec *executionContext) _Teacher_isLBA(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsLBA, nil + return ec.resolvers.Query().ZpaExamsNotToPlan(rctx) }) if err != nil { ec.Error(ctx, err) @@ -19312,26 +20907,52 @@ func (ec *executionContext) _Teacher_isLBA(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.ZPAExam) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Teacher_isLBA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_zpaExamsNotToPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Teacher", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _Teacher_isProfHC(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Teacher_isProfHC(ctx, field) +func (ec *executionContext) _Query_zpaExamsPlaningStatusUnknown(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_zpaExamsPlaningStatusUnknown(ctx, field) if err != nil { return graphql.Null } @@ -19344,7 +20965,7 @@ func (ec *executionContext) _Teacher_isProfHC(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsProfHC, nil + return ec.resolvers.Query().ZpaExamsPlaningStatusUnknown(rctx) }) if err != nil { ec.Error(ctx, err) @@ -19356,26 +20977,52 @@ func (ec *executionContext) _Teacher_isProfHC(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.ZPAExam) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Teacher_isProfHC(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_zpaExamsPlaningStatusUnknown(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Teacher", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, } return fc, nil } -func (ec *executionContext) _Teacher_isStaff(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Teacher_isStaff(ctx, field) +func (ec *executionContext) _Query_zpaExam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_zpaExam(ctx, field) if err != nil { return graphql.Null } @@ -19388,38 +21035,72 @@ func (ec *executionContext) _Teacher_isStaff(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsStaff, nil + return ec.resolvers.Query().ZpaExam(rctx, fc.Args["ancode"].(int)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*model.ZPAExam) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Teacher_isStaff(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_zpaExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Teacher", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_zpaExam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Teacher_lastSemester(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Teacher_lastSemester(ctx, field) +func (ec *executionContext) _Query_zpaAnCodes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_zpaAnCodes(ctx, field) if err != nil { return graphql.Null } @@ -19432,38 +21113,39 @@ func (ec *executionContext) _Teacher_lastSemester(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LastSemester, nil + return ec.resolvers.Query().ZpaAnCodes(rctx) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.AnCode) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOAnCode2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAnCode(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Teacher_lastSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_zpaAnCodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Teacher", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_AnCode_ancode(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AnCode", field.Name) }, } return fc, nil } -func (ec *executionContext) _Teacher_fk(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Teacher_fk(ctx, field) +func (ec *executionContext) _Query_studentRegsImportErrors(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_studentRegsImportErrors(ctx, field) if err != nil { return graphql.Null } @@ -19476,7 +21158,7 @@ func (ec *executionContext) _Teacher_fk(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.FK, nil + return ec.resolvers.Query().StudentRegsImportErrors(rctx) }) if err != nil { ec.Error(ctx, err) @@ -19488,26 +21170,32 @@ func (ec *executionContext) _Teacher_fk(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.RegWithError) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNRegWithError2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRegWithErrorᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Teacher_fk(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_studentRegsImportErrors(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Teacher", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "registration": + return ec.fieldContext_RegWithError_registration(ctx, field) + case "error": + return ec.fieldContext_RegWithError_error(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RegWithError", field.Name) }, } return fc, nil } -func (ec *executionContext) _Teacher_id(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Teacher_id(ctx, field) +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) if err != nil { return graphql.Null } @@ -19520,38 +21208,68 @@ func (ec *executionContext) _Teacher_id(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return ec.introspectType(fc.Args["name"].(string)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*introspection.Type) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Teacher_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Teacher", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) }, } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } return fc, nil } -func (ec *executionContext) _Teacher_email(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Teacher_email(ctx, field) +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) if err != nil { return graphql.Null } @@ -19564,38 +21282,49 @@ func (ec *executionContext) _Teacher_email(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Email, nil + return ec.introspectSchema() }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*introspection.Schema) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Teacher_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Teacher", + Object: "Query", Field: field, - IsMethod: false, + IsMethod: true, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) }, } return fc, nil } -func (ec *executionContext) _ZPAExam_zpaID(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_zpaID(ctx, field) +func (ec *executionContext) _RegWithError_registration(ctx context.Context, field graphql.CollectedField, obj *model.RegWithError) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegWithError_registration(ctx, field) if err != nil { return graphql.Null } @@ -19608,7 +21337,7 @@ func (ec *executionContext) _ZPAExam_zpaID(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ZpaID, nil + return obj.Registration, nil }) if err != nil { ec.Error(ctx, err) @@ -19620,26 +21349,34 @@ func (ec *executionContext) _ZPAExam_zpaID(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.ZPAStudentReg) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNZPAStudentReg2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAStudentReg(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_zpaID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegWithError_registration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "RegWithError", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "ancode": + return ec.fieldContext_ZPAStudentReg_ancode(ctx, field) + case "mtknr": + return ec.fieldContext_ZPAStudentReg_mtknr(ctx, field) + case "program": + return ec.fieldContext_ZPAStudentReg_program(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAStudentReg", field.Name) }, } return fc, nil } -func (ec *executionContext) _ZPAExam_semester(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_semester(ctx, field) +func (ec *executionContext) _RegWithError_error(ctx context.Context, field graphql.CollectedField, obj *model.RegWithError) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegWithError_error(ctx, field) if err != nil { return graphql.Null } @@ -19652,7 +21389,7 @@ func (ec *executionContext) _ZPAExam_semester(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Semester, nil + return obj.Error, nil }) if err != nil { ec.Error(ctx, err) @@ -19664,26 +21401,38 @@ func (ec *executionContext) _ZPAExam_semester(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.ZPAStudentRegError) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNZPAStudentRegError2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAStudentRegError(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_semester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegWithError_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "RegWithError", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "semester": + return ec.fieldContext_ZPAStudentRegError_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAStudentRegError_ancode(ctx, field) + case "exam": + return ec.fieldContext_ZPAStudentRegError_exam(ctx, field) + case "mtknr": + return ec.fieldContext_ZPAStudentRegError_mtknr(ctx, field) + case "program": + return ec.fieldContext_ZPAStudentRegError_program(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAStudentRegError", field.Name) }, } return fc, nil } -func (ec *executionContext) _ZPAExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_ancode(ctx, field) +func (ec *executionContext) _Room_name(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Room_name(ctx, field) if err != nil { return graphql.Null } @@ -19696,7 +21445,7 @@ func (ec *executionContext) _ZPAExam_ancode(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AnCode, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -19708,26 +21457,26 @@ func (ec *executionContext) _ZPAExam_ancode(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Room_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "Room", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAExam_module(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_module(ctx, field) +func (ec *executionContext) _Room_seats(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Room_seats(ctx, field) if err != nil { return graphql.Null } @@ -19740,7 +21489,7 @@ func (ec *executionContext) _ZPAExam_module(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Module, nil + return obj.Seats, nil }) if err != nil { ec.Error(ctx, err) @@ -19752,26 +21501,26 @@ func (ec *executionContext) _ZPAExam_module(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_module(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Room_seats(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "Room", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAExam_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_mainExamer(ctx, field) +func (ec *executionContext) _Room_handicap(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Room_handicap(ctx, field) if err != nil { return graphql.Null } @@ -19784,7 +21533,7 @@ func (ec *executionContext) _ZPAExam_mainExamer(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MainExamer, nil + return obj.Handicap, nil }) if err != nil { ec.Error(ctx, err) @@ -19796,26 +21545,26 @@ func (ec *executionContext) _ZPAExam_mainExamer(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Room_handicap(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "Room", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAExam_mainExamerID(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_mainExamerID(ctx, field) +func (ec *executionContext) _Room_lab(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Room_lab(ctx, field) if err != nil { return graphql.Null } @@ -19828,7 +21577,7 @@ func (ec *executionContext) _ZPAExam_mainExamerID(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MainExamerID, nil + return obj.Lab, nil }) if err != nil { ec.Error(ctx, err) @@ -19840,26 +21589,26 @@ func (ec *executionContext) _ZPAExam_mainExamerID(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(int) + res := resTmp.(bool) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_mainExamerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Room_lab(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "Room", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAExam_examType(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_examType(ctx, field) +func (ec *executionContext) _Room_placesWithSocket(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Room_placesWithSocket(ctx, field) if err != nil { return graphql.Null } @@ -19872,7 +21621,7 @@ func (ec *executionContext) _ZPAExam_examType(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExamType, nil + return obj.PlacesWithSocket, nil }) if err != nil { ec.Error(ctx, err) @@ -19884,26 +21633,26 @@ func (ec *executionContext) _ZPAExam_examType(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_examType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Room_placesWithSocket(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "Room", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAExam_examTypeFull(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_examTypeFull(ctx, field) +func (ec *executionContext) _Room_needsRequest(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Room_needsRequest(ctx, field) if err != nil { return graphql.Null } @@ -19916,7 +21665,7 @@ func (ec *executionContext) _ZPAExam_examTypeFull(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ExamTypeFull, nil + return obj.NeedsRequest, nil }) if err != nil { ec.Error(ctx, err) @@ -19928,26 +21677,26 @@ func (ec *executionContext) _ZPAExam_examTypeFull(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_examTypeFull(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Room_needsRequest(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "Room", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAExam_duration(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_duration(ctx, field) +func (ec *executionContext) _Room_exahm(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Room_exahm(ctx, field) if err != nil { return graphql.Null } @@ -19960,7 +21709,7 @@ func (ec *executionContext) _ZPAExam_duration(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Duration, nil + return obj.Exahm, nil }) if err != nil { ec.Error(ctx, err) @@ -19972,26 +21721,26 @@ func (ec *executionContext) _ZPAExam_duration(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(int) + res := resTmp.(bool) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_duration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Room_exahm(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "Room", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAExam_isRepeaterExam(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) +func (ec *executionContext) _Room_seb(ctx context.Context, field graphql.CollectedField, obj *model.Room) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Room_seb(ctx, field) if err != nil { return graphql.Null } @@ -20004,7 +21753,7 @@ func (ec *executionContext) _ZPAExam_isRepeaterExam(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeaterExam, nil + return obj.Seb, nil }) if err != nil { ec.Error(ctx, err) @@ -20021,9 +21770,9 @@ func (ec *executionContext) _ZPAExam_isRepeaterExam(ctx context.Context, field g return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_isRepeaterExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Room_seb(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "Room", Field: field, IsMethod: false, IsResolver: false, @@ -20034,8 +21783,8 @@ func (ec *executionContext) fieldContext_ZPAExam_isRepeaterExam(ctx context.Cont return fc, nil } -func (ec *executionContext) _ZPAExam_groups(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExam_groups(ctx, field) +func (ec *executionContext) _RoomAndExam_room(ctx context.Context, field graphql.CollectedField, obj *model.RoomAndExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomAndExam_room(ctx, field) if err != nil { return graphql.Null } @@ -20048,7 +21797,7 @@ func (ec *executionContext) _ZPAExam_groups(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Groups, nil + return obj.Room, nil }) if err != nil { ec.Error(ctx, err) @@ -20060,26 +21809,48 @@ func (ec *executionContext) _ZPAExam_groups(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]string) + res := resTmp.(*model.PlannedRoom) fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalNPlannedRoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedRoom(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExam_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomAndExam_room(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExam", + Object: "RoomAndExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "day": + return ec.fieldContext_PlannedRoom_day(ctx, field) + case "slot": + return ec.fieldContext_PlannedRoom_slot(ctx, field) + case "room": + return ec.fieldContext_PlannedRoom_room(ctx, field) + case "ancode": + return ec.fieldContext_PlannedRoom_ancode(ctx, field) + case "duration": + return ec.fieldContext_PlannedRoom_duration(ctx, field) + case "handicap": + return ec.fieldContext_PlannedRoom_handicap(ctx, field) + case "handicapRoomAlone": + return ec.fieldContext_PlannedRoom_handicapRoomAlone(ctx, field) + case "reserve": + return ec.fieldContext_PlannedRoom_reserve(ctx, field) + case "studentsInRoom": + return ec.fieldContext_PlannedRoom_studentsInRoom(ctx, field) + case "ntaMtknr": + return ec.fieldContext_PlannedRoom_ntaMtknr(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PlannedRoom", field.Name) }, } return fc, nil } -func (ec *executionContext) _ZPAExamWithConstraints_zpaExam(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExamWithConstraints) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExamWithConstraints_zpaExam(ctx, field) +func (ec *executionContext) _RoomAndExam_exam(ctx context.Context, field graphql.CollectedField, obj *model.RoomAndExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomAndExam_exam(ctx, field) if err != nil { return graphql.Null } @@ -20092,7 +21863,7 @@ func (ec *executionContext) _ZPAExamWithConstraints_zpaExam(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ZpaExam, nil + return obj.Exam, nil }) if err != nil { ec.Error(ctx, err) @@ -20109,9 +21880,9 @@ func (ec *executionContext) _ZPAExamWithConstraints_zpaExam(ctx context.Context, return ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExamWithConstraints_zpaExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomAndExam_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExamWithConstraints", + Object: "RoomAndExam", Field: field, IsMethod: false, IsResolver: false, @@ -20139,6 +21910,8 @@ func (ec *executionContext) fieldContext_ZPAExamWithConstraints_zpaExam(ctx cont return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) case "groups": return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) }, @@ -20146,8 +21919,8 @@ func (ec *executionContext) fieldContext_ZPAExamWithConstraints_zpaExam(ctx cont return fc, nil } -func (ec *executionContext) _ZPAExamWithConstraints_constraints(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExamWithConstraints) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExamWithConstraints_constraints(ctx, field) +func (ec *executionContext) _RoomConstraints_placesWithSocket(ctx context.Context, field graphql.CollectedField, obj *model.RoomConstraints) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomConstraints_placesWithSocket(ctx, field) if err != nil { return graphql.Null } @@ -20160,55 +21933,38 @@ func (ec *executionContext) _ZPAExamWithConstraints_constraints(ctx context.Cont }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Constraints, nil + return obj.PlacesWithSocket, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Constraints) + res := resTmp.(bool) fc.Result = res - return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExamWithConstraints_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomConstraints_placesWithSocket(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExamWithConstraints", + Object: "RoomConstraints", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ancode": - return ec.fieldContext_Constraints_ancode(ctx, field) - case "notPlannedByMe": - return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) - case "excludeDays": - return ec.fieldContext_Constraints_excludeDays(ctx, field) - case "possibleDays": - return ec.fieldContext_Constraints_possibleDays(ctx, field) - case "fixedDay": - return ec.fieldContext_Constraints_fixedDay(ctx, field) - case "fixedTime": - return ec.fieldContext_Constraints_fixedTime(ctx, field) - case "sameSlot": - return ec.fieldContext_Constraints_sameSlot(ctx, field) - case "online": - return ec.fieldContext_Constraints_online(ctx, field) - case "roomConstraints": - return ec.fieldContext_Constraints_roomConstraints(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAExamsForType_type(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExamsForType) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExamsForType_type(ctx, field) +func (ec *executionContext) _RoomConstraints_lab(ctx context.Context, field graphql.CollectedField, obj *model.RoomConstraints) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomConstraints_lab(ctx, field) if err != nil { return graphql.Null } @@ -20221,7 +21977,7 @@ func (ec *executionContext) _ZPAExamsForType_type(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.Lab, nil }) if err != nil { ec.Error(ctx, err) @@ -20233,26 +21989,26 @@ func (ec *executionContext) _ZPAExamsForType_type(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExamsForType_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomConstraints_lab(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExamsForType", + Object: "RoomConstraints", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAExamsForType_exams(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExamsForType) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAExamsForType_exams(ctx, field) +func (ec *executionContext) _RoomConstraints_exahmRooms(ctx context.Context, field graphql.CollectedField, obj *model.RoomConstraints) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomConstraints_exahmRooms(ctx, field) if err != nil { return graphql.Null } @@ -20265,7 +22021,7 @@ func (ec *executionContext) _ZPAExamsForType_exams(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exams, nil + return obj.ExahmRooms, nil }) if err != nil { ec.Error(ctx, err) @@ -20277,50 +22033,26 @@ func (ec *executionContext) _ZPAExamsForType_exams(ctx context.Context, field gr } return graphql.Null } - res := resTmp.([]*model.ZPAExam) + res := resTmp.(bool) fc.Result = res - return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAExamsForType_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomConstraints_exahmRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAExamsForType", + Object: "RoomConstraints", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "zpaID": - return ec.fieldContext_ZPAExam_zpaID(ctx, field) - case "semester": - return ec.fieldContext_ZPAExam_semester(ctx, field) - case "ancode": - return ec.fieldContext_ZPAExam_ancode(ctx, field) - case "module": - return ec.fieldContext_ZPAExam_module(ctx, field) - case "mainExamer": - return ec.fieldContext_ZPAExam_mainExamer(ctx, field) - case "mainExamerID": - return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) - case "examType": - return ec.fieldContext_ZPAExam_examType(ctx, field) - case "examTypeFull": - return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) - case "duration": - return ec.fieldContext_ZPAExam_duration(ctx, field) - case "isRepeaterExam": - return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) - case "groups": - return ec.fieldContext_ZPAExam_groups(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAInvigilator_teacher(ctx context.Context, field graphql.CollectedField, obj *model.ZPAInvigilator) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAInvigilator_teacher(ctx, field) +func (ec *executionContext) _RoomConstraints_seb(ctx context.Context, field graphql.CollectedField, obj *model.RoomConstraints) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomConstraints_seb(ctx, field) if err != nil { return graphql.Null } @@ -20333,7 +22065,7 @@ func (ec *executionContext) _ZPAInvigilator_teacher(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Teacher, nil + return obj.Seb, nil }) if err != nil { ec.Error(ctx, err) @@ -20345,48 +22077,26 @@ func (ec *executionContext) _ZPAInvigilator_teacher(ctx context.Context, field g } return graphql.Null } - res := resTmp.(*model.Teacher) + res := resTmp.(bool) fc.Result = res - return ec.marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAInvigilator_teacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomConstraints_seb(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAInvigilator", + Object: "RoomConstraints", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "shortname": - return ec.fieldContext_Teacher_shortname(ctx, field) - case "fullname": - return ec.fieldContext_Teacher_fullname(ctx, field) - case "isProf": - return ec.fieldContext_Teacher_isProf(ctx, field) - case "isLBA": - return ec.fieldContext_Teacher_isLBA(ctx, field) - case "isProfHC": - return ec.fieldContext_Teacher_isProfHC(ctx, field) - case "isStaff": - return ec.fieldContext_Teacher_isStaff(ctx, field) - case "lastSemester": - return ec.fieldContext_Teacher_lastSemester(ctx, field) - case "fk": - return ec.fieldContext_Teacher_fk(ctx, field) - case "id": - return ec.fieldContext_Teacher_id(ctx, field) - case "email": - return ec.fieldContext_Teacher_email(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAInvigilator_hasSubmittedRequirements(ctx context.Context, field graphql.CollectedField, obj *model.ZPAInvigilator) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAInvigilator_hasSubmittedRequirements(ctx, field) +func (ec *executionContext) _RoomForExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomForExam_ancode(ctx, field) if err != nil { return graphql.Null } @@ -20399,7 +22109,7 @@ func (ec *executionContext) _ZPAInvigilator_hasSubmittedRequirements(ctx context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.HasSubmittedRequirements, nil + return obj.Ancode, nil }) if err != nil { ec.Error(ctx, err) @@ -20411,26 +22121,26 @@ func (ec *executionContext) _ZPAInvigilator_hasSubmittedRequirements(ctx context } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAInvigilator_hasSubmittedRequirements(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomForExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAInvigilator", + Object: "RoomForExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAStudentReg_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentReg) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAStudentReg_ancode(ctx, field) +func (ec *executionContext) _RoomForExam_room(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomForExam_room(ctx, field) if err != nil { return graphql.Null } @@ -20443,38 +22153,53 @@ func (ec *executionContext) _ZPAStudentReg_ancode(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AnCode, nil + return ec.resolvers.RoomForExam().Room(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(int) + res := resTmp.(*model.Room) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalORoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoom(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAStudentReg_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomForExam_room(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAStudentReg", + Object: "RoomForExam", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext_Room_name(ctx, field) + case "seats": + return ec.fieldContext_Room_seats(ctx, field) + case "handicap": + return ec.fieldContext_Room_handicap(ctx, field) + case "lab": + return ec.fieldContext_Room_lab(ctx, field) + case "placesWithSocket": + return ec.fieldContext_Room_placesWithSocket(ctx, field) + case "needsRequest": + return ec.fieldContext_Room_needsRequest(ctx, field) + case "exahm": + return ec.fieldContext_Room_exahm(ctx, field) + case "seb": + return ec.fieldContext_Room_seb(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) }, } return fc, nil } -func (ec *executionContext) _ZPAStudentReg_mtknr(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentReg) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAStudentReg_mtknr(ctx, field) +func (ec *executionContext) _RoomForExam_seatsPlanned(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomForExam_seatsPlanned(ctx, field) if err != nil { return graphql.Null } @@ -20487,7 +22212,7 @@ func (ec *executionContext) _ZPAStudentReg_mtknr(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Mtknr, nil + return obj.SeatsPlanned, nil }) if err != nil { ec.Error(ctx, err) @@ -20499,26 +22224,26 @@ func (ec *executionContext) _ZPAStudentReg_mtknr(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAStudentReg_mtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomForExam_seatsPlanned(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAStudentReg", + Object: "RoomForExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAStudentReg_program(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentReg) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAStudentReg_program(ctx, field) +func (ec *executionContext) _RoomForExam_duration(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomForExam_duration(ctx, field) if err != nil { return graphql.Null } @@ -20531,7 +22256,7 @@ func (ec *executionContext) _ZPAStudentReg_program(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Program, nil + return obj.Duration, nil }) if err != nil { ec.Error(ctx, err) @@ -20543,26 +22268,26 @@ func (ec *executionContext) _ZPAStudentReg_program(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAStudentReg_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomForExam_duration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAStudentReg", + Object: "RoomForExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAStudentRegError_semester(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentRegError) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAStudentRegError_semester(ctx, field) +func (ec *executionContext) _RoomForExam_handicap(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomForExam_handicap(ctx, field) if err != nil { return graphql.Null } @@ -20575,7 +22300,7 @@ func (ec *executionContext) _ZPAStudentRegError_semester(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Semester, nil + return obj.Handicap, nil }) if err != nil { ec.Error(ctx, err) @@ -20587,26 +22312,26 @@ func (ec *executionContext) _ZPAStudentRegError_semester(ctx context.Context, fi } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAStudentRegError_semester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomForExam_handicap(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAStudentRegError", + Object: "RoomForExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAStudentRegError_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentRegError) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAStudentRegError_ancode(ctx, field) +func (ec *executionContext) _RoomForExam_reserve(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomForExam_reserve(ctx, field) if err != nil { return graphql.Null } @@ -20619,7 +22344,7 @@ func (ec *executionContext) _ZPAStudentRegError_ancode(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AnCode, nil + return obj.Reserve, nil }) if err != nil { ec.Error(ctx, err) @@ -20631,26 +22356,26 @@ func (ec *executionContext) _ZPAStudentRegError_ancode(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAStudentRegError_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomForExam_reserve(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAStudentRegError", + Object: "RoomForExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ZPAStudentRegError_exam(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentRegError) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAStudentRegError_exam(ctx, field) +func (ec *executionContext) _RoomForExam_students(ctx context.Context, field graphql.CollectedField, obj *model.RoomForExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomForExam_students(ctx, field) if err != nil { return graphql.Null } @@ -20663,7 +22388,7 @@ func (ec *executionContext) _ZPAStudentRegError_exam(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Exam, nil + return obj.Students, nil }) if err != nil { ec.Error(ctx, err) @@ -20675,26 +22400,40 @@ func (ec *executionContext) _ZPAStudentRegError_exam(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.StudentReg) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAStudentRegError_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomForExam_students(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAStudentRegError", + Object: "RoomForExam", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "mtknr": + return ec.fieldContext_StudentReg_mtknr(ctx, field) + case "ancode": + return ec.fieldContext_StudentReg_ancode(ctx, field) + case "program": + return ec.fieldContext_StudentReg_program(ctx, field) + case "group": + return ec.fieldContext_StudentReg_group(ctx, field) + case "name": + return ec.fieldContext_StudentReg_name(ctx, field) + case "presence": + return ec.fieldContext_StudentReg_presence(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type StudentReg", field.Name) }, } return fc, nil } -func (ec *executionContext) _ZPAStudentRegError_mtknr(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentRegError) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAStudentRegError_mtknr(ctx, field) +func (ec *executionContext) _RoomWithInvigilator_name(ctx context.Context, field graphql.CollectedField, obj *model.RoomWithInvigilator) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomWithInvigilator_name(ctx, field) if err != nil { return graphql.Null } @@ -20707,7 +22446,7 @@ func (ec *executionContext) _ZPAStudentRegError_mtknr(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Mtknr, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -20724,9 +22463,9 @@ func (ec *executionContext) _ZPAStudentRegError_mtknr(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAStudentRegError_mtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomWithInvigilator_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAStudentRegError", + Object: "RoomWithInvigilator", Field: field, IsMethod: false, IsResolver: false, @@ -20737,8 +22476,8 @@ func (ec *executionContext) fieldContext_ZPAStudentRegError_mtknr(ctx context.Co return fc, nil } -func (ec *executionContext) _ZPAStudentRegError_program(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentRegError) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ZPAStudentRegError_program(ctx, field) +func (ec *executionContext) _RoomWithInvigilator_maxDuration(ctx context.Context, field graphql.CollectedField, obj *model.RoomWithInvigilator) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomWithInvigilator_maxDuration(ctx, field) if err != nil { return graphql.Null } @@ -20751,7 +22490,7 @@ func (ec *executionContext) _ZPAStudentRegError_program(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Program, nil + return obj.MaxDuration, nil }) if err != nil { ec.Error(ctx, err) @@ -20763,26 +22502,26 @@ func (ec *executionContext) _ZPAStudentRegError_program(ctx context.Context, fie } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ZPAStudentRegError_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomWithInvigilator_maxDuration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ZPAStudentRegError", + Object: "RoomWithInvigilator", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) +func (ec *executionContext) _RoomWithInvigilator_studentCount(ctx context.Context, field graphql.CollectedField, obj *model.RoomWithInvigilator) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomWithInvigilator_studentCount(ctx, field) if err != nil { return graphql.Null } @@ -20795,7 +22534,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.StudentCount, nil }) if err != nil { ec.Error(ctx, err) @@ -20807,26 +22546,26 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomWithInvigilator_studentCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "RoomWithInvigilator", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) +func (ec *executionContext) _RoomWithInvigilator_roomAndExams(ctx context.Context, field graphql.CollectedField, obj *model.RoomWithInvigilator) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomWithInvigilator_roomAndExams(ctx, field) if err != nil { return graphql.Null } @@ -20839,35 +22578,44 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.RoomAndExams, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]*model.RoomAndExam) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNRoomAndExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomAndExamᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomWithInvigilator_roomAndExams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "RoomWithInvigilator", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "room": + return ec.fieldContext_RoomAndExam_room(ctx, field) + case "exam": + return ec.fieldContext_RoomAndExam_exam(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RoomAndExam", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) +func (ec *executionContext) _RoomWithInvigilator_invigilator(ctx context.Context, field graphql.CollectedField, obj *model.RoomWithInvigilator) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RoomWithInvigilator_invigilator(ctx, field) if err != nil { return graphql.Null } @@ -20880,38 +22628,57 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Locations, nil + return obj.Invigilator, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]string) + res := resTmp.(*model.Teacher) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalOTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RoomWithInvigilator_invigilator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "RoomWithInvigilator", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") + switch field.Name { + case "shortname": + return ec.fieldContext_Teacher_shortname(ctx, field) + case "fullname": + return ec.fieldContext_Teacher_fullname(ctx, field) + case "isProf": + return ec.fieldContext_Teacher_isProf(ctx, field) + case "isLBA": + return ec.fieldContext_Teacher_isLBA(ctx, field) + case "isProfHC": + return ec.fieldContext_Teacher_isProfHC(ctx, field) + case "isStaff": + return ec.fieldContext_Teacher_isStaff(ctx, field) + case "lastSemester": + return ec.fieldContext_Teacher_lastSemester(ctx, field) + case "fk": + return ec.fieldContext_Teacher_fk(ctx, field) + case "id": + return ec.fieldContext_Teacher_id(ctx, field) + case "email": + return ec.fieldContext_Teacher_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) +func (ec *executionContext) _Semester_id(ctx context.Context, field graphql.CollectedField, obj *model.Semester) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Semester_id(ctx, field) if err != nil { return graphql.Null } @@ -20924,7 +22691,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -20936,36 +22703,26 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(string) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Semester_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "Semester", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) +func (ec *executionContext) _SemesterConfig_days(ctx context.Context, field graphql.CollectedField, obj *model.SemesterConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SemesterConfig_days(ctx, field) if err != nil { return graphql.Null } @@ -20978,7 +22735,7 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil + return obj.Days, nil }) if err != nil { ec.Error(ctx, err) @@ -20990,26 +22747,32 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.ExamDay) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNExamDay2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamDayᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SemesterConfig_days(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Directive", + Object: "SemesterConfig", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "number": + return ec.fieldContext_ExamDay_number(ctx, field) + case "date": + return ec.fieldContext_ExamDay_date(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExamDay", field.Name) }, } return fc, nil } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) +func (ec *executionContext) _SemesterConfig_starttimes(ctx context.Context, field graphql.CollectedField, obj *model.SemesterConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SemesterConfig_starttimes(ctx, field) if err != nil { return graphql.Null } @@ -21022,7 +22785,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Starttimes, nil }) if err != nil { ec.Error(ctx, err) @@ -21034,26 +22797,32 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*model.Starttime) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNStarttime2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStarttimeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SemesterConfig_starttimes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "SemesterConfig", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "number": + return ec.fieldContext_Starttime_number(ctx, field) + case "start": + return ec.fieldContext_Starttime_start(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Starttime", field.Name) }, } return fc, nil } -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) +func (ec *executionContext) _SemesterConfig_slots(ctx context.Context, field graphql.CollectedField, obj *model.SemesterConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SemesterConfig_slots(ctx, field) if err != nil { return graphql.Null } @@ -21066,35 +22835,46 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Slots, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]*model.Slot) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SemesterConfig_slots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "SemesterConfig", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "dayNumber": + return ec.fieldContext_Slot_dayNumber(ctx, field) + case "slotNumber": + return ec.fieldContext_Slot_slotNumber(ctx, field) + case "starttime": + return ec.fieldContext_Slot_starttime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Slot", field.Name) }, } return fc, nil } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) +func (ec *executionContext) _SemesterConfig_goSlots(ctx context.Context, field graphql.CollectedField, obj *model.SemesterConfig) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SemesterConfig_goSlots(ctx, field) if err != nil { return graphql.Null } @@ -21107,38 +22887,35 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.GoSlots, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([][]int) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOInt2ᚕᚕintᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SemesterConfig_goSlots(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "SemesterConfig", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) +func (ec *executionContext) _Slot_dayNumber(ctx context.Context, field graphql.CollectedField, obj *model.Slot) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Slot_dayNumber(ctx, field) if err != nil { return graphql.Null } @@ -21151,35 +22928,38 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.DayNumber, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(int) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Slot_dayNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__EnumValue", + Object: "Slot", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) +func (ec *executionContext) _Slot_slotNumber(ctx context.Context, field graphql.CollectedField, obj *model.Slot) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Slot_slotNumber(ctx, field) if err != nil { return graphql.Null } @@ -21192,7 +22972,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.SlotNumber, nil }) if err != nil { ec.Error(ctx, err) @@ -21204,26 +22984,26 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Slot_slotNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Slot", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) +func (ec *executionContext) _Slot_starttime(ctx context.Context, field graphql.CollectedField, obj *model.Slot) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Slot_starttime(ctx, field) if err != nil { return graphql.Null } @@ -21236,35 +23016,38 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Starttime, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Slot_starttime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "Slot", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) +func (ec *executionContext) _SlotWithExamGroups_dayNumber(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithExamGroups) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SlotWithExamGroups_dayNumber(ctx, field) if err != nil { return graphql.Null } @@ -21277,7 +23060,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.DayNumber, nil }) if err != nil { ec.Error(ctx, err) @@ -21289,36 +23072,26 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(int) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SlotWithExamGroups_dayNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "SlotWithExamGroups", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(ctx, field) +func (ec *executionContext) _SlotWithExamGroups_slotNumber(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithExamGroups) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SlotWithExamGroups_slotNumber(ctx, field) if err != nil { return graphql.Null } @@ -21331,7 +23104,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.SlotNumber, nil }) if err != nil { ec.Error(ctx, err) @@ -21343,48 +23116,26 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(int) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SlotWithExamGroups_slotNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "SlotWithExamGroups", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) +func (ec *executionContext) _SlotWithExamGroups_examGroups(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithExamGroups) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SlotWithExamGroups_examGroups(ctx, field) if err != nil { return graphql.Null } @@ -21397,38 +23148,43 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.ExamGroups, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]*model.ExamGroup) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroup(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SlotWithExamGroups_examGroups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "SlotWithExamGroups", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "examGroupCode": + return ec.fieldContext_ExamGroup_examGroupCode(ctx, field) + case "exams": + return ec.fieldContext_ExamGroup_exams(ctx, field) + case "examGroupInfo": + return ec.fieldContext_ExamGroup_examGroupInfo(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExamGroup", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) +func (ec *executionContext) _SlotWithRooms_dayNumber(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SlotWithRooms_dayNumber(ctx, field) if err != nil { return graphql.Null } @@ -21441,35 +23197,38 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.DayNumber, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(int) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SlotWithRooms_dayNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Field", + Object: "SlotWithRooms", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(ctx, field) +func (ec *executionContext) _SlotWithRooms_slotNumber(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SlotWithRooms_slotNumber(ctx, field) if err != nil { return graphql.Null } @@ -21482,7 +23241,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.SlotNumber, nil }) if err != nil { ec.Error(ctx, err) @@ -21494,26 +23253,26 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SlotWithRooms_slotNumber(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "SlotWithRooms", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) +func (ec *executionContext) _SlotWithRooms_normalRooms(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SlotWithRooms_normalRooms(ctx, field) if err != nil { return graphql.Null } @@ -21526,35 +23285,56 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.NormalRooms, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]*model.Room) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SlotWithRooms_normalRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "SlotWithRooms", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext_Room_name(ctx, field) + case "seats": + return ec.fieldContext_Room_seats(ctx, field) + case "handicap": + return ec.fieldContext_Room_handicap(ctx, field) + case "lab": + return ec.fieldContext_Room_lab(ctx, field) + case "placesWithSocket": + return ec.fieldContext_Room_placesWithSocket(ctx, field) + case "needsRequest": + return ec.fieldContext_Room_needsRequest(ctx, field) + case "exahm": + return ec.fieldContext_Room_exahm(ctx, field) + case "seb": + return ec.fieldContext_Room_seb(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) }, } return fc, nil } -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) +func (ec *executionContext) _SlotWithRooms_exahmRooms(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SlotWithRooms_exahmRooms(ctx, field) if err != nil { return graphql.Null } @@ -21567,7 +23347,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.ExahmRooms, nil }) if err != nil { ec.Error(ctx, err) @@ -21579,48 +23359,44 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.([]*model.Room) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SlotWithRooms_exahmRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "SlotWithRooms", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) + return ec.fieldContext_Room_name(ctx, field) + case "seats": + return ec.fieldContext_Room_seats(ctx, field) + case "handicap": + return ec.fieldContext_Room_handicap(ctx, field) + case "lab": + return ec.fieldContext_Room_lab(ctx, field) + case "placesWithSocket": + return ec.fieldContext_Room_placesWithSocket(ctx, field) + case "needsRequest": + return ec.fieldContext_Room_needsRequest(ctx, field) + case "exahm": + return ec.fieldContext_Room_exahm(ctx, field) + case "seb": + return ec.fieldContext_Room_seb(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) }, } return fc, nil } -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) +func (ec *executionContext) _SlotWithRooms_labRooms(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SlotWithRooms_labRooms(ctx, field) if err != nil { return graphql.Null } @@ -21633,35 +23409,56 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil + return obj.LabRooms, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]*model.Room) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SlotWithRooms_labRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__InputValue", + Object: "SlotWithRooms", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext_Room_name(ctx, field) + case "seats": + return ec.fieldContext_Room_seats(ctx, field) + case "handicap": + return ec.fieldContext_Room_handicap(ctx, field) + case "lab": + return ec.fieldContext_Room_lab(ctx, field) + case "placesWithSocket": + return ec.fieldContext_Room_placesWithSocket(ctx, field) + case "needsRequest": + return ec.fieldContext_Room_needsRequest(ctx, field) + case "exahm": + return ec.fieldContext_Room_exahm(ctx, field) + case "seb": + return ec.fieldContext_Room_seb(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) +func (ec *executionContext) _SlotWithRooms_ntaRooms(ctx context.Context, field graphql.CollectedField, obj *model.SlotWithRooms) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SlotWithRooms_ntaRooms(ctx, field) if err != nil { return graphql.Null } @@ -21674,35 +23471,56 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.NtaRooms, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.([]*model.Room) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SlotWithRooms_ntaRooms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "SlotWithRooms", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "name": + return ec.fieldContext_Room_name(ctx, field) + case "seats": + return ec.fieldContext_Room_seats(ctx, field) + case "handicap": + return ec.fieldContext_Room_handicap(ctx, field) + case "lab": + return ec.fieldContext_Room_lab(ctx, field) + case "placesWithSocket": + return ec.fieldContext_Room_placesWithSocket(ctx, field) + case "needsRequest": + return ec.fieldContext_Room_needsRequest(ctx, field) + case "exahm": + return ec.fieldContext_Room_exahm(ctx, field) + case "seb": + return ec.fieldContext_Room_seb(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Room", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(ctx, field) +func (ec *executionContext) _Starttime_number(ctx context.Context, field graphql.CollectedField, obj *model.Starttime) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Starttime_number(ctx, field) if err != nil { return graphql.Null } @@ -21715,7 +23533,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Types(), nil + return obj.Number, nil }) if err != nil { ec.Error(ctx, err) @@ -21727,48 +23545,26 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(int) fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Starttime_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "Starttime", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(ctx, field) +func (ec *executionContext) _Starttime_start(ctx context.Context, field graphql.CollectedField, obj *model.Starttime) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Starttime_start(ctx, field) if err != nil { return graphql.Null } @@ -21781,7 +23577,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil + return obj.Start, nil }) if err != nil { ec.Error(ctx, err) @@ -21793,48 +23589,26 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Starttime_start(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "Starttime", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_mutationType(ctx, field) +func (ec *executionContext) _Step_number(ctx context.Context, field graphql.CollectedField, obj *model.Step) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Step_number(ctx, field) if err != nil { return graphql.Null } @@ -21847,57 +23621,38 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil + return obj.Number, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(int) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Step_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "Step", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) +func (ec *executionContext) _Step_name(ctx context.Context, field graphql.CollectedField, obj *model.Step) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Step_name(ctx, field) if err != nil { return graphql.Null } @@ -21910,57 +23665,38 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Step_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "Step", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(ctx, field) +func (ec *executionContext) _Step_done(ctx context.Context, field graphql.CollectedField, obj *model.Step) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Step_done(ctx, field) if err != nil { return graphql.Null } @@ -21973,7 +23709,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil + return obj.Done, nil }) if err != nil { ec.Error(ctx, err) @@ -21985,38 +23721,26 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } return graphql.Null } - res := resTmp.([]introspection.Directive) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Step_done(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Schema", + Object: "Step", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(ctx, field) +func (ec *executionContext) _Step_deadline(ctx context.Context, field graphql.CollectedField, obj *model.Step) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Step_deadline(ctx, field) if err != nil { return graphql.Null } @@ -22029,38 +23753,35 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil + return obj.Deadline, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Step_deadline(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Step", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(ctx, field) +func (ec *executionContext) _Student_mtknr(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_mtknr(ctx, field) if err != nil { return graphql.Null } @@ -22073,25 +23794,28 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name(), nil + return obj.Mtknr, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Student_mtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Student", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -22100,8 +23824,8 @@ func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field return fc, nil } -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) +func (ec *executionContext) _Student_program(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_program(ctx, field) if err != nil { return graphql.Null } @@ -22114,25 +23838,28 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Program, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Student_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Student", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -22141,8 +23868,8 @@ func (ec *executionContext) fieldContext___Type_description(ctx context.Context, return fc, nil } -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(ctx, field) +func (ec *executionContext) _Student_group(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_group(ctx, field) if err != nil { return graphql.Null } @@ -22155,60 +23882,82 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + return obj.Group, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Field) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Student_group(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Student", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Field_name(ctx, field) - case "description": - return ec.fieldContext___Field_description(ctx, field) - case "args": - return ec.fieldContext___Field_args(ctx, field) - case "type": - return ec.fieldContext___Field_type(ctx, field) - case "isDeprecated": - return ec.fieldContext___Field_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___Field_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) _Student_name(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { ec.Error(ctx, err) - return fc, err + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } return fc, nil } -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(ctx, field) +func (ec *executionContext) _Student_regs(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_regs(ctx, field) if err != nil { return graphql.Null } @@ -22221,57 +23970,38 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil + return obj.Regs, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.([]int) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalNInt2ᚕintᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Student_regs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Student", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) +func (ec *executionContext) _Student_nta(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_nta(ctx, field) if err != nil { return graphql.Null } @@ -22284,7 +24014,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil + return obj.Nta, nil }) if err != nil { ec.Error(ctx, err) @@ -22293,48 +24023,50 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(*model.NTA) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalONTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Student_nta(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "Student", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) + return ec.fieldContext_NTA_name(ctx, field) + case "email": + return ec.fieldContext_NTA_email(ctx, field) + case "mtknr": + return ec.fieldContext_NTA_mtknr(ctx, field) + case "compensation": + return ec.fieldContext_NTA_compensation(ctx, field) + case "deltaDurationPercent": + return ec.fieldContext_NTA_deltaDurationPercent(ctx, field) + case "needsRoomAlone": + return ec.fieldContext_NTA_needsRoomAlone(ctx, field) + case "program": + return ec.fieldContext_NTA_program(ctx, field) + case "from": + return ec.fieldContext_NTA_from(ctx, field) + case "until": + return ec.fieldContext_NTA_until(ctx, field) + case "lastSemester": + return ec.fieldContext_NTA_lastSemester(ctx, field) + case "exams": + return ec.fieldContext_NTA_exams(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, fmt.Errorf("no field named %q was found under type NTA", field.Name) }, } return fc, nil } -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(ctx, field) +func (ec *executionContext) _StudentReg_mtknr(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentReg_mtknr(ctx, field) if err != nil { return graphql.Null } @@ -22347,56 +24079,82 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + return obj.Mtknr, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.EnumValue) + res := resTmp.(string) fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_StudentReg_mtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "StudentReg", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___EnumValue_name(ctx, field) - case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) _StudentReg_ancode(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentReg_ancode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AnCode, nil + }) + if err != nil { ec.Error(ctx, err) - return fc, err + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_StudentReg_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "StudentReg", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, } return fc, nil } -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) +func (ec *executionContext) _StudentReg_program(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentReg_program(ctx, field) if err != nil { return graphql.Null } @@ -22409,45 +24167,38 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil + return obj.Program, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(string) fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_StudentReg_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "StudentReg", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_ofType(ctx, field) +func (ec *executionContext) _StudentReg_group(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentReg_group(ctx, field) if err != nil { return graphql.Null } @@ -22460,57 +24211,38 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil + return obj.Group, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_StudentReg_group(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "StudentReg", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) +func (ec *executionContext) _StudentReg_name(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentReg_name(ctx, field) if err != nil { return graphql.Null } @@ -22523,25 +24255,28 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SpecifiedByURL(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_StudentReg_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "__Type", + Object: "StudentReg", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type String does not have child fields") @@ -22550,117 +24285,4192 @@ func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Conte return fc, nil } -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -func (ec *executionContext) unmarshalInputAdditionalExamInput(ctx context.Context, obj interface{}) (model.AdditionalExamInput, error) { - var it model.AdditionalExamInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v +func (ec *executionContext) _StudentReg_presence(ctx context.Context, field graphql.CollectedField, obj *model.StudentReg) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentReg_presence(ctx, field) + if err != nil { + return graphql.Null } - - fieldsInOrder := [...]string{"ancode", "module", "mainExamerID", "duration", "isRepeaterExam", "groups"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } - switch k { - case "ancode": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ancode")) - data, err := ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err - } - it.Ancode = data - case "module": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("module")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Module = data - case "mainExamerID": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mainExamerID")) - data, err := ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err - } - it.MainExamerID = data - case "duration": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) - data, err := ec.unmarshalNInt2int(ctx, v) - if err != nil { - return it, err - } - it.Duration = data - case "isRepeaterExam": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isRepeaterExam")) - data, err := ec.unmarshalNBoolean2bool(ctx, v) - if err != nil { - return it, err - } - it.IsRepeaterExam = data - case "groups": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groups")) - data, err := ec.unmarshalNString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err - } - it.Groups = data + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Presence, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null } - - return it, nil + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) unmarshalInputNTAInput(ctx context.Context, obj interface{}) (model.NTAInput, error) { - var it model.NTAInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v +func (ec *executionContext) fieldContext_StudentReg_presence(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "StudentReg", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} - fieldsInOrder := [...]string{"name", "mtknr", "compensation", "deltaDurationPercent", "needsRoomAlone", "program", "from", "until"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue +func (ec *executionContext) _StudentRegsPerAncode_ancode(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerAncode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentRegsPerAncode_ancode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } - switch k { - case "name": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Name = data - case "mtknr": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mtknr")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Mtknr = data - case "compensation": + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ancode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_StudentRegsPerAncode_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "StudentRegsPerAncode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _StudentRegsPerAncode_perProgram(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerAncode) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentRegsPerAncode_perProgram(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PerProgram, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.StudentRegsPerAncodeAndProgram) + fc.Result = res + return ec.marshalNStudentRegsPerAncodeAndProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgramᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_StudentRegsPerAncode_perProgram(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "StudentRegsPerAncode", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "program": + return ec.fieldContext_StudentRegsPerAncodeAndProgram_program(ctx, field) + case "ancode": + return ec.fieldContext_StudentRegsPerAncodeAndProgram_ancode(ctx, field) + case "studentRegs": + return ec.fieldContext_StudentRegsPerAncodeAndProgram_studentRegs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type StudentRegsPerAncodeAndProgram", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _StudentRegsPerAncodeAndProgram_program(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerAncodeAndProgram) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentRegsPerAncodeAndProgram_program(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Program, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_StudentRegsPerAncodeAndProgram_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "StudentRegsPerAncodeAndProgram", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _StudentRegsPerAncodeAndProgram_ancode(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerAncodeAndProgram) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentRegsPerAncodeAndProgram_ancode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ancode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_StudentRegsPerAncodeAndProgram_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "StudentRegsPerAncodeAndProgram", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _StudentRegsPerAncodeAndProgram_studentRegs(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerAncodeAndProgram) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentRegsPerAncodeAndProgram_studentRegs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StudentRegs, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.StudentReg) + fc.Result = res + return ec.marshalNStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_StudentRegsPerAncodeAndProgram_studentRegs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "StudentRegsPerAncodeAndProgram", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "mtknr": + return ec.fieldContext_StudentReg_mtknr(ctx, field) + case "ancode": + return ec.fieldContext_StudentReg_ancode(ctx, field) + case "program": + return ec.fieldContext_StudentReg_program(ctx, field) + case "group": + return ec.fieldContext_StudentReg_group(ctx, field) + case "name": + return ec.fieldContext_StudentReg_name(ctx, field) + case "presence": + return ec.fieldContext_StudentReg_presence(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type StudentReg", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _StudentRegsPerStudent_student(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerStudent) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentRegsPerStudent_student(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Student, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Student) + fc.Result = res + return ec.marshalNStudent2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudent(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_StudentRegsPerStudent_student(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "StudentRegsPerStudent", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "mtknr": + return ec.fieldContext_Student_mtknr(ctx, field) + case "program": + return ec.fieldContext_Student_program(ctx, field) + case "group": + return ec.fieldContext_Student_group(ctx, field) + case "name": + return ec.fieldContext_Student_name(ctx, field) + case "regs": + return ec.fieldContext_Student_regs(ctx, field) + case "nta": + return ec.fieldContext_Student_nta(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Student", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _StudentRegsPerStudent_ancodes(ctx context.Context, field graphql.CollectedField, obj *model.StudentRegsPerStudent) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StudentRegsPerStudent_ancodes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ancodes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]int) + fc.Result = res + return ec.marshalNInt2ᚕintᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_StudentRegsPerStudent_ancodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "StudentRegsPerStudent", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_shortname(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_shortname(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Shortname, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_shortname(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_fullname(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_fullname(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fullname, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_fullname(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_isProf(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_isProf(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsProf, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_isProf(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_isLBA(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_isLBA(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsLBA, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_isLBA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_isProfHC(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_isProfHC(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsProfHC, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_isProfHC(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_isStaff(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_isStaff(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsStaff, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_isStaff(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_lastSemester(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_lastSemester(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastSemester, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_lastSemester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_fk(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_fk(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FK, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_fk(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_id(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_email(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_email(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Email, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAConflict_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ZPAConflict) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAConflict_ancode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ancode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAConflict_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAConflict", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAConflict_numberOfStuds(ctx context.Context, field graphql.CollectedField, obj *model.ZPAConflict) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAConflict_numberOfStuds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NumberOfStuds, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAConflict_numberOfStuds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAConflict", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAConflict_primussAncodes(ctx context.Context, field graphql.CollectedField, obj *model.ZPAConflict) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAConflict_primussAncodes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PrimussAncodes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.PrimussExamAncode) + fc.Result = res + return ec.marshalNPrimussExamAncode2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamAncodeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAConflict_primussAncodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAConflict", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "ancode": + return ec.fieldContext_PrimussExamAncode_ancode(ctx, field) + case "program": + return ec.fieldContext_PrimussExamAncode_program(ctx, field) + case "numberOfStuds": + return ec.fieldContext_PrimussExamAncode_numberOfStuds(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PrimussExamAncode", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_zpaID(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_zpaID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ZpaID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_zpaID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_semester(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_semester(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Semester, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_semester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_ancode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AnCode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_module(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_module(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Module, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_module(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_mainExamer(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_mainExamer(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MainExamer, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_mainExamer(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_mainExamerID(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MainExamerID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_mainExamerID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_examType(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_examType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ExamType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_examType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_examTypeFull(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ExamTypeFull, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_examTypeFull(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_duration(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_duration(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Duration, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_duration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_isRepeaterExam(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeaterExam, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_isRepeaterExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_groups(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_groups(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Groups, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_groups(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExam_primussAncodes(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExam) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PrimussAncodes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.ZPAPrimussAncodes) + fc.Result = res + return ec.marshalNZPAPrimussAncodes2ᚕgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAPrimussAncodesᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExam_primussAncodes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExam", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "program": + return ec.fieldContext_ZPAPrimussAncodes_program(ctx, field) + case "ancode": + return ec.fieldContext_ZPAPrimussAncodes_ancode(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAPrimussAncodes", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExamWithConstraints_zpaExam(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExamWithConstraints) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExamWithConstraints_zpaExam(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ZpaExam, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.ZPAExam) + fc.Result = res + return ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExamWithConstraints_zpaExam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExamWithConstraints", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExamWithConstraints_constraints(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExamWithConstraints) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExamWithConstraints_constraints(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Constraints, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Constraints) + fc.Result = res + return ec.marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConstraints(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExamWithConstraints_constraints(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExamWithConstraints", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "ancode": + return ec.fieldContext_Constraints_ancode(ctx, field) + case "notPlannedByMe": + return ec.fieldContext_Constraints_notPlannedByMe(ctx, field) + case "excludeDays": + return ec.fieldContext_Constraints_excludeDays(ctx, field) + case "possibleDays": + return ec.fieldContext_Constraints_possibleDays(ctx, field) + case "fixedDay": + return ec.fieldContext_Constraints_fixedDay(ctx, field) + case "fixedTime": + return ec.fieldContext_Constraints_fixedTime(ctx, field) + case "sameSlot": + return ec.fieldContext_Constraints_sameSlot(ctx, field) + case "online": + return ec.fieldContext_Constraints_online(ctx, field) + case "roomConstraints": + return ec.fieldContext_Constraints_roomConstraints(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Constraints", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExamsForType_type(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExamsForType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExamsForType_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExamsForType_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExamsForType", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAExamsForType_exams(ctx context.Context, field graphql.CollectedField, obj *model.ZPAExamsForType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAExamsForType_exams(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Exams, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.ZPAExam) + fc.Result = res + return ec.marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAExamsForType_exams(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAExamsForType", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "zpaID": + return ec.fieldContext_ZPAExam_zpaID(ctx, field) + case "semester": + return ec.fieldContext_ZPAExam_semester(ctx, field) + case "ancode": + return ec.fieldContext_ZPAExam_ancode(ctx, field) + case "module": + return ec.fieldContext_ZPAExam_module(ctx, field) + case "mainExamer": + return ec.fieldContext_ZPAExam_mainExamer(ctx, field) + case "mainExamerID": + return ec.fieldContext_ZPAExam_mainExamerID(ctx, field) + case "examType": + return ec.fieldContext_ZPAExam_examType(ctx, field) + case "examTypeFull": + return ec.fieldContext_ZPAExam_examTypeFull(ctx, field) + case "duration": + return ec.fieldContext_ZPAExam_duration(ctx, field) + case "isRepeaterExam": + return ec.fieldContext_ZPAExam_isRepeaterExam(ctx, field) + case "groups": + return ec.fieldContext_ZPAExam_groups(ctx, field) + case "primussAncodes": + return ec.fieldContext_ZPAExam_primussAncodes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ZPAExam", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAInvigilator_teacher(ctx context.Context, field graphql.CollectedField, obj *model.ZPAInvigilator) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAInvigilator_teacher(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Teacher, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Teacher) + fc.Result = res + return ec.marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAInvigilator_teacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAInvigilator", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "shortname": + return ec.fieldContext_Teacher_shortname(ctx, field) + case "fullname": + return ec.fieldContext_Teacher_fullname(ctx, field) + case "isProf": + return ec.fieldContext_Teacher_isProf(ctx, field) + case "isLBA": + return ec.fieldContext_Teacher_isLBA(ctx, field) + case "isProfHC": + return ec.fieldContext_Teacher_isProfHC(ctx, field) + case "isStaff": + return ec.fieldContext_Teacher_isStaff(ctx, field) + case "lastSemester": + return ec.fieldContext_Teacher_lastSemester(ctx, field) + case "fk": + return ec.fieldContext_Teacher_fk(ctx, field) + case "id": + return ec.fieldContext_Teacher_id(ctx, field) + case "email": + return ec.fieldContext_Teacher_email(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAInvigilator_hasSubmittedRequirements(ctx context.Context, field graphql.CollectedField, obj *model.ZPAInvigilator) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAInvigilator_hasSubmittedRequirements(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.HasSubmittedRequirements, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAInvigilator_hasSubmittedRequirements(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAInvigilator", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAPrimussAncodes_program(ctx context.Context, field graphql.CollectedField, obj *model.ZPAPrimussAncodes) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAPrimussAncodes_program(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Program, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAPrimussAncodes_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAPrimussAncodes", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAPrimussAncodes_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ZPAPrimussAncodes) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAPrimussAncodes_ancode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ancode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAPrimussAncodes_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAPrimussAncodes", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAStudentReg_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentReg) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAStudentReg_ancode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AnCode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAStudentReg_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAStudentReg", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAStudentReg_mtknr(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentReg) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAStudentReg_mtknr(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Mtknr, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAStudentReg_mtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAStudentReg", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAStudentReg_program(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentReg) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAStudentReg_program(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Program, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAStudentReg_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAStudentReg", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAStudentRegError_semester(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentRegError) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAStudentRegError_semester(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Semester, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAStudentRegError_semester(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAStudentRegError", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAStudentRegError_ancode(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentRegError) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAStudentRegError_ancode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AnCode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAStudentRegError_ancode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAStudentRegError", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAStudentRegError_exam(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentRegError) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAStudentRegError_exam(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Exam, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAStudentRegError_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAStudentRegError", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAStudentRegError_mtknr(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentRegError) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAStudentRegError_mtknr(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Mtknr, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAStudentRegError_mtknr(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAStudentRegError", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ZPAStudentRegError_program(ctx context.Context, field graphql.CollectedField, obj *model.ZPAStudentRegError) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ZPAStudentRegError_program(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Program, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ZPAStudentRegError_program(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ZPAStudentRegError", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputAdditionalExamInput(ctx context.Context, obj interface{}) (model.AdditionalExamInput, error) { + var it model.AdditionalExamInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"ancode", "module", "mainExamerID", "duration", "isRepeaterExam", "groups"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "ancode": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ancode")) + data, err := ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + it.Ancode = data + case "module": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("module")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Module = data + case "mainExamerID": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mainExamerID")) + data, err := ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + it.MainExamerID = data + case "duration": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("duration")) + data, err := ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + it.Duration = data + case "isRepeaterExam": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isRepeaterExam")) + data, err := ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.IsRepeaterExam = data + case "groups": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("groups")) + data, err := ec.unmarshalNString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Groups = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNTAInput(ctx context.Context, obj interface{}) (model.NTAInput, error) { + var it model.NTAInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "email", "mtknr", "compensation", "deltaDurationPercent", "needsRoomAlone", "program", "from", "until"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "email": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.Email = data + case "mtknr": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mtknr")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Mtknr = data + case "compensation": var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("compensation")) @@ -23054,37 +28864,83 @@ func (ec *executionContext) _ConflictPerProgram(ctx context.Context, sel ast.Sel return out } -var conflictsImplementors = []string{"Conflicts"} +var conflictsImplementors = []string{"Conflicts"} + +func (ec *executionContext) _Conflicts(ctx context.Context, sel ast.SelectionSet, obj *model.Conflicts) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, conflictsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Conflicts") + case "ancode": + out.Values[i] = ec._Conflicts_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "module": + out.Values[i] = ec._Conflicts_module(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mainExamer": + out.Values[i] = ec._Conflicts_mainExamer(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "conflicts": + out.Values[i] = ec._Conflicts_conflicts(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var conflictsPerProgramAncodeImplementors = []string{"ConflictsPerProgramAncode"} -func (ec *executionContext) _Conflicts(ctx context.Context, sel ast.SelectionSet, obj *model.Conflicts) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, conflictsImplementors) +func (ec *executionContext) _ConflictsPerProgramAncode(ctx context.Context, sel ast.SelectionSet, obj *model.ConflictsPerProgramAncode) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, conflictsPerProgramAncodeImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Conflicts") - case "ancode": - out.Values[i] = ec._Conflicts_ancode(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "module": - out.Values[i] = ec._Conflicts_module(ctx, field, obj) + out.Values[i] = graphql.MarshalString("ConflictsPerProgramAncode") + case "program": + out.Values[i] = ec._ConflictsPerProgramAncode_program(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "mainExamer": - out.Values[i] = ec._Conflicts_mainExamer(ctx, field, obj) + case "ancode": + out.Values[i] = ec._ConflictsPerProgramAncode_ancode(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "conflicts": - out.Values[i] = ec._Conflicts_conflicts(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } + out.Values[i] = ec._ConflictsPerProgramAncode_conflicts(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -23223,6 +29079,133 @@ func (ec *executionContext) _Constraints(ctx context.Context, sel ast.SelectionS return out } +var enhancedPrimussExamImplementors = []string{"EnhancedPrimussExam"} + +func (ec *executionContext) _EnhancedPrimussExam(ctx context.Context, sel ast.SelectionSet, obj *model.EnhancedPrimussExam) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, enhancedPrimussExamImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("EnhancedPrimussExam") + case "exam": + out.Values[i] = ec._EnhancedPrimussExam_exam(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "studentRegs": + out.Values[i] = ec._EnhancedPrimussExam_studentRegs(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "conflicts": + out.Values[i] = ec._EnhancedPrimussExam_conflicts(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ntas": + out.Values[i] = ec._EnhancedPrimussExam_ntas(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var examImplementors = []string{"Exam"} + +func (ec *executionContext) _Exam(ctx context.Context, sel ast.SelectionSet, obj *model.Exam) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, examImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Exam") + case "ancode": + out.Values[i] = ec._Exam_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "zpaExam": + out.Values[i] = ec._Exam_zpaExam(ctx, field, obj) + case "externalExam": + out.Values[i] = ec._Exam_externalExam(ctx, field, obj) + case "primussExams": + out.Values[i] = ec._Exam_primussExams(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "studentRegs": + out.Values[i] = ec._Exam_studentRegs(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "conflicts": + out.Values[i] = ec._Exam_conflicts(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "connectErrors": + out.Values[i] = ec._Exam_connectErrors(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "constraints": + out.Values[i] = ec._Exam_constraints(ctx, field, obj) + case "regularStudents": + out.Values[i] = ec._Exam_regularStudents(ctx, field, obj) + case "ntaStudents": + out.Values[i] = ec._Exam_ntaStudents(ctx, field, obj) + case "slot": + out.Values[i] = ec._Exam_slot(ctx, field, obj) + case "rooms": + out.Values[i] = ec._Exam_rooms(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var examDayImplementors = []string{"ExamDay"} func (ec *executionContext) _ExamDay(ctx context.Context, sel ast.SelectionSet, obj *model.ExamDay) graphql.Marshaler { @@ -23591,13 +29574,13 @@ func (ec *executionContext) _ExamWithRegsAndRooms(ctx context.Context, sel ast.S if out.Values[i] == graphql.Null { out.Invalids++ } - case "normalRegs": - out.Values[i] = ec._ExamWithRegsAndRooms_normalRegs(ctx, field, obj) + case "normalRegsMtknr": + out.Values[i] = ec._ExamWithRegsAndRooms_normalRegsMtknr(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "ntaRegs": - out.Values[i] = ec._ExamWithRegsAndRooms_ntaRegs(ctx, field, obj) + case "ntas": + out.Values[i] = ec._ExamWithRegsAndRooms_ntas(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -23673,6 +29656,65 @@ func (ec *executionContext) _ExamerInPlan(ctx context.Context, sel ast.Selection return out } +var externalExamImplementors = []string{"ExternalExam"} + +func (ec *executionContext) _ExternalExam(ctx context.Context, sel ast.SelectionSet, obj *model.ExternalExam) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, externalExamImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ExternalExam") + case "ancode": + out.Values[i] = ec._ExternalExam_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "program": + out.Values[i] = ec._ExternalExam_program(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "module": + out.Values[i] = ec._ExternalExam_module(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mainExamer": + out.Values[i] = ec._ExternalExam_mainExamer(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "duration": + out.Values[i] = ec._ExternalExam_duration(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var fK07ProgramImplementors = []string{"FK07Program"} func (ec *executionContext) _FK07Program(ctx context.Context, sel ast.SelectionSet, obj *model.FK07Program) graphql.Marshaler { @@ -23712,6 +29754,113 @@ func (ec *executionContext) _FK07Program(ctx context.Context, sel ast.SelectionS return out } +var generatedExamImplementors = []string{"GeneratedExam"} + +func (ec *executionContext) _GeneratedExam(ctx context.Context, sel ast.SelectionSet, obj *model.GeneratedExam) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, generatedExamImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GeneratedExam") + case "ancode": + out.Values[i] = ec._GeneratedExam_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "zpaExam": + out.Values[i] = ec._GeneratedExam_zpaExam(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "mainExamer": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._GeneratedExam_mainExamer(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "primussExams": + out.Values[i] = ec._GeneratedExam_primussExams(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "constraints": + out.Values[i] = ec._GeneratedExam_constraints(ctx, field, obj) + case "conflicts": + out.Values[i] = ec._GeneratedExam_conflicts(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "studentRegsCount": + out.Values[i] = ec._GeneratedExam_studentRegsCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "ntas": + out.Values[i] = ec._GeneratedExam_ntas(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "maxDuration": + out.Values[i] = ec._GeneratedExam_maxDuration(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var invigilationImplementors = []string{"Invigilation"} func (ec *executionContext) _Invigilation(ctx context.Context, sel ast.SelectionSet, obj *model.Invigilation) graphql.Marshaler { @@ -24193,13 +30342,6 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { out.Invalids++ } - case "prepareExams": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_prepareExams(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } case "addNTA": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_addNTA(ctx, field) @@ -24291,6 +30433,20 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { out.Invalids++ } + case "addExamToSlot": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_addExamToSlot(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "rmExamFromSlot": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_rmExamFromSlot(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -24330,6 +30486,8 @@ func (ec *executionContext) _NTA(ctx context.Context, sel ast.SelectionSet, obj if out.Values[i] == graphql.Null { out.Invalids++ } + case "email": + out.Values[i] = ec._NTA_email(ctx, field, obj) case "mtknr": out.Values[i] = ec._NTA_mtknr(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -24610,6 +30768,207 @@ func (ec *executionContext) _Plan(ctx context.Context, sel ast.SelectionSet, obj return out } +var planEntryImplementors = []string{"PlanEntry"} + +func (ec *executionContext) _PlanEntry(ctx context.Context, sel ast.SelectionSet, obj *model.PlanEntry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, planEntryImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PlanEntry") + case "dayNumber": + out.Values[i] = ec._PlanEntry_dayNumber(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "slotNumber": + out.Values[i] = ec._PlanEntry_slotNumber(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "starttime": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PlanEntry_starttime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "ancode": + out.Values[i] = ec._PlanEntry_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "locked": + out.Values[i] = ec._PlanEntry_locked(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var plannedExamImplementors = []string{"PlannedExam"} + +func (ec *executionContext) _PlannedExam(ctx context.Context, sel ast.SelectionSet, obj *model.PlannedExam) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, plannedExamImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PlannedExam") + case "ancode": + out.Values[i] = ec._PlannedExam_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "zpaExam": + out.Values[i] = ec._PlannedExam_zpaExam(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "mainExamer": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PlannedExam_mainExamer(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "primussExams": + out.Values[i] = ec._PlannedExam_primussExams(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "constraints": + out.Values[i] = ec._PlannedExam_constraints(ctx, field, obj) + case "conflicts": + out.Values[i] = ec._PlannedExam_conflicts(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "studentRegsCount": + out.Values[i] = ec._PlannedExam_studentRegsCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "ntas": + out.Values[i] = ec._PlannedExam_ntas(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "maxDuration": + out.Values[i] = ec._PlannedExam_maxDuration(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "planEntry": + out.Values[i] = ec._PlannedExam_planEntry(ctx, field, obj) + case "plannedRooms": + out.Values[i] = ec._PlannedExam_plannedRooms(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var plannedExamWithNTAImplementors = []string{"PlannedExamWithNTA"} func (ec *executionContext) _PlannedExamWithNTA(ctx context.Context, sel ast.SelectionSet, obj *model.PlannedExamWithNta) graphql.Marshaler { @@ -24653,160 +31012,318 @@ func (ec *executionContext) _PlannedExamWithNTA(ctx context.Context, sel ast.Sel return out } -var primussExamImplementors = []string{"PrimussExam"} +var plannedRoomImplementors = []string{"PlannedRoom"} + +func (ec *executionContext) _PlannedRoom(ctx context.Context, sel ast.SelectionSet, obj *model.PlannedRoom) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, plannedRoomImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PlannedRoom") + case "day": + out.Values[i] = ec._PlannedRoom_day(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "slot": + out.Values[i] = ec._PlannedRoom_slot(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "room": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._PlannedRoom_room(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "ancode": + out.Values[i] = ec._PlannedRoom_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "duration": + out.Values[i] = ec._PlannedRoom_duration(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "handicap": + out.Values[i] = ec._PlannedRoom_handicap(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "handicapRoomAlone": + out.Values[i] = ec._PlannedRoom_handicapRoomAlone(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "reserve": + out.Values[i] = ec._PlannedRoom_reserve(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "studentsInRoom": + out.Values[i] = ec._PlannedRoom_studentsInRoom(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "ntaMtknr": + out.Values[i] = ec._PlannedRoom_ntaMtknr(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var primussExamImplementors = []string{"PrimussExam"} + +func (ec *executionContext) _PrimussExam(ctx context.Context, sel ast.SelectionSet, obj *model.PrimussExam) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, primussExamImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PrimussExam") + case "ancode": + out.Values[i] = ec._PrimussExam_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "module": + out.Values[i] = ec._PrimussExam_module(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mainExamer": + out.Values[i] = ec._PrimussExam_mainExamer(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "program": + out.Values[i] = ec._PrimussExam_program(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "examType": + out.Values[i] = ec._PrimussExam_examType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "presence": + out.Values[i] = ec._PrimussExam_presence(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var primussExamAncodeImplementors = []string{"PrimussExamAncode"} + +func (ec *executionContext) _PrimussExamAncode(ctx context.Context, sel ast.SelectionSet, obj *model.PrimussExamAncode) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, primussExamAncodeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PrimussExamAncode") + case "ancode": + out.Values[i] = ec._PrimussExamAncode_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "program": + out.Values[i] = ec._PrimussExamAncode_program(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "numberOfStuds": + out.Values[i] = ec._PrimussExamAncode_numberOfStuds(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var primussExamByProgramImplementors = []string{"PrimussExamByProgram"} + +func (ec *executionContext) _PrimussExamByProgram(ctx context.Context, sel ast.SelectionSet, obj *model.PrimussExamByProgram) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, primussExamByProgramImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PrimussExamByProgram") + case "program": + out.Values[i] = ec._PrimussExamByProgram_program(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "exams": + out.Values[i] = ec._PrimussExamByProgram_exams(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var primussExamWithCountImplementors = []string{"PrimussExamWithCount"} -func (ec *executionContext) _PrimussExam(ctx context.Context, sel ast.SelectionSet, obj *model.PrimussExam) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, primussExamImplementors) +func (ec *executionContext) _PrimussExamWithCount(ctx context.Context, sel ast.SelectionSet, obj *model.PrimussExamWithCount) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, primussExamWithCountImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("PrimussExam") + out.Values[i] = graphql.MarshalString("PrimussExamWithCount") case "ancode": - out.Values[i] = ec._PrimussExam_ancode(ctx, field, obj) + out.Values[i] = ec._PrimussExamWithCount_ancode(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "module": - out.Values[i] = ec._PrimussExam_module(ctx, field, obj) + out.Values[i] = ec._PrimussExamWithCount_module(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "mainExamer": - out.Values[i] = ec._PrimussExam_mainExamer(ctx, field, obj) + out.Values[i] = ec._PrimussExamWithCount_mainExamer(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "program": - out.Values[i] = ec._PrimussExam_program(ctx, field, obj) + out.Values[i] = ec._PrimussExamWithCount_program(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "examType": - out.Values[i] = ec._PrimussExam_examType(ctx, field, obj) + out.Values[i] = ec._PrimussExamWithCount_examType(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "presence": - out.Values[i] = ec._PrimussExam_presence(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "studentRegs": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._PrimussExam_studentRegs(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "conflicts": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._PrimussExam_conflicts(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var primussExamByProgramImplementors = []string{"PrimussExamByProgram"} - -func (ec *executionContext) _PrimussExamByProgram(ctx context.Context, sel ast.SelectionSet, obj *model.PrimussExamByProgram) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, primussExamByProgramImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("PrimussExamByProgram") - case "program": - out.Values[i] = ec._PrimussExamByProgram_program(ctx, field, obj) + out.Values[i] = ec._PrimussExamWithCount_presence(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "exams": - out.Values[i] = ec._PrimussExamByProgram_exams(ctx, field, obj) + case "studentRegsCount": + out.Values[i] = ec._PrimussExamWithCount_studentRegsCount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -24959,7 +31476,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "teacher": + case "additionalExams": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -24968,7 +31485,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_teacher(ctx, field) + res = ec._Query_additionalExams(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -24978,7 +31498,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "teachers": + case "primussExam": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -24987,7 +31507,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_teachers(ctx, field) + res = ec._Query_primussExam(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -25000,7 +31520,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "invigilators": + case "primussExamsForAnCode": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25009,10 +31529,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_invigilators(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Query_primussExamsForAnCode(ctx, field) return res } @@ -25022,7 +31539,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "fk07programs": + case "studentRegsForProgram": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25031,10 +31548,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_fk07programs(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Query_studentRegsForProgram(ctx, field) return res } @@ -25044,7 +31558,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "zpaExams": + case "examWithRegs": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25053,10 +31567,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_zpaExams(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Query_examWithRegs(ctx, field) return res } @@ -25066,7 +31577,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "zpaExamsByType": + case "examsWithRegs": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25075,10 +31586,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_zpaExamsByType(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Query_examsWithRegs(ctx, field) return res } @@ -25088,7 +31596,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "zpaExamsToPlan": + case "constraintForAncode": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25097,10 +31605,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_zpaExamsToPlan(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Query_constraintForAncode(ctx, field) return res } @@ -25110,7 +31615,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "zpaExamsNotToPlan": + case "zpaExamsToPlanWithConstraints": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25119,7 +31624,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_zpaExamsNotToPlan(ctx, field) + res = ec._Query_zpaExamsToPlanWithConstraints(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -25132,7 +31637,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "zpaExamsPlaningStatusUnknown": + case "examGroups": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25141,7 +31646,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_zpaExamsPlaningStatusUnknown(ctx, field) + res = ec._Query_examGroups(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -25154,7 +31659,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "zpaExam": + case "examGroup": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25163,7 +31668,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_zpaExam(ctx, field) + res = ec._Query_examGroup(ctx, field) return res } @@ -25173,7 +31678,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "zpaAnCodes": + case "ntasWithRegsByTeacher": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25182,7 +31687,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_zpaAnCodes(ctx, field) + res = ec._Query_ntasWithRegsByTeacher(ctx, field) return res } @@ -25192,7 +31697,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "studentRegsImportErrors": + case "nta": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25201,10 +31706,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_studentRegsImportErrors(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Query_nta(ctx, field) return res } @@ -25214,7 +31716,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "additionalExams": + case "examGroupsWithoutSlot": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25223,10 +31725,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_additionalExams(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Query_examGroupsWithoutSlot(ctx, field) return res } @@ -25236,7 +31735,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "primussExams": + case "plannedExamsInSlot": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25245,7 +31744,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_primussExams(ctx, field) + res = ec._Query_plannedExamsInSlot(ctx, field) return res } @@ -25255,7 +31754,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "primussExam": + case "examsInPlan": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25264,7 +31763,45 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_primussExam(ctx, field) + res = ec._Query_examsInPlan(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "examsInSlotWithRooms": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_examsInSlotWithRooms(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "roomsWithConstraints": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_roomsWithConstraints(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -25277,7 +31814,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "primussExamsForAnCode": + case "roomsForSlot": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25286,7 +31823,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_primussExamsForAnCode(ctx, field) + res = ec._Query_roomsForSlot(ctx, field) return res } @@ -25296,7 +31833,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "studentRegsForProgram": + case "dayOkForInvigilator": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25305,7 +31842,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_studentRegsForProgram(ctx, field) + res = ec._Query_dayOkForInvigilator(ctx, field) return res } @@ -25356,7 +31893,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "examWithRegs": + case "externalExams": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25365,7 +31902,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_examWithRegs(ctx, field) + res = ec._Query_externalExams(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25375,7 +31915,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "examsWithRegs": + case "generatedExams": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25384,7 +31924,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_examsWithRegs(ctx, field) + res = ec._Query_generatedExams(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25394,7 +31937,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "constraintForAncode": + case "generatedExam": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25403,7 +31946,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_constraintForAncode(ctx, field) + res = ec._Query_generatedExam(ctx, field) return res } @@ -25413,7 +31956,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "zpaExamsToPlanWithConstraints": + case "plannedExams": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25422,7 +31965,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_zpaExamsToPlanWithConstraints(ctx, field) + res = ec._Query_plannedExams(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -25435,7 +31978,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "examGroups": + case "plannedExam": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25444,7 +31987,64 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_examGroups(ctx, field) + res = ec._Query_plannedExam(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "conflictingAncodes": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_conflictingAncodes(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "exam": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_exam(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "exams": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_exams(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -25457,7 +32057,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "examGroup": + case "invigilatorTodos": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25466,7 +32066,48 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_examGroup(ctx, field) + res = ec._Query_invigilatorTodos(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "invigilatorsWithReq": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_invigilatorsWithReq(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "roomsWithInvigilationsForSlot": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_roomsWithInvigilationsForSlot(ctx, field) return res } @@ -25476,7 +32117,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "conflictingGroupCodes": + case "invigilatorsForDay": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25485,7 +32126,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_conflictingGroupCodes(ctx, field) + res = ec._Query_invigilatorsForDay(ctx, field) return res } @@ -25533,7 +32174,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "ntasWithRegsByTeacher": + case "allProgramsInPlan": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25542,7 +32183,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_ntasWithRegsByTeacher(ctx, field) + res = ec._Query_allProgramsInPlan(ctx, field) return res } @@ -25552,7 +32193,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "nta": + case "ancodesInPlan": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25561,7 +32202,67 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_nta(ctx, field) + res = ec._Query_ancodesInPlan(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "examerInPlan": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_examerInPlan(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "examsInSlot": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_examsInSlot(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "examsWithoutSlot": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_examsWithoutSlot(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25612,7 +32313,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "examGroupsInSlot": + case "primussExams": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25621,7 +32322,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_examGroupsInSlot(ctx, field) + res = ec._Query_primussExams(ctx, field) return res } @@ -25631,7 +32332,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "examGroupsWithoutSlot": + case "rooms": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25640,7 +32341,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_examGroupsWithoutSlot(ctx, field) + res = ec._Query_rooms(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25650,7 +32354,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "allProgramsInPlan": + case "plannedRoomNames": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25659,7 +32363,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_allProgramsInPlan(ctx, field) + res = ec._Query_plannedRoomNames(ctx, field) return res } @@ -25669,7 +32373,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "ancodesInPlan": + case "plannedRoomNamesInSlot": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25678,7 +32382,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_ancodesInPlan(ctx, field) + res = ec._Query_plannedRoomNamesInSlot(ctx, field) return res } @@ -25688,7 +32392,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "examerInPlan": + case "plannedRoomsInSlot": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25697,7 +32401,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_examerInPlan(ctx, field) + res = ec._Query_plannedRoomsInSlot(ctx, field) return res } @@ -25707,7 +32411,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "plannedExamsInSlot": + case "studentByMtknr": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25716,7 +32420,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_plannedExamsInSlot(ctx, field) + res = ec._Query_studentByMtknr(ctx, field) return res } @@ -25726,7 +32430,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "examsInPlan": + case "studentsByName": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25735,7 +32439,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_examsInPlan(ctx, field) + res = ec._Query_studentsByName(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25745,7 +32452,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "examsInSlot": + case "students": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25754,7 +32461,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_examsInSlot(ctx, field) + res = ec._Query_students(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25764,7 +32474,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "examsInSlotWithRooms": + case "teacher": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25773,7 +32483,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_examsInSlotWithRooms(ctx, field) + res = ec._Query_teacher(ctx, field) return res } @@ -25783,7 +32493,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "rooms": + case "teachers": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25792,7 +32502,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_rooms(ctx, field) + res = ec._Query_teachers(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -25805,7 +32515,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "roomsWithConstraints": + case "invigilators": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25814,7 +32524,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_roomsWithConstraints(ctx, field) + res = ec._Query_invigilators(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -25827,7 +32537,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "roomsForSlot": + case "fk07programs": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25836,7 +32546,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_roomsForSlot(ctx, field) + res = ec._Query_fk07programs(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25846,7 +32559,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "plannedRoomNames": + case "zpaExams": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25855,7 +32568,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_plannedRoomNames(ctx, field) + res = ec._Query_zpaExams(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25865,7 +32581,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "plannedRoomNamesInSlot": + case "zpaExamsByType": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25874,7 +32590,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_plannedRoomNamesInSlot(ctx, field) + res = ec._Query_zpaExamsByType(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25884,7 +32603,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "invigilatorsWithReq": + case "zpaExamsToPlan": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25893,7 +32612,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_invigilatorsWithReq(ctx, field) + res = ec._Query_zpaExamsToPlan(ctx, field) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -25906,7 +32625,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "invigilatorTodos": + case "zpaExamsNotToPlan": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25915,7 +32634,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_invigilatorTodos(ctx, field) + res = ec._Query_zpaExamsNotToPlan(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25925,7 +32647,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "roomsWithInvigilationsForSlot": + case "zpaExamsPlaningStatusUnknown": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25934,7 +32656,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_roomsWithInvigilationsForSlot(ctx, field) + res = ec._Query_zpaExamsPlaningStatusUnknown(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -25944,7 +32669,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "invigilatorsForDay": + case "zpaExam": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25953,7 +32678,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_invigilatorsForDay(ctx, field) + res = ec._Query_zpaExam(ctx, field) return res } @@ -25963,7 +32688,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "dayOkForInvigilator": + case "zpaAnCodes": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -25972,7 +32697,29 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_dayOkForInvigilator(ctx, field) + res = ec._Query_zpaAnCodes(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "studentRegsImportErrors": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_studentRegsImportErrors(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -26757,6 +33504,13 @@ func (ec *executionContext) _Student(ctx context.Context, sel ast.SelectionSet, if out.Values[i] == graphql.Null { out.Invalids++ } + case "regs": + out.Values[i] = ec._Student_regs(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "nta": + out.Values[i] = ec._Student_nta(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26904,6 +33658,11 @@ func (ec *executionContext) _StudentRegsPerAncodeAndProgram(ctx context.Context, if out.Values[i] == graphql.Null { out.Invalids++ } + case "ancode": + out.Values[i] = ec._StudentRegsPerAncodeAndProgram_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } case "studentRegs": out.Values[i] = ec._StudentRegsPerAncodeAndProgram_studentRegs(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -27017,23 +33776,447 @@ func (ec *executionContext) _Teacher(ctx context.Context, sel ast.SelectionSet, if out.Values[i] == graphql.Null { out.Invalids++ } - case "lastSemester": - out.Values[i] = ec._Teacher_lastSemester(ctx, field, obj) + case "lastSemester": + out.Values[i] = ec._Teacher_lastSemester(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "fk": + out.Values[i] = ec._Teacher_fk(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "id": + out.Values[i] = ec._Teacher_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "email": + out.Values[i] = ec._Teacher_email(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var zPAConflictImplementors = []string{"ZPAConflict"} + +func (ec *executionContext) _ZPAConflict(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAConflict) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, zPAConflictImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ZPAConflict") + case "ancode": + out.Values[i] = ec._ZPAConflict_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "numberOfStuds": + out.Values[i] = ec._ZPAConflict_numberOfStuds(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "primussAncodes": + out.Values[i] = ec._ZPAConflict_primussAncodes(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var zPAExamImplementors = []string{"ZPAExam"} + +func (ec *executionContext) _ZPAExam(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAExam) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, zPAExamImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ZPAExam") + case "zpaID": + out.Values[i] = ec._ZPAExam_zpaID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "semester": + out.Values[i] = ec._ZPAExam_semester(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ancode": + out.Values[i] = ec._ZPAExam_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "module": + out.Values[i] = ec._ZPAExam_module(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mainExamer": + out.Values[i] = ec._ZPAExam_mainExamer(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mainExamerID": + out.Values[i] = ec._ZPAExam_mainExamerID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "examType": + out.Values[i] = ec._ZPAExam_examType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "examTypeFull": + out.Values[i] = ec._ZPAExam_examTypeFull(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "duration": + out.Values[i] = ec._ZPAExam_duration(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isRepeaterExam": + out.Values[i] = ec._ZPAExam_isRepeaterExam(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "groups": + out.Values[i] = ec._ZPAExam_groups(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "primussAncodes": + out.Values[i] = ec._ZPAExam_primussAncodes(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var zPAExamWithConstraintsImplementors = []string{"ZPAExamWithConstraints"} + +func (ec *executionContext) _ZPAExamWithConstraints(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAExamWithConstraints) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, zPAExamWithConstraintsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ZPAExamWithConstraints") + case "zpaExam": + out.Values[i] = ec._ZPAExamWithConstraints_zpaExam(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "constraints": + out.Values[i] = ec._ZPAExamWithConstraints_constraints(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var zPAExamsForTypeImplementors = []string{"ZPAExamsForType"} + +func (ec *executionContext) _ZPAExamsForType(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAExamsForType) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, zPAExamsForTypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ZPAExamsForType") + case "type": + out.Values[i] = ec._ZPAExamsForType_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "exams": + out.Values[i] = ec._ZPAExamsForType_exams(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var zPAInvigilatorImplementors = []string{"ZPAInvigilator"} + +func (ec *executionContext) _ZPAInvigilator(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAInvigilator) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, zPAInvigilatorImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ZPAInvigilator") + case "teacher": + out.Values[i] = ec._ZPAInvigilator_teacher(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "hasSubmittedRequirements": + out.Values[i] = ec._ZPAInvigilator_hasSubmittedRequirements(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var zPAPrimussAncodesImplementors = []string{"ZPAPrimussAncodes"} + +func (ec *executionContext) _ZPAPrimussAncodes(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAPrimussAncodes) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, zPAPrimussAncodesImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ZPAPrimussAncodes") + case "program": + out.Values[i] = ec._ZPAPrimussAncodes_program(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ancode": + out.Values[i] = ec._ZPAPrimussAncodes_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var zPAStudentRegImplementors = []string{"ZPAStudentReg"} + +func (ec *executionContext) _ZPAStudentReg(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAStudentReg) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, zPAStudentRegImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ZPAStudentReg") + case "ancode": + out.Values[i] = ec._ZPAStudentReg_ancode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mtknr": + out.Values[i] = ec._ZPAStudentReg_mtknr(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "program": + out.Values[i] = ec._ZPAStudentReg_program(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var zPAStudentRegErrorImplementors = []string{"ZPAStudentRegError"} + +func (ec *executionContext) _ZPAStudentRegError(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAStudentRegError) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, zPAStudentRegErrorImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ZPAStudentRegError") + case "semester": + out.Values[i] = ec._ZPAStudentRegError_semester(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ancode": + out.Values[i] = ec._ZPAStudentRegError_ancode(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "fk": - out.Values[i] = ec._Teacher_fk(ctx, field, obj) + case "exam": + out.Values[i] = ec._ZPAStudentRegError_exam(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "id": - out.Values[i] = ec._Teacher_id(ctx, field, obj) + case "mtknr": + out.Values[i] = ec._ZPAStudentRegError_mtknr(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "email": - out.Values[i] = ec._Teacher_email(ctx, field, obj) + case "program": + out.Values[i] = ec._ZPAStudentRegError_program(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -27060,69 +34243,36 @@ func (ec *executionContext) _Teacher(ctx context.Context, sel ast.SelectionSet, return out } -var zPAExamImplementors = []string{"ZPAExam"} +var __DirectiveImplementors = []string{"__Directive"} -func (ec *executionContext) _ZPAExam(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAExam) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, zPAExamImplementors) +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ZPAExam") - case "zpaID": - out.Values[i] = ec._ZPAExam_zpaID(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "semester": - out.Values[i] = ec._ZPAExam_semester(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "ancode": - out.Values[i] = ec._ZPAExam_ancode(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "module": - out.Values[i] = ec._ZPAExam_module(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "mainExamer": - out.Values[i] = ec._ZPAExam_mainExamer(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "mainExamerID": - out.Values[i] = ec._ZPAExam_mainExamerID(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "examType": - out.Values[i] = ec._ZPAExam_examType(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "examTypeFull": - out.Values[i] = ec._ZPAExam_examTypeFull(ctx, field, obj) + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "duration": - out.Values[i] = ec._ZPAExam_duration(ctx, field, obj) + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "isRepeaterExam": - out.Values[i] = ec._ZPAExam_isRepeaterExam(ctx, field, obj) + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "groups": - out.Values[i] = ec._ZPAExam_groups(ctx, field, obj) + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -27149,24 +34299,31 @@ func (ec *executionContext) _ZPAExam(ctx context.Context, sel ast.SelectionSet, return out } -var zPAExamWithConstraintsImplementors = []string{"ZPAExamWithConstraints"} +var __EnumValueImplementors = []string{"__EnumValue"} -func (ec *executionContext) _ZPAExamWithConstraints(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAExamWithConstraints) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, zPAExamWithConstraintsImplementors) +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ZPAExamWithConstraints") - case "zpaExam": - out.Values[i] = ec._ZPAExamWithConstraints_zpaExam(ctx, field, obj) + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "constraints": - out.Values[i] = ec._ZPAExamWithConstraints_constraints(ctx, field, obj) + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -27190,27 +34347,41 @@ func (ec *executionContext) _ZPAExamWithConstraints(ctx context.Context, sel ast return out } -var zPAExamsForTypeImplementors = []string{"ZPAExamsForType"} +var __FieldImplementors = []string{"__Field"} -func (ec *executionContext) _ZPAExamsForType(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAExamsForType) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, zPAExamsForTypeImplementors) +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ZPAExamsForType") + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } case "type": - out.Values[i] = ec._ZPAExamsForType_type(ctx, field, obj) + out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "exams": - out.Values[i] = ec._ZPAExamsForType_exams(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -27234,27 +34405,31 @@ func (ec *executionContext) _ZPAExamsForType(ctx context.Context, sel ast.Select return out } -var zPAInvigilatorImplementors = []string{"ZPAInvigilator"} +var __InputValueImplementors = []string{"__InputValue"} -func (ec *executionContext) _ZPAInvigilator(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAInvigilator) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, zPAInvigilatorImplementors) +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ZPAInvigilator") - case "teacher": - out.Values[i] = ec._ZPAInvigilator_teacher(ctx, field, obj) + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "hasSubmittedRequirements": - out.Values[i] = ec._ZPAInvigilator_hasSubmittedRequirements(ctx, field, obj) + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -27278,29 +34453,35 @@ func (ec *executionContext) _ZPAInvigilator(ctx context.Context, sel ast.Selecti return out } -var zPAStudentRegImplementors = []string{"ZPAStudentReg"} +var __SchemaImplementors = []string{"__Schema"} -func (ec *executionContext) _ZPAStudentReg(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAStudentReg) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, zPAStudentRegImplementors) +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ZPAStudentReg") - case "ancode": - out.Values[i] = ec._ZPAStudentReg_ancode(ctx, field, obj) + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "mtknr": - out.Values[i] = ec._ZPAStudentReg_mtknr(ctx, field, obj) + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "program": - out.Values[i] = ec._ZPAStudentReg_program(ctx, field, obj) + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -27327,42 +34508,40 @@ func (ec *executionContext) _ZPAStudentReg(ctx context.Context, sel ast.Selectio return out } -var zPAStudentRegErrorImplementors = []string{"ZPAStudentRegError"} +var __TypeImplementors = []string{"__Type"} -func (ec *executionContext) _ZPAStudentRegError(ctx context.Context, sel ast.SelectionSet, obj *model.ZPAStudentRegError) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, zPAStudentRegErrorImplementors) +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ZPAStudentRegError") - case "semester": - out.Values[i] = ec._ZPAStudentRegError_semester(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "ancode": - out.Values[i] = ec._ZPAStudentRegError_ancode(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "exam": - out.Values[i] = ec._ZPAStudentRegError_exam(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "mtknr": - out.Values[i] = ec._ZPAStudentRegError_mtknr(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "program": - out.Values[i] = ec._ZPAStudentRegError_program(ctx, field, obj) + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -27386,333 +34565,611 @@ func (ec *executionContext) _ZPAStudentRegError(ctx context.Context, sel ast.Sel return out } -var __DirectiveImplementors = []string{"__Directive"} +// endregion **************************** object.gotpl **************************** -func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) +// region ***************************** type.gotpl ***************************** - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Directive") - case "name": - out.Values[i] = ec.___Directive_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ +func (ec *executionContext) marshalNAdditionalExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAdditionalExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.AdditionalExam) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() } - case "description": - out.Values[i] = ec.___Directive_description(ctx, field, obj) - case "locations": - out.Values[i] = ec.___Directive_locations(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + ret[i] = ec.marshalNAdditionalExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAdditionalExam(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNAdditionalExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAdditionalExam(ctx context.Context, sel ast.SelectionSet, v *model.AdditionalExam) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._AdditionalExam(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNAdditionalExamInput2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAdditionalExamInput(ctx context.Context, v interface{}) (model.AdditionalExamInput, error) { + res, err := ec.unmarshalInputAdditionalExamInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Conflict) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() } - case "args": - out.Values[i] = ec.___Directive_args(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + ret[i] = ec.marshalNConflict2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflict(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNConflict2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflict(ctx context.Context, sel ast.SelectionSet, v *model.Conflict) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Conflict(ctx, sel, v) +} + +func (ec *executionContext) marshalNConflictPerProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictPerProgramᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ConflictPerProgram) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() } - case "isRepeatable": - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + ret[i] = ec.marshalNConflictPerProgram2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictPerProgram(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNConflictPerProgram2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictPerProgram(ctx context.Context, sel ast.SelectionSet, v *model.ConflictPerProgram) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ConflictPerProgram(ctx, sel, v) +} + +func (ec *executionContext) marshalNConflictsPerProgramAncode2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictsPerProgramAncodeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ConflictsPerProgramAncode) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNConflictsPerProgramAncode2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictsPerProgramAncode(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNConflictsPerProgramAncode2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictsPerProgramAncode(ctx context.Context, sel ast.SelectionSet, v *model.ConflictsPerProgramAncode) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ConflictsPerProgramAncode(ctx, sel, v) +} + +func (ec *executionContext) marshalNConnectedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ConnectedExam) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() } - default: - panic("unknown field " + strconv.Quote(field.Name)) + ret[i] = ec.marshalNConnectedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExam(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + } + wg.Wait() - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - return out + return ret } -var __EnumValueImplementors = []string{"__EnumValue"} - -func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__EnumValue") - case "name": - out.Values[i] = ec.___EnumValue_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "description": - out.Values[i] = ec.___EnumValue_description(ctx, field, obj) - case "isDeprecated": - out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "deprecationReason": - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNConnectedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExam(ctx context.Context, sel ast.SelectionSet, v *model.ConnectedExam) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } - } - out.Dispatch(ctx) - if out.Invalids > 0 { return graphql.Null } + return ec._ConnectedExam(ctx, sel, v) +} - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) +func (ec *executionContext) marshalNEnhancedPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐEnhancedPrimussExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.EnhancedPrimussExam) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNEnhancedPrimussExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐEnhancedPrimussExam(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - return out -} + } + wg.Wait() -var __FieldImplementors = []string{"__Field"} + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } -func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + return ret +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Field") - case "name": - out.Values[i] = ec.___Field_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "description": - out.Values[i] = ec.___Field_description(ctx, field, obj) - case "args": - out.Values[i] = ec.___Field_args(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "type": - out.Values[i] = ec.___Field_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "isDeprecated": - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "deprecationReason": - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNEnhancedPrimussExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐEnhancedPrimussExam(ctx context.Context, sel ast.SelectionSet, v *model.EnhancedPrimussExam) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } - } - out.Dispatch(ctx) - if out.Invalids > 0 { return graphql.Null } + return ec._EnhancedPrimussExam(ctx, sel, v) +} - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) +func (ec *executionContext) marshalNExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Exam) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExam(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - return out -} + } + wg.Wait() -var __InputValueImplementors = []string{"__InputValue"} + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } -func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + return ret +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__InputValue") - case "name": - out.Values[i] = ec.___InputValue_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "description": - out.Values[i] = ec.___InputValue_description(ctx, field, obj) - case "type": - out.Values[i] = ec.___InputValue_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "defaultValue": - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExam(ctx context.Context, sel ast.SelectionSet, v *model.Exam) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } - } - out.Dispatch(ctx) - if out.Invalids > 0 { return graphql.Null } + return ec._Exam(ctx, sel, v) +} - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) +func (ec *executionContext) marshalNExamDay2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamDayᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ExamDay) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNExamDay2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamDay(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - return out -} + } + wg.Wait() -var __SchemaImplementors = []string{"__Schema"} + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } -func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + return ret +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Schema") - case "description": - out.Values[i] = ec.___Schema_description(ctx, field, obj) - case "types": - out.Values[i] = ec.___Schema_types(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "queryType": - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "mutationType": - out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) - case "subscriptionType": - out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) - case "directives": - out.Values[i] = ec.___Schema_directives(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNExamDay2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamDay(ctx context.Context, sel ast.SelectionSet, v *model.ExamDay) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } - } - out.Dispatch(ctx) - if out.Invalids > 0 { return graphql.Null } + return ec._ExamDay(ctx, sel, v) +} - atomic.AddInt32(&ec.deferred, int32(len(deferred))) +func (ec *executionContext) marshalNExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ExamGroup) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNExamGroup2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroup(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) } + wg.Wait() - return out + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret } -var __TypeImplementors = []string{"__Type"} +func (ec *executionContext) marshalNExamGroup2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroup(ctx context.Context, sel ast.SelectionSet, v *model.ExamGroup) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ExamGroup(ctx, sel, v) +} -func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) +func (ec *executionContext) marshalNExamInPlan2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamInPlan(ctx context.Context, sel ast.SelectionSet, v *model.ExamInPlan) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ExamInPlan(ctx, sel, v) +} - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Type") - case "kind": - out.Values[i] = ec.___Type_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ +func (ec *executionContext) marshalNExamToPlan2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamToPlanᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ExamToPlan) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() } - case "name": - out.Values[i] = ec.___Type_name(ctx, field, obj) - case "description": - out.Values[i] = ec.___Type_description(ctx, field, obj) - case "fields": - out.Values[i] = ec.___Type_fields(ctx, field, obj) - case "interfaces": - out.Values[i] = ec.___Type_interfaces(ctx, field, obj) - case "possibleTypes": - out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) - case "enumValues": - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) - case "inputFields": - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) - case "ofType": - out.Values[i] = ec.___Type_ofType(ctx, field, obj) - case "specifiedByURL": - out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) + ret[i] = ec.marshalNExamToPlan2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamToPlan(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) } + } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + return ret +} - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) +func (ec *executionContext) marshalNExamToPlan2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamToPlan(ctx context.Context, sel ast.SelectionSet, v *model.ExamToPlan) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null } + return ec._ExamToPlan(ctx, sel, v) +} - return out +func (ec *executionContext) marshalNExamWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegs(ctx context.Context, sel ast.SelectionSet, v *model.ExamWithRegs) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ExamWithRegs(ctx, sel, v) } -// endregion **************************** object.gotpl **************************** +func (ec *executionContext) marshalNExamWithRegsAndRooms2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegsAndRooms(ctx context.Context, sel ast.SelectionSet, v *model.ExamWithRegsAndRooms) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ExamWithRegsAndRooms(ctx, sel, v) +} -// region ***************************** type.gotpl ***************************** +func (ec *executionContext) marshalNExamerInPlan2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamerInPlan(ctx context.Context, sel ast.SelectionSet, v *model.ExamerInPlan) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ExamerInPlan(ctx, sel, v) +} -func (ec *executionContext) marshalNAdditionalExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAdditionalExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.AdditionalExam) graphql.Marshaler { +func (ec *executionContext) marshalNExternalExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExternalExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ExternalExam) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -27736,7 +35193,7 @@ func (ec *executionContext) marshalNAdditionalExam2ᚕᚖgithubᚗcomᚋobcode if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNAdditionalExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAdditionalExam(ctx, sel, v[i]) + ret[i] = ec.marshalNExternalExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExternalExam(ctx, sel, v[i]) } if isLen1 { f(i) @@ -27756,37 +35213,17 @@ func (ec *executionContext) marshalNAdditionalExam2ᚕᚖgithubᚗcomᚋobcode return ret } -func (ec *executionContext) marshalNAdditionalExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAdditionalExam(ctx context.Context, sel ast.SelectionSet, v *model.AdditionalExam) graphql.Marshaler { +func (ec *executionContext) marshalNExternalExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExternalExam(ctx context.Context, sel ast.SelectionSet, v *model.ExternalExam) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._AdditionalExam(ctx, sel, v) + return ec._ExternalExam(ctx, sel, v) } -func (ec *executionContext) unmarshalNAdditionalExamInput2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐAdditionalExamInput(ctx context.Context, v interface{}) (model.AdditionalExamInput, error) { - res, err := ec.unmarshalInputAdditionalExamInput(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) marshalNConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Conflict) graphql.Marshaler { +func (ec *executionContext) marshalNFK07Program2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐFK07Programᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.FK07Program) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -27810,7 +35247,7 @@ func (ec *executionContext) marshalNConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexa if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNConflict2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflict(ctx, sel, v[i]) + ret[i] = ec.marshalNFK07Program2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐFK07Program(ctx, sel, v[i]) } if isLen1 { f(i) @@ -27830,17 +35267,32 @@ func (ec *executionContext) marshalNConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexa return ret } -func (ec *executionContext) marshalNConflict2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflict(ctx context.Context, sel ast.SelectionSet, v *model.Conflict) graphql.Marshaler { +func (ec *executionContext) marshalNFK07Program2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐFK07Program(ctx context.Context, sel ast.SelectionSet, v *model.FK07Program) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._Conflict(ctx, sel, v) + return ec._FK07Program(ctx, sel, v) } -func (ec *executionContext) marshalNConflictPerProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictPerProgramᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ConflictPerProgram) graphql.Marshaler { +func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { + res, err := graphql.UnmarshalFloatContext(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + res := graphql.MarshalFloatContext(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return graphql.WrapContextMarshaler(ctx, res) +} + +func (ec *executionContext) marshalNGeneratedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐGeneratedExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GeneratedExam) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -27864,7 +35316,7 @@ func (ec *executionContext) marshalNConflictPerProgram2ᚕᚖgithubᚗcomᚋobco if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNConflictPerProgram2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictPerProgram(ctx, sel, v[i]) + ret[i] = ec.marshalNGeneratedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐGeneratedExam(ctx, sel, v[i]) } if isLen1 { f(i) @@ -27884,31 +35336,74 @@ func (ec *executionContext) marshalNConflictPerProgram2ᚕᚖgithubᚗcomᚋobco return ret } -func (ec *executionContext) marshalNConflictPerProgram2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictPerProgram(ctx context.Context, sel ast.SelectionSet, v *model.ConflictPerProgram) graphql.Marshaler { +func (ec *executionContext) marshalNGeneratedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐGeneratedExam(ctx context.Context, sel ast.SelectionSet, v *model.GeneratedExam) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ConflictPerProgram(ctx, sel, v) + return ec._GeneratedExam(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res } -func (ec *executionContext) marshalNConflicts2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflicts(ctx context.Context, sel ast.SelectionSet, v model.Conflicts) graphql.Marshaler { - return ec._Conflicts(ctx, sel, &v) +func (ec *executionContext) unmarshalNInt2ᚕintᚄ(ctx context.Context, v interface{}) ([]int, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]int, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInt2int(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil } -func (ec *executionContext) marshalNConflicts2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflicts(ctx context.Context, sel ast.SelectionSet, v *model.Conflicts) graphql.Marshaler { +func (ec *executionContext) marshalNInt2ᚕintᚄ(ctx context.Context, sel ast.SelectionSet, v []int) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNInt2int(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNInvigilation2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilation(ctx context.Context, sel ast.SelectionSet, v *model.Invigilation) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._Conflicts(ctx, sel, v) + return ec._Invigilation(ctx, sel, v) } -func (ec *executionContext) marshalNConnectedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ConnectedExam) graphql.Marshaler { +func (ec *executionContext) marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Invigilator) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -27932,7 +35427,7 @@ func (ec *executionContext) marshalNConnectedExam2ᚕᚖgithubᚗcomᚋobcodeᚋ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNConnectedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExam(ctx, sel, v[i]) + ret[i] = ec.marshalNInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilator(ctx, sel, v[i]) } if isLen1 { f(i) @@ -27952,17 +35447,21 @@ func (ec *executionContext) marshalNConnectedExam2ᚕᚖgithubᚗcomᚋobcodeᚋ return ret } -func (ec *executionContext) marshalNConnectedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExam(ctx context.Context, sel ast.SelectionSet, v *model.ConnectedExam) graphql.Marshaler { +func (ec *executionContext) marshalNInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilator(ctx context.Context, sel ast.SelectionSet, v *model.Invigilator) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ConnectedExam(ctx, sel, v) + return ec._Invigilator(ctx, sel, v) } -func (ec *executionContext) marshalNExamDay2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamDayᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ExamDay) graphql.Marshaler { +func (ec *executionContext) marshalNNTA2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx context.Context, sel ast.SelectionSet, v model.NTA) graphql.Marshaler { + return ec._NTA(ctx, sel, &v) +} + +func (ec *executionContext) marshalNNTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.NTA) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -27986,7 +35485,7 @@ func (ec *executionContext) marshalNExamDay2ᚕᚖgithubᚗcomᚋobcodeᚋplexam if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNExamDay2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamDay(ctx, sel, v[i]) + ret[i] = ec.marshalNNTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28006,17 +35505,17 @@ func (ec *executionContext) marshalNExamDay2ᚕᚖgithubᚗcomᚋobcodeᚋplexam return ret } -func (ec *executionContext) marshalNExamDay2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamDay(ctx context.Context, sel ast.SelectionSet, v *model.ExamDay) graphql.Marshaler { +func (ec *executionContext) marshalNNTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx context.Context, sel ast.SelectionSet, v *model.NTA) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ExamDay(ctx, sel, v) + return ec._NTA(ctx, sel, v) } -func (ec *executionContext) marshalNExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ExamGroup) graphql.Marshaler { +func (ec *executionContext) marshalNNTAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.NTAExam) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28040,7 +35539,7 @@ func (ec *executionContext) marshalNExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplex if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNExamGroup2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroup(ctx, sel, v[i]) + ret[i] = ec.marshalNNTAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAExam(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28060,37 +35559,52 @@ func (ec *executionContext) marshalNExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplex return ret } -func (ec *executionContext) marshalNExamGroup2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroup(ctx context.Context, sel ast.SelectionSet, v *model.ExamGroup) graphql.Marshaler { +func (ec *executionContext) marshalNNTAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAExam(ctx context.Context, sel ast.SelectionSet, v *model.NTAExam) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ExamGroup(ctx, sel, v) + return ec._NTAExam(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNNTAInput2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAInput(ctx context.Context, v interface{}) (model.NTAInput, error) { + res, err := ec.unmarshalInputNTAInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNExamGroupConflict2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupConflict(ctx context.Context, sel ast.SelectionSet, v *model.ExamGroupConflict) graphql.Marshaler { +func (ec *executionContext) marshalNNTAWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegs(ctx context.Context, sel ast.SelectionSet, v *model.NTAWithRegs) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ExamGroupConflict(ctx, sel, v) + return ec._NTAWithRegs(ctx, sel, v) } -func (ec *executionContext) marshalNExamInPlan2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamInPlan(ctx context.Context, sel ast.SelectionSet, v *model.ExamInPlan) graphql.Marshaler { +func (ec *executionContext) marshalNNTAWithRegsByExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsByExam(ctx context.Context, sel ast.SelectionSet, v *model.NTAWithRegsByExam) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ExamInPlan(ctx, sel, v) + return ec._NTAWithRegsByExam(ctx, sel, v) } -func (ec *executionContext) marshalNExamToPlan2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamToPlanᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ExamToPlan) graphql.Marshaler { +func (ec *executionContext) marshalNNTAWithRegsByExamAndTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsByExamAndTeacher(ctx context.Context, sel ast.SelectionSet, v *model.NTAWithRegsByExamAndTeacher) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._NTAWithRegsByExamAndTeacher(ctx, sel, v) +} + +func (ec *executionContext) marshalNPlannedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PlannedExam) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28114,7 +35628,7 @@ func (ec *executionContext) marshalNExamToPlan2ᚕᚖgithubᚗcomᚋobcodeᚋple if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNExamToPlan2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamToPlan(ctx, sel, v[i]) + ret[i] = ec.marshalNPlannedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExam(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28134,47 +35648,27 @@ func (ec *executionContext) marshalNExamToPlan2ᚕᚖgithubᚗcomᚋobcodeᚋple return ret } -func (ec *executionContext) marshalNExamToPlan2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamToPlan(ctx context.Context, sel ast.SelectionSet, v *model.ExamToPlan) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ExamToPlan(ctx, sel, v) -} - -func (ec *executionContext) marshalNExamWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegs(ctx context.Context, sel ast.SelectionSet, v *model.ExamWithRegs) graphql.Marshaler { +func (ec *executionContext) marshalNPlannedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExam(ctx context.Context, sel ast.SelectionSet, v *model.PlannedExam) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ExamWithRegs(ctx, sel, v) + return ec._PlannedExam(ctx, sel, v) } -func (ec *executionContext) marshalNExamWithRegsAndRooms2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamWithRegsAndRooms(ctx context.Context, sel ast.SelectionSet, v *model.ExamWithRegsAndRooms) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ExamWithRegsAndRooms(ctx, sel, v) -} - -func (ec *executionContext) marshalNExamerInPlan2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamerInPlan(ctx context.Context, sel ast.SelectionSet, v *model.ExamerInPlan) graphql.Marshaler { +func (ec *executionContext) marshalNPlannedExamWithNTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExamWithNta(ctx context.Context, sel ast.SelectionSet, v *model.PlannedExamWithNta) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ExamerInPlan(ctx, sel, v) + return ec._PlannedExamWithNTA(ctx, sel, v) } -func (ec *executionContext) marshalNFK07Program2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐFK07Programᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.FK07Program) graphql.Marshaler { +func (ec *executionContext) marshalNPlannedRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedRoomᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PlannedRoom) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28198,7 +35692,7 @@ func (ec *executionContext) marshalNFK07Program2ᚕᚖgithubᚗcomᚋobcodeᚋpl if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNFK07Program2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐFK07Program(ctx, sel, v[i]) + ret[i] = ec.marshalNPlannedRoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedRoom(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28218,68 +35712,54 @@ func (ec *executionContext) marshalNFK07Program2ᚕᚖgithubᚗcomᚋobcodeᚋpl return ret } -func (ec *executionContext) marshalNFK07Program2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐFK07Program(ctx context.Context, sel ast.SelectionSet, v *model.FK07Program) graphql.Marshaler { +func (ec *executionContext) marshalNPlannedRoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedRoom(ctx context.Context, sel ast.SelectionSet, v *model.PlannedRoom) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._FK07Program(ctx, sel, v) + return ec._PlannedRoom(ctx, sel, v) } -func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { - res, err := graphql.UnmarshalFloatContext(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) marshalNPrimussExam2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExam(ctx context.Context, sel ast.SelectionSet, v model.PrimussExam) graphql.Marshaler { + return ec._PrimussExam(ctx, sel, &v) } -func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { - res := graphql.MarshalFloatContext(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } +func (ec *executionContext) marshalNPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PrimussExam) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) } - return graphql.WrapContextMarshaler(ctx, res) -} - -func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { - res, err := graphql.UnmarshalInt(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { - res := graphql.MarshalInt(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], } - } - return res -} - -func (ec *executionContext) unmarshalNInt2ᚕintᚄ(ctx context.Context, v interface{}) ([]int, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]int, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNInt2int(ctx, vSlice[i]) - if err != nil { - return nil, err + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNPrimussExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExam(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) } - } - return res, nil -} -func (ec *executionContext) marshalNInt2ᚕintᚄ(ctx context.Context, sel ast.SelectionSet, v []int) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - for i := range v { - ret[i] = ec.marshalNInt2int(ctx, sel, v[i]) } + wg.Wait() for _, e := range ret { if e == graphql.Null { @@ -28290,17 +35770,17 @@ func (ec *executionContext) marshalNInt2ᚕintᚄ(ctx context.Context, sel ast.S return ret } -func (ec *executionContext) marshalNInvigilation2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilation(ctx context.Context, sel ast.SelectionSet, v *model.Invigilation) graphql.Marshaler { +func (ec *executionContext) marshalNPrimussExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExam(ctx context.Context, sel ast.SelectionSet, v *model.PrimussExam) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._Invigilation(ctx, sel, v) + return ec._PrimussExam(ctx, sel, v) } -func (ec *executionContext) marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilatorᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Invigilator) graphql.Marshaler { +func (ec *executionContext) marshalNPrimussExamAncode2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamAncodeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PrimussExamAncode) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28324,7 +35804,7 @@ func (ec *executionContext) marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋpl if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilator(ctx, sel, v[i]) + ret[i] = ec.marshalNPrimussExamAncode2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamAncode(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28344,31 +35824,17 @@ func (ec *executionContext) marshalNInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋpl return ret } -func (ec *executionContext) marshalNInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐInvigilator(ctx context.Context, sel ast.SelectionSet, v *model.Invigilator) graphql.Marshaler { +func (ec *executionContext) marshalNPrimussExamAncode2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamAncode(ctx context.Context, sel ast.SelectionSet, v *model.PrimussExamAncode) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._Invigilator(ctx, sel, v) -} - -func (ec *executionContext) marshalNNTA2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx context.Context, sel ast.SelectionSet, v model.NTA) graphql.Marshaler { - return ec._NTA(ctx, sel, &v) -} - -func (ec *executionContext) marshalNNTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx context.Context, sel ast.SelectionSet, v *model.NTA) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._NTA(ctx, sel, v) + return ec._PrimussExamAncode(ctx, sel, v) } -func (ec *executionContext) marshalNNTAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.NTAExam) graphql.Marshaler { +func (ec *executionContext) marshalNPrimussExamWithCount2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamWithCountᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PrimussExamWithCount) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28392,7 +35858,7 @@ func (ec *executionContext) marshalNNTAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexam if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNNTAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAExam(ctx, sel, v[i]) + ret[i] = ec.marshalNPrimussExamWithCount2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamWithCount(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28412,22 +35878,17 @@ func (ec *executionContext) marshalNNTAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexam return ret } -func (ec *executionContext) marshalNNTAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAExam(ctx context.Context, sel ast.SelectionSet, v *model.NTAExam) graphql.Marshaler { +func (ec *executionContext) marshalNPrimussExamWithCount2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamWithCount(ctx context.Context, sel ast.SelectionSet, v *model.PrimussExamWithCount) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._NTAExam(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNNTAInput2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAInput(ctx context.Context, v interface{}) (model.NTAInput, error) { - res, err := ec.unmarshalInputNTAInput(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) + return ec._PrimussExamWithCount(ctx, sel, v) } -func (ec *executionContext) marshalNNTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.NTAWithRegs) graphql.Marshaler { +func (ec *executionContext) marshalNRegWithError2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRegWithErrorᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RegWithError) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28451,7 +35912,7 @@ func (ec *executionContext) marshalNNTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋpl if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNNTAWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegs(ctx, sel, v[i]) + ret[i] = ec.marshalNRegWithError2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRegWithError(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28471,51 +35932,75 @@ func (ec *executionContext) marshalNNTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋpl return ret } -func (ec *executionContext) marshalNNTAWithRegs2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegs(ctx context.Context, sel ast.SelectionSet, v *model.NTAWithRegs) graphql.Marshaler { +func (ec *executionContext) marshalNRegWithError2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRegWithError(ctx context.Context, sel ast.SelectionSet, v *model.RegWithError) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._NTAWithRegs(ctx, sel, v) + return ec._RegWithError(ctx, sel, v) } -func (ec *executionContext) marshalNNTAWithRegsByExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsByExam(ctx context.Context, sel ast.SelectionSet, v *model.NTAWithRegsByExam) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") +func (ec *executionContext) marshalNRoom2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoom(ctx context.Context, sel ast.SelectionSet, v model.Room) graphql.Marshaler { + return ec._Room(ctx, sel, &v) +} + +func (ec *executionContext) marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Room) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], } - return graphql.Null + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNRoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoom(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + } - return ec._NTAWithRegsByExam(ctx, sel, v) -} + wg.Wait() -func (ec *executionContext) marshalNNTAWithRegsByExamAndTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsByExamAndTeacher(ctx context.Context, sel ast.SelectionSet, v *model.NTAWithRegsByExamAndTeacher) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") + for _, e := range ret { + if e == graphql.Null { + return graphql.Null } - return graphql.Null } - return ec._NTAWithRegsByExamAndTeacher(ctx, sel, v) + + return ret } -func (ec *executionContext) marshalNPlannedExamWithNTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExamWithNta(ctx context.Context, sel ast.SelectionSet, v *model.PlannedExamWithNta) graphql.Marshaler { +func (ec *executionContext) marshalNRoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoom(ctx context.Context, sel ast.SelectionSet, v *model.Room) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._PlannedExamWithNTA(ctx, sel, v) -} - -func (ec *executionContext) marshalNPrimussExam2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExam(ctx context.Context, sel ast.SelectionSet, v model.PrimussExam) graphql.Marshaler { - return ec._PrimussExam(ctx, sel, &v) + return ec._Room(ctx, sel, v) } -func (ec *executionContext) marshalNPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PrimussExam) graphql.Marshaler { +func (ec *executionContext) marshalNRoomAndExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomAndExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RoomAndExam) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28539,7 +36024,7 @@ func (ec *executionContext) marshalNPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋpl if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNPrimussExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExam(ctx, sel, v[i]) + ret[i] = ec.marshalNRoomAndExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomAndExam(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28559,39 +36044,32 @@ func (ec *executionContext) marshalNPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋpl return ret } -func (ec *executionContext) marshalNPrimussExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExam(ctx context.Context, sel ast.SelectionSet, v *model.PrimussExam) graphql.Marshaler { +func (ec *executionContext) marshalNRoomAndExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomAndExam(ctx context.Context, sel ast.SelectionSet, v *model.RoomAndExam) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._PrimussExam(ctx, sel, v) + return ec._RoomAndExam(ctx, sel, v) } -func (ec *executionContext) unmarshalNPrimussExamInput2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamInputᚄ(ctx context.Context, v interface{}) ([]*model.PrimussExamInput, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*model.PrimussExamInput, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNPrimussExamInput2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamInput(ctx, vSlice[i]) - if err != nil { - return nil, err +func (ec *executionContext) marshalNRoomForExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExam(ctx context.Context, sel ast.SelectionSet, v *model.RoomForExam) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } + return graphql.Null } - return res, nil + return ec._RoomForExam(ctx, sel, v) } -func (ec *executionContext) unmarshalNPrimussExamInput2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamInput(ctx context.Context, v interface{}) (*model.PrimussExamInput, error) { - res, err := ec.unmarshalInputPrimussExamInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) +func (ec *executionContext) unmarshalNRoomForExamInput2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExamInput(ctx context.Context, v interface{}) (model.RoomForExamInput, error) { + res, err := ec.unmarshalInputRoomForExamInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNRegWithError2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRegWithErrorᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RegWithError) graphql.Marshaler { +func (ec *executionContext) marshalNRoomWithInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomWithInvigilatorᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RoomWithInvigilator) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28615,7 +36093,7 @@ func (ec *executionContext) marshalNRegWithError2ᚕᚖgithubᚗcomᚋobcodeᚋp if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNRegWithError2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRegWithError(ctx, sel, v[i]) + ret[i] = ec.marshalNRoomWithInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomWithInvigilator(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28635,17 +36113,21 @@ func (ec *executionContext) marshalNRegWithError2ᚕᚖgithubᚗcomᚋobcodeᚋp return ret } -func (ec *executionContext) marshalNRegWithError2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRegWithError(ctx context.Context, sel ast.SelectionSet, v *model.RegWithError) graphql.Marshaler { +func (ec *executionContext) marshalNRoomWithInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomWithInvigilator(ctx context.Context, sel ast.SelectionSet, v *model.RoomWithInvigilator) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._RegWithError(ctx, sel, v) + return ec._RoomWithInvigilator(ctx, sel, v) } -func (ec *executionContext) marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Room) graphql.Marshaler { +func (ec *executionContext) marshalNSemester2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemester(ctx context.Context, sel ast.SelectionSet, v model.Semester) graphql.Marshaler { + return ec._Semester(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSemester2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Semester) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28669,7 +36151,7 @@ func (ec *executionContext) marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexams if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNRoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoom(ctx, sel, v[i]) + ret[i] = ec.marshalNSemester2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemester(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28689,17 +36171,31 @@ func (ec *executionContext) marshalNRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexams return ret } -func (ec *executionContext) marshalNRoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoom(ctx context.Context, sel ast.SelectionSet, v *model.Room) graphql.Marshaler { +func (ec *executionContext) marshalNSemester2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemester(ctx context.Context, sel ast.SelectionSet, v *model.Semester) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._Room(ctx, sel, v) + return ec._Semester(ctx, sel, v) } -func (ec *executionContext) marshalNRoomAndExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomAndExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RoomAndExam) graphql.Marshaler { +func (ec *executionContext) marshalNSemesterConfig2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterConfig(ctx context.Context, sel ast.SelectionSet, v model.SemesterConfig) graphql.Marshaler { + return ec._SemesterConfig(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSemesterConfig2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterConfig(ctx context.Context, sel ast.SelectionSet, v *model.SemesterConfig) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._SemesterConfig(ctx, sel, v) +} + +func (ec *executionContext) marshalNSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Slot) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28723,7 +36219,7 @@ func (ec *executionContext) marshalNRoomAndExam2ᚕᚖgithubᚗcomᚋobcodeᚋpl if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNRoomAndExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomAndExam(ctx, sel, v[i]) + ret[i] = ec.marshalNSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28743,17 +36239,17 @@ func (ec *executionContext) marshalNRoomAndExam2ᚕᚖgithubᚗcomᚋobcodeᚋpl return ret } -func (ec *executionContext) marshalNRoomAndExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomAndExam(ctx context.Context, sel ast.SelectionSet, v *model.RoomAndExam) graphql.Marshaler { +func (ec *executionContext) marshalNSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx context.Context, sel ast.SelectionSet, v *model.Slot) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._RoomAndExam(ctx, sel, v) + return ec._Slot(ctx, sel, v) } -func (ec *executionContext) marshalNRoomForExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RoomForExam) graphql.Marshaler { +func (ec *executionContext) marshalNStarttime2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStarttimeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Starttime) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28777,7 +36273,7 @@ func (ec *executionContext) marshalNRoomForExam2ᚕᚖgithubᚗcomᚋobcodeᚋpl if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNRoomForExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExam(ctx, sel, v[i]) + ret[i] = ec.marshalNStarttime2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStarttime(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28797,22 +36293,17 @@ func (ec *executionContext) marshalNRoomForExam2ᚕᚖgithubᚗcomᚋobcodeᚋpl return ret } -func (ec *executionContext) marshalNRoomForExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExam(ctx context.Context, sel ast.SelectionSet, v *model.RoomForExam) graphql.Marshaler { +func (ec *executionContext) marshalNStarttime2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStarttime(ctx context.Context, sel ast.SelectionSet, v *model.Starttime) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._RoomForExam(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNRoomForExamInput2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExamInput(ctx context.Context, v interface{}) (model.RoomForExamInput, error) { - res, err := ec.unmarshalInputRoomForExamInput(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) + return ec._Starttime(ctx, sel, v) } -func (ec *executionContext) marshalNRoomWithInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomWithInvigilatorᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RoomWithInvigilator) graphql.Marshaler { +func (ec *executionContext) marshalNStep2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStepᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Step) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28836,7 +36327,7 @@ func (ec *executionContext) marshalNRoomWithInvigilator2ᚕᚖgithubᚗcomᚋobc if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNRoomWithInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomWithInvigilator(ctx, sel, v[i]) + ret[i] = ec.marshalNStep2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStep(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28856,21 +36347,64 @@ func (ec *executionContext) marshalNRoomWithInvigilator2ᚕᚖgithubᚗcomᚋobc return ret } -func (ec *executionContext) marshalNRoomWithInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomWithInvigilator(ctx context.Context, sel ast.SelectionSet, v *model.RoomWithInvigilator) graphql.Marshaler { +func (ec *executionContext) marshalNStep2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStep(ctx context.Context, sel ast.SelectionSet, v *model.Step) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._RoomWithInvigilator(ctx, sel, v) + return ec._Step(ctx, sel, v) } -func (ec *executionContext) marshalNSemester2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemester(ctx context.Context, sel ast.SelectionSet, v model.Semester) graphql.Marshaler { - return ec._Semester(ctx, sel, &v) +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNSemester2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Semester) graphql.Marshaler { +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNStudent2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Student) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28894,7 +36428,7 @@ func (ec *executionContext) marshalNSemester2ᚕᚖgithubᚗcomᚋobcodeᚋplexa if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNSemester2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemester(ctx, sel, v[i]) + ret[i] = ec.marshalNStudent2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudent(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28914,31 +36448,17 @@ func (ec *executionContext) marshalNSemester2ᚕᚖgithubᚗcomᚋobcodeᚋplexa return ret } -func (ec *executionContext) marshalNSemester2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemester(ctx context.Context, sel ast.SelectionSet, v *model.Semester) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Semester(ctx, sel, v) -} - -func (ec *executionContext) marshalNSemesterConfig2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterConfig(ctx context.Context, sel ast.SelectionSet, v model.SemesterConfig) graphql.Marshaler { - return ec._SemesterConfig(ctx, sel, &v) -} - -func (ec *executionContext) marshalNSemesterConfig2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterConfig(ctx context.Context, sel ast.SelectionSet, v *model.SemesterConfig) graphql.Marshaler { +func (ec *executionContext) marshalNStudent2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudent(ctx context.Context, sel ast.SelectionSet, v *model.Student) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._SemesterConfig(ctx, sel, v) + return ec._Student(ctx, sel, v) } -func (ec *executionContext) marshalNSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlotᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Slot) graphql.Marshaler { +func (ec *executionContext) marshalNStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.StudentReg) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -28962,7 +36482,7 @@ func (ec *executionContext) marshalNSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexams if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx, sel, v[i]) + ret[i] = ec.marshalNStudentReg2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentReg(ctx, sel, v[i]) } if isLen1 { f(i) @@ -28982,17 +36502,17 @@ func (ec *executionContext) marshalNSlot2ᚕᚖgithubᚗcomᚋobcodeᚋplexams return ret } -func (ec *executionContext) marshalNSlot2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSlot(ctx context.Context, sel ast.SelectionSet, v *model.Slot) graphql.Marshaler { +func (ec *executionContext) marshalNStudentReg2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentReg(ctx context.Context, sel ast.SelectionSet, v *model.StudentReg) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._Slot(ctx, sel, v) + return ec._StudentReg(ctx, sel, v) } -func (ec *executionContext) marshalNStarttime2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStarttimeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Starttime) graphql.Marshaler { +func (ec *executionContext) marshalNStudentRegsPerAncodeAndProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgramᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.StudentRegsPerAncodeAndProgram) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -29016,7 +36536,7 @@ func (ec *executionContext) marshalNStarttime2ᚕᚖgithubᚗcomᚋobcodeᚋplex if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNStarttime2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStarttime(ctx, sel, v[i]) + ret[i] = ec.marshalNStudentRegsPerAncodeAndProgram2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgram(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29036,17 +36556,21 @@ func (ec *executionContext) marshalNStarttime2ᚕᚖgithubᚗcomᚋobcodeᚋplex return ret } -func (ec *executionContext) marshalNStarttime2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStarttime(ctx context.Context, sel ast.SelectionSet, v *model.Starttime) graphql.Marshaler { +func (ec *executionContext) marshalNStudentRegsPerAncodeAndProgram2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgram(ctx context.Context, sel ast.SelectionSet, v *model.StudentRegsPerAncodeAndProgram) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._Starttime(ctx, sel, v) + return ec._StudentRegsPerAncodeAndProgram(ctx, sel, v) } -func (ec *executionContext) marshalNStep2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStepᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Step) graphql.Marshaler { +func (ec *executionContext) marshalNTeacher2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx context.Context, sel ast.SelectionSet, v model.Teacher) graphql.Marshaler { + return ec._Teacher(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTeacher2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacherᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Teacher) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -29070,7 +36594,7 @@ func (ec *executionContext) marshalNStep2ᚕᚖgithubᚗcomᚋobcodeᚋplexams if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNStep2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStep(ctx, sel, v[i]) + ret[i] = ec.marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29090,23 +36614,23 @@ func (ec *executionContext) marshalNStep2ᚕᚖgithubᚗcomᚋobcodeᚋplexams return ret } -func (ec *executionContext) marshalNStep2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStep(ctx context.Context, sel ast.SelectionSet, v *model.Step) graphql.Marshaler { +func (ec *executionContext) marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx context.Context, sel ast.SelectionSet, v *model.Teacher) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._Step(ctx, sel, v) + return ec._Teacher(ctx, sel, v) } -func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) +func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { + res, err := graphql.UnmarshalTime(v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) +func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { + res := graphql.MarshalTime(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") @@ -29115,16 +36639,16 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } -func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { +func (ec *executionContext) unmarshalNTime2ᚕᚖtimeᚐTimeᚄ(ctx context.Context, v interface{}) ([]*time.Time, error) { var vSlice []interface{} if v != nil { vSlice = graphql.CoerceList(v) } var err error - res := make([]string, len(vSlice)) + res := make([]*time.Time, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + res[i], err = ec.unmarshalNTime2ᚖtimeᚐTime(ctx, vSlice[i]) if err != nil { return nil, err } @@ -29132,10 +36656,10 @@ func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v return res, nil } -func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { +func (ec *executionContext) marshalNTime2ᚕᚖtimeᚐTimeᚄ(ctx context.Context, sel ast.SelectionSet, v []*time.Time) graphql.Marshaler { ret := make(graphql.Array, len(v)) for i := range v { - ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + ret[i] = ec.marshalNTime2ᚖtimeᚐTime(ctx, sel, v[i]) } for _, e := range ret { @@ -29147,71 +36671,28 @@ func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel return ret } -func (ec *executionContext) marshalNStudent2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudent(ctx context.Context, sel ast.SelectionSet, v *model.Student) graphql.Marshaler { +func (ec *executionContext) unmarshalNTime2ᚖtimeᚐTime(ctx context.Context, v interface{}) (*time.Time, error) { + res, err := graphql.UnmarshalTime(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._Student(ctx, sel, v) -} - -func (ec *executionContext) marshalNStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.StudentReg) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNStudentReg2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentReg(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNStudentReg2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentReg(ctx context.Context, sel ast.SelectionSet, v *model.StudentReg) graphql.Marshaler { - if v == nil { + res := graphql.MarshalTime(*v) + if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } - return graphql.Null } - return ec._StudentReg(ctx, sel, v) + return res } -func (ec *executionContext) marshalNStudentRegsPerAncodeAndProgram2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgramᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.StudentRegsPerAncodeAndProgram) graphql.Marshaler { +func (ec *executionContext) marshalNZPAConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAConflictᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ZPAConflict) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -29235,7 +36716,7 @@ func (ec *executionContext) marshalNStudentRegsPerAncodeAndProgram2ᚕᚖgithub if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNStudentRegsPerAncodeAndProgram2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgram(ctx, sel, v[i]) + ret[i] = ec.marshalNZPAConflict2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAConflict(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29255,17 +36736,17 @@ func (ec *executionContext) marshalNStudentRegsPerAncodeAndProgram2ᚕᚖgithub return ret } -func (ec *executionContext) marshalNStudentRegsPerAncodeAndProgram2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegsPerAncodeAndProgram(ctx context.Context, sel ast.SelectionSet, v *model.StudentRegsPerAncodeAndProgram) graphql.Marshaler { +func (ec *executionContext) marshalNZPAConflict2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAConflict(ctx context.Context, sel ast.SelectionSet, v *model.ZPAConflict) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._StudentRegsPerAncodeAndProgram(ctx, sel, v) + return ec._ZPAConflict(ctx, sel, v) } -func (ec *executionContext) marshalNTeacher2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacherᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Teacher) graphql.Marshaler { +func (ec *executionContext) marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ZPAExam) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -29289,7 +36770,7 @@ func (ec *executionContext) marshalNTeacher2ᚕᚖgithubᚗcomᚋobcodeᚋplexam if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx, sel, v[i]) + ret[i] = ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29309,85 +36790,17 @@ func (ec *executionContext) marshalNTeacher2ᚕᚖgithubᚗcomᚋobcodeᚋplexam return ret } -func (ec *executionContext) marshalNTeacher2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐTeacher(ctx context.Context, sel ast.SelectionSet, v *model.Teacher) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Teacher(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { - res, err := graphql.UnmarshalTime(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { - res := graphql.MarshalTime(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalNTime2ᚕᚖtimeᚐTimeᚄ(ctx context.Context, v interface{}) ([]*time.Time, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]*time.Time, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNTime2ᚖtimeᚐTime(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalNTime2ᚕᚖtimeᚐTimeᚄ(ctx context.Context, sel ast.SelectionSet, v []*time.Time) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - for i := range v { - ret[i] = ec.marshalNTime2ᚖtimeᚐTime(ctx, sel, v[i]) - } - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) unmarshalNTime2ᚖtimeᚐTime(ctx context.Context, v interface{}) (*time.Time, error) { - res, err := graphql.UnmarshalTime(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler { +func (ec *executionContext) marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx context.Context, sel ast.SelectionSet, v *model.ZPAExam) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - res := graphql.MarshalTime(*v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res + return ec._ZPAExam(ctx, sel, v) } -func (ec *executionContext) marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ZPAExam) graphql.Marshaler { +func (ec *executionContext) marshalNZPAExamWithConstraints2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamWithConstraintsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ZPAExamWithConstraints) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -29411,7 +36824,7 @@ func (ec *executionContext) marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexam if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx, sel, v[i]) + ret[i] = ec.marshalNZPAExamWithConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamWithConstraints(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29431,17 +36844,17 @@ func (ec *executionContext) marshalNZPAExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexam return ret } -func (ec *executionContext) marshalNZPAExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExam(ctx context.Context, sel ast.SelectionSet, v *model.ZPAExam) graphql.Marshaler { +func (ec *executionContext) marshalNZPAExamWithConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamWithConstraints(ctx context.Context, sel ast.SelectionSet, v *model.ZPAExamWithConstraints) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ZPAExam(ctx, sel, v) + return ec._ZPAExamWithConstraints(ctx, sel, v) } -func (ec *executionContext) marshalNZPAExamWithConstraints2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamWithConstraintsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ZPAExamWithConstraints) graphql.Marshaler { +func (ec *executionContext) marshalNZPAExamsForType2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamsForTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ZPAExamsForType) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -29465,7 +36878,7 @@ func (ec *executionContext) marshalNZPAExamWithConstraints2ᚕᚖgithubᚗcomᚋ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNZPAExamWithConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamWithConstraints(ctx, sel, v[i]) + ret[i] = ec.marshalNZPAExamsForType2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamsForType(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29485,17 +36898,17 @@ func (ec *executionContext) marshalNZPAExamWithConstraints2ᚕᚖgithubᚗcomᚋ return ret } -func (ec *executionContext) marshalNZPAExamWithConstraints2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamWithConstraints(ctx context.Context, sel ast.SelectionSet, v *model.ZPAExamWithConstraints) graphql.Marshaler { +func (ec *executionContext) marshalNZPAExamsForType2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamsForType(ctx context.Context, sel ast.SelectionSet, v *model.ZPAExamsForType) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ZPAExamWithConstraints(ctx, sel, v) + return ec._ZPAExamsForType(ctx, sel, v) } -func (ec *executionContext) marshalNZPAExamsForType2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamsForTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ZPAExamsForType) graphql.Marshaler { +func (ec *executionContext) marshalNZPAInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAInvigilatorᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ZPAInvigilator) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -29519,7 +36932,7 @@ func (ec *executionContext) marshalNZPAExamsForType2ᚕᚖgithubᚗcomᚋobcode if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNZPAExamsForType2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamsForType(ctx, sel, v[i]) + ret[i] = ec.marshalNZPAInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAInvigilator(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29539,17 +36952,21 @@ func (ec *executionContext) marshalNZPAExamsForType2ᚕᚖgithubᚗcomᚋobcode return ret } -func (ec *executionContext) marshalNZPAExamsForType2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAExamsForType(ctx context.Context, sel ast.SelectionSet, v *model.ZPAExamsForType) graphql.Marshaler { +func (ec *executionContext) marshalNZPAInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAInvigilator(ctx context.Context, sel ast.SelectionSet, v *model.ZPAInvigilator) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._ZPAExamsForType(ctx, sel, v) + return ec._ZPAInvigilator(ctx, sel, v) } -func (ec *executionContext) marshalNZPAInvigilator2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAInvigilatorᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ZPAInvigilator) graphql.Marshaler { +func (ec *executionContext) marshalNZPAPrimussAncodes2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAPrimussAncodes(ctx context.Context, sel ast.SelectionSet, v model.ZPAPrimussAncodes) graphql.Marshaler { + return ec._ZPAPrimussAncodes(ctx, sel, &v) +} + +func (ec *executionContext) marshalNZPAPrimussAncodes2ᚕgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAPrimussAncodesᚄ(ctx context.Context, sel ast.SelectionSet, v []model.ZPAPrimussAncodes) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -29573,7 +36990,7 @@ func (ec *executionContext) marshalNZPAInvigilator2ᚕᚖgithubᚗcomᚋobcode if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNZPAInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAInvigilator(ctx, sel, v[i]) + ret[i] = ec.marshalNZPAPrimussAncodes2githubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAPrimussAncodes(ctx, sel, v[i]) } if isLen1 { f(i) @@ -29593,16 +37010,6 @@ func (ec *executionContext) marshalNZPAInvigilator2ᚕᚖgithubᚗcomᚋobcode return ret } -func (ec *executionContext) marshalNZPAInvigilator2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAInvigilator(ctx context.Context, sel ast.SelectionSet, v *model.ZPAInvigilator) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._ZPAInvigilator(ctx, sel, v) -} - func (ec *executionContext) marshalNZPAStudentReg2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐZPAStudentReg(ctx context.Context, sel ast.SelectionSet, v *model.ZPAStudentReg) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -29950,6 +37357,60 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast return res } +func (ec *executionContext) marshalOConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflictᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Conflict) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNConflict2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflict(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOConflicts2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConflicts(ctx context.Context, sel ast.SelectionSet, v *model.Conflicts) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Conflicts(ctx, sel, v) +} + func (ec *executionContext) marshalOConnectedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐConnectedExam(ctx context.Context, sel ast.SelectionSet, v *model.ConnectedExam) graphql.Marshaler { if v == nil { return graphql.Null @@ -29964,6 +37425,13 @@ func (ec *executionContext) marshalOConstraints2ᚖgithubᚗcomᚋobcodeᚋplexa return ec._Constraints(ctx, sel, v) } +func (ec *executionContext) marshalOExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExam(ctx context.Context, sel ast.SelectionSet, v *model.Exam) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Exam(ctx, sel, v) +} + func (ec *executionContext) marshalOExamGroup2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroup(ctx context.Context, sel ast.SelectionSet, v []*model.ExamGroup) graphql.Marshaler { if v == nil { return graphql.Null @@ -30100,53 +37568,6 @@ func (ec *executionContext) marshalOExamGroupConflict2ᚕᚖgithubᚗcomᚋobcod return ret } -func (ec *executionContext) marshalOExamGroupConflict2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupConflictᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ExamGroupConflict) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNExamGroupConflict2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupConflict(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - func (ec *executionContext) marshalOExamGroupConflict2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExamGroupConflict(ctx context.Context, sel ast.SelectionSet, v *model.ExamGroupConflict) graphql.Marshaler { if v == nil { return graphql.Null @@ -30356,6 +37777,20 @@ func (ec *executionContext) marshalOExamerInPlan2ᚕᚖgithubᚗcomᚋobcodeᚋp return ret } +func (ec *executionContext) marshalOExternalExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐExternalExam(ctx context.Context, sel ast.SelectionSet, v *model.ExternalExam) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ExternalExam(ctx, sel, v) +} + +func (ec *executionContext) marshalOGeneratedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐGeneratedExam(ctx context.Context, sel ast.SelectionSet, v *model.GeneratedExam) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GeneratedExam(ctx, sel, v) +} + func (ec *executionContext) unmarshalOInt2ᚕintᚄ(ctx context.Context, v interface{}) ([]int, error) { if v == nil { return nil, nil @@ -30577,6 +38012,13 @@ func (ec *executionContext) marshalONTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗ return ret } +func (ec *executionContext) marshalONTA2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTA(ctx context.Context, sel ast.SelectionSet, v *model.NTA) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._NTA(ctx, sel, v) +} + func (ec *executionContext) marshalONTAWithRegs2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐNTAWithRegsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.NTAWithRegs) graphql.Marshaler { if v == nil { return graphql.Null @@ -30725,6 +38167,67 @@ func (ec *executionContext) marshalONTAWithRegsByExamAndTeacher2ᚕᚖgithubᚗc return ret } +func (ec *executionContext) marshalOPlanEntry2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlanEntry(ctx context.Context, sel ast.SelectionSet, v *model.PlanEntry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._PlanEntry(ctx, sel, v) +} + +func (ec *executionContext) marshalOPlannedExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PlannedExam) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNPlannedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExam(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOPlannedExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExam(ctx context.Context, sel ast.SelectionSet, v *model.PlannedExam) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._PlannedExam(ctx, sel, v) +} + func (ec *executionContext) marshalOPlannedExamWithNTA2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedExamWithNtaᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PlannedExamWithNta) graphql.Marshaler { if v == nil { return graphql.Null @@ -30772,6 +38275,53 @@ func (ec *executionContext) marshalOPlannedExamWithNTA2ᚕᚖgithubᚗcomᚋobco return ret } +func (ec *executionContext) marshalOPlannedRoom2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedRoomᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PlannedRoom) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNPlannedRoom2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPlannedRoom(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + func (ec *executionContext) marshalOPrimussExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐPrimussExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PrimussExam) graphql.Marshaler { if v == nil { return graphql.Null @@ -30889,6 +38439,53 @@ func (ec *executionContext) marshalORoomConstraints2ᚖgithubᚗcomᚋobcodeᚋp return ec._RoomConstraints(ctx, sel, v) } +func (ec *executionContext) marshalORoomForExam2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExamᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RoomForExam) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNRoomForExam2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐRoomForExam(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + func (ec *executionContext) marshalOSemesterConfig2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐSemesterConfig(ctx context.Context, sel ast.SelectionSet, v *model.SemesterConfig) graphql.Marshaler { if v == nil { return graphql.Null @@ -31066,6 +38663,60 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as return res } +func (ec *executionContext) marshalOStudent2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Student) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNStudent2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudent(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOStudent2ᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudent(ctx context.Context, sel ast.SelectionSet, v *model.Student) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Student(ctx, sel, v) +} + func (ec *executionContext) marshalOStudentReg2ᚕᚖgithubᚗcomᚋobcodeᚋplexamsᚗgoᚋgraphᚋmodelᚐStudentRegᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.StudentReg) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/graph/invigilation.graphqls b/graph/invigilation.graphqls index ef74bf6..5c93beb 100644 --- a/graph/invigilation.graphqls +++ b/graph/invigilation.graphqls @@ -1,3 +1,10 @@ +extend type Query { + invigilatorTodos: InvigilationTodos + invigilatorsWithReq: [Invigilator!]! + roomsWithInvigilationsForSlot(day: Int!, time: Int!): InvigilationSlot + invigilatorsForDay(day: Int!): InvigilatorsForDay +} + type Invigilation { roomName: String duration: Int! diff --git a/graph/invigilation.resolvers.go b/graph/invigilation.resolvers.go new file mode 100644 index 0000000..60b62d4 --- /dev/null +++ b/graph/invigilation.resolvers.go @@ -0,0 +1,31 @@ +package graph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.34 + +import ( + "context" + + "github.com/obcode/plexams.go/graph/model" +) + +// InvigilatorTodos is the resolver for the invigilatorTodos field. +func (r *queryResolver) InvigilatorTodos(ctx context.Context) (*model.InvigilationTodos, error) { + return r.plexams.GetInvigilationTodos(ctx) +} + +// InvigilatorsWithReq is the resolver for the invigilatorsWithReq field. +func (r *queryResolver) InvigilatorsWithReq(ctx context.Context) ([]*model.Invigilator, error) { + return r.plexams.InvigilatorsWithReq(ctx) +} + +// RoomsWithInvigilationsForSlot is the resolver for the roomsWithInvigilationsForSlot field. +func (r *queryResolver) RoomsWithInvigilationsForSlot(ctx context.Context, day int, time int) (*model.InvigilationSlot, error) { + return r.plexams.RoomsWithInvigilationsForSlot(ctx, day, time) +} + +// InvigilatorsForDay is the resolver for the invigilatorsForDay field. +func (r *queryResolver) InvigilatorsForDay(ctx context.Context, day int) (*model.InvigilatorsForDay, error) { + return r.plexams.InvigilatorsForDay(ctx, day) +} diff --git a/graph/model/exam.go b/graph/model/exam.go index 23437dd..3031f8f 100644 --- a/graph/model/exam.go +++ b/graph/model/exam.go @@ -5,20 +5,20 @@ type RemovedPrimussExam struct { Program string `bson:"Stg"` } -type Exam struct { - Semester string `json:"semester"` - AnCode int `json:"ancode"` - Module string `json:"module"` - MainExamer *Teacher `json:"main_examer"` - MainExamerName string `json:"main_examer_name"` - MainExamerID int `json:"main_examer_id"` - ExamType string `json:"exam_type"` - Duration int `json:"duration"` - IsRepeaterExam bool `json:"is_repeater_exam"` - ZpaGroups []string `json:"groups"` - RemovedPrimussExams []RemovedPrimussExam `json:"removedPrimussExams"` - RegisteredExams []*RegisteredExam `json:"registeredExams"` -} +// type Exam struct { +// Semester string `json:"semester"` +// AnCode int `json:"ancode"` +// Module string `json:"module"` +// MainExamer *Teacher `json:"main_examer"` +// MainExamerName string `json:"main_examer_name"` +// MainExamerID int `json:"main_examer_id"` +// ExamType string `json:"exam_type"` +// Duration int `json:"duration"` +// IsRepeaterExam bool `json:"is_repeater_exam"` +// ZpaGroups []string `json:"groups"` +// RemovedPrimussExams []RemovedPrimussExam `json:"removedPrimussExams"` +// RegisteredExams []*RegisteredExam `json:"registeredExams"` +// } func (exam *ExamToPlan) IsGO() bool { for _, primussExam := range exam.Exam.PrimussExams { @@ -28,3 +28,27 @@ func (exam *ExamToPlan) IsGO() bool { } return false } + +type GeneratedExam struct { + Ancode int `json:"ancode"` + ZpaExam *ZPAExam `json:"zpaExam"` + PrimussExams []*EnhancedPrimussExam `json:"primussExams"` + Constraints *Constraints `json:"constraints,omitempty"` + Conflicts []*ZPAConflict `json:"conflicts"` + StudentRegsCount int `json:"studentRegsCount"` + Ntas []*NTA `json:"ntas"` + MaxDuration int `json:"maxDuration"` +} + +type PlannedExam struct { + Ancode int `json:"ancode"` + ZpaExam *ZPAExam `json:"zpaExam"` + PrimussExams []*EnhancedPrimussExam `json:"primussExams"` + Constraints *Constraints `json:"constraints,omitempty"` + Conflicts []*ZPAConflict `json:"conflicts"` + StudentRegsCount int `json:"studentRegsCount"` + Ntas []*NTA `json:"ntas"` + MaxDuration int `json:"maxDuration"` + PlanEntry *PlanEntry `json:"planEntry,omitempty"` + PlannedRooms []*PlannedRoom `json:"plannedRooms,omitempty"` +} diff --git a/graph/model/models_gen.go b/graph/model/models_gen.go index 56db2b1..daa5df6 100644 --- a/graph/model/models_gen.go +++ b/graph/model/models_gen.go @@ -34,6 +34,12 @@ type ConflictPerProgram struct { Conflicts []*Conflict `json:"conflicts"` } +type ConflictsPerProgramAncode struct { + Program string `json:"program"` + Ancode int `json:"ancode"` + Conflicts *Conflicts `json:"conflicts,omitempty"` +} + type ConnectedExam struct { ZpaExam *ZPAExam `json:"zpaExam"` PrimussExams []*PrimussExam `json:"primussExams"` @@ -53,6 +59,28 @@ type Constraints struct { RoomConstraints *RoomConstraints `json:"roomConstraints,omitempty"` } +type EnhancedPrimussExam struct { + Exam *PrimussExam `json:"exam"` + StudentRegs []*StudentReg `json:"studentRegs"` + Conflicts []*Conflict `json:"conflicts"` + Ntas []*NTA `json:"ntas"` +} + +type Exam struct { + Ancode int `json:"ancode"` + ZpaExam *ZPAExam `json:"zpaExam,omitempty"` + ExternalExam *ExternalExam `json:"externalExam,omitempty"` + PrimussExams []*PrimussExam `json:"primussExams"` + StudentRegs []*StudentRegsPerAncodeAndProgram `json:"studentRegs"` + Conflicts []*ConflictsPerProgramAncode `json:"conflicts"` + ConnectErrors []string `json:"connectErrors"` + Constraints *Constraints `json:"constraints,omitempty"` + RegularStudents []*Student `json:"regularStudents,omitempty"` + NtaStudents []*Student `json:"ntaStudents,omitempty"` + Slot *Slot `json:"slot,omitempty"` + Rooms []*RoomForExam `json:"rooms,omitempty"` +} + type ExamDay struct { Number int `json:"number"` Date time.Time `json:"date"` @@ -105,10 +133,10 @@ type ExamWithRegs struct { } type ExamWithRegsAndRooms struct { - Exam *ExamInPlan `json:"exam"` - NormalRegs []*StudentReg `json:"normalRegs"` - NtaRegs []*NTAWithRegs `json:"ntaRegs"` - Rooms []*RoomForExam `json:"rooms"` + Exam *PlannedExam `json:"exam"` + NormalRegsMtknr []string `json:"normalRegsMtknr"` + Ntas []*NTA `json:"ntas"` + Rooms []*PlannedRoom `json:"rooms"` } type ExamerInPlan struct { @@ -116,6 +144,14 @@ type ExamerInPlan struct { MainExamerID int `json:"mainExamerID"` } +type ExternalExam struct { + Ancode int `json:"ancode"` + Program string `json:"program"` + Module string `json:"module"` + MainExamer string `json:"mainExamer"` + Duration int `json:"duration"` +} + type FK07Program struct { Name string `json:"name"` } @@ -182,14 +218,15 @@ type InvigilatorsForDay struct { } type NTAInput struct { - Name string `json:"name"` - Mtknr string `json:"mtknr"` - Compensation string `json:"compensation"` - DeltaDurationPercent int `json:"deltaDurationPercent"` - NeedsRoomAlone bool `json:"needsRoomAlone"` - Program string `json:"program"` - From string `json:"from"` - Until string `json:"until"` + Name string `json:"name"` + Email *string `json:"email,omitempty"` + Mtknr string `json:"mtknr"` + Compensation string `json:"compensation"` + DeltaDurationPercent int `json:"deltaDurationPercent"` + NeedsRoomAlone bool `json:"needsRoomAlone"` + Program string `json:"program"` + From string `json:"from"` + Until string `json:"until"` } type NTAWithRegs struct { @@ -218,9 +255,15 @@ type PlannedExamWithNta struct { Nta []*NTAWithRegs `json:"nta,omitempty"` } +type PrimussExamAncode struct { + Ancode int `json:"ancode"` + Program string `json:"program"` + NumberOfStuds int `json:"numberOfStuds"` +} + type PrimussExamByProgram struct { - Program string `json:"program"` - Exams []*PrimussExam `json:"exams"` + Program string `json:"program"` + Exams []*PrimussExamWithCount `json:"exams"` } type PrimussExamInput struct { @@ -228,6 +271,16 @@ type PrimussExamInput struct { Program string `json:"program"` } +type PrimussExamWithCount struct { + Ancode int `json:"ancode"` + Module string `json:"module"` + MainExamer string `json:"mainExamer"` + Program string `json:"program"` + ExamType string `json:"examType"` + Presence string `json:"presence"` + StudentRegsCount int `json:"studentRegsCount"` +} + type Room struct { Name string `json:"name"` Seats int `json:"seats"` @@ -240,7 +293,7 @@ type Room struct { } type RoomAndExam struct { - Room *RoomForExam `json:"room"` + Room *PlannedRoom `json:"room"` Exam *ZPAExam `json:"exam"` } @@ -312,6 +365,8 @@ type Student struct { Program string `json:"program"` Group string `json:"group"` Name string `json:"name"` + Regs []int `json:"regs"` + Nta *NTA `json:"nta,omitempty"` } type StudentRegsPerAncode struct { @@ -321,6 +376,7 @@ type StudentRegsPerAncode struct { type StudentRegsPerAncodeAndProgram struct { Program string `json:"program"` + Ancode int `json:"ancode"` StudentRegs []*StudentReg `json:"studentRegs"` } @@ -329,6 +385,12 @@ type StudentRegsPerStudent struct { Ancodes []int `json:"ancodes"` } +type ZPAConflict struct { + Ancode int `json:"ancode"` + NumberOfStuds int `json:"numberOfStuds"` + PrimussAncodes []*PrimussExamAncode `json:"primussAncodes"` +} + type ZPAExamWithConstraints struct { ZpaExam *ZPAExam `json:"zpaExam"` Constraints *Constraints `json:"constraints,omitempty"` diff --git a/graph/model/nta.go b/graph/model/nta.go index ca46f94..0b0a890 100644 --- a/graph/model/nta.go +++ b/graph/model/nta.go @@ -9,6 +9,7 @@ type NTAExam struct { type NTA struct { Name string `bson:"name"` + Email *string `bson:"email"` Mtknr string `bson:"mtknr"` Compensation string `bson:"compensation"` DeltaDurationPercent int `bson:"deltaDurationPercent"` @@ -23,6 +24,7 @@ type NTA struct { func NtaInputToNta(ntaInput NTAInput) *NTA { return &NTA{ Name: ntaInput.Name, + Email: ntaInput.Email, Mtknr: ntaInput.Mtknr, Compensation: ntaInput.Compensation, DeltaDurationPercent: ntaInput.DeltaDurationPercent, diff --git a/graph/model/plan.go b/graph/model/plan.go index d1b32ff..212f973 100644 --- a/graph/model/plan.go +++ b/graph/model/plan.go @@ -1,23 +1,8 @@ package model -import "time" - type PlanEntry struct { - DayNumber int `json:"dayNumber"` - SlotNumber int `json:"slotNumber"` - ExamGroupCode int `json:"examGroupCode"` - Locked bool `json:"locked"` -} - -type PlanAncodeEntry struct { - DayNumber int `json:"dayNumber"` - SlotNumber int `json:"slotNumber"` - Ancode int `json:"ancode"` -} - -type PlannedExam struct { - Ancode int - Module string - MainExamer string - DateTime *time.Time + DayNumber int `json:"dayNumber"` + SlotNumber int `json:"slotNumber"` + Ancode int `json:"ancode"` + Locked bool `json:"locked"` } diff --git a/graph/model/rooms.go b/graph/model/rooms.go index ddc19d1..1961b14 100644 --- a/graph/model/rooms.go +++ b/graph/model/rooms.go @@ -9,3 +9,16 @@ type RoomForExam struct { Reserve bool `json:"reserve"` Students []*StudentReg `json:"students"` } + +type PlannedRoom struct { + Day int `json:"day"` + Slot int `json:"slot"` + RoomName string `json:"roomName"` + Ancode int `json:"ancode"` + Duration int `json:"duration"` + Handicap bool `json:"handicap"` + HandicapRoomAlone bool `json:"handicapRoomAlone"` + Reserve bool `json:"reserve"` + StudentsInRoom []string `json:"studentsInRoom"` + NtaMtknr *string `json:"ntaMtknr,omitempty"` +} diff --git a/graph/model/zpa.go b/graph/model/zpa.go index 8a51dad..a376fb5 100644 --- a/graph/model/zpa.go +++ b/graph/model/zpa.go @@ -14,19 +14,30 @@ type Teacher struct { } type ZPAExam struct { - ZpaID int `json:"id"` - Semester string `json:"semester"` - AnCode int `json:"ancode"` - Module string `json:"module"` - MainExamer string `json:"main_examer"` - MainExamerID int `json:"main_examer_id"` - ExamType string `json:"exam_type"` - ExamTypeFull string `json:"full_name"` - Date string `json:"date"` - Starttime string `json:"start_time"` - Duration int `json:"duration"` - IsRepeaterExam bool `json:"is_repeater_exam"` - Groups []string `json:"groups"` + ZpaID int `json:"id"` + Semester string `json:"semester"` + AnCode int `json:"ancode"` + Module string `json:"module"` + MainExamer string `json:"main_examer"` + MainExamerID int `json:"main_examer_id"` + ExamType string `json:"exam_type"` + ExamTypeFull string `json:"full_name"` + Date string `json:"date"` + Starttime string `json:"start_time"` + Duration int `json:"duration"` + IsRepeaterExam bool `json:"is_repeater_exam"` + Groups []string `json:"groups"` + PrimussAncodes []ZPAPrimussAncodes `json:"primuss_ancodes"` +} + +type ZPAPrimussAncodes struct { + Program string `json:"program"` + Ancode int `json:"ancode"` +} + +type AddedPrimussAncode struct { + Ancode int `json:"ancode"` + PrimussAncode ZPAPrimussAncodes `json:"primuss_ancodes"` } type ZPAStudentReg struct { diff --git a/graph/mutation.graphqls b/graph/mutation.graphqls index ab186ea..b6971d5 100644 --- a/graph/mutation.graphqls +++ b/graph/mutation.graphqls @@ -2,13 +2,13 @@ type Mutation { setSemester(input: String!): Semester! # Prepare ZPA-Exams zpaExamsToPlan(input: [Int!]!): [ZPAExam!]! - addZpaExamToPlan(ancode: Int!, unknown: Boolean!): Boolean! - rmZpaExamFromPlan(ancode: Int!, unknown: Boolean!): Boolean! + addZpaExamToPlan(ancode: Int!): Boolean! + rmZpaExamFromPlan(ancode: Int!): Boolean! # Additional Exams addAdditionalExam(exam: AdditionalExamInput!): Boolean! # Primuss removePrimussExam(input: PrimussExamInput): Boolean! - prepareExams(input: [PrimussExamInput!]!): Boolean! + # prepareExams(input: [PrimussExamInput!]!): Boolean! addNTA(input: NTAInput!): NTA! # Contraints notPlannedByMe(ancode: Int!): Boolean! diff --git a/graph/mutation.resolvers.go b/graph/mutation.resolvers.go index 322ed03..8254895 100644 --- a/graph/mutation.resolvers.go +++ b/graph/mutation.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.33 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" @@ -22,13 +22,13 @@ func (r *mutationResolver) ZpaExamsToPlan(ctx context.Context, input []int) ([]* } // AddZPAExamToPlan is the resolver for the addZPAExamToPlan field. -func (r *mutationResolver) AddZpaExamToPlan(ctx context.Context, ancode int, unknown bool) (bool, error) { - return r.plexams.AddZpaExamToPlan(ctx, ancode, unknown) +func (r *mutationResolver) AddZpaExamToPlan(ctx context.Context, ancode int) (bool, error) { + return r.plexams.AddZpaExamToPlan(ctx, ancode) } // RmZPAExamFromPlan is the resolver for the rmZPAExamFromPlan field. -func (r *mutationResolver) RmZpaExamFromPlan(ctx context.Context, ancode int, unknown bool) (bool, error) { - return r.plexams.RmZpaExamFromPlan(ctx, ancode, unknown) +func (r *mutationResolver) RmZpaExamFromPlan(ctx context.Context, ancode int) (bool, error) { + return r.plexams.RmZpaExamFromPlan(ctx, ancode) } // AddAdditionalExam is the resolver for the addAdditionalExam field. @@ -41,11 +41,6 @@ func (r *mutationResolver) RemovePrimussExam(ctx context.Context, input *model.P return r.plexams.RemovePrimussExam(ctx, input) } -// PrepareExams is the resolver for the prepareExams field. -func (r *mutationResolver) PrepareExams(ctx context.Context, input []*model.PrimussExamInput) (bool, error) { - return r.plexams.PrepareExams(ctx, input) -} - // AddNta is the resolver for the addNTA field. func (r *mutationResolver) AddNta(ctx context.Context, input model.NTAInput) (*model.NTA, error) { return r.plexams.AddNta(ctx, input) diff --git a/graph/nta.graphqls b/graph/nta.graphqls index b340c27..ef8fece 100644 --- a/graph/nta.graphqls +++ b/graph/nta.graphqls @@ -1,3 +1,8 @@ +extend type Query { + ntas: [NTA!] + ntasWithRegs: [Student!] +} + type NTAExam { semester: String! ancode: String! @@ -7,6 +12,7 @@ type NTAExam { type NTA { name: String! + email: String mtknr: String! compensation: String! deltaDurationPercent: Int! @@ -20,6 +26,7 @@ type NTA { input NTAInput { name: String! + email: String mtknr: String! compensation: String! deltaDurationPercent: Int! diff --git a/graph/nta.resolvers.go b/graph/nta.resolvers.go new file mode 100644 index 0000000..8228196 --- /dev/null +++ b/graph/nta.resolvers.go @@ -0,0 +1,21 @@ +package graph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.34 + +import ( + "context" + + "github.com/obcode/plexams.go/graph/model" +) + +// Ntas is the resolver for the ntas field. +func (r *queryResolver) Ntas(ctx context.Context) ([]*model.NTA, error) { + return r.plexams.Ntas(ctx) +} + +// NtasWithRegs is the resolver for the ntasWithRegs field. +func (r *queryResolver) NtasWithRegs(ctx context.Context) ([]*model.Student, error) { + return r.plexams.NtasWithRegs(ctx) +} diff --git a/graph/plan.graphqls b/graph/plan.graphqls index 608080c..70e9eb8 100644 --- a/graph/plan.graphqls +++ b/graph/plan.graphqls @@ -1,3 +1,20 @@ +extend type Query { + allProgramsInPlan: [String!] + ancodesInPlan: [Int!] + examerInPlan: [ExamerInPlan!] + + examsInSlot(day: Int!, time: Int!): [PlannedExam!] + examsWithoutSlot: [PlannedExam!]! + + allowedSlots(ancode: Int!): [Slot!] + awkwardSlots(ancode: Int!): [Slot!]! # slots before or after a conflict +} + +extend type Mutation { + addExamToSlot(day: Int!, time: Int!, ancode: Int!): Boolean! + rmExamFromSlot(ancode: Int!): Boolean! +} + type SemesterConfig { days: [ExamDay!]! starttimes: [Starttime!]! @@ -61,3 +78,12 @@ type ExamerInPlan { mainExamer: String! mainExamerID: Int! } + +# TODO: remove starttime!!! +type PlanEntry { + dayNumber: Int! + slotNumber: Int! + starttime: Time! + ancode: Int! + locked: Boolean! +} diff --git a/graph/plan.resolvers.go b/graph/plan.resolvers.go new file mode 100644 index 0000000..9855446 --- /dev/null +++ b/graph/plan.resolvers.go @@ -0,0 +1,69 @@ +package graph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.34 + +import ( + "context" + "fmt" + "time" + + "github.com/obcode/plexams.go/graph/generated" + "github.com/obcode/plexams.go/graph/model" +) + +// AddExamToSlot is the resolver for the addExamToSlot field. +func (r *mutationResolver) AddExamToSlot(ctx context.Context, day int, time int, ancode int) (bool, error) { + panic(fmt.Errorf("not implemented: AddExamToSlot - addExamToSlot")) +} + +// RmExamFromSlot is the resolver for the rmExamFromSlot field. +func (r *mutationResolver) RmExamFromSlot(ctx context.Context, ancode int) (bool, error) { + panic(fmt.Errorf("not implemented: RmExamFromSlot - rmExamFromSlot")) +} + +// Starttime is the resolver for the starttime field. +func (r *planEntryResolver) Starttime(ctx context.Context, obj *model.PlanEntry) (*time.Time, error) { + return r.plexams.GetStarttime(obj.DayNumber, obj.SlotNumber) +} + +// AllProgramsInPlan is the resolver for the allProgramsInPlan field. +func (r *queryResolver) AllProgramsInPlan(ctx context.Context) ([]string, error) { + return r.plexams.AllProgramsInPlan(ctx) +} + +// AncodesInPlan is the resolver for the ancodesInPlan field. +func (r *queryResolver) AncodesInPlan(ctx context.Context) ([]int, error) { + return r.plexams.AncodesInPlan(ctx) +} + +// ExamerNamesInPlan is the resolver for the examerNamesInPlan field. +func (r *queryResolver) ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error) { + return r.plexams.ExamerInPlan(ctx) +} + +// ExamGroupsInSlot is the resolver for the examGroupsInSlot field. +func (r *queryResolver) ExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExam, error) { + return r.plexams.GetExamsInSlot(ctx, day, time) +} + +// ExamsWithoutSlot is the resolver for the examsWithoutSlot field. +func (r *queryResolver) ExamsWithoutSlot(ctx context.Context) ([]*model.PlannedExam, error) { + return r.plexams.ExamsWithoutSlot(ctx) +} + +// AllowedSlots is the resolver for the allowedSlots field. +func (r *queryResolver) AllowedSlots(ctx context.Context, ancode int) ([]*model.Slot, error) { + return r.plexams.AllowedSlots(ctx, ancode) +} + +// AwkwardSlots is the resolver for the awkwardSlots field. +func (r *queryResolver) AwkwardSlots(ctx context.Context, ancode int) ([]*model.Slot, error) { + return r.plexams.AwkwardSlots(ctx, ancode) +} + +// PlanEntry returns generated.PlanEntryResolver implementation. +func (r *Resolver) PlanEntry() generated.PlanEntryResolver { return &planEntryResolver{r} } + +type planEntryResolver struct{ *Resolver } diff --git a/graph/primuss.graphqls b/graph/primuss.graphqls index ff539e2..70a2f19 100644 --- a/graph/primuss.graphqls +++ b/graph/primuss.graphqls @@ -1,3 +1,7 @@ +extend type Query { + primussExams: [PrimussExamByProgram] +} + type PrimussExam { ancode: Int! module: String! @@ -5,18 +9,39 @@ type PrimussExam { program: String! examType: String! presence: String! +} + +type EnhancedPrimussExam { + exam: PrimussExam! studentRegs: [StudentReg!]! - conflicts: Conflicts! + conflicts: [Conflict!]! + ntas: [NTA!]! } -input PrimussExamInput { +type PrimussExamWithCount { ancode: Int! + module: String! + mainExamer: String! program: String! + examType: String! + presence: String! + studentRegsCount: Int! } type PrimussExamByProgram { program: String! - exams: [PrimussExam!]! + exams: [PrimussExamWithCount!]! +} + +type PrimussExamAncode { + ancode: Int! + program: String! + numberOfStuds: Int! +} + +input PrimussExamInput { + ancode: Int! + program: String! } type StudentReg { @@ -45,9 +70,8 @@ type ConflictPerProgram { conflicts: [Conflict!]! } -type ConnectedExam { - zpaExam: ZPAExam! - primussExams: [PrimussExam!]! - otherPrimussExams: [PrimussExam!]! - errors: [String!]! +type ConflictsPerProgramAncode { + program: String! + ancode: Int! + conflicts: Conflicts } diff --git a/graph/primuss.resolvers.go b/graph/primuss.resolvers.go index a8b1b99..cf00785 100644 --- a/graph/primuss.resolvers.go +++ b/graph/primuss.resolvers.go @@ -2,26 +2,15 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.33 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" - "github.com/obcode/plexams.go/graph/generated" "github.com/obcode/plexams.go/graph/model" ) -// StudentRegs is the resolver for the studentRegs field. -func (r *primussExamResolver) StudentRegs(ctx context.Context, obj *model.PrimussExam) ([]*model.StudentReg, error) { - return r.plexams.GetStudentRegs(ctx, obj) +// PrimussExams is the resolver for the primussExams field. +func (r *queryResolver) PrimussExams(ctx context.Context) ([]*model.PrimussExamByProgram, error) { + return r.plexams.PrimussExams(ctx) } - -// Conflicts is the resolver for the conflicts field. -func (r *primussExamResolver) Conflicts(ctx context.Context, obj *model.PrimussExam) (*model.Conflicts, error) { - return r.plexams.GetConflicts(ctx, obj) -} - -// PrimussExam returns generated.PrimussExamResolver implementation. -func (r *Resolver) PrimussExam() generated.PrimussExamResolver { return &primussExamResolver{r} } - -type primussExamResolver struct{ *Resolver } diff --git a/graph/query.graphqls b/graph/query.graphqls index c7444eb..5fe636c 100644 --- a/graph/query.graphqls +++ b/graph/query.graphqls @@ -4,29 +4,13 @@ type Query { allSemesterNames: [Semester!]! semester: Semester! semesterConfig: SemesterConfig! - # ZPA - teacher(id: Int!): Teacher - teachers(fromZPA: Boolean): [Teacher!]! - invigilators: [ZPAInvigilator!]! - fk07programs: [FK07Program!]! - zpaExams(fromZPA: Boolean): [ZPAExam!]! - zpaExamsByType: [ZPAExamsForType!]! - zpaExamsToPlan: [ZPAExam!]! - zpaExamsNotToPlan: [ZPAExam!]! - zpaExamsPlaningStatusUnknown: [ZPAExam!]! - zpaExam(ancode: Int!): ZPAExam - zpaAnCodes: [AnCode] - studentRegsImportErrors: [RegWithError!]! # Additional Exams additionalExams: [AdditionalExam!]! # Primuss - primussExams: [PrimussExamByProgram] primussExam(program: String!, ancode: Int!): PrimussExam! primussExamsForAnCode(ancode: Int!): [PrimussExam!] studentRegsForProgram(program: String!): [StudentReg!] - # Exams connected - connectedExam(ancode: Int!): ConnectedExam - connectedExams: [ConnectedExam!]! + # exam with regs examWithRegs(ancode: Int!): ExamWithRegs examsWithRegs: [ExamWithRegs!] @@ -36,27 +20,20 @@ type Query { # exam groups examGroups: [ExamGroup!]! examGroup(examGroupCode: Int!): ExamGroup - conflictingGroupCodes(examGroupCode: Int!): [ExamGroupConflict!] # NTAs - ntas: [NTA!] - ntasWithRegs: [NTAWithRegs!] ntasWithRegsByTeacher: [NTAWithRegsByExamAndTeacher!] nta(mtknr: String!): NTAWithRegs + # Plan - allowedSlots(examGroupCode: Int!): [Slot!] - awkwardSlots(examGroupCode: Int!): [Slot!]! # slots before or after a conflict - examGroupsInSlot(day: Int!, time: Int!): [ExamGroup!] examGroupsWithoutSlot: [ExamGroup!] - allProgramsInPlan: [String!] - ancodesInPlan: [Int!] - examerInPlan: [ExamerInPlan!] + # PlannedExamsWithNTA plannedExamsInSlot(day: Int!, time: Int!): [PlannedExamWithNTA!] examsInPlan: [ExamInPlan!] - examsInSlot(day: Int!, time: Int!): [ExamInPlan!] + # examsInSlot(day: Int!, time: Int!): [ExamInPlan!] # Rooms examsInSlotWithRooms(day: Int!, time: Int!): [ExamWithRegsAndRooms!] - rooms: [Room!]! + # rooms: [Room!]! roomsWithConstraints( handicap: Boolean! lab: Boolean! @@ -64,12 +41,7 @@ type Query { exahm: Boolean ): [Room!]! roomsForSlot(day: Int!, time: Int!): SlotWithRooms - plannedRoomNames: [String!] - plannedRoomNamesInSlot(day: Int!, time: Int!): [String!] + # Invigilators - invigilatorsWithReq: [Invigilator!]! - invigilatorTodos: InvigilationTodos - roomsWithInvigilationsForSlot(day: Int!, time: Int!): InvigilationSlot - invigilatorsForDay(day: Int!): InvigilatorsForDay dayOkForInvigilator(day: Int!, invigilatorID: Int!): Boolean } diff --git a/graph/query.resolvers.go b/graph/query.resolvers.go index 336c039..028c16f 100644 --- a/graph/query.resolvers.go +++ b/graph/query.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.33 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" @@ -37,76 +37,11 @@ func (r *queryResolver) SemesterConfig(ctx context.Context) (*model.SemesterConf return r.plexams.GetSemesterConfig(), nil } -// Teacher is the resolver for the teacher field. -func (r *queryResolver) Teacher(ctx context.Context, id int) (*model.Teacher, error) { - return r.plexams.GetTeacher(ctx, id) -} - -// Teachers is the resolver for the teachers field. -func (r *queryResolver) Teachers(ctx context.Context, fromZpa *bool) ([]*model.Teacher, error) { - return r.plexams.GetTeachers(ctx, fromZpa) -} - -// Invigilators is the resolver for the invigilators field. -func (r *queryResolver) Invigilators(ctx context.Context) ([]*model.ZPAInvigilator, error) { - return r.plexams.GetInvigilators(ctx) -} - -// Fk07programs is the resolver for the fk07programs field. -func (r *queryResolver) Fk07programs(ctx context.Context) ([]*model.FK07Program, error) { - return r.plexams.GetFk07programs(ctx) -} - -// ZpaExams is the resolver for the zpaExams field. -func (r *queryResolver) ZpaExams(ctx context.Context, fromZpa *bool) ([]*model.ZPAExam, error) { - return r.plexams.GetZPAExams(ctx, fromZpa) -} - -// ZpaExamsByType is the resolver for the zpaExamsByType field. -func (r *queryResolver) ZpaExamsByType(ctx context.Context) ([]*model.ZPAExamsForType, error) { - return r.plexams.GetZPAExamsGroupedByType(ctx) -} - -// ZpaExamsToPlan is the resolver for the zpaExamsToPlan field. -func (r *queryResolver) ZpaExamsToPlan(ctx context.Context) ([]*model.ZPAExam, error) { - return r.plexams.GetZpaExamsToPlan(ctx) -} - -// ZpaExamsNotToPlan is the resolver for the zpaExamsNotToPlan field. -func (r *queryResolver) ZpaExamsNotToPlan(ctx context.Context) ([]*model.ZPAExam, error) { - return r.plexams.GetZpaExamsNotToPlan(ctx) -} - -// ZpaExamsPlaningStatusUnknown is the resolver for the zpaExamsPlaningStatusUnknown field. -func (r *queryResolver) ZpaExamsPlaningStatusUnknown(ctx context.Context) ([]*model.ZPAExam, error) { - return r.plexams.ZpaExamsPlaningStatusUnknown(ctx) -} - -// ZpaExam is the resolver for the zpaExam field. -func (r *queryResolver) ZpaExam(ctx context.Context, ancode int) (*model.ZPAExam, error) { - return r.plexams.GetZpaExamByAncode(ctx, ancode) -} - -// ZpaAnCodes is the resolver for the zpaAnCodes field. -func (r *queryResolver) ZpaAnCodes(ctx context.Context) ([]*model.AnCode, error) { - return r.plexams.GetZpaAnCodes(ctx) -} - -// StudentRegsImportErrors is the resolver for the studentRegsImportErrors field. -func (r *queryResolver) StudentRegsImportErrors(ctx context.Context) ([]*model.RegWithError, error) { - return r.plexams.StudentRegsImportErrors(ctx) -} - // AdditionalExams is the resolver for the additionalExams field. func (r *queryResolver) AdditionalExams(ctx context.Context) ([]*model.AdditionalExam, error) { return r.plexams.AdditionalExams(ctx) } -// PrimussExams is the resolver for the primussExams field. -func (r *queryResolver) PrimussExams(ctx context.Context) ([]*model.PrimussExamByProgram, error) { - return r.plexams.PrimussExams(ctx) -} - // PrimussExam is the resolver for the primussExam field. func (r *queryResolver) PrimussExam(ctx context.Context, program string, ancode int) (*model.PrimussExam, error) { return r.plexams.GetPrimussExam(ctx, program, ancode) @@ -122,16 +57,6 @@ func (r *queryResolver) StudentRegsForProgram(ctx context.Context, program strin return r.plexams.StudentRegsForProgram(ctx, program) } -// ConnectedExam is the resolver for the connectedExam field. -func (r *queryResolver) ConnectedExam(ctx context.Context, ancode int) (*model.ConnectedExam, error) { - return r.plexams.GetConnectedExam(ctx, ancode) -} - -// ConnectedExams is the resolver for the connectedExams field. -func (r *queryResolver) ConnectedExams(ctx context.Context) ([]*model.ConnectedExam, error) { - return r.plexams.GetConnectedExams(ctx) -} - // ExamWithRegs is the resolver for the examWithRegs field. func (r *queryResolver) ExamWithRegs(ctx context.Context, ancode int) (*model.ExamWithRegs, error) { return r.plexams.ExamWithRegs(ctx, ancode) @@ -162,21 +87,6 @@ func (r *queryResolver) ExamGroup(ctx context.Context, examGroupCode int) (*mode return r.plexams.ExamGroup(ctx, examGroupCode) } -// ConflictingGroupCodes is the resolver for the conflictingGroupCodes field. -func (r *queryResolver) ConflictingGroupCodes(ctx context.Context, examGroupCode int) ([]*model.ExamGroupConflict, error) { - return r.plexams.ConflictingGroupCodes(ctx, examGroupCode) -} - -// Ntas is the resolver for the ntas field. -func (r *queryResolver) Ntas(ctx context.Context) ([]*model.NTA, error) { - return r.plexams.Ntas(ctx) -} - -// NtasWithRegs is the resolver for the ntasWithRegs field. -func (r *queryResolver) NtasWithRegs(ctx context.Context) ([]*model.NTAWithRegs, error) { - return r.plexams.NtasWithRegs(ctx) -} - // NtasWithRegsByTeacher is the resolver for the ntasWithRegsByTeacher field. func (r *queryResolver) NtasWithRegsByTeacher(ctx context.Context) ([]*model.NTAWithRegsByExamAndTeacher, error) { return r.plexams.NtasWithRegsByTeacher(ctx) @@ -187,44 +97,14 @@ func (r *queryResolver) Nta(ctx context.Context, mtknr string) (*model.NTAWithRe return r.plexams.Nta(ctx, mtknr) } -// AllowedSlots is the resolver for the allowedSlots field. -func (r *queryResolver) AllowedSlots(ctx context.Context, examGroupCode int) ([]*model.Slot, error) { - return r.plexams.AllowedSlots(ctx, examGroupCode) -} - -// AwkwardSlots is the resolver for the awkwardSlots field. -func (r *queryResolver) AwkwardSlots(ctx context.Context, examGroupCode int) ([]*model.Slot, error) { - return r.plexams.AwkwardSlots(ctx, examGroupCode) -} - -// ExamGroupsInSlot is the resolver for the examGroupsInSlot field. -func (r *queryResolver) ExamGroupsInSlot(ctx context.Context, day int, time int) ([]*model.ExamGroup, error) { - return r.plexams.ExamGroupsInSlot(ctx, day, time) -} - // ExamGroupsWithoutSlot is the resolver for the examGroupsWithoutSlot field. func (r *queryResolver) ExamGroupsWithoutSlot(ctx context.Context) ([]*model.ExamGroup, error) { return r.plexams.ExamGroupsWithoutSlot(ctx) } -// AllProgramsInPlan is the resolver for the allProgramsInPlan field. -func (r *queryResolver) AllProgramsInPlan(ctx context.Context) ([]string, error) { - return r.plexams.AllProgramsInPlan(ctx) -} - -// AncodesInPlan is the resolver for the ancodesInPlan field. -func (r *queryResolver) AncodesInPlan(ctx context.Context) ([]int, error) { - return r.plexams.AncodesInPlan(ctx) -} - -// ExamerNamesInPlan is the resolver for the examerNamesInPlan field. -func (r *queryResolver) ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error) { - return r.plexams.ExamerInPlan(ctx) -} - // PlannedExamsInSlot is the resolver for the plannedExamsInSlot field. func (r *queryResolver) PlannedExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExamWithNta, error) { - return r.plexams.PlannedExamsInSlot(ctx, day, time) + return nil, nil } // ExamsInPlan is the resolver for the examsInPlan field. @@ -232,21 +112,11 @@ func (r *queryResolver) ExamsInPlan(ctx context.Context) ([]*model.ExamInPlan, e return r.plexams.ExamsInPlan(ctx) } -// ExamsInSlot is the resolver for the examsInSlot field. -func (r *queryResolver) ExamsInSlot(ctx context.Context, day int, time int) ([]*model.ExamInPlan, error) { - return r.plexams.ExamsInSlot(ctx, day, time) -} - // ExamsInSlotWithRooms is the resolver for the examsInSlotWithRooms field. func (r *queryResolver) ExamsInSlotWithRooms(ctx context.Context, day int, time int) ([]*model.ExamWithRegsAndRooms, error) { return r.plexams.ExamsInSlotWithRooms(ctx, day, time) } -// Rooms is the resolver for the rooms field. -func (r *queryResolver) Rooms(ctx context.Context) ([]*model.Room, error) { - return r.plexams.Rooms(ctx) -} - // RoomsWithConstraints is the resolver for the roomsWithConstraints field. func (r *queryResolver) RoomsWithConstraints(ctx context.Context, handicap bool, lab bool, placesWithSocket bool, exahm *bool) ([]*model.Room, error) { panic(fmt.Errorf("not implemented: RoomsWithConstraints - roomsWithConstraints")) @@ -257,36 +127,6 @@ func (r *queryResolver) RoomsForSlot(ctx context.Context, day int, time int) (*m return r.plexams.RoomsForSlot(ctx, day, time) } -// PlannedRoomNames is the resolver for the plannedRoomNames field. -func (r *queryResolver) PlannedRoomNames(ctx context.Context) ([]string, error) { - return r.plexams.PlannedRoomNames(ctx) -} - -// PlannedRoomNamesInSlot is the resolver for the plannedRoomNamesInSlot field. -func (r *queryResolver) PlannedRoomNamesInSlot(ctx context.Context, day int, time int) ([]string, error) { - return r.plexams.PlannedRoomNamesInSlot(ctx, day, time) -} - -// InvigilatorsWithReq is the resolver for the invigilatorsWithReq field. -func (r *queryResolver) InvigilatorsWithReq(ctx context.Context) ([]*model.Invigilator, error) { - return r.plexams.InvigilatorsWithReq(ctx) -} - -// InvigilatorTodos is the resolver for the invigilatorTodos field. -func (r *queryResolver) InvigilatorTodos(ctx context.Context) (*model.InvigilationTodos, error) { - return r.plexams.InvigilationTodos(ctx) -} - -// RoomsWithInvigilationsForSlot is the resolver for the roomsWithInvigilationsForSlot field. -func (r *queryResolver) RoomsWithInvigilationsForSlot(ctx context.Context, day int, time int) (*model.InvigilationSlot, error) { - return r.plexams.RoomsWithInvigilationsForSlot(ctx, day, time) -} - -// InvigilatorsForDay is the resolver for the invigilatorsForDay field. -func (r *queryResolver) InvigilatorsForDay(ctx context.Context, day int) (*model.InvigilatorsForDay, error) { - return r.plexams.InvigilatorsForDay(ctx, day) -} - // DayOkForInvigilator is the resolver for the dayOkForInvigilator field. func (r *queryResolver) DayOkForInvigilator(ctx context.Context, day int, invigilatorID int) (*bool, error) { panic(fmt.Errorf("not implemented: DayOkForInvigilator - dayOkForInvigilator")) diff --git a/graph/room.graphqls b/graph/room.graphqls index 5e91615..097fa7e 100644 --- a/graph/room.graphqls +++ b/graph/room.graphqls @@ -1,3 +1,10 @@ +extend type Query { + rooms: [Room!]! + plannedRoomNames: [String!] + plannedRoomNamesInSlot(day: Int!, time: Int!): [String!] + plannedRoomsInSlot(day: Int!, time: Int!): [PlannedRoom!] +} + type Room { name: String! seats: Int! @@ -18,6 +25,36 @@ type SlotWithRooms { ntaRooms: [Room!]! } +type PlannedRoom { + day: Int! + slot: Int! + room: Room! + ancode: Int! + duration: Int! + handicap: Boolean! + handicapRoomAlone: Boolean! + reserve: Boolean! + studentsInRoom: [String!]! + ntaMtknr: String +} + +# type EnhancedPlannedRoom { +# day: Int! +# slot: Int! +# roomName: String! +# room: Room! +# ancode: Int! +# exam: GeneratedExam! +# duration: Int! +# handicap: Boolean! +# handicapRoomAlone: Boolean! +# reserve: Boolean! +# studentsInRoom: [String!]! +# ntaMtknr: String +# ntaInRoom: NTA +# } + +# Deprecated: rm me type RoomForExam { ancode: Int! room: Room @@ -28,6 +65,7 @@ type RoomForExam { students: [StudentReg!]! } +# Deprecated: rm me input RoomForExamInput { ancode: Int! day: Int! @@ -40,6 +78,6 @@ input RoomForExamInput { } type RoomAndExam { - room: RoomForExam! + room: PlannedRoom! exam: ZPAExam! } diff --git a/graph/room.resolvers.go b/graph/room.resolvers.go index bad1ea1..c9af92a 100644 --- a/graph/room.resolvers.go +++ b/graph/room.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.33 +// Code generated by github.com/99designs/gqlgen version v0.17.34 import ( "context" @@ -11,12 +11,41 @@ import ( "github.com/obcode/plexams.go/graph/model" ) +// Room is the resolver for the room field. +func (r *plannedRoomResolver) Room(ctx context.Context, obj *model.PlannedRoom) (*model.Room, error) { + return r.plexams.RoomFromName(ctx, obj.RoomName) +} + +// Rooms is the resolver for the rooms field. +func (r *queryResolver) Rooms(ctx context.Context) ([]*model.Room, error) { + return r.plexams.Rooms(ctx) +} + +// PlannedRoomNames is the resolver for the plannedRoomNames field. +func (r *queryResolver) PlannedRoomNames(ctx context.Context) ([]string, error) { + return r.plexams.PlannedRoomNames(ctx) +} + +// PlannedRoomNamesInSlot is the resolver for the plannedRoomNamesInSlot field. +func (r *queryResolver) PlannedRoomNamesInSlot(ctx context.Context, day int, time int) ([]string, error) { + return r.plexams.PlannedRoomNamesInSlot(ctx, day, time) +} + +// PlannedRoomsInSlot is the resolver for the plannedRoomsInSlot field. +func (r *queryResolver) PlannedRoomsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedRoom, error) { + return r.plexams.PlannedRoomsInSlot(ctx, day, time) +} + // Room is the resolver for the room field. func (r *roomForExamResolver) Room(ctx context.Context, obj *model.RoomForExam) (*model.Room, error) { return r.plexams.Room(ctx, obj) } +// PlannedRoom returns generated.PlannedRoomResolver implementation. +func (r *Resolver) PlannedRoom() generated.PlannedRoomResolver { return &plannedRoomResolver{r} } + // RoomForExam returns generated.RoomForExamResolver implementation. func (r *Resolver) RoomForExam() generated.RoomForExamResolver { return &roomForExamResolver{r} } +type plannedRoomResolver struct{ *Resolver } type roomForExamResolver struct{ *Resolver } diff --git a/graph/studentregs.graphqls b/graph/studentregs.graphqls index a0caf1e..60b352d 100644 --- a/graph/studentregs.graphqls +++ b/graph/studentregs.graphqls @@ -1,3 +1,9 @@ +extend type Query { + studentByMtknr(mtknr: String!): Student + studentsByName(regex: String!): [Student!]! + students: [Student!]! +} + type StudentRegsPerStudent { student: Student! ancodes: [Int!]! @@ -10,6 +16,7 @@ type StudentRegsPerAncode { type StudentRegsPerAncodeAndProgram { program: String! + ancode: Int! studentRegs: [StudentReg!]! } @@ -18,4 +25,6 @@ type Student { program: String! group: String! name: String! + regs: [Int!]! + nta: NTA } diff --git a/graph/studentregs.resolvers.go b/graph/studentregs.resolvers.go new file mode 100644 index 0000000..eae310b --- /dev/null +++ b/graph/studentregs.resolvers.go @@ -0,0 +1,26 @@ +package graph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.34 + +import ( + "context" + + "github.com/obcode/plexams.go/graph/model" +) + +// StudentByMtknr is the resolver for the studentByMtknr field. +func (r *queryResolver) StudentByMtknr(ctx context.Context, mtknr string) (*model.Student, error) { + return r.plexams.StudentByMtknr(ctx, mtknr, nil) +} + +// StudentsByName is the resolver for the studentsByName field. +func (r *queryResolver) StudentsByName(ctx context.Context, regex string) ([]*model.Student, error) { + return r.plexams.StudentsByName(ctx, regex) +} + +// Students is the resolver for the students field. +func (r *queryResolver) Students(ctx context.Context) ([]*model.Student, error) { + return r.plexams.Students(ctx) +} diff --git a/graph/zpa.graphqls b/graph/zpa.graphqls index 1612eef..1aeb2af 100644 --- a/graph/zpa.graphqls +++ b/graph/zpa.graphqls @@ -1,3 +1,18 @@ +extend type Query { + teacher(id: Int!): Teacher + teachers(fromZPA: Boolean): [Teacher!]! + invigilators: [ZPAInvigilator!]! + fk07programs: [FK07Program!]! + zpaExams(fromZPA: Boolean): [ZPAExam!]! + zpaExamsByType: [ZPAExamsForType!]! + zpaExamsToPlan: [ZPAExam!]! + zpaExamsNotToPlan: [ZPAExam!]! + zpaExamsPlaningStatusUnknown: [ZPAExam!]! + zpaExam(ancode: Int!): ZPAExam + zpaAnCodes: [AnCode] + studentRegsImportErrors: [RegWithError!]! +} + type ZPAExam { zpaID: Int! semester: String! @@ -10,6 +25,12 @@ type ZPAExam { duration: Int! isRepeaterExam: Boolean! groups: [String!]! + primussAncodes: [ZPAPrimussAncodes!]! +} + +type ZPAPrimussAncodes { + program: String! + ancode: Int! } type ZPAExamsForType { @@ -40,6 +61,7 @@ type FK07Program { name: String! } +# Deprecated: remove me type ZPAExamWithConstraints { zpaExam: ZPAExam! constraints: Constraints # == nil if no constraint diff --git a/graph/zpa.resolvers.go b/graph/zpa.resolvers.go new file mode 100644 index 0000000..ea2b54f --- /dev/null +++ b/graph/zpa.resolvers.go @@ -0,0 +1,71 @@ +package graph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.34 + +import ( + "context" + + "github.com/obcode/plexams.go/graph/model" +) + +// Teacher is the resolver for the teacher field. +func (r *queryResolver) Teacher(ctx context.Context, id int) (*model.Teacher, error) { + return r.plexams.GetTeacher(ctx, id) +} + +// Teachers is the resolver for the teachers field. +func (r *queryResolver) Teachers(ctx context.Context, fromZpa *bool) ([]*model.Teacher, error) { + return r.plexams.GetTeachers(ctx, fromZpa) +} + +// Invigilators is the resolver for the invigilators field. +func (r *queryResolver) Invigilators(ctx context.Context) ([]*model.ZPAInvigilator, error) { + return r.plexams.GetInvigilators(ctx) +} + +// Fk07programs is the resolver for the fk07programs field. +func (r *queryResolver) Fk07programs(ctx context.Context) ([]*model.FK07Program, error) { + return r.plexams.GetFk07programs(ctx) +} + +// ZpaExams is the resolver for the zpaExams field. +func (r *queryResolver) ZpaExams(ctx context.Context, fromZpa *bool) ([]*model.ZPAExam, error) { + return r.plexams.GetZPAExams(ctx, fromZpa) +} + +// ZpaExamsByType is the resolver for the zpaExamsByType field. +func (r *queryResolver) ZpaExamsByType(ctx context.Context) ([]*model.ZPAExamsForType, error) { + return r.plexams.GetZPAExamsGroupedByType(ctx) +} + +// ZpaExamsToPlan is the resolver for the zpaExamsToPlan field. +func (r *queryResolver) ZpaExamsToPlan(ctx context.Context) ([]*model.ZPAExam, error) { + return r.plexams.GetZpaExamsToPlan(ctx) +} + +// ZpaExamsNotToPlan is the resolver for the zpaExamsNotToPlan field. +func (r *queryResolver) ZpaExamsNotToPlan(ctx context.Context) ([]*model.ZPAExam, error) { + return r.plexams.GetZpaExamsNotToPlan(ctx) +} + +// ZpaExamsPlaningStatusUnknown is the resolver for the zpaExamsPlaningStatusUnknown field. +func (r *queryResolver) ZpaExamsPlaningStatusUnknown(ctx context.Context) ([]*model.ZPAExam, error) { + return r.plexams.ZpaExamsPlaningStatusUnknown(ctx) +} + +// ZpaExam is the resolver for the zpaExam field. +func (r *queryResolver) ZpaExam(ctx context.Context, ancode int) (*model.ZPAExam, error) { + return r.plexams.GetZpaExamByAncode(ctx, ancode) +} + +// ZpaAnCodes is the resolver for the zpaAnCodes field. +func (r *queryResolver) ZpaAnCodes(ctx context.Context) ([]*model.AnCode, error) { + return r.plexams.GetZpaAnCodes(ctx) +} + +// StudentRegsImportErrors is the resolver for the studentRegsImportErrors field. +func (r *queryResolver) StudentRegsImportErrors(ctx context.Context) ([]*model.RegWithError, error) { + return r.plexams.StudentRegsImportErrors(ctx) +} diff --git a/main.go b/main.go index 91d004d..faabac6 100644 --- a/main.go +++ b/main.go @@ -2,9 +2,14 @@ package main import ( + "time" + "github.com/obcode/plexams.go/cmd" ) func main() { + loc, _ := time.LoadLocation("Europe/Berlin") + time.Local = loc + cmd.Execute() } diff --git a/plexams/constraints.go b/plexams/constraints.go index 959da78..19c87ca 100644 --- a/plexams/constraints.go +++ b/plexams/constraints.go @@ -94,6 +94,21 @@ func (p *Plexams) Constraints(ctx context.Context) ([]*model.Constraints, error) return p.dbClient.GetConstraints(ctx) } +func (p *Plexams) ConstraintsMap(ctx context.Context) (map[int]*model.Constraints, error) { + constraints, err := p.dbClient.GetConstraints(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get constraints") + return nil, err + } + + constraintsMap := make(map[int]*model.Constraints) + for _, constraintsForAncode := range constraints { + constraintsMap[constraintsForAncode.Ancode] = constraintsForAncode + } + + return constraintsMap, nil +} + func (p *Plexams) ZpaExamsToPlanWithConstraints(ctx context.Context) ([]*model.ZPAExamWithConstraints, error) { exams, err := p.GetZpaExamsToPlan(ctx) if err != nil { diff --git a/plexams/csv.go b/plexams/csv.go new file mode 100644 index 0000000..d860371 --- /dev/null +++ b/plexams/csv.go @@ -0,0 +1,172 @@ +package plexams + +import ( + "context" + "fmt" + "os" + "sort" + "strings" + + set "github.com/deckarep/golang-set/v2" + "github.com/jszwec/csvutil" + "github.com/rs/zerolog/log" +) + +type CsvExam struct { + Ancode int `csv:"Ancode"` + Module string `csv:"Modul"` + MainExamer string `csv:"Erstprüfer:in"` + ExamDate string `csv:"Termin"` + Rooms string `csv:"Räume"` + Comment string `csv:"Anmerkungen"` +} + +func (p *Plexams) CsvForProgram(program, filename string) error { + ctx := context.Background() + exams, err := p.PlannedExamsForProgram(ctx, program, true) + if err != nil { + log.Error().Err(err).Str("program", program).Msg("cannot get planned exams for program") + return err + } + + csvExams := make(map[int][]CsvExam, 0) + ancodes := make([]int, 0, len(exams)) + + for _, exam := range exams { + primussAncode := 0 + for _, primussExam := range exam.PrimussExams { + if primussExam.Exam.Program == program { + primussAncode = primussExam.Exam.AnCode + ancodes = append(ancodes, primussAncode) + break + } + } + + if primussAncode == 0 { + log.Error().Int("zpa ancode", exam.Ancode).Msg("primuss ancode not found") + } + + examDate := "fehlt" + if exam.PlanEntry != nil { + starttime := p.getSlotTime(exam.PlanEntry.DayNumber, exam.PlanEntry.SlotNumber) + examDate = starttime.Local().Format("02.01.06, 15:04 Uhr") + } + + if exam.PlannedRooms != nil { + csvEntries := make([]CsvExam, 0, len(exam.PlannedRooms)) + for _, room := range exam.PlannedRooms { + var sb strings.Builder + if room.Handicap { + sb.WriteString(fmt.Sprintf("NTA %d Min., ", room.Duration)) + } + if room.Reserve { + sb.WriteString("Reserveraum, nicht veröffentlichen, ") + } + sb.WriteString(fmt.Sprintf("%d Studierende eingeplant", len(room.StudentsInRoom))) + csvEntries = append(csvEntries, CsvExam{ + Ancode: primussAncode, + Module: exam.ZpaExam.Module, + MainExamer: exam.ZpaExam.MainExamer, + ExamDate: examDate, + Rooms: room.RoomName, + Comment: sb.String(), + }) + } + + // examRooms = sb.String() + + csvExams[primussAncode] = csvEntries + } else { + csvExams[primussAncode] = []CsvExam{{ + Ancode: primussAncode, + Module: exam.ZpaExam.Module, + MainExamer: exam.ZpaExam.MainExamer, + ExamDate: examDate, + Rooms: "fehlen noch", + }} + } + } + + sort.Ints(ancodes) + + csvExamsSlice := make([]CsvExam, 0, len(exams)) + for _, ancode := range ancodes { + csvExamsSlice = append(csvExamsSlice, csvExams[ancode]...) + } + + b, err := csvutil.Marshal(csvExamsSlice) + if err != nil { + log.Error().Err(err).Msg("error when marshaling to csv") + } + + return os.WriteFile(filename, b, 0644) +} + +type CsvExamEXaHM struct { + Ancode int `csv:"Ancode"` + Module string `csv:"Modul"` + MainExamer string `csv:"Erstprüfer:in"` + ExamDate string `csv:"Termin"` + MaxDuration int `csv:"Maximale Länge"` + Students int `csv:"Anmeldungen"` + Rooms string `csv:"Räume"` + Type string `csv:"Typ"` +} + +func (p *Plexams) CsvForEXaHM(filename string) error { + ctx := context.Background() + exams, err := p.PlannedExams(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get planned exams") + return err + } + + exahmExams := make([]CsvExamEXaHM, 0) + + for _, exam := range exams { + if exam.Constraints == nil || exam.Constraints.RoomConstraints == nil || + (!exam.Constraints.RoomConstraints.ExahmRooms && !exam.Constraints.RoomConstraints.Seb) { + continue + } + + examDate := "fehlt" + if exam.PlanEntry != nil { + starttime := p.getSlotTime(exam.PlanEntry.DayNumber, exam.PlanEntry.SlotNumber) + examDate = starttime.Local().Format("02.01.06, 15:04 Uhr") + } + + var rooms []string + if len(exam.PlannedRooms) == 0 { + rooms = []string{"noch nicht geplant"} + } else { + roomSet := set.NewSet[string]() + for _, room := range exam.PlannedRooms { + roomSet.Add(room.RoomName) + } + rooms = roomSet.ToSlice() + } + + typeOfExam := "EXaHM" + if exam.Constraints.RoomConstraints.Seb { + typeOfExam = "SEB" + } + + exahmExams = append(exahmExams, CsvExamEXaHM{ + Ancode: exam.Ancode, + Module: exam.ZpaExam.Module, + MainExamer: exam.ZpaExam.MainExamer, + ExamDate: examDate, + MaxDuration: exam.MaxDuration, + Students: exam.StudentRegsCount, + Rooms: fmt.Sprintf("%v", rooms), + Type: typeOfExam, + }) + } + + b, err := csvutil.Marshal(exahmExams) + if err != nil { + log.Error().Err(err).Msg("error when marshaling to csv") + } + + return os.WriteFile(filename, b, 0644) +} diff --git a/plexams/email.go b/plexams/email.go index 7723b83..fec2282 100644 --- a/plexams/email.go +++ b/plexams/email.go @@ -8,9 +8,14 @@ import ( "html/template" "net/smtp" "net/textproto" + "time" + // TODO: Ersetzen durch github.com/wneessen/go-mail "github.com/jordan-wright/email" + "github.com/logrusorgru/aurora" + "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" + "github.com/theckman/yacspin" ) type HandicapsEmail struct { @@ -49,6 +54,141 @@ func (p *Plexams) SendTestMail() error { }) } +func (p *Plexams) SendGeneratedExamMails(ctx context.Context, run bool) error { + generatedExams, err := p.GeneratedExams(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get generated exams") + return err + } + + notFromZPA := false + teachers, err := p.GetTeachers(ctx, ¬FromZPA) + if err != nil { + log.Error().Err(err).Msg("cannot get generated exams") + return err + } + + teachersMap := make(map[int]*model.Teacher) + for _, teacher := range teachers { + teachersMap[teacher.ID] = teacher + } + + for _, exam := range generatedExams { + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" sending email about exam %d. %s (%s)"), + aurora.Yellow(exam.ZpaExam.AnCode), + aurora.Magenta(exam.ZpaExam.Module), + aurora.Magenta(exam.ZpaExam.MainExamer), + ), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "not planned by me", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + if exam.Constraints != nil && exam.Constraints.NotPlannedByMe { + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + continue + } + teacher, ok := teachersMap[exam.ZpaExam.MainExamerID] + if !ok { + log.Debug().Int("ancode", exam.Ancode).Str("module", exam.ZpaExam.Module).Str("teacher", exam.ZpaExam.MainExamer). + Msg("no info about teacher in zpa") + continue + } + + var to string + if run { + to = teacher.Email + } else { + to = "galority@gmail.com" + } + + hasStudentRegs := false + + for _, primussExam := range exam.PrimussExams { + hasStudentRegs = hasStudentRegs || len(primussExam.StudentRegs) > 0 + } + + err = p.SendGeneratedExamMailToTeacher(ctx, to, &GeneratedExamMailData{ + Exam: exam, + Teacher: teacher, + PlanerName: p.planer.Name, + HasStudentRegs: hasStudentRegs, + }) + if err != nil { + log.Error().Err(err).Msg("cannot send email") + return err + } + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + + return nil +} + +type GeneratedExamMailData struct { + Exam *model.GeneratedExam + Teacher *model.Teacher + PlanerName string + HasStudentRegs bool +} + +func (p *Plexams) SendGeneratedExamMailToTeacher(ctx context.Context, to string, generatedExamMailData *GeneratedExamMailData) error { + log.Debug().Interface("to", to).Msg("sending email") + + tmpl, err := template.ParseFiles("tmpl/generatedExamEmail.tmpl") + if err != nil { + return err + } + bufText := new(bytes.Buffer) + err = tmpl.Execute(bufText, generatedExamMailData) + if err != nil { + return err + } + + tmpl, err = template.ParseFiles("tmpl/generatedExamEmailHTML.tmpl") + if err != nil { + return err + } + bufHTML := new(bytes.Buffer) + err = tmpl.Execute(bufHTML, generatedExamMailData) + if err != nil { + return err + } + + subject := fmt.Sprintf("[Prüfungsplanung %s] Vorliegende Planungsdaten für Ihre Prüfung %s", + p.semester, generatedExamMailData.Exam.ZpaExam.Module) + if !generatedExamMailData.HasStudentRegs { + subject = fmt.Sprintf("[Prüfungsplanung %s] Keine Anmeldungen für Ihre Prüfung %s", + p.semester, generatedExamMailData.Exam.ZpaExam.Module) + } + + return p.sendMail([]string{to}, + subject, + bufText.Bytes(), + bufHTML.Bytes(), + ) +} + func (p *Plexams) SendHandicapsMails(ctx context.Context, run bool) error { ntasByTeacher, err := p.NtasWithRegsByTeacher(ctx) if err != nil { @@ -123,6 +263,78 @@ func (p *Plexams) SendHandicapsMailToMainExamer(ctx context.Context, to []string ) } +type NTAEmail struct { + NTA *model.Student + Exams []*model.PlannedExam + PlanerName string +} + +func (p *Plexams) SendHandicapsMailsNTARoomAlone(ctx context.Context, run bool) error { + ntas, err := p.NtasWithRegs(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get ntas") + return err + } + for _, nta := range ntas { + if !nta.Nta.NeedsRoomAlone { + continue + } + + exams := make([]*model.PlannedExam, 0, len(nta.Regs)) + for _, ancode := range nta.Regs { + exam, err := p.PlannedExam(ctx, ancode) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get exam") + return err + } + if exam.Constraints == nil || !exam.Constraints.NotPlannedByMe { + exams = append(exams, exam) + } + } + + err = p.SendHandicapsMailToStudent(ctx, []string{p.planer.Email}, &NTAEmail{ + NTA: nta, + Exams: exams, + PlanerName: p.planer.Name, + }) + if err != nil { + return err + } + + } + return nil +} + +func (p *Plexams) SendHandicapsMailToStudent(ctx context.Context, to []string, handicapsEmail *NTAEmail) error { + log.Debug().Interface("to", to).Msg("sending email") + + tmpl, err := template.ParseFiles("tmpl/handicapEmailRoomAlone.tmpl") + if err != nil { + return err + } + bufText := new(bytes.Buffer) + err = tmpl.Execute(bufText, handicapsEmail) + if err != nil { + return err + } + + tmpl, err = template.ParseFiles("tmpl/handicapEmailRoomAloneHTML.tmpl") + if err != nil { + return err + } + bufHTML := new(bytes.Buffer) + err = tmpl.Execute(bufHTML, handicapsEmail) + if err != nil { + return err + } + + return p.sendMail(to, + fmt.Sprintf("[Prüfungsplanung %s] Eigener Raum für Ihre Prüfung(en)", p.semester), + bufText.Bytes(), + bufHTML.Bytes(), + ) +} + func (p *Plexams) sendMail(to []string, subject string, text []byte, html []byte) error { e := &email.Email{ To: to, diff --git a/plexams/exam.go b/plexams/exam.go index 8cfb3c1..8aacccd 100644 --- a/plexams/exam.go +++ b/plexams/exam.go @@ -8,10 +8,12 @@ import ( "github.com/rs/zerolog/log" ) +// Deprecated: rm me func (p *Plexams) AddAdditionalExam(ctx context.Context, exam model.AdditionalExamInput) (bool, error) { return p.dbClient.AddAdditionalExam(ctx, exam) } +// Deprecated: rm me func (p *Plexams) AdditionalExams(ctx context.Context) ([]*model.AdditionalExam, error) { return p.dbClient.AdditionalExams(ctx) } @@ -22,36 +24,24 @@ func (p *Plexams) prepareConnectedExam(ctx context.Context, ancode int, allProgr return nil, err } - allKeys := make(map[string]bool) - programs := []string{} - for _, group := range zpaExam.Groups { - program := group[:2] - if _, value := allKeys[program]; !value { - allKeys[program] = true - programs = append(programs, program) - } - } - primussExams := make([]*model.PrimussExam, 0) - var errors []string + errors := make([]string, 0) - for _, program := range programs { - primussExam, err := p.GetPrimussExam(ctx, program, ancode) + // Replace with primuss ancodes + for _, primussAncode := range zpaExam.PrimussAncodes { + primussExam, err := p.GetPrimussExam(ctx, primussAncode.Program, primussAncode.Ancode) if err != nil { - if errors == nil { - errors = make([]string, 0) - } - errors = append(errors, fmt.Sprintf("%s/%d not found", program, ancode)) + errors = append(errors, fmt.Sprintf("%s/%d not found", primussAncode.Program, primussAncode.Ancode)) } else { primussExams = append(primussExams, primussExam) } } - otherPrograms := make([]string, 0, len(allPrograms)-len(programs)) + otherPrograms := make([]string, 0, len(allPrograms)-len(zpaExam.PrimussAncodes)) OUTER: for _, aP := range allPrograms { - for _, p := range programs { - if aP == p { + for _, p := range zpaExam.PrimussAncodes { + if aP == p.Program { continue OUTER } } @@ -66,9 +56,6 @@ OUTER: if otherPrimussExams == nil { otherPrimussExams = make([]*model.PrimussExam, 0) } - if errors == nil { - errors = make([]string, 0) - } errors = append(errors, fmt.Sprintf("found %s/%d (%s: %s)", program, ancode, primussExam.MainExamer, primussExam.Module)) otherPrimussExams = append(otherPrimussExams, primussExam) } @@ -149,87 +136,158 @@ func (p *Plexams) PrepareConnectedExam(ancode int) error { return nil } -func (p *Plexams) PrepareExams(ctx context.Context, inputs []*model.PrimussExamInput) (bool, error) { - if p.dbClient.ExamsAlreadyPrepared(ctx) { - oks := true - for _, input := range inputs { - ok, err := p.RemovePrimussExam(ctx, input) - if err != nil { - return false, err - } - oks = oks && ok +func (p *Plexams) Exam(ctx context.Context, ancode int) (*model.Exam, error) { + connectedExam, err := p.GetConnectedExam(ctx, ancode) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get connected exam") + return nil, err + } + // TODO: maybe external exam? + + studentRegs := make([]*model.StudentRegsPerAncodeAndProgram, 0, len(connectedExam.PrimussExams)) + // TODO: only conflicts of planned primussExams? + conflicts := make([]*model.ConflictsPerProgramAncode, 0, len(connectedExam.PrimussExams)) + + for _, primussExam := range connectedExam.PrimussExams { + studentRegsProgram, err := p.dbClient.GetPrimussStudentRegsForProgrammAncode(ctx, primussExam.Program, primussExam.AnCode) + if err != nil { + log.Error().Err(err).Int("ancode", primussExam.AnCode).Str("program", primussExam.Program).Msg("cannot get studentregs") + return nil, err } - return oks, nil - } else { - connectedExams, err := p.GetConnectedExams(ctx) + studentRegs = append(studentRegs, &model.StudentRegsPerAncodeAndProgram{ + Program: primussExam.Program, + Ancode: primussExam.AnCode, + StudentRegs: studentRegsProgram, + }) + + conflictsProgram, err := p.dbClient.GetPrimussConflictsForAncode(ctx, primussExam.Program, primussExam.AnCode) if err != nil { - return false, err + log.Error().Err(err).Int("ancode", primussExam.AnCode).Str("program", primussExam.Program).Msg("cannot get studentregs") + return nil, err } + conflicts = append(conflicts, &model.ConflictsPerProgramAncode{ + Program: primussExam.Program, + Ancode: primussExam.AnCode, + Conflicts: conflictsProgram, + }) + } - oks := true - for _, connectedExam := range connectedExams { - // generate Exam and add Teacher - exam, err := p.zpaExamToExam(ctx, connectedExam.ZpaExam) - if err != nil { - // FIXME: Maybe not a good idea? - return false, err - } + constraints, err := p.ConstraintForAncode(ctx, ancode) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get constraints for ancode") + } - for _, primussExam := range connectedExam.PrimussExams { - - if isConnected(primussExam, inputs) { - studentRegs, err := p.GetStudentRegs(ctx, primussExam) - if err != nil { - err := p.Log(ctx, fmt.Sprintf("no studentRegs for primuss exam %s/%d", - primussExam.Program, primussExam.AnCode), "") - if err != nil { - log.Error().Err(err).Msg("cannot log") - } - } - conflicts, err := p.GetConflicts(ctx, primussExam) - if err != nil { - err := p.Log(ctx, fmt.Sprintf("no studentRegs for primuss exam %s/%d", - primussExam.Program, primussExam.AnCode), "") - if err != nil { - log.Error().Err(err).Msg("cannot log") - } - } - exam.RegisteredExams = append(exam.RegisteredExams, &model.RegisteredExam{ - Exam: primussExam, - StudentRegs: studentRegs, - Conflicts: conflicts.Conflicts, - }) - } else { // should not be connected - if exam.RemovedPrimussExams == nil { - exam.RemovedPrimussExams = make([]model.RemovedPrimussExam, 0) - } - exam.RemovedPrimussExams = append(exam.RemovedPrimussExams, - model.RemovedPrimussExam{ - AnCode: primussExam.AnCode, - Program: primussExam.Program, - }) - // log to MongoDb - err := p.Log(ctx, fmt.Sprintf("removed primuss exam %s/%d from exam %d", - primussExam.Program, primussExam.AnCode, exam.AnCode), "") - if err != nil { - log.Error().Err(err).Str("program", primussExam.Program). - Int("ancode", primussExam.AnCode). - Msg("cannot log removed primuss exam") - } - } - } + regularStuds, ntaStuds, err := p.StudentsFromStudentRegs(ctx, studentRegs) + if err != nil { + log.Error().Err(err).Msg("cannot get students from student regs") + } - // add exam to db - err = p.dbClient.AddExam(ctx, exam) - if err != nil { - log.Error().Err(err).Int("ancode", exam.AnCode).Msg("cannot insert exam to db") - } + for _, nta := range ntaStuds { + err := p.dbClient.SetCurrentSemesterOnNTA(ctx, nta.Mtknr) + if err != nil { + log.Error().Err(err).Interface("nta", nta).Msg("cannot set current semester on nta") } - - return oks, nil } + + // TODO: Maybe make plausibility checks? + + return &model.Exam{ + Ancode: ancode, + ZpaExam: connectedExam.ZpaExam, + ExternalExam: nil, + PrimussExams: connectedExam.PrimussExams, + StudentRegs: studentRegs, + Conflicts: conflicts, + ConnectErrors: connectedExam.Errors, + Constraints: constraints, + RegularStudents: regularStuds, + NtaStudents: ntaStuds, + Slot: nil, + Rooms: nil, + }, nil } +// func (p *Plexams) PrepareExams(ctx context.Context, inputs []*model.PrimussExamInput) (bool, error) { +// if p.dbClient.ExamsAlreadyPrepared(ctx) { +// oks := true +// for _, input := range inputs { +// ok, err := p.RemovePrimussExam(ctx, input) +// if err != nil { +// return false, err +// } +// oks = oks && ok +// } +// return oks, nil +// } else { +// connectedExams, err := p.GetConnectedExams(ctx) +// if err != nil { +// return false, err +// } + +// oks := true +// for _, connectedExam := range connectedExams { +// // generate Exam and add Teacher +// exam, err := p.zpaExamToExam(ctx, connectedExam.ZpaExam) +// if err != nil { +// // FIXME: Maybe not a good idea? +// return false, err +// } + +// for _, primussExam := range connectedExam.PrimussExams { + +// if isConnected(primussExam, inputs) { +// studentRegs, err := p.GetStudentRegs(ctx, primussExam) +// if err != nil { +// err := p.Log(ctx, fmt.Sprintf("no studentRegs for primuss exam %s/%d", +// primussExam.Program, primussExam.AnCode), "") +// if err != nil { +// log.Error().Err(err).Msg("cannot log") +// } +// } +// conflicts, err := p.GetConflicts(ctx, primussExam) +// if err != nil { +// err := p.Log(ctx, fmt.Sprintf("no studentRegs for primuss exam %s/%d", +// primussExam.Program, primussExam.AnCode), "") +// if err != nil { +// log.Error().Err(err).Msg("cannot log") +// } +// } +// exam.RegisteredExams = append(exam.RegisteredExams, &model.RegisteredExam{ +// Exam: primussExam, +// StudentRegs: studentRegs, +// Conflicts: conflicts.Conflicts, +// }) +// } else { // should not be connected +// if exam.RemovedPrimussExams == nil { +// exam.RemovedPrimussExams = make([]model.RemovedPrimussExam, 0) +// } +// exam.RemovedPrimussExams = append(exam.RemovedPrimussExams, +// model.RemovedPrimussExam{ +// AnCode: primussExam.AnCode, +// Program: primussExam.Program, +// }) +// // log to MongoDb +// err := p.Log(ctx, fmt.Sprintf("removed primuss exam %s/%d from exam %d", +// primussExam.Program, primussExam.AnCode, exam.AnCode), "") +// if err != nil { +// log.Error().Err(err).Str("program", primussExam.Program). +// Int("ancode", primussExam.AnCode). +// Msg("cannot log removed primuss exam") +// } +// } +// } + +// // add exam to db +// err = p.dbClient.AddExam(ctx, exam) +// if err != nil { +// log.Error().Err(err).Int("ancode", exam.AnCode).Msg("cannot insert exam to db") +// } +// } + +// return oks, nil +// } +// } + func (p *Plexams) ConnectExam(ancode int, program string) error { ctx := context.Background() connectedExam, err := p.GetConnectedExam(ctx, ancode) @@ -290,56 +348,61 @@ func (p *Plexams) RemovePrimussExam(ctx context.Context, input *model.PrimussExa return true, nil } -func isConnected(primussExam *model.PrimussExam, notConnectedExams []*model.PrimussExamInput) bool { - for _, notConnectedExam := range notConnectedExams { - if primussExam.AnCode == notConnectedExam.Ancode && primussExam.Program == notConnectedExam.Program { - return false - } - } - - return true -} - -func (p *Plexams) zpaExamToExam(ctx context.Context, zpaExam *model.ZPAExam) (*model.Exam, error) { - mainExamer, err := p.dbClient.GetTeacher(ctx, zpaExam.MainExamerID) - if err != nil { - log.Error().Err(err).Int("AnCode", zpaExam.AnCode).Int("MainExamerID", zpaExam.MainExamerID). - Str("MainExamerName", zpaExam.MainExamer).Msg("cannot find main examer") - return nil, err - } - - return &model.Exam{ - Semester: zpaExam.Semester, - AnCode: zpaExam.AnCode, - Module: zpaExam.Module, - MainExamer: mainExamer, - MainExamerName: zpaExam.MainExamer, - MainExamerID: zpaExam.MainExamerID, - ExamType: zpaExam.ExamType, - Duration: zpaExam.Duration, - IsRepeaterExam: zpaExam.IsRepeaterExam, - ZpaGroups: zpaExam.Groups, - RemovedPrimussExams: nil, - RegisteredExams: []*model.RegisteredExam{}, - }, nil -} - +// func isConnected(primussExam *model.PrimussExam, notConnectedExams []*model.PrimussExamInput) bool { +// for _, notConnectedExam := range notConnectedExams { +// if primussExam.AnCode == notConnectedExam.Ancode && primussExam.Program == notConnectedExam.Program { +// return false +// } +// } + +// return true +// } + +// func (p *Plexams) zpaExamToExam(ctx context.Context, zpaExam *model.ZPAExam) (*model.Exam, error) { +// mainExamer, err := p.dbClient.GetTeacher(ctx, zpaExam.MainExamerID) +// if err != nil { +// log.Error().Err(err).Int("AnCode", zpaExam.AnCode).Int("MainExamerID", zpaExam.MainExamerID). +// Str("MainExamerName", zpaExam.MainExamer).Msg("cannot find main examer") +// return nil, err +// } + +// return &model.Exam{ +// Semester: zpaExam.Semester, +// AnCode: zpaExam.AnCode, +// Module: zpaExam.Module, +// MainExamer: mainExamer, +// MainExamerName: zpaExam.MainExamer, +// MainExamerID: zpaExam.MainExamerID, +// ExamType: zpaExam.ExamType, +// Duration: zpaExam.Duration, +// IsRepeaterExam: zpaExam.IsRepeaterExam, +// ZpaGroups: zpaExam.Groups, +// RemovedPrimussExams: nil, +// RegisteredExams: []*model.RegisteredExam{}, +// }, nil +// } + +// Deprecated: Remove me func (p *Plexams) ExamWithRegs(ctx context.Context, ancode int) (*model.ExamWithRegs, error) { return p.dbClient.ExamWithRegs(ctx, ancode) } +// Deprecated: Remove me func (p *Plexams) ExamsWithRegs(ctx context.Context) ([]*model.ExamWithRegs, error) { return p.dbClient.ExamsWithRegs(ctx) } +// Deprecated: Remove me func (p *Plexams) ExamGroup(ctx context.Context, examGroupCode int) (*model.ExamGroup, error) { return p.dbClient.ExamGroup(ctx, examGroupCode) } +// FIXME: Remove me func (p *Plexams) ExamGroups(ctx context.Context) ([]*model.ExamGroup, error) { return p.dbClient.ExamGroups(ctx) } +// Deprecated: Remove me func (p *Plexams) ConflictingGroupCodes(ctx context.Context, examGroupCode int) ([]*model.ExamGroupConflict, error) { examGroup, err := p.ExamGroup(ctx, examGroupCode) if err != nil { diff --git a/plexams/exam_cache.go b/plexams/exam_cache.go new file mode 100644 index 0000000..b340991 --- /dev/null +++ b/plexams/exam_cache.go @@ -0,0 +1,116 @@ +package plexams + +import ( + "context" + "fmt" + "time" + + "github.com/logrusorgru/aurora" + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" + "github.com/theckman/yacspin" +) + +func (p *Plexams) CacheExam(ancode int) error { + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" caching exam %d"), + aurora.Yellow(ancode), + ), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + ctx := context.Background() + + spinner.Message("generating exam") + exam, err := p.Exam(ctx, ancode) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("error while getting exam") + spinner.StopFailMessage(fmt.Sprintf("problem: %v", err)) + + err := spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + return err + } + if exam.ZpaExam != nil { + log.Debug().Int("ancode", exam.Ancode).Str("module", exam.ZpaExam.Module).Str("examer", exam.ZpaExam.MainExamer). + Msg("caching exam") + } + + spinner.Message("caching exam") + err = p.dbClient.CacheExam(ctx, exam) + if err == nil { + if exam.ZpaExam != nil { + str := aurora.Sprintf(aurora.Green("%s, %s"), exam.ZpaExam.MainExamer, exam.ZpaExam.Module) + if len(exam.RegularStudents) > 0 { + str = fmt.Sprintf("%s, %s", str, aurora.Sprintf(aurora.Magenta("%d stud"), + len(exam.RegularStudents)+len(exam.NtaStudents))) + } + if len(exam.NtaStudents) > 0 { + str = fmt.Sprintf("%s + %s", str, aurora.Sprintf(aurora.Red("%d nta"), + len(exam.NtaStudents))) + } + + spinner.StopMessage(str) + } + } else { + spinner.StopFailMessage(fmt.Sprintf("problem: %v", err)) + + err := spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + return nil +} + +func (p *Plexams) CacheExams() error { + ctx := context.Background() + ancodes, err := p.GetZpaAnCodesToPlan(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get zpa ancodes to plan") + return err + } + for _, ancode := range ancodes { + err = p.CacheExam(ancode.Ancode) + if err != nil { + log.Error().Err(err).Int("ancode", ancode.Ancode).Msg("cannot cache exam") + return err + } + log.Debug().Int("ancode", ancode.Ancode).Msg("successfully cached exam") + } + fmt.Println(aurora.Sprintf(aurora.Green("%d exams successfully cached.\n"), len(ancodes))) + return nil +} + +func (p *Plexams) RmCacheExams() error { + return p.dbClient.RmCacheExams(context.Background()) +} + +func (p *Plexams) CachedExam(ctx context.Context, ancode int) (*model.Exam, error) { + return p.dbClient.CachedExam(ctx, ancode) +} + +func (p *Plexams) CachedExams(ctx context.Context) ([]*model.Exam, error) { + return p.dbClient.CachedExams(ctx) +} diff --git a/plexams/external_exam.go b/plexams/external_exam.go new file mode 100644 index 0000000..77f7372 --- /dev/null +++ b/plexams/external_exam.go @@ -0,0 +1,21 @@ +package plexams + +import ( + "context" + + "github.com/obcode/plexams.go/graph/model" +) + +func (p *Plexams) AddExternalExam(ctx context.Context, primussExam *model.PrimussExam, duration int) error { + return p.dbClient.AddExternalExam(ctx, &model.ExternalExam{ + Ancode: primussExam.AnCode, + Program: primussExam.Program, + Module: primussExam.Module, + MainExamer: primussExam.MainExamer, + Duration: duration, + }) +} + +func (p *Plexams) ExternalExams(ctx context.Context) ([]*model.ExternalExam, error) { + return p.dbClient.ExternalExams(ctx) +} diff --git a/plexams/generate.go b/plexams/generate.go index d294995..e5fa8c2 100644 --- a/plexams/generate.go +++ b/plexams/generate.go @@ -8,6 +8,7 @@ import ( "github.com/rs/zerolog/log" ) +// Deprecated: rm me func (p *Plexams) GeneratePlan(ctx context.Context) error { err := p.dbClient.BackupPlan(ctx) @@ -66,9 +67,9 @@ func (p *Plexams) GeneratePlan(ctx context.Context) error { newPlanEntries := make([]*model.PlanEntry, 0) for _, entry := range plan { - planEntry, err := p.dbClient.PlanEntryForExamGroup(ctx, entry.ExamGroupCode) + planEntry, err := p.dbClient.PlanEntryForExamGroup(ctx, entry.Ancode) if err != nil { - log.Error().Err(err).Int("examgroupcode", entry.ExamGroupCode).Msg("cannot get plan entry for exam group code") + log.Error().Err(err).Int("examgroupcode", entry.Ancode).Msg("cannot get plan entry for exam group code") return err } // if entry is already in plan, day and slot should be the same diff --git a/plexams/generatedExams.go b/plexams/generatedExams.go new file mode 100644 index 0000000..6f26d71 --- /dev/null +++ b/plexams/generatedExams.go @@ -0,0 +1,361 @@ +package plexams + +import ( + "context" + "fmt" + "sort" + "time" + + "github.com/logrusorgru/aurora" + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" + "github.com/theckman/yacspin" +) + +func (p *Plexams) PrepareGeneratedExams() error { + ctx := context.Background() + // from connected exams to exam generated + connectedExams, err := p.GetConnectedExams(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get connected exams") + return err + } + + // TODO: connectedExamsMap + + constraints, err := p.ConstraintsMap(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get connected exams") + return err + } + + allNtas, err := p.Ntas(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get ntas") + return err + } + + ntaMap := make(map[string]*model.NTA) + for _, nta := range allNtas { + ntaMap[nta.Mtknr] = nta + } + + externalExams, err := p.ExternalExams(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get external exams") + return err + } + + ancodesMap := primussAncodesToZpaAncodes(connectedExams, externalExams) + + exams := make([]*model.GeneratedExam, 0, len(connectedExams)) + + for _, connectedExam := range connectedExams { + // // TODO: remove me + // if connectedExam.ZpaExam.AnCode != 390 && connectedExam.ZpaExam.AnCode != 393 && connectedExam.ZpaExam.AnCode != 294 { + // continue + // } + + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" generating exam %d. %s (%s)"), + aurora.Yellow(connectedExam.ZpaExam.AnCode), + aurora.Magenta(connectedExam.ZpaExam.Module), + aurora.Magenta(connectedExam.ZpaExam.MainExamer), + ), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + spinner.Message("adding primuss data") + studentRegsCount := 0 + ntas := make([]*model.NTA, 0) + + enhancedPrimussExams := make([]*model.EnhancedPrimussExam, 0, len(connectedExam.PrimussExams)) + for _, primussExam := range connectedExam.PrimussExams { + enhanced, err := p.primussToEnhanced(ctx, primussExam, ntaMap) + if err != nil { + log.Error().Err(err).Str("program", primussExam.Program).Int("ancode", primussExam.AnCode). + Msg("cannot enhance primuss exam") + return err + } + + ntas = append(ntas, enhanced.Ntas...) + studentRegsCount += len(enhanced.StudentRegs) + enhancedPrimussExams = append(enhancedPrimussExams, enhanced) + } + + conflictsMap := make(map[int]*model.ZPAConflict) + for _, enhanced := range enhancedPrimussExams { + for _, primussConflict := range enhanced.Conflicts { + if primussConflict.AnCode == enhanced.Exam.AnCode { + continue + } + zpaAncode, ok := ancodesMap[PrimussAncode{ + Program: enhanced.Exam.Program, + Ancode: primussConflict.AnCode, + }] + if ok { + zpaConflict, ok := conflictsMap[zpaAncode] + if ok { + conflictsMap[zpaAncode] = &model.ZPAConflict{ + Ancode: zpaAncode, + NumberOfStuds: zpaConflict.NumberOfStuds + primussConflict.NumberOfStuds, + PrimussAncodes: append(zpaConflict.PrimussAncodes, &model.PrimussExamAncode{ + Ancode: primussConflict.AnCode, + Program: enhanced.Exam.Program, + NumberOfStuds: primussConflict.NumberOfStuds, + }), + } + } else { + conflictsMap[zpaAncode] = &model.ZPAConflict{ + Ancode: zpaAncode, + NumberOfStuds: primussConflict.NumberOfStuds, + PrimussAncodes: []*model.PrimussExamAncode{{ + Ancode: primussConflict.AnCode, + Program: enhanced.Exam.Program, + NumberOfStuds: primussConflict.NumberOfStuds, + }}, + } + } + } + } + } + + keys := make([]int, 0, len(conflictsMap)) + for key := range conflictsMap { + keys = append(keys, key) + } + sort.Ints(keys) + + conflicts := make([]*model.ZPAConflict, 0, len(conflictsMap)) + for _, key := range keys { + conflicts = append(conflicts, conflictsMap[key]) + } + + duration := connectedExam.ZpaExam.Duration + maxDuration := duration + for _, nta := range ntas { + ntaDuration := (duration * (100 + nta.DeltaDurationPercent)) / 100 + if ntaDuration > maxDuration { + maxDuration = ntaDuration + } + } + + exams = append(exams, &model.GeneratedExam{ + Ancode: connectedExam.ZpaExam.AnCode, + ZpaExam: connectedExam.ZpaExam, + PrimussExams: enhancedPrimussExams, + Constraints: constraints[connectedExam.ZpaExam.AnCode], + Conflicts: conflicts, + StudentRegsCount: studentRegsCount, + Ntas: ntas, + MaxDuration: maxDuration, + }) + + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + + // TODO: External Exams with student regs, ... + // automatically set notPlannedByMe constraint + + // spinner.Message("recalculating conflicts") + // TODO: for recalculating the conflicts wee need also the exams which have to be in the same slot + // primussExamsForConflicts := make([]*model.EnhancedPrimussExam) + + conflictsPerAncode := make(map[int][]*model.ZPAConflict) + for _, exam := range exams { + conflictsPerAncode[exam.Ancode] = exam.Conflicts + } + + fmt.Println() + + for _, exam := range exams { + // // TODO: remove me + // if exam.ZpaExam.AnCode != 390 && exam.ZpaExam.AnCode != 393 && exam.ZpaExam.AnCode != 294 { + // continue + // } + + if exam.Constraints != nil && len(exam.Constraints.SameSlot) > 0 { + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" recalculating conflicts for exam %d. %s (%s) with same slot constraints %v, was %2d"), + aurora.Yellow(exam.ZpaExam.AnCode), + aurora.Magenta(exam.ZpaExam.Module), + aurora.Magenta(exam.ZpaExam.MainExamer), + aurora.Red(exam.Constraints.SameSlot), + aurora.Red(len(exam.Conflicts)), + ), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + conflictsMap := make(map[int]*model.ZPAConflict) + for _, conflict := range exam.Conflicts { + conflictsMap[conflict.Ancode] = conflict + } + + for _, ancode := range exam.Constraints.SameSlot { + otherConflicts, ok := conflictsPerAncode[ancode] + if !ok { + spinner.Message("cannot get other conflicts") + } + + for _, otherConflict := range otherConflicts { + conflictEntry, ok := conflictsMap[otherConflict.Ancode] + if !ok { + conflictsMap[otherConflict.Ancode] = otherConflict + } else { + conflictsMap[otherConflict.Ancode] = &model.ZPAConflict{ + Ancode: conflictEntry.Ancode, + NumberOfStuds: conflictEntry.NumberOfStuds + otherConflict.NumberOfStuds, + PrimussAncodes: append(conflictEntry.PrimussAncodes, otherConflict.PrimussAncodes...), + } + } + } + } + + keys := make([]int, 0, len(conflictsMap)) + for key := range conflictsMap { + keys = append(keys, key) + } + sort.Ints(keys) + + conflicts := make([]*model.ZPAConflict, 0, len(conflictsMap)) + for _, key := range keys { + conflicts = append(conflicts, conflictsMap[key]) + } + + exam.Conflicts = conflicts + + spinner.StopMessage(aurora.Sprintf(aurora.Green("now %d constraints"), + aurora.Red(len(exam.Conflicts)), + )) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + } + + return p.dbClient.CacheGeneratedExams(ctx, exams) +} + +func (p *Plexams) primussToEnhanced(ctx context.Context, exam *model.PrimussExam, ntaMap map[string]*model.NTA) (*model.EnhancedPrimussExam, error) { + studentRegs, err := p.GetStudentRegs(ctx, exam) + if err != nil { + log.Error().Err(err).Str("program", exam.Program).Int("ancode", exam.AnCode). + Msg("cannot get student regs for primuss exam") + return nil, err + } + + conflicts, err := p.GetConflicts(ctx, exam) + if err != nil { + log.Error().Err(err).Str("program", exam.Program).Int("ancode", exam.AnCode). + Msg("cannot get student regs for primuss exam") + return nil, err + } + + ntas := make([]*model.NTA, 0) + + for _, studentReg := range studentRegs { + nta, ok := ntaMap[studentReg.Mtknr] + if ok { + ntas = append(ntas, nta) + } + } + + if len(studentRegs) > 0 && !p.dbClient.CheckStudentRegsCount(ctx, exam.Program, exam.AnCode, len(studentRegs)) { + log.Error().Err(err).Str("program", exam.Program).Int("ancode", exam.AnCode).Int("count", len(studentRegs)). + Msg("student reg count does not match") + } + + return &model.EnhancedPrimussExam{ + Exam: exam, + StudentRegs: studentRegs, + Conflicts: conflicts.Conflicts, + Ntas: ntas, + }, nil +} + +type PrimussAncode struct { + Program string + Ancode int +} + +func primussAncodesToZpaAncodes(exams []*model.ConnectedExam, externalExams []*model.ExternalExam) map[PrimussAncode]int { + ancodesMap := make(map[PrimussAncode]int) + for _, exam := range exams { + zpaAncode := exam.ZpaExam.AnCode + for _, primussExam := range exam.PrimussExams { + ancodesMap[PrimussAncode{ + Program: primussExam.Program, + Ancode: primussExam.AnCode, + }] = zpaAncode + } + } + + // TODO: add external exams + + return ancodesMap +} + +func (p *Plexams) GeneratedExams(ctx context.Context) ([]*model.GeneratedExam, error) { + return p.dbClient.GetGeneratedExams(ctx) +} + +func (p *Plexams) GeneratedExamsForExamer(ctx context.Context, examerID int) ([]*model.GeneratedExam, error) { + return p.dbClient.GetGeneratedExamsForExamer(ctx, examerID) +} + +func (p *Plexams) GeneratedExam(ctx context.Context, ancode int) (*model.GeneratedExam, error) { + return p.dbClient.GetGeneratedExam(ctx, ancode) +} + +func (p *Plexams) ConflictingAncodes(ctx context.Context, ancode int) ([]*model.Conflict, error) { + exam, err := p.dbClient.GetGeneratedExam(ctx, ancode) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get generated exam") + return nil, err + } + + conflicts := make([]*model.Conflict, 0, len(exam.Conflicts)) + for _, zpaConflict := range exam.Conflicts { + conflicts = append(conflicts, &model.Conflict{ + AnCode: zpaConflict.Ancode, + NumberOfStuds: zpaConflict.NumberOfStuds, + }) + } + + return conflicts, nil +} diff --git a/plexams/generateplan/algorithm.go b/plexams/generateplan/algorithm.go index 3a70173..da1822d 100644 --- a/plexams/generateplan/algorithm.go +++ b/plexams/generateplan/algorithm.go @@ -87,7 +87,7 @@ func (algorithm *Algorithm) NRuns(n int) ([]*model.PlanEntry, error) { var exportPlan []*model.PlanEntry for _, exam := range plan.exams { exportPlan = append(exportPlan, - &model.PlanEntry{DayNumber: exam.day, SlotNumber: exam.slot, ExamGroupCode: exam.examGroup.ExamGroupCode, Locked: false}) + &model.PlanEntry{DayNumber: exam.day, SlotNumber: exam.slot, Ancode: exam.examGroup.ExamGroupCode, Locked: false}) } return exportPlan, nil } diff --git a/plexams/invigilation.go b/plexams/invigilation.go index bc2d148..7085447 100644 --- a/plexams/invigilation.go +++ b/plexams/invigilation.go @@ -18,7 +18,7 @@ func (p *Plexams) AddInvigilation(ctx context.Context, room string, day, slot, i return err } // check if (day,slot) needs a reserve, i.e. contains exams - examsInSlot, err := p.ExamsInSlot(ctx, day, slot) + examsInSlot, err := p.GetExamsInSlot(ctx, day, slot) if err != nil { return err } @@ -34,7 +34,7 @@ func (p *Plexams) AddInvigilation(ctx context.Context, room string, day, slot, i } } // no exam in same slot - exams, err := p.dbClient.PlannedExamsByMainExamer(ctx, invigilatorID) + exams, err := p.dbClient.PlannedExamsByMainExamer(ctx, invigilatorID) //nolint if err != nil { return err } @@ -48,7 +48,7 @@ func (p *Plexams) AddInvigilation(ctx context.Context, room string, day, slot, i } func (p *Plexams) GetInvigilator(ctx context.Context, invigilatorID int) (*model.Invigilator, error) { - invigilationTodos, err := p.InvigilationTodos(ctx) + invigilationTodos, err := p.dbClient.GetInvigilationTodos(ctx) if err != nil { log.Error().Err(err).Msg("cannot get invigilation todos") return nil, err diff --git a/plexams/invigilators.go b/plexams/invigilators.go index 068e827..26e447e 100644 --- a/plexams/invigilators.go +++ b/plexams/invigilators.go @@ -65,7 +65,8 @@ func (p *Plexams) InvigilatorsWithReq(ctx context.Context) ([]*model.Invigilator excludedDates := make([]*time.Time, 0, len(reqs.ExcludedDates)) for _, day := range reqs.ExcludedDates { - t, err := time.Parse("02.01.06", day) + loc, _ := time.LoadLocation("Europe/Berlin") + t, err := time.ParseInLocation("02.01.06", day, loc) if err != nil { log.Error().Err(err).Str("day", day).Msg("cannot parse date") } else { @@ -74,12 +75,19 @@ func (p *Plexams) InvigilatorsWithReq(ctx context.Context) ([]*model.Invigilator } examDateTimes := make([]*time.Time, 0) - exams, err := p.dbClient.PlannedExamsByMainExamer(ctx, teacher.ID) + exams, err := p.GeneratedExamsForExamer(ctx, teacher.ID) if err != nil { log.Error().Err(err).Str("name", teacher.Shortname).Msg("cannit get exams by main examer") } else { for _, exam := range exams { - examDateTimes = append(examDateTimes, &exam.Slot.Starttime) + planEntry, err := p.dbClient.PlanEntry(ctx, exam.Ancode) + if err != nil { + log.Error().Err(err).Int("ancode", exam.Ancode).Msg("cannot get plan entry for ancode") + } + if planEntry != nil { + starttime := p.getSlotTime(planEntry.DayNumber, planEntry.SlotNumber) + examDateTimes = append(examDateTimes, &starttime) + } } } @@ -129,19 +137,46 @@ func (p *Plexams) InvigilatorsWithReq(ctx context.Context) ([]*model.Invigilator } func (p *Plexams) datesToDay(dates []*time.Time) []int { - days := make([]int, 0, len(dates)) + days := set.NewSet[int]() for _, date := range dates { for _, day := range p.semesterConfig.Days { if day.Date.Month() == date.Month() && day.Date.Day() == date.Day() { - days = append(days, day.Number) + days.Add(day.Number) } } } - return days + daysSlice := days.ToSlice() + sort.Ints(daysSlice) + return daysSlice } -func (p *Plexams) InvigilationTodos(ctx context.Context) (*model.InvigilationTodos, error) { - selfInvigilations, err := p.GetSelfInvigilations(ctx) +func (p *Plexams) GetInvigilationTodos(ctx context.Context) (*model.InvigilationTodos, error) { + todos, err := p.dbClient.GetInvigilationTodos(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get invigilation todos") + return nil, err + } + if todos == nil { + return p.PrepareInvigilationTodos(ctx) + } + + err = p.AddInvigilatorsToInvigilationTodos(ctx, todos) + if err != nil { + log.Error().Err(err).Msg("cannot add invigilators to invigilation todos") + return nil, err + } + + err = p.dbClient.CacheInvigilatorTodos(ctx, todos) + if err != nil { + log.Error().Err(err).Msg("cannot cache invigilation todos") + return nil, err + } + + return todos, nil +} + +func (p *Plexams) PrepareInvigilationTodos(ctx context.Context) (*model.InvigilationTodos, error) { + selfInvigilations, err := p.MakeSelfInvigilations(ctx) if err != nil { log.Error().Err(err).Msg("cannot get self invigilations") } @@ -265,11 +300,204 @@ func (p *Plexams) InvigilationTodos(ctx context.Context) (*model.InvigilationTod } } + err = p.dbClient.CacheInvigilatorTodos(ctx, &todos) + if err != nil { + log.Error().Err(err).Msg("cannot cache invigilation todos") + return &todos, err + } + return &todos, nil } +func (p *Plexams) AddInvigilatorsToInvigilationTodos(ctx context.Context, todos *model.InvigilationTodos) error { + reqs, err := p.InvigilatorsWithReq(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get invigilators with regs") + return err + } + + todos.Invigilators = reqs + + for _, invigilator := range todos.Invigilators { + + enough := false + totalMinutes := todos.TodoPerInvigilatorOvertimeCutted + if invigilator.Requirements != nil { + totalMinutes = int(float64(totalMinutes) * invigilator.Requirements.Factor) + } + + if invigilator.Requirements != nil { + totalMinutes -= invigilator.Requirements.AllContributions + + if totalMinutes < 0 { + totalMinutes = 0 + enough = true + } + } + + invigilationsForInvigilator, err := p.dbClient.InvigilationsForInvigilator(ctx, invigilator.Teacher.ID) + if err != nil { + log.Error().Err(err).Str("invigilator", invigilator.Teacher.Shortname). + Msg("cannot get invigilations") + return err + } + + invigilationSet := set.NewSet[int]() + doingMinutes := 0 + + for _, invigilation := range invigilationsForInvigilator { + invigilationSet.Add(invigilation.Slot.DayNumber) + if !invigilation.IsSelfInvigilation { + doingMinutes += invigilation.Duration + } + } + invigilationDays := invigilationSet.ToSlice() + sort.Ints(invigilationDays) + + invigilator.Todos = &model.InvigilatorTodos{ + TotalMinutes: totalMinutes, + DoingMinutes: doingMinutes, + Enough: enough, + InvigilationDays: invigilationDays, + Invigilations: invigilationsForInvigilator, + } + } + + return nil +} + +// Deprecated: split to other functions +func (p *Plexams) InvigilationTodos(ctx context.Context) (*model.InvigilationTodos, error) { + // selfInvigilations, err := p.MakeSelfInvigilations(ctx) + // if err != nil { + // log.Error().Err(err).Msg("cannot get self invigilations") + // } + + // todos := model.InvigilationTodos{} + + // for _, slot := range p.semesterConfig.Slots { + // roomsInSlot, err := p.PlannedRoomsInSlot(ctx, slot.DayNumber, slot.SlotNumber) + // if err != nil { + // log.Error().Err(err).Int("day", slot.DayNumber).Int("time", slot.SlotNumber). + // Msg("cannot get rooms for slot") + // } else { + // if len(roomsInSlot) == 0 { + // continue + // } + // roomMap := make(map[string]int) + // OUTER: + // for _, room := range roomsInSlot { + // for _, selfInvigilation := range selfInvigilations { + // if selfInvigilation.Slot.DayNumber == slot.DayNumber && + // selfInvigilation.Slot.SlotNumber == slot.SlotNumber && + // *selfInvigilation.RoomName == room.RoomName { + // log.Debug().Int("day", slot.DayNumber).Int("slot", slot.SlotNumber).Str("room", room.RoomName). + // Msg("found self invigilation") + // continue OUTER + // } + // } + // maxDuration, ok := roomMap[room.RoomName] + // if !ok || maxDuration < room.Duration { + // roomMap[room.RoomName] = room.Duration + // } + // } + + // for _, maxDuration := range roomMap { + // todos.SumExamRooms += maxDuration + // } + // todos.SumReserve += 60 // FIXME: Maybe some other time? half of max duration in slot? + // } + // } + + // reqs, err := p.InvigilatorsWithReq(ctx) + // if err != nil { + // log.Error().Err(err).Msg("cannot get invigilators with regs") + // } + + // todos.Invigilators = reqs + + // for _, invigilator := range reqs { + // if invigilator.Requirements != nil { + // todos.SumOtherContributions += invigilator.Requirements.AllContributions + // } + // } + + // todos.InvigilatorCount = len(reqs) + // adjustedInvigilatorCount := 0.0 + + // for _, invigilator := range reqs { + // if invigilator.Requirements != nil { + // adjustedInvigilatorCount += invigilator.Requirements.Factor + // } + // } + + // todos.TodoPerInvigilator = int(math.Ceil(float64(todos.SumExamRooms+todos.SumReserve+todos.SumOtherContributions) / adjustedInvigilatorCount)) + + // sumOtherContributionsOvertimeCutted := 0 + // for _, invigilator := range reqs { + // if invigilator.Requirements != nil { + // if otherContributions := invigilator.Requirements.OralExamsContribution + + // invigilator.Requirements.LiveCodingContribution + + // invigilator.Requirements.MasterContribution; otherContributions > todos.TodoPerInvigilator { + // sumOtherContributionsOvertimeCutted += todos.TodoPerInvigilator + // } else { + // sumOtherContributionsOvertimeCutted += otherContributions + // } + // } + // } + // todos.SumOtherContributionsOvertimeCutted = sumOtherContributionsOvertimeCutted + // todos.TodoPerInvigilatorOvertimeCutted = int(math.Ceil(float64(todos.SumExamRooms+todos.SumReserve+sumOtherContributionsOvertimeCutted) / adjustedInvigilatorCount)) + + // for _, invigilator := range todos.Invigilators { + + // enough := false + // totalMinutes := todos.TodoPerInvigilatorOvertimeCutted + // if invigilator.Requirements != nil { + // totalMinutes = int(float64(totalMinutes) * invigilator.Requirements.Factor) + // } + + // if invigilator.Requirements != nil { + // totalMinutes -= invigilator.Requirements.AllContributions + + // if totalMinutes < 0 { + // totalMinutes = 0 + // enough = true + // } + // } + + // invigilationsForInvigilator, err := p.dbClient.InvigilationsForInvigilator(ctx, invigilator.Teacher.ID) + // if err != nil { + // log.Error().Err(err).Str("invigilator", invigilator.Teacher.Shortname). + // Msg("cannot get invigilations") + // } + + // invigilationSet := set.NewSet[int]() + // doingMinutes := 0 + + // for _, invigilation := range invigilationsForInvigilator { + // invigilationSet.Add(invigilation.Slot.DayNumber) + // if !invigilation.IsSelfInvigilation { + // doingMinutes += invigilation.Duration + // } + // } + // invigilationDays := invigilationSet.ToSlice() + // sort.Ints(invigilationDays) + + // invigilator.Todos = &model.InvigilatorTodos{ + // TotalMinutes: totalMinutes, + // DoingMinutes: doingMinutes, + // Enough: enough, + // InvigilationDays: invigilationDays, + // Invigilations: invigilationsForInvigilator, + // } + // } + + // return &todos, nil + return nil, nil +} + func (p *Plexams) InvigilatorsForDay(ctx context.Context, day int) (*model.InvigilatorsForDay, error) { - invigilationTodos, err := p.InvigilationTodos(ctx) + invigilationTodos, err := p.dbClient.GetInvigilationTodos(ctx) if err != nil { log.Error().Err(err).Msg("cannot get invigilation todos") return nil, err @@ -315,7 +543,7 @@ func dayOkForInvigilator(day int, invigilator *model.Invigilator) (wantDay, canD func (p *Plexams) PrepareSelfInvigilation() error { ctx := context.Background() - selfInvigilations, err := p.GetSelfInvigilations(ctx) + selfInvigilations, err := p.MakeSelfInvigilations(ctx) if err != nil { return err } @@ -331,7 +559,7 @@ func (p *Plexams) PrepareSelfInvigilation() error { return p.dbClient.DropAndSave(context.WithValue(ctx, db.CollectionName("collectionName"), "invigilations_self"), toSave) } -func (p *Plexams) GetSelfInvigilations(ctx context.Context) ([]*model.Invigilation, error) { +func (p *Plexams) MakeSelfInvigilations(ctx context.Context) ([]*model.Invigilation, error) { invigilators, err := p.InvigilatorsWithReq(ctx) if err != nil || invigilators == nil { log.Error().Err(err).Msg("cannot get invigilators") @@ -345,74 +573,108 @@ func (p *Plexams) GetSelfInvigilations(ctx context.Context) ([]*model.Invigilati invigilatorMap[invigilator.Teacher.ID] = invigilator } - invigilations := make([]*model.Invigilation, 0) + type key struct { + roomName string + day int + slot int + } + + invigilationsMap := make(map[key][]*model.Invigilation) + for _, slot := range p.semesterConfig.Slots { - examsInSlot, err := p.ExamsInSlot(ctx, slot.DayNumber, slot.SlotNumber) + examsInSlot, err := p.GetExamsInSlot(ctx, slot.DayNumber, slot.SlotNumber) if err != nil { log.Error().Err(err).Int("day", slot.DayNumber).Int("time", slot.SlotNumber). Msg("cannot get exams in slot") continue } - examerWithExams := make(map[int][]*model.ExamInPlan) + examerWithExams := make(map[int][]*model.PlannedExam) OUTER: for _, exam := range examsInSlot { - invigilator, ok := invigilatorMap[exam.Exam.ZpaExam.MainExamerID] + invigilator, ok := invigilatorMap[exam.ZpaExam.MainExamerID] if !ok { - log.Debug().Str("name", exam.Exam.ZpaExam.MainExamer).Msg("ist keine Aufsicht") + log.Debug().Str("name", exam.ZpaExam.MainExamer).Msg("ist keine Aufsicht") + continue + } + if exam.Constraints != nil && exam.Constraints.NotPlannedByMe { + continue + } + if len(exam.PlannedRooms) == 0 { continue } if invigilator.Requirements != nil { for _, day := range invigilator.Requirements.ExcludedDays { - if day == exam.Slot.DayNumber { - log.Debug().Str("name", exam.Exam.ZpaExam.MainExamer).Interface("slot", exam.Slot). + if day == exam.PlanEntry.DayNumber { + log.Debug().Str("name", exam.ZpaExam.MainExamer).Interface("slot", exam.PlanEntry). Msg("Tag ist gesperrt für Aufsicht") continue OUTER } } } - exams, ok := examerWithExams[exam.Exam.ZpaExam.MainExamerID] + exams, ok := examerWithExams[exam.ZpaExam.MainExamerID] if !ok { - examerWithExams[exam.Exam.ZpaExam.MainExamerID] = []*model.ExamInPlan{exam} + examerWithExams[exam.ZpaExam.MainExamerID] = []*model.PlannedExam{exam} } else { - examerWithExams[exam.Exam.ZpaExam.MainExamerID] = append(exams, exam) + examerWithExams[exam.ZpaExam.MainExamerID] = append(exams, exam) } } for examer, exams := range examerWithExams { roomNames := set.NewSet[string]() for _, exam := range exams { - rooms, err := p.dbClient.RoomsForAncode(ctx, exam.Exam.Ancode) - - if err != nil { - log.Error().Err(err).Int("ancode", exam.Exam.Ancode).Msg("cannot get rooms for ancode") - } else { - for _, room := range rooms { - roomNames.Add(room.RoomName) - } + for _, room := range exam.PlannedRooms { + roomNames.Add(room.RoomName) } } if roomNames.Cardinality() == 1 { log.Debug().Int("examerid", examer).Interface("room", roomNames).Interface("slot", slot). Msg("found self invigilation") - invigilation := model.Invigilation{ + key := key{ + roomName: roomNames.ToSlice()[0], + day: slot.DayNumber, + slot: slot.SlotNumber, + } + invigilationsForKey, ok := invigilationsMap[key] + if !ok { + invigilationsForKey = make([]*model.Invigilation, 0, 1) + } + invigilationsMap[key] = append(invigilationsForKey, &model.Invigilation{ RoomName: &roomNames.ToSlice()[0], Duration: 0, // FIXME: ?? self-invigilation does not count InvigilatorID: examer, Slot: slot, IsReserve: false, IsSelfInvigilation: true, - } - invigilations = append(invigilations, &invigilation) + }) } } } + + invigilations := make([]*model.Invigilation, 0) + for _, invigs := range invigilationsMap { + // if len(invigs) == 1 { + // invigilations = append(invigilations, invigs...) + // } else { + if len(invigs) > 1 { + log.Debug().Interface("invigs", invigs).Msg("found more self invigs") + } + // // TODO: find examer with most studs in room + // // for _, invig := range invigs { + + // // } + // } + invigilations = append(invigilations, invigs[0]) + } + log.Debug().Int("count", len(invigilations)).Msg("found self invigilations") + return invigilations, nil } +// TODO: rewrite me func (p *Plexams) RoomsWithInvigilationsForSlot(ctx context.Context, day int, time int) (*model.InvigilationSlot, error) { rooms, err := p.PlannedRoomsInSlot(ctx, day, time) if err != nil { @@ -421,6 +683,10 @@ func (p *Plexams) RoomsWithInvigilationsForSlot(ctx context.Context, day int, ti return nil, err } + if len(rooms) == 0 { + return nil, nil // okay? + } + reserve, err := p.dbClient.GetInvigilatorInSlot(ctx, "reserve", day, time) if err != nil { log.Error().Err(err).Int("day", day).Int("time", time). @@ -433,12 +699,12 @@ func (p *Plexams) RoomsWithInvigilationsForSlot(ctx context.Context, day int, ti RoomsWithInvigilators: []*model.RoomWithInvigilator{}, } - roomMap := make(map[string][]*model.RoomForExam) + roomMap := make(map[string][]*model.PlannedRoom) for _, room := range rooms { roomsForExam, ok := roomMap[room.RoomName] if !ok { - roomsForExam = make([]*model.RoomForExam, 0, 1) + roomsForExam = make([]*model.PlannedRoom, 0, 1) } roomMap[room.RoomName] = append(roomsForExam, room) } @@ -474,7 +740,7 @@ func (p *Plexams) RoomsWithInvigilationsForSlot(ctx context.Context, day int, ti if roomForExam.Duration > maxDuration { maxDuration = roomForExam.Duration } - studentCount += roomForExam.SeatsPlanned + studentCount += len(roomForExam.StudentsInRoom) } slot.RoomsWithInvigilators = append(slot.RoomsWithInvigilators, &model.RoomWithInvigilator{ diff --git a/plexams/nta.go b/plexams/nta.go index 20ed554..d016a2f 100644 --- a/plexams/nta.go +++ b/plexams/nta.go @@ -2,10 +2,8 @@ package plexams import ( "context" - "sort" "github.com/obcode/plexams.go/graph/model" - "github.com/rs/zerolog/log" ) func (p *Plexams) AddNta(ctx context.Context, input model.NTAInput) (*model.NTA, error) { @@ -16,130 +14,137 @@ func (p *Plexams) Ntas(ctx context.Context) ([]*model.NTA, error) { return p.dbClient.Ntas(ctx) } -func (p *Plexams) NtasWithRegs(ctx context.Context) ([]*model.NTAWithRegs, error) { +func (p *Plexams) NtasWithRegs(ctx context.Context) ([]*model.Student, error) { return p.dbClient.NtasWithRegs(ctx) } +// Deprecated: rm me func (p *Plexams) Nta(ctx context.Context, mtknr string) (*model.NTAWithRegs, error) { + return p.dbClient.NtaWithRegs(ctx, mtknr) +} + +func (p *Plexams) NtaByMtknr(ctx context.Context, mtknr string) (*model.NTA, error) { return p.dbClient.Nta(ctx, mtknr) } +// Deprecated: rm me func (p *Plexams) PrepareNta() error { - ctx := context.Background() - // get NTAs - ntas, err := p.Ntas(ctx) - if err != nil { - log.Error().Err(err).Msg("cannot get NTAs") - return err - } - - // get StudentRegs - studentRegs, err := p.StudentRegsPerStudentPlanned(ctx) - if err != nil { - log.Error().Err(err).Msg("cannot get student regs") - return err - } - - // merge - ntaWithRegs := make([]*model.NTAWithRegs, 0) - for _, nta := range ntas { - for _, studentReg := range studentRegs { - if nta.Mtknr == studentReg.Student.Mtknr { - ntaWithRegs = append(ntaWithRegs, &model.NTAWithRegs{ - Nta: nta, - Regs: studentReg, - }) - break - } - } - } - - err = p.dbClient.SaveSemesterNTAs(ctx, ntaWithRegs) - if err != nil { - log.Error().Err(err).Msg("cannot save ntas for semester") - return err - } + // ctx := context.Background() + // // get NTAs + // ntas, err := p.Ntas(ctx) + // if err != nil { + // log.Error().Err(err).Msg("cannot get NTAs") + // return err + // } + + // // get StudentRegs + // studentRegs, err := p.StudentRegsPerStudentPlanned(ctx) + // if err != nil { + // log.Error().Err(err).Msg("cannot get student regs") + // return err + // } + + // // merge + // ntaWithRegs := make([]*model.NTAWithRegs, 0) + // for _, nta := range ntas { + // for _, studentReg := range studentRegs { + // if nta.Mtknr == studentReg.Student.Mtknr { + // ntaWithRegs = append(ntaWithRegs, &model.NTAWithRegs{ + // Nta: nta, + // Regs: studentReg, + // }) + // break + // } + // } + // } + + // err = p.dbClient.SaveSemesterNTAs(ctx, ntaWithRegs) + // if err != nil { + // log.Error().Err(err).Msg("cannot save ntas for semester") + // return err + // } return nil } +// Deprecated: rm me func (p *Plexams) NtasWithRegsByTeacher(ctx context.Context) ([]*model.NTAWithRegsByExamAndTeacher, error) { - ntas, err := p.NtasWithRegs(ctx) - if err != nil { - log.Error().Err(err).Msg("cannot get NTAs with regs") - return nil, err - } - - ancodesMap := make(map[int][]*model.NTAWithRegs) - for _, nta := range ntas { - for _, ancode := range nta.Regs.Ancodes { - entry, ok := ancodesMap[ancode] - if ok { - entry = append(entry, nta) - } else { - entry = []*model.NTAWithRegs{nta} - } - ancodesMap[ancode] = entry - } - } - - mainExamerMap := make(map[int][]*model.ZPAExam) - for ancode := range ancodesMap { - exam, err := p.GetZpaExamByAncode(ctx, ancode) - if err != nil { - log.Error().Err(err).Int("ancode", ancode).Msg("cannot get exam with ancode") - return nil, err - } - - exams, ok := mainExamerMap[exam.MainExamerID] - if ok { - exams = append(exams, exam) - } else { - exams = []*model.ZPAExam{exam} - } - mainExamerMap[exam.MainExamerID] = exams - } - - // sort teacher - teacherMap := make(map[string]*model.Teacher) - teacherNames := make([]string, 0, len(mainExamerMap)) - for mainExamerID := range mainExamerMap { - teacher, err := p.GetTeacher(ctx, mainExamerID) - if err != nil { - log.Error().Err(err).Int("mainExamerID", mainExamerID).Msg("cannot get teacher with mainExamerID") - return nil, err - } - teacherMap[teacher.Shortname] = teacher - teacherNames = append(teacherNames, teacher.Shortname) - } - sort.Strings(teacherNames) - - result := make([]*model.NTAWithRegsByExamAndTeacher, 0, len(mainExamerMap)) - for _, teacherName := range teacherNames { - teacher := teacherMap[teacherName] - exams := mainExamerMap[teacher.ID] - examsResult := make([]*model.NTAWithRegsByExam, 0) - for _, exam := range exams { - constraint, err := p.ConstraintForAncode(ctx, exam.AnCode) - if err != nil { - log.Error().Err(err).Int("ancode", exam.AnCode).Msg("cannot get constraint for ancode") - } - if constraint != nil && constraint.NotPlannedByMe { - break - } - examsResult = append(examsResult, &model.NTAWithRegsByExam{ - Exam: exam, - Ntas: ancodesMap[exam.AnCode], - }) - } - - if len(examsResult) > 0 { - result = append(result, &model.NTAWithRegsByExamAndTeacher{ - Teacher: teacher, - Exams: examsResult, - }) - } - } - - return result, err + // ntas, err := p.NtasWithRegs(ctx) + // if err != nil { + // log.Error().Err(err).Msg("cannot get NTAs with regs") + // return nil, err + // } + + // ancodesMap := make(map[int][]*model.NTAWithRegs) + // for _, nta := range ntas { + // for _, ancode := range nta.Regs.Ancodes { + // entry, ok := ancodesMap[ancode] + // if ok { + // entry = append(entry, nta) + // } else { + // entry = []*model.NTAWithRegs{nta} + // } + // ancodesMap[ancode] = entry + // } + // } + + // mainExamerMap := make(map[int][]*model.ZPAExam) + // for ancode := range ancodesMap { + // exam, err := p.GetZpaExamByAncode(ctx, ancode) + // if err != nil { + // log.Error().Err(err).Int("ancode", ancode).Msg("cannot get exam with ancode") + // return nil, err + // } + + // exams, ok := mainExamerMap[exam.MainExamerID] + // if ok { + // exams = append(exams, exam) + // } else { + // exams = []*model.ZPAExam{exam} + // } + // mainExamerMap[exam.MainExamerID] = exams + // } + + // // sort teacher + // teacherMap := make(map[string]*model.Teacher) + // teacherNames := make([]string, 0, len(mainExamerMap)) + // for mainExamerID := range mainExamerMap { + // teacher, err := p.GetTeacher(ctx, mainExamerID) + // if err != nil { + // log.Error().Err(err).Int("mainExamerID", mainExamerID).Msg("cannot get teacher with mainExamerID") + // return nil, err + // } + // teacherMap[teacher.Shortname] = teacher + // teacherNames = append(teacherNames, teacher.Shortname) + // } + // sort.Strings(teacherNames) + + // result := make([]*model.NTAWithRegsByExamAndTeacher, 0, len(mainExamerMap)) + // for _, teacherName := range teacherNames { + // teacher := teacherMap[teacherName] + // exams := mainExamerMap[teacher.ID] + // examsResult := make([]*model.NTAWithRegsByExam, 0) + // for _, exam := range exams { + // constraint, err := p.ConstraintForAncode(ctx, exam.AnCode) + // if err != nil { + // log.Error().Err(err).Int("ancode", exam.AnCode).Msg("cannot get constraint for ancode") + // } + // if constraint != nil && constraint.NotPlannedByMe { + // break + // } + // examsResult = append(examsResult, &model.NTAWithRegsByExam{ + // Exam: exam, + // Ntas: ancodesMap[exam.AnCode], + // }) + // } + + // if len(examsResult) > 0 { + // result = append(result, &model.NTAWithRegsByExamAndTeacher{ + // Teacher: teacher, + // Exams: examsResult, + // }) + // } + // } + + return nil, nil } diff --git a/plexams/pdf.go b/plexams/pdf.go index c1d5237..0ae6116 100644 --- a/plexams/pdf.go +++ b/plexams/pdf.go @@ -60,7 +60,7 @@ func (p *Plexams) GenerateExamsToPlanPDF(ctx context.Context, outfile string) er }) }) }) - m.Row(20, func() { + m.Row(10, func() { m.Col(12, func() { m.Text( fmt.Sprintf("Melden Sie sich bitte umgehend per E-Mail (%s) bei mir (%s), wenn Ihre Prüfung hier fehlt oder hier nicht stehen sollte.", @@ -71,6 +71,16 @@ func (p *Plexams) GenerateExamsToPlanPDF(ctx context.Context, outfile string) er }) }) }) + m.Row(10, func() { + m.Col(12, func() { + m.Text( + "Dieses Dokument enthält alle Prüfungen in 3 Sortierungen.", props.Text{ + Top: 3, + Style: consts.Normal, + Align: consts.Center, + }) + }) + }) header := []string{"AnCode", "Modul", "Prüfer:in", "Gruppe(n)", "Form"} @@ -79,6 +89,17 @@ func (p *Plexams) GenerateExamsToPlanPDF(ctx context.Context, outfile string) er log.Error().Err(err).Msg("error while getting exams") } + m.Row(20, func() { + m.Col(12, func() { + m.Text( + "Sortiert nach AnCode (= der Code im ZPA)", props.Text{ + Top: 5, + Style: consts.Bold, + Align: consts.Center, + }) + }) + }) + contents := make([][]string, 0, len(exams)) for _, exam := range exams { @@ -106,6 +127,104 @@ func (p *Plexams) GenerateExamsToPlanPDF(ctx context.Context, outfile string) er Line: false, }) + m.Row(20, func() { + m.Col(12, func() { + m.Text( + "Sortiert nach dem Namen der Prüfer:in", props.Text{ + Top: 5, + Style: consts.Bold, + Align: consts.Center, + }) + }) + }) + + examsByExamers := make(map[string][]*model.ZPAExam) + for _, exam := range exams { + examsByExamer, ok := examsByExamers[exam.MainExamer] + if !ok { + examsByExamer = make([]*model.ZPAExam, 0, 1) + } + examsByExamers[exam.MainExamer] = append(examsByExamer, exam) + } + + keys := make([]string, 0, len(examsByExamers)) + for k := range examsByExamers { + keys = append(keys, k) + } + sort.Strings(keys) + + contents = make([][]string, 0, len(exams)) + + for _, key := range keys { + for _, exam := range examsByExamers[key] { + contents = append(contents, []string{strconv.Itoa(exam.AnCode), exam.Module, exam.MainExamer, fmt.Sprintf("%v", exam.Groups), exam.ExamTypeFull}) + } + } + + m.TableList(header, contents, props.TableList{ + HeaderProp: props.TableListContent{ + Size: 9, + GridSizes: []uint{1, 4, 2, 2, 3}, + }, + ContentProp: props.TableListContent{ + Size: 8, + GridSizes: []uint{1, 4, 2, 2, 3}, + }, + Align: consts.Left, + AlternatedBackground: &grayColor, + HeaderContentSpace: 1, + Line: false, + }) + + m.Row(20, func() { + m.Col(12, func() { + m.Text( + "Sortiert nach dem Prüfungsnamen", props.Text{ + Top: 5, + Style: consts.Bold, + Align: consts.Center, + }) + }) + }) + + examsByModules := make(map[string][]*model.ZPAExam) + for _, exam := range exams { + examsByModule, ok := examsByModules[exam.Module] + if !ok { + examsByModule = make([]*model.ZPAExam, 0, 1) + } + examsByModules[exam.Module] = append(examsByModule, exam) + } + + keys = make([]string, 0, len(examsByModules)) + for k := range examsByModules { + keys = append(keys, k) + } + sort.Strings(keys) + + contents = make([][]string, 0, len(exams)) + + for _, key := range keys { + for _, exam := range examsByModules[key] { + contents = append(contents, []string{strconv.Itoa(exam.AnCode), exam.Module, exam.MainExamer, fmt.Sprintf("%v", exam.Groups), exam.ExamTypeFull}) + } + } + + m.TableList(header, contents, props.TableList{ + HeaderProp: props.TableListContent{ + Size: 9, + GridSizes: []uint{1, 4, 2, 2, 3}, + }, + ContentProp: props.TableListContent{ + Size: 8, + GridSizes: []uint{1, 4, 2, 2, 3}, + }, + Align: consts.Left, + AlternatedBackground: &grayColor, + HeaderContentSpace: 1, + Line: false, + }) + err = m.OutputFileAndClose(outfile) if err != nil { log.Error().Err(err).Msg("Could not save PDF") diff --git a/plexams/pdfDraft.go b/plexams/pdfDraft.go index d591a16..f62a4eb 100644 --- a/plexams/pdfDraft.go +++ b/plexams/pdfDraft.go @@ -233,14 +233,21 @@ func (p *Plexams) tableForProgram(ctx context.Context, program, programLong stri contents := make([][]string, 0) - exams, err := p.PlannedExamsForProgram(ctx, program) + exams, err := p.PlannedExamsForProgram(ctx, program, true) if err != nil { log.Error().Err(err).Msg("error while getting exams") } for _, exam := range exams { - contents = append(contents, - []string{strconv.Itoa(exam.Ancode), exam.Module, exam.MainExamer, - r.Replace(exam.DateTime.Format("Mon. 02.01.06, 15:04 Uhr"))}) + if exam.PlanEntry == nil { + contents = append(contents, + []string{strconv.Itoa(exam.Ancode), exam.ZpaExam.Module, exam.ZpaExam.MainExamer, + "fehlt noch"}) + } else { + starttime := p.getSlotTime(exam.PlanEntry.DayNumber, exam.PlanEntry.SlotNumber) + contents = append(contents, + []string{strconv.Itoa(exam.Ancode), exam.ZpaExam.Module, exam.ZpaExam.MainExamer, + r.Replace(starttime.Local().Format("Mon. 02.01.06, 15:04 Uhr"))}) + } } grayColor := color.Color{ diff --git a/plexams/plan.go b/plexams/plan.go index e2d5d85..f42107d 100644 --- a/plexams/plan.go +++ b/plexams/plan.go @@ -7,61 +7,36 @@ import ( "time" set "github.com/deckarep/golang-set/v2" - "github.com/gookit/color" - "github.com/obcode/plexams.go/db" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" - "github.com/spf13/viper" ) func (p *Plexams) AddExamToSlot(ctx context.Context, ancode int, dayNumber int, timeNumber int) (bool, error) { - examGroup, err := p.GetExamGroupForAncode(ctx, ancode) - if err != nil { - log.Error().Err(err).Int("ancode", ancode).Msg("cannot get exam group for ancode") - } + var slot *model.Slot - return p.AddExamGroupToSlot(ctx, dayNumber, timeNumber, examGroup.ExamGroupCode) -} - -func (p *Plexams) GetExamGroupForAncode(ctx context.Context, ancode int) (*model.ExamGroup, error) { - return p.dbClient.GetExamGroupForAncode(ctx, ancode) -} - -func (p *Plexams) AddExamGroupToSlot(ctx context.Context, dayNumber int, timeNumber int, examGroupCode int) (bool, error) { - // check if slot exists - ok := false - for _, day := range p.semesterConfig.Days { - if day.Number == dayNumber { - ok = true - break - } - } - if !ok { - log.Error().Int("day", dayNumber).Msg("day does not exists") - return false, fmt.Errorf("day %d does not exist", dayNumber) - } - ok = false - for _, time := range p.semesterConfig.Starttimes { - if time.Number == timeNumber { - ok = true + for _, s := range p.semesterConfig.Slots { + if s.DayNumber == dayNumber && s.SlotNumber == timeNumber { + slot = s break } } - if !ok { - log.Error().Int("time", timeNumber).Msg("time does not exists") - return false, fmt.Errorf("time %d does not exist", timeNumber) + + if slot == nil { + err := fmt.Errorf("slot (%d,%d) does not exist", dayNumber, timeNumber) + log.Error().Err(err).Int("day", dayNumber).Int("slot", timeNumber).Msg("slot does not exist") + return false, err } - // check if examGroup exists - _, err := p.ExamGroup(ctx, examGroupCode) - if err != nil { - log.Error().Err(err).Int("examGroupCode", examGroupCode).Msg("exam group does not exist") + // check if exam with ancode exists + exam, err := p.GeneratedExam(ctx, ancode) + if err != nil || exam == nil { + log.Error().Err(err).Int("ancode", ancode).Msg("exam does not exist or does not need to be planned") + return false, err } - // check if slot is allowed - allowedSlots, err := p.AllowedSlots(ctx, examGroupCode) + allowedSlots, err := p.AllowedSlots(ctx, ancode) if err != nil { - log.Error().Err(err).Int("examGroupCode", examGroupCode).Msg("cannot get allowed slots") + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get allowed slots") } slotIsAllowed := false @@ -72,352 +47,244 @@ func (p *Plexams) AddExamGroupToSlot(ctx context.Context, dayNumber int, timeNum } } if !slotIsAllowed { - log.Debug().Int("day", dayNumber).Int("time", timeNumber).Int("examGroupCode", examGroupCode). + log.Debug().Int("day", dayNumber).Int("time", timeNumber).Int("ancode", ancode). Msg("slot is not allowed") - return false, fmt.Errorf("slot (%d,%d) is not allowed for exam group %d", - dayNumber, timeNumber, examGroupCode) + return false, fmt.Errorf("slot (%d,%d) is not allowed for exam %d", + dayNumber, timeNumber, ancode) } - return p.dbClient.AddExamGroupToSlot(ctx, dayNumber, timeNumber, examGroupCode) -} - -func (p *Plexams) RmExamGroupFromSlot(ctx context.Context, examGroupCode int) (bool, error) { - return p.dbClient.RmExamGroupFromSlot(ctx, examGroupCode) + return p.dbClient.AddExamToSlot(ctx, &model.PlanEntry{ + DayNumber: slot.DayNumber, + SlotNumber: slot.SlotNumber, + Ancode: ancode, + Locked: false, + }) } -func (p *Plexams) ExamGroupsInSlot(ctx context.Context, day int, time int) ([]*model.ExamGroup, error) { - return p.dbClient.ExamGroupsInSlot(ctx, day, time) -} - -func (p *Plexams) AllowedSlots(ctx context.Context, examGroupCode int) ([]*model.Slot, error) { - if p.dbClient.ExamGroupIsLocked(ctx, examGroupCode) { - return []*model.Slot{}, nil - } - examGroup, err := p.ExamGroup(ctx, examGroupCode) +func (p *Plexams) AllowedSlots(ctx context.Context, ancode int) ([]*model.Slot, error) { + exam, err := p.GeneratedExam(ctx, ancode) if err != nil { - log.Error().Err(err).Int("examGroupCode", examGroupCode).Msg("exam group does not exist") + log.Error().Err(err).Int("ancode", ancode).Msg("exam does not exist") } - allowedSlots := make([]*model.Slot, 0) -OUTER: - for _, slot := range examGroup.ExamGroupInfo.PossibleSlots { - // get ExamGroups for slot and check Conflicts - examGroups, err := p.ExamGroupsInSlot(ctx, slot.DayNumber, slot.SlotNumber) - if err != nil { - log.Error().Err(err).Int("day", slot.DayNumber).Int("time", slot.SlotNumber). - Msg("cannot get exam groups in slot") - return nil, err - } - for _, otherExamGroup := range examGroups { - for _, conflict := range examGroup.ExamGroupInfo.Conflicts { - if otherExamGroup.ExamGroupCode == conflict.ExamGroupCode { - continue OUTER - } - } - } + allSlots := p.semesterConfig.Slots - allowedSlots = append(allowedSlots, &model.Slot{ - DayNumber: slot.DayNumber, - SlotNumber: slot.SlotNumber, - Starttime: p.getSlotTime(slot.DayNumber, slot.SlotNumber), - }) + if exam.Constraints != nil && exam.Constraints.FixedTime != nil { + return []*model.Slot{getSlotForTime(allSlots, exam.Constraints.FixedTime)}, nil } - return allowedSlots, nil -} - -func (p *Plexams) AwkwardSlots(ctx context.Context, examGroupCode int) ([]*model.Slot, error) { - if p.dbClient.ExamGroupIsLocked(ctx, examGroupCode) { - return []*model.Slot{}, nil - } - examGroup, err := p.ExamGroup(ctx, examGroupCode) - if err != nil { - log.Error().Err(err).Int("examGroupCode", examGroupCode).Msg("exam group does not exist") + if exam.Constraints != nil && exam.Constraints.FixedDay != nil { + return getSlotsForDay(allSlots, exam.Constraints.FixedDay), nil } - awkwardSlots := make([]*model.Slot, 0) - for _, conflict := range examGroup.ExamGroupInfo.Conflicts { - planEntry, err := p.dbClient.PlanEntryForExamGroup(ctx, conflict.ExamGroupCode) - if err != nil { - log.Error().Err(err).Int("examGroupCode", conflict.ExamGroupCode).Msg("error while trying to get plan entry") - continue - } + allowedSlots := make([]*model.Slot, 0) - if planEntry != nil { - awkwardSlots = append(awkwardSlots, - &model.Slot{ - DayNumber: planEntry.DayNumber, - SlotNumber: planEntry.SlotNumber - 1, - Starttime: time.Time{}, - }, - &model.Slot{ - DayNumber: planEntry.DayNumber, - SlotNumber: planEntry.SlotNumber + 1, - Starttime: time.Time{}, - }, - ) + if exam.Constraints != nil && exam.Constraints.PossibleDays != nil { + for _, day := range exam.Constraints.PossibleDays { + allowedSlots = append(allowedSlots, getSlotsForDay(allSlots, day)...) } + } else { + allowedSlots = allSlots } - return awkwardSlots, nil -} - -func (p *Plexams) ExamGroupsWithoutSlot(ctx context.Context) ([]*model.ExamGroup, error) { - examGroupsWithoutSlots := make([]*model.ExamGroup, 0) - - examGroups, err := p.ExamGroups(ctx) - if err != nil { - log.Error().Err(err).Msg("cannot get exam groups") - } - - planEntries, err := p.dbClient.PlanEntries(ctx) - if err != nil { - log.Error().Err(err).Msg("cannot get plan entries") - } - -OUTER: - for _, examGroup := range examGroups { - for _, planEntry := range planEntries { - if examGroup.ExamGroupCode == planEntry.ExamGroupCode { - continue OUTER - } + if exam.Constraints != nil && exam.Constraints.ExcludeDays != nil { + for _, day := range exam.Constraints.ExcludeDays { + allowedSlots = removeSlotsForDay(allowedSlots, day) } - examGroupsWithoutSlots = append(examGroupsWithoutSlots, examGroup) } - return examGroupsWithoutSlots, nil -} + // TODO: recalculate from conflicts -func (p *Plexams) AllProgramsInPlan(ctx context.Context) ([]string, error) { - examGroups, err := p.ExamGroups(ctx) + allowedSlotsWithConflicts := make([]*model.Slot, 0, len(allowedSlots)) + + slotsWithConflicts, err := p.slotsWithConflicts(ctx, exam) if err != nil { - log.Error().Err(err).Msg("cannot get exam groups") + log.Error().Err(err).Int("ancode", exam.Ancode).Msg("cannot get slots with conflicts") + return nil, err } - programSet := set.NewSet[string]() - - for _, group := range examGroups { - for _, program := range group.ExamGroupInfo.Programs { - programSet.Add(program) + for _, slot := range allowedSlots { + if !slotsWithConflicts.Contains(*slot) { + allowedSlotsWithConflicts = append(allowedSlotsWithConflicts, slot) } } - allPrograms := programSet.ToSlice() - sort.Strings(allPrograms) - - return allPrograms, nil -} - -func (p *Plexams) AncodesInPlan(ctx context.Context) ([]int, error) { - return p.dbClient.AncodesInPlan(ctx) -} - -func (p *Plexams) ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error) { - return p.dbClient.ExamerInPlan(ctx) + return allowedSlotsWithConflicts, nil } -func (p *Plexams) SlotForAncode(ctx context.Context, ancode int) (*model.Slot, error) { - examGroup, err := p.GetExamGroupForAncode(ctx, ancode) +func (p *Plexams) AwkwardSlots(ctx context.Context, ancode int) ([]*model.Slot, error) { + exam, err := p.GeneratedExam(ctx, ancode) if err != nil { - log.Error().Err(err).Int("ancode", ancode).Msg("cannot get exam group for ancode") - } - - if examGroup == nil { - return nil, nil + log.Error().Err(err).Int("ancode", ancode).Msg("exam does not exist") } - return p.SlotForExamGroup(ctx, examGroup.ExamGroupCode) -} - -func (p *Plexams) SlotForExamGroup(ctx context.Context, examGroupCode int) (*model.Slot, error) { - planEntry, err := p.dbClient.PlanEntryForExamGroup(ctx, examGroupCode) - if err != nil { - log.Error().Err(err).Int("exam group code", examGroupCode).Msg("cannot get plan entry for exam group") - } - if planEntry == nil { - return nil, nil + type SlotID struct { + DayNumber, SlotNumber int } + allSlotsMap := make(map[SlotID]*model.Slot) for _, slot := range p.semesterConfig.Slots { - if planEntry.DayNumber == slot.DayNumber && planEntry.SlotNumber == slot.SlotNumber { - return slot, nil - } + allSlotsMap[SlotID{slot.DayNumber, slot.SlotNumber}] = slot } - return nil, fmt.Errorf("slot for exam group #%d not found", examGroupCode) -} - -func (p *Plexams) PlannedExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExamWithNta, error) { - examGroups, err := p.ExamGroupsInSlot(ctx, day, time) + slotsWithConflicts, err := p.slotsWithConflicts(ctx, exam) if err != nil { - log.Error().Err(err).Int("day number", day).Int("slot number", time).Msg("cannot get exam group for slot") - } - if examGroups == nil { - return nil, nil - } - - ntasWithRegsByTeacher, err := p.NtasWithRegsByTeacher(ctx) - if err != nil { - log.Error().Err(err).Msg("cannot get ntas with regs") + log.Error().Err(err).Int("ancode", exam.Ancode).Msg("cannot get slots with conflicts") return nil, err } - ancodeNTAMap := make(map[int][]*model.NTAWithRegs) - for _, ntaWithRegByTeacher := range ntasWithRegsByTeacher { - for _, ntaWithRegsByExam := range ntaWithRegByTeacher.Exams { - ancodeNTAMap[ntaWithRegsByExam.Exam.AnCode] = ntaWithRegsByExam.Ntas + awkwardSlots := make([]*model.Slot, 0) + for _, slot := range slotsWithConflicts.ToSlice() { + slotMinus1, ok := allSlotsMap[SlotID{slot.DayNumber, slot.SlotNumber - 1}] + if ok { + awkwardSlots = append(awkwardSlots, slotMinus1) + } + slotPlus1, ok := allSlotsMap[SlotID{slot.DayNumber, slot.SlotNumber + 1}] + if ok { + awkwardSlots = append(awkwardSlots, slotPlus1) } } - plannedExams := make([]*model.PlannedExamWithNta, 0) - for _, examGroup := range examGroups { - for _, exam := range examGroup.Exams { - ntas, ok := ancodeNTAMap[exam.Exam.Ancode] - if !ok { - ntas = nil - } - plannedExams = append(plannedExams, &model.PlannedExamWithNta{ - Exam: exam.Exam, - Constraints: exam.Constraints, - Nta: ntas, - }) + return awkwardSlots, nil +} + +func (p *Plexams) slotsWithConflicts(ctx context.Context, exam *model.GeneratedExam) (set.Set[model.Slot], error) { + slotSet := set.NewSet[model.Slot]() + for _, conflict := range exam.Conflicts { + slot, err := p.SlotForAncode(ctx, conflict.Ancode) + if err != nil { + log.Error().Err(err).Int("ancode", conflict.Ancode).Msg("cannot get slot for ancode") + return nil, err + } + if slot != nil { + slotSet.Add(*slot) } } - return plannedExams, nil + return slotSet, nil } -func (p *Plexams) LockExamGroup(ctx context.Context, examGroupCode int) (*model.PlanEntry, *model.ExamGroup, error) { - planEntry, err := p.dbClient.LockExamGroup(ctx, examGroupCode) - if err != nil { - return nil, nil, err - } - examGroup, err := p.dbClient.ExamGroup(ctx, examGroupCode) - if err != nil { - return planEntry, nil, err +func getSlotForTime(slots []*model.Slot, time *time.Time) *model.Slot { + for _, slot := range slots { + if time.Local().Day() == slot.Starttime.Day() && time.Local().Month() == slot.Starttime.Month() && + time.Local().Hour() == slot.Starttime.Local().Hour() && time.Local().Minute() == slot.Starttime.Local().Minute() { + return slot + } } - return planEntry, examGroup, nil + return nil } -func (p *Plexams) UnlockExamGroup(ctx context.Context, examGroupCode int) (*model.PlanEntry, *model.ExamGroup, error) { - planEntry, err := p.dbClient.UnlockExamGroup(ctx, examGroupCode) - if err != nil { - return nil, nil, err - } - examGroup, err := p.dbClient.ExamGroup(ctx, examGroupCode) - if err != nil { - return planEntry, nil, err +func getSlotsForDay(allSlots []*model.Slot, day *time.Time) []*model.Slot { + slots := make([]*model.Slot, 0) + + for _, slot := range allSlots { + if day.Local().Day() == slot.Starttime.Day() && day.Local().Month() == slot.Starttime.Month() { + slots = append(slots, slot) + } } - return planEntry, examGroup, nil + return slots } -func (p *Plexams) RemoveUnlockedExamGroupsFromPlan(ctx context.Context) (int, error) { - return p.dbClient.RemoveUnlockedExamGroupsFromPlan(ctx) -} +func removeSlotsForDay(allSlots []*model.Slot, day *time.Time) []*model.Slot { + slots := make([]*model.Slot, 0) -func (p *Plexams) LockPlan(ctx context.Context) error { - return p.dbClient.LockPlan(ctx) + for _, slot := range allSlots { + if !(day.Day() == slot.Starttime.Day() && day.Month() == slot.Starttime.Month()) { + slots = append(slots, slot) + } + } + return slots } -func (p *Plexams) PreparePlannedExams() error { - ctx := context.Background() - examGroups, err := p.ExamGroups(ctx) +func (p *Plexams) ExamsWithoutSlot(ctx context.Context) ([]*model.PlannedExam, error) { + exams, err := p.dbClient.GetGeneratedExams(ctx) if err != nil { - log.Error().Err(err).Msg("cannot get exam groups") - return err + log.Error().Err(err).Msg("cannot get generated exams") + return nil, err } - ntas, err := p.NtasWithRegsByTeacher(ctx) + planEntries, err := p.dbClient.PlannedAncodes(ctx) if err != nil { - log.Error().Err(err).Msg("cannot get ntas") - return err + log.Error().Err(err).Msg("cannot get planned ancodes") + return nil, err } - ntasMap := make(map[int][]*model.NTAWithRegs) - for _, ntaWithRegByTeacher := range ntas { - for _, ntantaWithRegByExam := range ntaWithRegByTeacher.Exams { - ntasMap[ntantaWithRegByExam.Exam.AnCode] = ntantaWithRegByExam.Ntas - } - } + examsWithotSlots := make([]*model.PlannedExam, 0) - doNotPublish := viper.GetIntSlice("donotpublish") - for _, ancodeNotToPublish := range doNotPublish { - color.Yellow.Printf("do not publish: %d\n", ancodeNotToPublish) - } - - exams := make([]*model.ExamInPlan, 0) OUTER: - for _, examGroup := range examGroups { - for _, exam := range examGroup.Exams { - // do not include exams not planned by me - if exam.Constraints != nil && exam.Constraints.NotPlannedByMe { - continue - } - // import from other departments will sometimes be only published there - for _, ancodeNotToPublish := range doNotPublish { - if exam.Exam.Ancode == ancodeNotToPublish { - continue OUTER - } - } - // - slot, err := p.SlotForAncode(ctx, exam.Exam.Ancode) - if err != nil { - log.Error().Err(err).Int("ancode", exam.Exam.Ancode).Msg("cannot get slot for ancode") + for _, exam := range exams { + for _, planEntry := range planEntries { + if exam.Ancode == planEntry.Ancode { + continue OUTER } - slot.Starttime = p.getSlotTime(slot.DayNumber, slot.SlotNumber) - - exams = append(exams, &model.ExamInPlan{ - Exam: exam.Exam, - Constraints: exam.Constraints, - Nta: ntasMap[exam.Exam.Ancode], - Slot: slot, - }) } + examsWithotSlots = append(examsWithotSlots, &model.PlannedExam{ + Ancode: exam.Ancode, + ZpaExam: exam.ZpaExam, + PrimussExams: exam.PrimussExams, + Constraints: exam.Constraints, + Conflicts: exam.Conflicts, + StudentRegsCount: exam.StudentRegsCount, + PlanEntry: nil, + }) } - examsInterface := make([]interface{}, 0, len(exams)) - for _, exam := range exams { - examsInterface = append(examsInterface, exam) + // sort by student regs + examsMap := make(map[int][]*model.PlannedExam) + for _, exam := range examsWithotSlots { + exams, ok := examsMap[exam.StudentRegsCount] + if !ok { + exams = make([]*model.PlannedExam, 0, 1) + } + examsMap[exam.StudentRegsCount] = append(exams, exam) } - err = p.dbClient.DropAndSave(context.WithValue(ctx, db.CollectionName("collectionName"), "exams_in_plan"), examsInterface) - if err != nil { - log.Error().Err(err).Msg("cannot save exams in plan") + keys := make([]int, 0, len(examsMap)) + for key := range examsMap { + keys = append(keys, key) } - color.Green.Printf("inserted %d exams\n", len(exams)) + sort.Sort(sort.Reverse(sort.IntSlice(keys))) - return nil + examsWithotSlotsSorted := make([]*model.PlannedExam, 0, len(examsWithotSlots)) + for _, key := range keys { + examsWithotSlotsSorted = append(examsWithotSlotsSorted, examsMap[key]...) + } + + return examsWithotSlotsSorted, nil } -func (p *Plexams) ExamsInPlan(ctx context.Context) ([]*model.ExamInPlan, error) { - return p.dbClient.ExamsInPlan(ctx) +func (p *Plexams) AncodesInPlan(ctx context.Context) ([]int, error) { + return p.dbClient.AncodesInPlan(ctx) +} + +// Deprecated: rm me +func (p *Plexams) ExamsInSlot(ctx context.Context, day int, time int) ([]*model.ExamInPlan, error) { + return p.dbClient.ExamsInSlot(ctx, day, time) } -func (p *Plexams) ExamsInSlotWithRooms(ctx context.Context, day int, time int) ([]*model.ExamWithRegsAndRooms, error) { - examsInSlot, err := p.ExamsInSlot(ctx, day, time) +func (p *Plexams) GetExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExam, error) { + return p.dbClient.GetExamsInSlot(ctx, day, time) +} + +func (p *Plexams) SlotForAncode(ctx context.Context, ancode int) (*model.Slot, error) { + planEntry, err := p.dbClient.PlanEntry(ctx, ancode) if err != nil { - log.Error().Err(err).Int("day", day).Int("time", time). - Msg("cannot get exams in slot") + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get plan entry for exam") return nil, err } + if planEntry == nil { + return nil, nil + } - examsInSlotWithRooms := make([]*model.ExamWithRegsAndRooms, 0, len(examsInSlot)) - for _, exam := range examsInSlot { - rooms, err := p.dbClient.RoomsForAncode(ctx, exam.Exam.Ancode) - if err != nil { - log.Error().Err(err).Int("day", day).Int("time", time).Int("ancode", exam.Exam.Ancode). - Msg("cannot get rooms for ancode") - return nil, err + for _, slot := range p.semesterConfig.Slots { + if planEntry.DayNumber == slot.DayNumber && planEntry.SlotNumber == slot.SlotNumber { + return slot, nil } - - examsInSlotWithRooms = append(examsInSlotWithRooms, &model.ExamWithRegsAndRooms{ - Exam: exam, - NormalRegs: []*model.StudentReg{}, - NtaRegs: []*model.NTAWithRegs{}, - Rooms: rooms, - }) - } - return examsInSlotWithRooms, nil + return nil, fmt.Errorf("slot for exam #%d not found", ancode) +} + +func (p *Plexams) LockPlan(ctx context.Context) error { + return p.dbClient.LockPlan(ctx) } diff --git a/plexams/plan_examgroups.go b/plexams/plan_examgroups.go new file mode 100644 index 0000000..675a0bc --- /dev/null +++ b/plexams/plan_examgroups.go @@ -0,0 +1,417 @@ +package plexams + +import ( + "context" + "fmt" + "sort" + + set "github.com/deckarep/golang-set/v2" + "github.com/gookit/color" + "github.com/obcode/plexams.go/db" + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" + "github.com/spf13/viper" +) + +// func (p *Plexams) AddExamToSlot(ctx context.Context, ancode int, dayNumber int, timeNumber int) (bool, error) { +// examGroup, err := p.GetExamGroupForAncode(ctx, ancode) +// if err != nil { +// log.Error().Err(err).Int("ancode", ancode).Msg("cannot get exam group for ancode") +// } + +// return p.AddExamGroupToSlot(ctx, dayNumber, timeNumber, examGroup.ExamGroupCode) +// } + +func (p *Plexams) GetExamGroupForAncode(ctx context.Context, ancode int) (*model.ExamGroup, error) { + return p.dbClient.GetExamGroupForAncode(ctx, ancode) +} + +// Deprecated: rm me +func (p *Plexams) AddExamGroupToSlot(ctx context.Context, dayNumber int, timeNumber int, examGroupCode int) (bool, error) { + return false, fmt.Errorf("not implemented") + // check if slot exists + // ok := false + // for _, day := range p.semesterConfig.Days { + // if day.Number == dayNumber { + // ok = true + // break + // } + // } + // if !ok { + // log.Error().Int("day", dayNumber).Msg("day does not exists") + // return false, fmt.Errorf("day %d does not exist", dayNumber) + // } + // ok = false + // for _, time := range p.semesterConfig.Starttimes { + // if time.Number == timeNumber { + // ok = true + // break + // } + // } + // if !ok { + // log.Error().Int("time", timeNumber).Msg("time does not exists") + // return false, fmt.Errorf("time %d does not exist", timeNumber) + // } + + // // check if examGroup exists + // _, err := p.ExamGroup(ctx, examGroupCode) + // if err != nil { + // log.Error().Err(err).Int("examGroupCode", examGroupCode).Msg("exam group does not exist") + // } + + // // check if slot is allowed + // allowedSlots, err := p.AllowedSlots(ctx, examGroupCode) + // if err != nil { + // log.Error().Err(err).Int("examGroupCode", examGroupCode).Msg("cannot get allowed slots") + // } + // slotIsAllowed := false + + // for _, slot := range allowedSlots { + // if slot.DayNumber == dayNumber && slot.SlotNumber == timeNumber { + // slotIsAllowed = true + // break + // } + // } + // if !slotIsAllowed { + // log.Debug().Int("day", dayNumber).Int("time", timeNumber).Int("examGroupCode", examGroupCode). + // Msg("slot is not allowed") + // return false, fmt.Errorf("slot (%d,%d) is not allowed for exam group %d", + // dayNumber, timeNumber, examGroupCode) + // } + + // return p.dbClient.AddExamToSlot(ctx, dayNumber, timeNumber, examGroupCode) +} + +func (p *Plexams) RmExamGroupFromSlot(ctx context.Context, examGroupCode int) (bool, error) { + return p.dbClient.RmExamGroupFromSlot(ctx, examGroupCode) +} + +// func (p *Plexams) AllowedSlots(ctx context.Context, examGroupCode int) ([]*model.Slot, error) { +// if p.dbClient.ExamGroupIsLocked(ctx, examGroupCode) { +// return []*model.Slot{}, nil +// } +// examGroup, err := p.ExamGroup(ctx, examGroupCode) +// if err != nil { +// log.Error().Err(err).Int("examGroupCode", examGroupCode).Msg("exam group does not exist") +// } + +// allowedSlots := make([]*model.Slot, 0) +// OUTER: +// for _, slot := range examGroup.ExamGroupInfo.PossibleSlots { +// // get ExamGroups for slot and check Conflicts +// examGroups, err := p.ExamGroupsInSlot(ctx, slot.DayNumber, slot.SlotNumber) +// if err != nil { +// log.Error().Err(err).Int("day", slot.DayNumber).Int("time", slot.SlotNumber). +// Msg("cannot get exam groups in slot") +// return nil, err +// } +// for _, otherExamGroup := range examGroups { +// for _, conflict := range examGroup.ExamGroupInfo.Conflicts { +// if otherExamGroup.ExamGroupCode == conflict.ExamGroupCode { +// continue OUTER +// } +// } +// } + +// allowedSlots = append(allowedSlots, &model.Slot{ +// DayNumber: slot.DayNumber, +// SlotNumber: slot.SlotNumber, +// Starttime: p.getSlotTime(slot.DayNumber, slot.SlotNumber), +// }) +// } + +// return allowedSlots, nil +// } + +// func (p *Plexams) AwkwardSlots(ctx context.Context, examGroupCode int) ([]*model.Slot, error) { +// if p.dbClient.ExamGroupIsLocked(ctx, examGroupCode) { +// return []*model.Slot{}, nil +// } +// examGroup, err := p.ExamGroup(ctx, examGroupCode) +// if err != nil { +// log.Error().Err(err).Int("examGroupCode", examGroupCode).Msg("exam group does not exist") +// } + +// awkwardSlots := make([]*model.Slot, 0) +// for _, conflict := range examGroup.ExamGroupInfo.Conflicts { +// planEntry, err := p.dbClient.PlanEntryForExamGroup(ctx, conflict.ExamGroupCode) +// if err != nil { +// log.Error().Err(err).Int("examGroupCode", conflict.ExamGroupCode).Msg("error while trying to get plan entry") +// continue +// } + +// if planEntry != nil { +// awkwardSlots = append(awkwardSlots, +// &model.Slot{ +// DayNumber: planEntry.DayNumber, +// SlotNumber: planEntry.SlotNumber - 1, +// Starttime: time.Time{}, +// }, +// &model.Slot{ +// DayNumber: planEntry.DayNumber, +// SlotNumber: planEntry.SlotNumber + 1, +// Starttime: time.Time{}, +// }, +// ) +// } +// } + +// return awkwardSlots, nil +// } + +// Deprecated: rm me +func (p *Plexams) ExamGroupsWithoutSlot(ctx context.Context) ([]*model.ExamGroup, error) { + examGroupsWithoutSlots := make([]*model.ExamGroup, 0) + + examGroups, err := p.ExamGroups(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get exam groups") + } + + planEntries, err := p.dbClient.PlanEntries(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get plan entries") + } + +OUTER: + for _, examGroup := range examGroups { + for _, planEntry := range planEntries { + if examGroup.ExamGroupCode == planEntry.Ancode { + continue OUTER + } + } + examGroupsWithoutSlots = append(examGroupsWithoutSlots, examGroup) + } + + return examGroupsWithoutSlots, nil +} + +func (p *Plexams) AllProgramsInPlan(ctx context.Context) ([]string, error) { + exams, err := p.GeneratedExams(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get exams") + } + + programSet := set.NewSet[string]() + + for _, exam := range exams { + for _, primussExam := range exam.PrimussExams { + programSet.Add(primussExam.Exam.Program) + } + } + + allPrograms := programSet.ToSlice() + sort.Strings(allPrograms) + + return allPrograms, nil +} + +func (p *Plexams) ExamerInPlan(ctx context.Context) ([]*model.ExamerInPlan, error) { + return p.dbClient.ExamerInPlan(ctx) +} + +// // Deprecated: rm me +// func (p *Plexams) SlotForAncode(ctx context.Context, ancode int) (*model.Slot, error) { +// examGroup, err := p.GetExamGroupForAncode(ctx, ancode) +// if err != nil { +// log.Error().Err(err).Int("ancode", ancode).Msg("cannot get exam group for ancode") +// } + +// if examGroup == nil { +// return nil, nil +// } + +// return p.SlotForExamGroup(ctx, examGroup.ExamGroupCode) +// } + +// Deprecated: rm me +func (p *Plexams) SlotForExamGroup(ctx context.Context, examGroupCode int) (*model.Slot, error) { + planEntry, err := p.dbClient.PlanEntryForExamGroup(ctx, examGroupCode) + if err != nil { + log.Error().Err(err).Int("exam group code", examGroupCode).Msg("cannot get plan entry for exam group") + } + if planEntry == nil { + return nil, nil + } + + for _, slot := range p.semesterConfig.Slots { + if planEntry.DayNumber == slot.DayNumber && planEntry.SlotNumber == slot.SlotNumber { + return slot, nil + } + } + + return nil, fmt.Errorf("slot for exam group #%d not found", examGroupCode) +} + +// func (p *Plexams) PlannedExamsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedExamWithNta, error) { +// examGroups, err := p.ExamGroupsInSlot(ctx, day, time) +// if err != nil { +// log.Error().Err(err).Int("day number", day).Int("slot number", time).Msg("cannot get exam group for slot") +// } +// if examGroups == nil { +// return nil, nil +// } + +// ntasWithRegsByTeacher, err := p.NtasWithRegsByTeacher(ctx) +// if err != nil { +// log.Error().Err(err).Msg("cannot get ntas with regs") +// return nil, err +// } + +// ancodeNTAMap := make(map[int][]*model.NTAWithRegs) +// for _, ntaWithRegByTeacher := range ntasWithRegsByTeacher { +// for _, ntaWithRegsByExam := range ntaWithRegByTeacher.Exams { +// ancodeNTAMap[ntaWithRegsByExam.Exam.AnCode] = ntaWithRegsByExam.Ntas +// } +// } + +// plannedExams := make([]*model.PlannedExamWithNta, 0) +// for _, examGroup := range examGroups { +// for _, exam := range examGroup.Exams { +// ntas, ok := ancodeNTAMap[exam.Exam.Ancode] +// if !ok { +// ntas = nil +// } +// plannedExams = append(plannedExams, &model.PlannedExamWithNta{ +// Exam: exam.Exam, +// Constraints: exam.Constraints, +// Nta: ntas, +// }) +// } +// } +// return plannedExams, nil +// } + +func (p *Plexams) LockExam(ctx context.Context, ancode int) (*model.PlanEntry, *model.GeneratedExam, error) { + planEntry, err := p.dbClient.LockExam(ctx, ancode) + if err != nil { + return nil, nil, err + } + exam, err := p.dbClient.GetGeneratedExam(ctx, ancode) + if err != nil { + return planEntry, nil, err + } + return planEntry, exam, nil +} + +func (p *Plexams) UnlockExam(ctx context.Context, ancode int) (*model.PlanEntry, *model.GeneratedExam, error) { + planEntry, err := p.dbClient.UnlockExam(ctx, ancode) + if err != nil { + return nil, nil, err + } + exam, err := p.dbClient.GetGeneratedExam(ctx, ancode) + if err != nil { + return planEntry, nil, err + } + return planEntry, exam, nil +} + +func (p *Plexams) RemoveUnlockedExamGroupsFromPlan(ctx context.Context) (int, error) { + return p.dbClient.RemoveUnlockedExamGroupsFromPlan(ctx) +} + +func (p *Plexams) PreparePlannedExams() error { + ctx := context.Background() + examGroups, err := p.ExamGroups(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get exam groups") + return err + } + + ntas, err := p.NtasWithRegsByTeacher(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get ntas") + return err + } + + ntasMap := make(map[int][]*model.NTAWithRegs) + for _, ntaWithRegByTeacher := range ntas { + for _, ntantaWithRegByExam := range ntaWithRegByTeacher.Exams { + ntasMap[ntantaWithRegByExam.Exam.AnCode] = ntantaWithRegByExam.Ntas + } + } + + doNotPublish := viper.GetIntSlice("donotpublish") + for _, ancodeNotToPublish := range doNotPublish { + color.Yellow.Printf("do not publish: %d\n", ancodeNotToPublish) + } + + exams := make([]*model.ExamInPlan, 0) +OUTER: + for _, examGroup := range examGroups { + for _, exam := range examGroup.Exams { + // do not include exams not planned by me + if exam.Constraints != nil && exam.Constraints.NotPlannedByMe { + continue + } + // import from other departments will sometimes be only published there + for _, ancodeNotToPublish := range doNotPublish { + if exam.Exam.Ancode == ancodeNotToPublish { + continue OUTER + } + } + // + slot, err := p.SlotForAncode(ctx, exam.Exam.Ancode) + if err != nil { + log.Error().Err(err).Int("ancode", exam.Exam.Ancode).Msg("cannot get slot for ancode") + } + slot.Starttime = p.getSlotTime(slot.DayNumber, slot.SlotNumber) + + exams = append(exams, &model.ExamInPlan{ + Exam: exam.Exam, + Constraints: exam.Constraints, + Nta: ntasMap[exam.Exam.Ancode], + Slot: slot, + }) + } + } + + examsInterface := make([]interface{}, 0, len(exams)) + for _, exam := range exams { + examsInterface = append(examsInterface, exam) + } + + err = p.dbClient.DropAndSave(context.WithValue(ctx, db.CollectionName("collectionName"), "exams_in_plan"), examsInterface) + if err != nil { + log.Error().Err(err).Msg("cannot save exams in plan") + } + + color.Green.Printf("inserted %d exams\n", len(exams)) + + return nil +} + +func (p *Plexams) ExamsInPlan(ctx context.Context) ([]*model.ExamInPlan, error) { + return p.dbClient.ExamsInPlan(ctx) +} + +// TODO: rewrite me or delete me +func (p *Plexams) ExamsInSlotWithRooms(ctx context.Context, day int, time int) ([]*model.ExamWithRegsAndRooms, error) { + // examsInSlot, err := p.ExamsInSlot(ctx, day, time) + // if err != nil { + // log.Error().Err(err).Int("day", day).Int("time", time). + // Msg("cannot get exams in slot") + // return nil, err + // } + + // examsInSlotWithRooms := make([]*model.ExamWithRegsAndRooms, 0, len(examsInSlot)) + // for _, exam := range examsInSlot { + // rooms, err := p.dbClient.RoomsForAncode(ctx, exam.Exam.Ancode) + // if err != nil { + // log.Error().Err(err).Int("day", day).Int("time", time).Int("ancode", exam.Exam.Ancode). + // Msg("cannot get rooms for ancode") + // return nil, err + // } + + // examsInSlotWithRooms = append(examsInSlotWithRooms, &model.ExamWithRegsAndRooms{ + // Exam: exam, + // NormalRegs: []*model.StudentReg{}, + // NtaRegs: []*model.NTAWithRegs{}, + // Rooms: rooms, + // }) + + // } + + // return examsInSlotWithRooms, nil + return nil, nil +} diff --git a/plexams/plannedExams.go b/plexams/plannedExams.go index e9a335e..39e1a7c 100644 --- a/plexams/plannedExams.go +++ b/plexams/plannedExams.go @@ -2,73 +2,132 @@ package plexams import ( "context" - "time" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" ) -func (p *Plexams) PlannedExamsForProgram(ctx context.Context, program string) ([]*model.PlannedExam, error) { - connectedExams, err := p.GetConnectedExams(ctx) +func (p *Plexams) PlanEntries(ctx context.Context) ([]*model.PlanEntry, error) { + return p.dbClient.PlanEntries(ctx) +} + +func (p *Plexams) PlannedExam(ctx context.Context, ancode int) (*model.PlannedExam, error) { + exam, err := p.GeneratedExam(ctx, ancode) if err != nil { - log.Error().Err(err).Msg("cannot get connected exams") + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get generated exam") return nil, err } - plannedExams := make([]*model.PlannedExam, 0) + planEntry, err := p.dbClient.PlanEntry(ctx, ancode) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get planEntry for ancode") + return nil, err + } - for _, connectedExam := range connectedExams { - constraints, _ := p.ConstraintForAncode(ctx, connectedExam.ZpaExam.AnCode) - if constraints != nil && constraints.NotPlannedByMe { - // if notPlannedByMe, _ := p.NotPlannedByMe(ctx, connectedExam.ZpaExam.AnCode); notPlannedByMe { - log.Debug().Int("ancode", connectedExam.ZpaExam.AnCode). - Str("module", connectedExam.ZpaExam.Module). - Str("main examer", connectedExam.ZpaExam.MainExamer). - Msg("exam not planned by me") - continue - } + plannedRooms, err := p.dbClient.PlannedRoomsForAncode(ctx, ancode) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get planned rooms for ancode") + return nil, err + } - var plannedExam *model.PlannedExam - for _, primussExam := range connectedExam.PrimussExams { - if primussExam.Program == program { - plannedExam = &model.PlannedExam{ - Ancode: connectedExam.ZpaExam.AnCode, - Module: connectedExam.ZpaExam.Module, - MainExamer: connectedExam.ZpaExam.MainExamer, - DateTime: nil, - } - } - } + return &model.PlannedExam{ + Ancode: exam.Ancode, + ZpaExam: exam.ZpaExam, + PrimussExams: exam.PrimussExams, + Constraints: exam.Constraints, + Conflicts: exam.Conflicts, + StudentRegsCount: exam.StudentRegsCount, + Ntas: exam.Ntas, + MaxDuration: exam.MaxDuration, + PlanEntry: planEntry, + PlannedRooms: plannedRooms, + }, err +} - if plannedExam == nil { - continue - } +func (p *Plexams) PlannedExams(ctx context.Context) ([]*model.PlannedExam, error) { + exams, err := p.GeneratedExams(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get generated exams") + return nil, err + } - log.Debug().Int("ancode", plannedExam.Ancode).Msg("found connected exam") + planEntries, err := p.dbClient.PlanEntries(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get planEntries") + return nil, err + } - slot, err := p.SlotForAncode(ctx, plannedExam.Ancode) + planEntryMap := make(map[int]*model.PlanEntry) + for _, planEntry := range planEntries { + planEntryMap[planEntry.Ancode] = planEntry + } + + plannedExams := make([]*model.PlannedExam, 0, len(exams)) + + for _, exam := range exams { + plannedRooms, err := p.dbClient.PlannedRoomsForAncode(ctx, exam.Ancode) if err != nil { - log.Error().Err(err).Int("ancode", plannedExam.Ancode).Msg("cannot get slot for ancode") - return nil, err - } - if slot != nil { - plannedExam.DateTime = p.getTimeForSlot(slot.DayNumber, slot.SlotNumber) + log.Error().Err(err).Int("ancode", exam.Ancode).Msg("cannot find planned rooms") } - plannedExams = append(plannedExams, plannedExam) + + plannedExams = append(plannedExams, + &model.PlannedExam{ + Ancode: exam.Ancode, + ZpaExam: exam.ZpaExam, + PrimussExams: exam.PrimussExams, + Constraints: exam.Constraints, + Conflicts: exam.Conflicts, + StudentRegsCount: exam.StudentRegsCount, + Ntas: exam.Ntas, + MaxDuration: exam.MaxDuration, + PlanEntry: planEntryMap[exam.Ancode], + PlannedRooms: plannedRooms, + }) } return plannedExams, nil } -func (p *Plexams) getTimeForSlot(dayNumber, slotNumber int) *time.Time { - for _, slot := range p.semesterConfig.Slots { - if slot.DayNumber == dayNumber && slot.SlotNumber == slotNumber { - return &slot.Starttime +func (p *Plexams) PlannedExamsByExamer(ctx context.Context, examerID int) ([]*model.PlannedExam, error) { + plannedExams, err := p.PlannedExams(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get planned exams") + return nil, err + } + + plannedExamsForExamer := make([]*model.PlannedExam, 0) + for _, plannedExam := range plannedExams { + if plannedExam.Constraints != nil && plannedExam.Constraints.NotPlannedByMe { + continue + } + if plannedExam.ZpaExam.MainExamerID == examerID { + plannedExamsForExamer = append(plannedExamsForExamer, plannedExam) + break } } - return nil + + return plannedExamsForExamer, nil } -func (p *Plexams) ExamsInSlot(ctx context.Context, day int, time int) ([]*model.ExamInPlan, error) { - return p.dbClient.ExamsInSlot(ctx, day, time) +func (p *Plexams) PlannedExamsForProgram(ctx context.Context, program string, onlyPlannedByMe bool) ([]*model.PlannedExam, error) { + plannedExams, err := p.PlannedExams(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get planned exams") + return nil, err + } + + plannedExamsForProgram := make([]*model.PlannedExam, 0) + for _, plannedExam := range plannedExams { + if onlyPlannedByMe && plannedExam.Constraints != nil && plannedExam.Constraints.NotPlannedByMe { + continue + } + for _, primussExam := range plannedExam.PrimussExams { + if primussExam.Exam.Program == program { + plannedExamsForProgram = append(plannedExamsForProgram, plannedExam) + break + } + } + } + + return plannedExamsForProgram, nil } diff --git a/plexams/plexams.go b/plexams/plexams.go index 60f818a..301bc14 100644 --- a/plexams/plexams.go +++ b/plexams/plexams.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/gookit/color" + "github.com/logrusorgru/aurora" "github.com/obcode/plexams.go/db" "github.com/obcode/plexams.go/graph/model" "github.com/obcode/plexams.go/zpa" @@ -53,10 +53,18 @@ func NewPlexams(semester, dbUri, zpaBaseurl, zpaUsername, zpaPassword string, fk if dbUri == "" { log.Info().Msg("starting without DB!") } else { - client, err = db.NewDB(dbUri, semester) + dbName := viper.GetString("db.database") + var databaseName *string + if dbName == "" { + databaseName = nil + } else { + databaseName = &dbName + } + + client, err = db.NewDB(dbUri, semester, databaseName) if err != nil { - panic(fmt.Errorf("fatal cannot create mongo client: %w", err)) + log.Fatal().Err(err).Msg("cannot connect to plexams.db") } } @@ -214,22 +222,31 @@ func (p *Plexams) GetSemesterConfig() *model.SemesterConfig { return p.semesterConfig } +func (p *Plexams) GetStarttime(dayNumber, slotNumber int) (*time.Time, error) { + for _, slot := range p.semesterConfig.Slots { + if slot.DayNumber == dayNumber && slot.SlotNumber == slotNumber { + time := slot.Starttime.Local() + return &time, nil + } + } + return nil, fmt.Errorf("no starttime for slot (%d/%d)", dayNumber, slotNumber) +} + func (p *Plexams) getSlotTime(dayNumber, slotNumber int) time.Time { for _, slot := range p.semesterConfig.Slots { if slot.DayNumber == dayNumber && slot.SlotNumber == slotNumber { - return slot.Starttime + return slot.Starttime.Local() } } return time.Date(0, 0, 0, 0, 0, 0, 0, nil) } -func (p *Plexams) PrintSemester() { - color.Style{color.FgCyan, color.BgYellow, color.OpBold}.Printf(" --- Planning Semester: %s --- ", p.semester) - color.Println() +func (p *Plexams) PrintInfo() { + fmt.Println(aurora.Sprintf(aurora.Magenta(" --- Planning Semester: %s --- \n"), p.semester)) } func (p *Plexams) setRoomInfo() { - rooms, err := p.dbClient.GlobalRooms(context.Background()) + rooms, err := p.dbClient.Rooms(context.Background()) if err != nil { log.Error().Err(err).Msg("cannot get global rooms") } diff --git a/plexams/prepare.go b/plexams/prepare.go index 10bed3f..b19f2de 100644 --- a/plexams/prepare.go +++ b/plexams/prepare.go @@ -2,140 +2,137 @@ package plexams import ( "context" + "fmt" "sort" + set "github.com/deckarep/golang-set/v2" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" ) func (p *Plexams) PrepareStudentRegs() error { ctx := context.Background() - studentRegsPerAncode, studentRegsPerStudent, err := p.prepareAllStudentRegs() - log.Debug().Int("length studentRegsPerAncode", len(studentRegsPerAncode)). - Int("length studentRegsPerStudent", len(studentRegsPerStudent)).Msg("got the following") + + programs, err := p.dbClient.GetPrograms(ctx) if err != nil { + log.Error().Err(err).Msg("cannot get programs") return err } - ancodes, err := p.dbClient.GetZpaAncodesPlanned(ctx) + connectedExams, err := p.dbClient.GetConnectedExams(ctx) if err != nil { + log.Error().Err(err).Msg("cannot get connected exams") return err } - studentRegsPerAncodePlanned := make(map[int]map[string][]*model.StudentReg) - for _, ancode := range ancodes { - studentRegsPerAncodePlanned[ancode.Ancode] = studentRegsPerAncode[ancode.Ancode] + type programmAndAncode struct { + Program string `json:"program,omitempty"` + Ancode int `json:"ancode,omitempty"` } - studentRegsPerStudentPlanned := make(map[string][]*model.StudentReg, 0) - for mtknr, studentRegs := range studentRegsPerStudent { - studentRegsPlanned := make([]*model.StudentReg, 0) - for _, studentReg := range studentRegs { - for _, ancode := range ancodes { - if ancode.Ancode == studentReg.AnCode { - studentRegsPlanned = append(studentRegsPlanned, studentReg) - break - } + plannedZpaAncodes := make(map[string]set.Set[int]) // program -> set of ancodes + primussAncodesToZpaAncodes := make(map[programmAndAncode]int) + + for _, connectedExam := range connectedExams { + ancode := connectedExam.ZpaExam.AnCode + + for _, primussExam := range connectedExam.PrimussExams { + plannedZpaAncodesForProgram, ok := plannedZpaAncodes[primussExam.Program] + if !ok { + plannedZpaAncodesForProgram = set.NewSet[int]() + } + plannedZpaAncodesForProgram.Add(ancode) + plannedZpaAncodes[primussExam.Program] = plannedZpaAncodesForProgram + + if primussExam.AnCode != ancode { + primussAncodesToZpaAncodes[programmAndAncode{primussExam.Program, primussExam.AnCode}] = ancode } } - studentRegsPerStudentPlanned[mtknr] = studentRegsPlanned } - err = p.dbClient.SaveStudentRegsPerAncode(ctx, studentRegsPerAncode, true) - if err != nil { - return err + // TODO: rm me + for program, ancodes := range plannedZpaAncodes { + fmt.Printf(">>> %s <<<\n", program) + fmt.Printf(" %v\n\n", ancodes) } - err = p.dbClient.SaveStudentRegsPerAncode(ctx, studentRegsPerAncodePlanned, false) - if err != nil { - return err + for k, v := range primussAncodesToZpaAncodes { + log.Debug().Interface("primussAncode", k).Int("zpa ancode", v).Msg("primuss ancodes with different zpa ancodes") } - err = p.dbClient.SaveStudentRegsPerStudent(ctx, studentRegsPerStudent, true) - if err != nil { - return err - } + // mtknr -> studentreg + studentRegsPerStudent := make(map[string][]*model.StudentReg) - err = p.dbClient.SaveStudentRegsPerStudent(ctx, studentRegsPerStudentPlanned, false) - if err != nil { - return err - } + for _, program := range programs { + studentRegs, err := p.dbClient.StudentRegsForProgram(ctx, program) + if err != nil { + log.Error().Err(err).Str("program", program).Msg("cannot get studentregs for program") + return err + } - return nil -} + for _, studentReg := range studentRegs { + zpaAncode, ok := primussAncodesToZpaAncodes[programmAndAncode{program, studentReg.AnCode}] + if ok { + log.Debug().Str("program", program).Int("primussAncode", studentReg.AnCode).Int("zpaAncode", zpaAncode). + Str("name", studentReg.Name).Msg("fixing ancode") + studentReg.AnCode = zpaAncode + } -func (p *Plexams) prepareAllStudentRegs() ( - studentRegsPerAncode map[int]map[string][]*model.StudentReg, - studentRegsPerStudent map[string][]*model.StudentReg, - err error, -) { - ctx := context.Background() - studentRegsPerAncode = make(map[int]map[string][]*model.StudentReg) - studentRegsPerStudent = make(map[string][]*model.StudentReg) + if !plannedZpaAncodes[program].Contains(studentReg.AnCode) { + continue + } - programs, err := p.dbClient.GetPrograms(ctx) - if err != nil { - log.Error().Err(err).Msg("cannot get programs") - return + otherRegs, ok := studentRegsPerStudent[studentReg.Mtknr] + if ok { + studentRegsPerStudent[studentReg.Mtknr] = append(otherRegs, studentReg) + } else { + studentRegsPerStudent[studentReg.Mtknr] = []*model.StudentReg{studentReg} + } + } } - ancodesPlannedPerProgram, err := p.dbClient.GetAncodesPlannedPerProgram(ctx) + ntas, err := p.Ntas(ctx) if err != nil { - log.Error().Err(err).Msg("cannot get ancodes planned per program") + log.Error().Err(err).Msg("cannot get ntas") + return err } - for _, program := range programs { - var studentRegsPerAncodeForProgram map[int][]*model.StudentReg - studentRegsPerAncodeForProgram, err = p.dbClient.GetPrimussStudentRegsPerAncode(ctx, program) - if err != nil { - log.Error().Err(err).Str("program", program).Msg("cannot get studentregs for program") - return - } + ntaMap := make(map[string]*model.NTA) + for _, nta := range ntas { + ntaMap[nta.Mtknr] = nta + } - for ancode, studentRegs := range studentRegsPerAncodeForProgram { - programsForAncode := ancodesPlannedPerProgram[ancode] - programPlanned := false + studentRegsSlice := make([]interface{}, 0) - for _, programForAncode := range programsForAncode { - if programForAncode == program { - programPlanned = true - break - } + for mtknr, regs := range studentRegsPerStudent { + if len(regs) > 0 { + ancodes := make([]int, 0, len(regs)) + for _, reg := range regs { + ancodes = append(ancodes, reg.AnCode) } - if !programPlanned { - continue - } - // per ancodes - regs, ok := studentRegsPerAncode[ancode] - if !ok { - regs = make(map[string][]*model.StudentReg) - } + sort.Ints(ancodes) - sort.Slice(studentRegs, func(i, j int) bool { - return studentRegs[i].Name < studentRegs[j].Name + studentRegsSlice = append(studentRegsSlice, &model.Student{ + Mtknr: mtknr, + Program: regs[0].Program, + Group: regs[0].Group, + Name: regs[0].Name, + Regs: ancodes, + Nta: ntaMap[mtknr], }) - regs[program] = studentRegs - studentRegsPerAncode[ancode] = regs - - // per student - for _, studentReg := range studentRegs { - regs, ok := studentRegsPerStudent[studentReg.Mtknr] - if !ok { - regs = make([]*model.StudentReg, 0) - } - regs = append(regs, studentReg) - sort.Slice(regs, func(i, j int) bool { - return regs[i].AnCode < regs[j].AnCode - }) - studentRegsPerStudent[studentReg.Mtknr] = regs - } } } - return + err = p.dbClient.SetSemesterOnNTAs(ctx, studentRegsSlice) + if err != nil { + log.Error().Err(err).Msg("cannot set last semester on ntas") + } + + return p.dbClient.SaveStudentRegs(ctx, studentRegsSlice) } +// Deprecated: part of generated exams func (p *Plexams) PrepareExamsWithRegs() error { ctx := context.Background() zpaExamsToPlan, err := p.GetZpaExamsToPlan(ctx) @@ -149,8 +146,8 @@ func (p *Plexams) PrepareExamsWithRegs() error { } connectedExams := make(map[int]*model.ConnectedExam) - for _, connecconnectedExam := range connectedExamsSlice { - connectedExams[connecconnectedExam.ZpaExam.AnCode] = connecconnectedExam + for _, connectedExam := range connectedExamsSlice { + connectedExams[connectedExam.ZpaExam.AnCode] = connectedExam } studentRegsSlice, err := p.GetStudentRegsPerAncodePlanned(ctx) diff --git a/plexams/prepare_groups.go b/plexams/prepare_groups.go index 71caaf0..840a8a5 100644 --- a/plexams/prepare_groups.go +++ b/plexams/prepare_groups.go @@ -47,6 +47,7 @@ func (p *Plexams) initPrepareExamGroups(ctx context.Context) (ancodesToPlan []in return } +// Deprecated: no more exam groups func (p *Plexams) PrepareExamGroups() error { ctx := context.Background() ancodes, examsWithRegs, constraints, err := p.initPrepareExamGroups(ctx) diff --git a/plexams/primuss.go b/plexams/primuss.go index 69b4da8..7b54579 100644 --- a/plexams/primuss.go +++ b/plexams/primuss.go @@ -30,7 +30,7 @@ func (p *Plexams) StudentRegsForProgram(ctx context.Context, program string) ([] return p.dbClient.StudentRegsForProgram(ctx, program) } -func (p *Plexams) StudentRegsPerStudentPlanned(ctx context.Context) ([]*model.StudentRegsPerStudent, error) { +func (p *Plexams) StudentRegsPerStudentPlanned(ctx context.Context) ([]*model.Student, error) { return p.dbClient.StudentRegsPerStudentPlanned(ctx) } @@ -41,3 +41,7 @@ func (p *Plexams) StudentRegsImportErrors(ctx context.Context) ([]*model.RegWith func (p *Plexams) GetConflicts(ctx context.Context, exam *model.PrimussExam) (*model.Conflicts, error) { return p.dbClient.GetPrimussConflictsForAncode(ctx, exam.Program, exam.AnCode) } + +func (p *Plexams) AddAncode(ctx context.Context, zpaAncode int, program string, primussAncode int) error { + return p.dbClient.AddAncode(ctx, zpaAncode, program, primussAncode) +} diff --git a/plexams/rooms.go b/plexams/rooms.go index 63bda1e..3c296e0 100644 --- a/plexams/rooms.go +++ b/plexams/rooms.go @@ -3,33 +3,146 @@ package plexams import ( "context" "fmt" - "math" "sort" + "time" set "github.com/deckarep/golang-set/v2" - "github.com/obcode/plexams.go/db" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" "github.com/spf13/viper" ) +type SlotNumber struct { + day, slot int +} + +/* +roomConstraints: + booked: + - date: 2024-01-22 + from: "14:00" + until: "17:00" + rooms: + - T3.015 + - T3.016 + - T3.017 + - T3.023 +*/ + +type BookedEntry struct { + From time.Time + Until time.Time + Rooms []string +} + +func (p *Plexams) ExahmRoomsFromBooked() ([]BookedEntry, error) { + bookedInfo := viper.Get("roomconstraints.booked") + + bookedInfoSlice, ok := bookedInfo.([]interface{}) + if !ok { + log.Error().Interface("booked info", bookedInfo).Msg("cannot convert booked info to slice") + return nil, fmt.Errorf("cannot convert booked info to slice") + } + + entries := make([]BookedEntry, 0, len(bookedInfoSlice)) + for _, bookedEntry := range bookedInfoSlice { + fromUntil, err := fromUntil(bookedEntry) + if err != nil { + log.Error().Err(err).Interface("entry", bookedEntry).Msg("cannot convert entry to time") + return nil, err + } + + entry, ok := bookedEntry.(map[string]interface{}) + if !ok { + log.Error().Interface("booked entry", bookedEntry).Msg("cannot convert booked entry to map") + return nil, fmt.Errorf("cannot convert booked entry to map") + } + + rawRooms, ok := entry["rooms"].([]interface{}) + if !ok { + log.Error().Interface("rooms entry", entry["rooms"]).Msg("cannot convert rooms entry to []string") + return nil, fmt.Errorf("cannot convert rooms entry to []string") + } + + rooms := make([]string, 0, len(rawRooms)) + for _, rawRoom := range rawRooms { + room, ok := rawRoom.(string) + if !ok { + log.Error().Interface("room entry", rawRoom).Msg("cannot convert room entry to string") + return nil, fmt.Errorf("cannot convert room entry to string") + } + rooms = append(rooms, room) + } + + entries = append(entries, BookedEntry{ + From: fromUntil.From, + Until: fromUntil.Until, + Rooms: rooms, + }) + + } + + return entries, nil +} + +func (p *Plexams) SlotsWithRoomsFromBookedEntries(bookedEntries []BookedEntry) (map[SlotNumber][]*model.Room, error) { + globalRooms, err := p.dbClient.Rooms(context.Background()) + if err != nil { + log.Error().Err(err).Msg("cannot get global rooms") + return nil, err + } + + globalRoomsMap := make(map[string]*model.Room) + for _, room := range globalRooms { + globalRoomsMap[room.Name] = room + } + + slotsWithRooms := make(map[SlotNumber][]*model.Room) + + for _, slot := range p.semesterConfig.Slots { + for _, entry := range bookedEntries { + if entry.From.Before(slot.Starttime.Local()) && entry.Until.After(slot.Starttime.Local().Add(89*time.Minute)) { + rooms := make([]*model.Room, 0, len(entry.Rooms)) + for _, roomName := range entry.Rooms { + room, ok := globalRoomsMap[roomName] + if !ok { + log.Error().Str("room name", roomName).Msg("room not found") + return nil, fmt.Errorf("room %s not found", roomName) + } + rooms = append(rooms, room) + } + slotsWithRooms[SlotNumber{slot.DayNumber, slot.SlotNumber}] = rooms + } + } + } + + return slotsWithRooms, nil +} + func (p *Plexams) PrepareRoomsForSemester() error { - globalRooms, err := p.dbClient.GlobalRooms(context.Background()) + globalRooms, err := p.dbClient.Rooms(context.Background()) if err != nil { log.Error().Err(err).Msg("cannot get global rooms") return err } - roomsForSlots := make(map[int][]*model.Room) + roomsForSlots := make(map[SlotNumber][]*model.Room) for _, room := range globalRooms { - if room.Name == "No Room" { + if room.Name == "No Room" || room.Exahm { continue } roomConstraints := viper.Get(fmt.Sprintf("roomConstraints.%s", room.Name)) if roomConstraints == nil { + + if room.NeedsRequest { + fmt.Printf("%s: no constraints found, but room needs request, ignoring room\n", room.Name) + continue + } + fmt.Printf("%s: no constraints found\n", room.Name) + for _, slot := range p.semesterConfig.Slots { - slotNumber := slot.DayNumber*10 + slot.SlotNumber + slotNumber := SlotNumber{slot.DayNumber, slot.SlotNumber} slotEntry, ok := roomsForSlots[slotNumber] if !ok { slotEntry = []*model.Room{room} @@ -39,13 +152,29 @@ func (p *Plexams) PrepareRoomsForSemester() error { roomsForSlots[slotNumber] = slotEntry } } else { - allowedSlots := viper.Get(fmt.Sprintf("roomConstraints.%s.allowedSlots", room.Name)) - if allowedSlots != nil { - fmt.Printf("%s: allowed slots found\n", room.Name) - allowedSlotsSlice := allowedSlots.([]interface{}) - for _, allowedSlot := range allowedSlotsSlice { - allowedSlotSlice := allowedSlot.([]interface{}) - slotNumber := allowedSlotSlice[0].(int)*10 + allowedSlotSlice[1].(int) + // R1.046: + // reservations: + // - date: 2024-01-24 + // from: 10:15 + // until: 12:15 + // - date: 2024-01-24 + // from: 14:15 + // until: 16:15 + reservations := viper.Get(fmt.Sprintf("roomConstraints.%s.reservations", room.Name)) + if reservations != nil { + fmt.Printf("%s: reservations found\n", room.Name) + reservationsSlice, ok := reservations.([]interface{}) + if !ok { + log.Error().Interface("reservations", reservations).Msg("cannot convert reservations to slice") + return fmt.Errorf("cannot convert reservations to slice") + } + reservedSlots, err := p.reservations2Slots(reservationsSlice) + if err != nil { + log.Error().Err(err).Msg("cannot convert reservations to slots") + return err + } + for _, slot := range reservedSlots.ToSlice() { + slotNumber := SlotNumber{slot.day, slot.slot} slotEntry, ok := roomsForSlots[slotNumber] if !ok { slotEntry = []*model.Room{room} @@ -54,18 +183,28 @@ func (p *Plexams) PrepareRoomsForSemester() error { } roomsForSlots[slotNumber] = slotEntry } - // } else { - // TODO: forbiddenSlots := viper.Get(fmt.Sprintf("roomConstraints.%s.forbiddenSlots", room.Name)) } } } + bookedEntries, err := p.ExahmRoomsFromBooked() + if err != nil { + log.Error().Err(err).Msg("cannot get exahm rooms from booked") + return err + } + bookedRoomsMap, err := p.SlotsWithRoomsFromBookedEntries(bookedEntries) + if err != nil { + log.Error().Err(err).Msg("cannot get booked rooms map from booked entries") + return err + } + slotsWithRooms := make([]*model.SlotWithRooms, 0, len(roomsForSlots)) for slot, rooms := range roomsForSlots { - normalRooms, exahmRooms, labRooms, ntaRooms := splitRooms(rooms) + normalRooms, _, labRooms, ntaRooms := splitRooms(rooms) + exahmRooms := bookedRoomsMap[slot] slotsWithRooms = append(slotsWithRooms, &model.SlotWithRooms{ - DayNumber: slot / 10, - SlotNumber: slot % 10, + DayNumber: slot.day, + SlotNumber: slot.slot, NormalRooms: normalRooms, ExahmRooms: exahmRooms, LabRooms: labRooms, @@ -76,6 +215,111 @@ func (p *Plexams) PrepareRoomsForSemester() error { return p.dbClient.SaveRooms(context.Background(), slotsWithRooms) } +type TimeRange struct { + From time.Time + Until time.Time +} + +func (p *Plexams) GetReservations() (map[string][]TimeRange, error) { + ctx := context.Background() + rooms, err := p.Rooms(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get rooms") + } + + reservations := make(map[string][]TimeRange) + + for _, room := range rooms { + if viper.IsSet(fmt.Sprintf("roomConstraints.%s.reservations", room.Name)) { + log.Debug().Str("room", room.Name).Msg("found reservations for room") + reservationsForRoom := viper.Get(fmt.Sprintf("roomConstraints.%s.reservations", room.Name)) + reservationsSlice, ok := reservationsForRoom.([]interface{}) + if !ok { + log.Error().Interface("reservations", reservations).Msg("cannot convert reservations to slice") + return nil, fmt.Errorf("cannot convert reservations to slice") + } + + reservations[room.Name] = make([]TimeRange, 0, len(reservationsSlice)) + + for _, reservationEntry := range reservationsSlice { + fromUntil, err := fromUntil(reservationEntry) + if err != nil { + log.Error().Err(err).Interface("reservation", reservationsSlice).Msg("cannot convert reservation to time") + return nil, err + } + reservations[room.Name] = append(reservations[room.Name], *fromUntil) + } + } + } + + return reservations, nil +} + +func (p *Plexams) reservations2Slots(reservations []interface{}) (set.Set[SlotNumber], error) { + slots := set.NewSet[SlotNumber]() + for _, reservation := range reservations { + fromUntil, err := fromUntil(reservation) + if err != nil { + log.Error().Err(err).Interface("reservation", reservation).Msg("cannot convert reservation to time") + return nil, err + } + + fmt.Printf(" From: %v Until: %v\n", fromUntil.From, fromUntil.Until) + + for _, slot := range p.semesterConfig.Slots { + if (fromUntil.From.Before(slot.Starttime.Local()) || fromUntil.From.Equal(slot.Starttime.Local())) && fromUntil.Until.After(slot.Starttime.Local().Add(89*time.Minute)) { + fmt.Printf(" ---> add (%d, %d)\n", slot.DayNumber, slot.SlotNumber) + slots.Add(SlotNumber{slot.DayNumber, slot.SlotNumber}) + } + } + } + return slots, nil +} + +func fromUntil(dateEntry interface{}) (fromUntil *TimeRange, err error) { + entry, ok := dateEntry.(map[string]interface{}) + if !ok { + err = fmt.Errorf("cannot convert date entry to map") + log.Error().Interface("date entry", dateEntry).Msg("cannot convert date entry to map") + return nil, err + } + + rawDate, ok := entry["date"].(time.Time) + if !ok { + err = fmt.Errorf("cannot convert date entry to string") + log.Error().Interface("date entry", entry["date"]).Msg("cannot convert date entry to string") + return nil, err + } + rawFrom, ok := entry["from"].(string) + if !ok { + err = fmt.Errorf("cannot convert from entry to string") + log.Error().Interface("date entry", entry["from"]).Msg("cannot convert from entry to string") + return nil, err + } + rawUntil, ok := entry["until"].(string) + if !ok { + err = fmt.Errorf("cannot convert until entry to string") + log.Error().Interface("date entry", entry["until"]).Msg("cannot convert until entry to string") + return nil, err + } + + from, err := time.ParseInLocation("2006-01-02 15:04", fmt.Sprintf("%s %s", rawDate.Format("2006-01-02"), rawFrom), time.Local) + if err != nil { + log.Error().Err(err).Interface("date", rawDate).Str("time", rawFrom).Msg("cannot parse to time") + return nil, err + } + until, err := time.ParseInLocation("2006-01-02 15:04", fmt.Sprintf("%s %s", rawDate.Format("2006-01-02"), rawUntil), time.Local) + if err != nil { + log.Error().Err(err).Interface("date", rawDate).Str("time", rawFrom).Msg("cannot parse to time") + return nil, err + } + + return &TimeRange{ + From: from, + Until: until, + }, nil +} + func splitRooms(rooms []*model.Room) ([]*model.Room, []*model.Room, []*model.Room, []*model.Room) { normalRooms := make([]*model.Room, 0) exahmRooms := make([]*model.Room, 0) @@ -172,219 +416,6 @@ func (p *Plexams) AddRoomToExam(ctx context.Context, input model.RoomForExamInpu // return room, nil // } -func (p *Plexams) PrepareRoomForExams() error { - ctx := context.Background() - - examRooms := make([]interface{}, 0) - - for _, slot := range p.semesterConfig.Slots { - // get exams - examsInPlan, err := p.ExamsInSlot(ctx, slot.DayNumber, slot.SlotNumber) - - if err != nil { - log.Error().Err(err).Int("day", slot.DayNumber).Int("time", slot.SlotNumber). - Msg("error while trying to find exams in slot") - return err - } - - exams := make([]*model.ExamWithRegsAndRooms, 0, len(examsInPlan)) - for _, examInPlan := range examsInPlan { - ntas := examInPlan.Nta - isNTA := func(studReg *model.StudentReg) bool { - for _, nta := range ntas { - if studReg.Mtknr == nta.Nta.Mtknr { - return true - } - } - return false - } - regs := make([]*model.StudentReg, 0) - for _, registrations := range examInPlan.Exam.StudentRegs { - for _, studReg := range registrations.StudentRegs { - if !isNTA(studReg) { - regs = append(regs, studReg) - } - } - } - - exams = append(exams, &model.ExamWithRegsAndRooms{ - Exam: examInPlan, - NormalRegs: regs, - NtaRegs: ntas, - Rooms: make([]*model.RoomForExam, 0), - }) - } - - // get rooms - slotWithRooms, err := p.RoomsForSlot(ctx, slot.DayNumber, slot.SlotNumber) - if err != nil { - log.Error().Err(err).Int("day", slot.DayNumber).Int("time", slot.SlotNumber). - Msg("error while trying to get rooms for slot") - return err - } - - // rooms without NTA - for { - if len(exams) == 0 { - break - } - - sort.Slice(exams, func(i, j int) bool { - return len(exams[i].NormalRegs) > len(exams[j].NormalRegs) - }) - - if len(exams[0].NormalRegs) == 0 { - break - } - - exam := exams[0] - exams = exams[1:] - - var room *model.Room - - if exam.Exam.Constraints != nil { - if exam.Exam.Constraints.Online { - room = &model.Room{ - Name: "ONLINE", - Seats: 1000, - } - } else if exam.Exam.Constraints.RoomConstraints != nil { - if exam.Exam.Constraints.RoomConstraints.ExahmRooms { - if len(slotWithRooms.ExahmRooms) > 0 { - room = slotWithRooms.ExahmRooms[0] - slotWithRooms.ExahmRooms = slotWithRooms.ExahmRooms[1:] - } - } else if exam.Exam.Constraints.RoomConstraints.Seb { - if len(slotWithRooms.ExahmRooms) > 0 { - room = slotWithRooms.ExahmRooms[0] - slotWithRooms.ExahmRooms = slotWithRooms.ExahmRooms[1:] - } - } else if exam.Exam.Constraints.RoomConstraints.Lab { - if len(slotWithRooms.LabRooms) > 0 { - room = slotWithRooms.LabRooms[0] - slotWithRooms.LabRooms = slotWithRooms.LabRooms[1:] - } - } else if exam.Exam.Constraints.RoomConstraints.PlacesWithSocket { - for i := 0; i < len(slotWithRooms.NormalRooms); i++ { - if slotWithRooms.NormalRooms[i].PlacesWithSocket { - room = slotWithRooms.NormalRooms[i] - slotWithRooms.NormalRooms = append(slotWithRooms.NormalRooms[:i], slotWithRooms.NormalRooms[i+1:]...) - break - } - } - } else { - room = slotWithRooms.NormalRooms[0] - slotWithRooms.NormalRooms = slotWithRooms.NormalRooms[1:] - } - } else { - room = slotWithRooms.NormalRooms[0] - slotWithRooms.NormalRooms = slotWithRooms.NormalRooms[1:] - } - } else { - room = slotWithRooms.NormalRooms[0] - slotWithRooms.NormalRooms = slotWithRooms.NormalRooms[1:] - } - - if room == nil { - log.Error().Int("ancode", exam.Exam.Exam.Ancode). - Msg("no room found for exam") - room = &model.Room{ - Name: "No Room", - Seats: 1000, - } - } - - reserveRoom := false - studentCountInRoom := room.Seats - if studentCountInRoom > len(exam.NormalRegs) { - studentCountInRoom = len(exam.NormalRegs) - if len(exam.Rooms) > 0 && studentCountInRoom < 10 { - reserveRoom = true - } - } - - studentsInRoom := exam.NormalRegs[:studentCountInRoom] - exam.NormalRegs = exam.NormalRegs[studentCountInRoom:] - - examRoom := model.RoomForExam{ - Ancode: exam.Exam.Exam.Ancode, - RoomName: room.Name, - SeatsPlanned: len(studentsInRoom), - Duration: exam.Exam.Exam.ZpaExam.Duration, - Handicap: false, - Reserve: reserveRoom, - Students: studentsInRoom, - } - - exam.Rooms = append(exam.Rooms, &examRoom) - examRooms = append(examRooms, &examRoom) - - exams = append(exams, exam) - } // for exams - - // NTAs - for _, exam := range exams { - if len(exam.NtaRegs) == 0 { - continue - } - - ntaRooms := slotWithRooms.NtaRooms - - for _, nta := range exam.NtaRegs { - - ntaDuration := int(math.Ceil(float64(exam.Exam.Exam.ZpaExam.Duration*(100+nta.Nta.DeltaDurationPercent)) / 100)) - - if nta.Nta.NeedsRoomAlone { - examRooms = append(examRooms, &model.RoomForExam{ - Ancode: exam.Exam.Exam.Ancode, - RoomName: ntaRooms[0].Name, - SeatsPlanned: 1, - Duration: ntaDuration, - Handicap: true, - Reserve: false, - Students: []*model.StudentReg{ - { - Mtknr: nta.Nta.Mtknr, - Name: nta.Nta.Name, - }, - }, - }) - ntaRooms = ntaRooms[1:] - } else { - // find room with a seat left - for _, room := range exam.Rooms { - if room.SeatsPlanned < p.GetRoomInfo(room.RoomName).Seats { - examRooms = append(examRooms, &model.RoomForExam{ - Ancode: exam.Exam.Exam.Ancode, - RoomName: room.RoomName, - SeatsPlanned: 1, - Duration: ntaDuration, - Handicap: true, - Reserve: false, - Students: []*model.StudentReg{ - { - Mtknr: nta.Nta.Mtknr, - Name: nta.Nta.Name, - }, - }, - }) - break - } - } - } - } - } - } // for slot - - err := p.dbClient.DropAndSave(context.WithValue(ctx, db.CollectionName("collectionName"), "rooms_for_exams"), examRooms) - if err != nil { - log.Error().Err(err).Msg("cannot save rooms for exams") - return err - } - - return nil -} - func (p *Plexams) ChangeRoom(ctx context.Context, ancode int, oldRoomName, newRoomName string) (bool, error) { roomsForAncode, err := p.dbClient.RoomsForAncode(ctx, ancode) if err != nil { @@ -451,33 +482,42 @@ func (p *Plexams) PlannedRoomNames(ctx context.Context) ([]string, error) { return p.dbClient.PlannedRoomNames(ctx) } -func (p *Plexams) PlannedRoomsInSlot(ctx context.Context, day int, time int) ([]*model.RoomForExam, error) { - exams, err := p.ExamsInSlotWithRooms(ctx, day, time) +func (p *Plexams) PlannedRoomsInSlot(ctx context.Context, day int, time int) ([]*model.PlannedRoom, error) { + rooms, err := p.dbClient.PlannedRoomsInSlot(ctx, day, time) if err != nil { log.Error().Err(err).Int("day", day).Int("time", time).Msg("cannot get exams in slot") } - rooms := make([]*model.RoomForExam, 0) - for _, exam := range exams { - rooms = append(rooms, exam.Rooms...) - } - return rooms, nil } +// func enhancePlannedRooms(plannedRooms []*model.PlannedRoom) []*model.EnhancedPlannedRoom { +// enhancedPlannedRooms := make([]*model.EnhancedPlannedRoom, 0, len(plannedRooms)) +// for _, room := range plannedRooms { +// enhancedPlannedRooms = append(enhancedPlannedRooms, &model.EnhancedPlannedRoom{ +// Day: room.Day, +// Slot: room.Ancode, +// RoomName: room.RoomName, +// Ancode: room.Ancode, +// Duration: room.Duration, +// Handicap: room.Handicap, +// HandicapRoomAlone: room.HandicapRoomAlone, +// Reserve: room.Reserve, +// StudentsInRoom: room.StudentsInRoom, +// NtaMtknr: room.NtaMtknr, +// }) +// } +// return enhancedPlannedRooms +// } + func (p *Plexams) PlannedRoomNamesInSlot(ctx context.Context, day int, time int) ([]string, error) { - exams, err := p.ExamsInSlotWithRooms(ctx, day, time) - if err != nil { - log.Error().Err(err).Int("day", day).Int("time", time).Msg("cannot get exams in slot") - } + return p.dbClient.PlannedRoomNamesInSlot(ctx, day, time) +} - roomNamesSet := set.NewSet[string]() - for _, exam := range exams { - for _, room := range exam.Rooms { - roomNamesSet.Add(room.RoomName) - } - } - roomNames := roomNamesSet.ToSlice() - sort.Strings(roomNames) - return roomNames, nil +func (p *Plexams) PlannedRooms(ctx context.Context) ([]*model.PlannedRoom, error) { + return p.dbClient.PlannedRooms(ctx) +} + +func (p *Plexams) RoomFromName(ctx context.Context, roomName string) (*model.Room, error) { + return p.dbClient.RoomFromName(ctx, roomName) } diff --git a/plexams/roomsForNTA.go b/plexams/roomsForNTA.go deleted file mode 100644 index 7249566..0000000 --- a/plexams/roomsForNTA.go +++ /dev/null @@ -1,63 +0,0 @@ -package plexams - -import ( - "context" - "fmt" - "strings" - - "github.com/obcode/plexams.go/graph/model" - "github.com/rs/zerolog/log" -) - -func (p *Plexams) GetRoomsForNTA(name string) error { - ctx := context.Background() - ntas, err := p.NtasWithRegs(ctx) - if err != nil { - return err - } - var nta *model.NTAWithRegs - for _, ntaInDB := range ntas { - if strings.HasPrefix(ntaInDB.Nta.Name, name) { - nta = ntaInDB - break - } - } - if nta == nil { - return fmt.Errorf("NTA with name=%s not found", name) - } - log.Debug().Str("name", nta.Nta.Name).Msg("found nta") - -ANCODES: - for _, ancode := range nta.Regs.Ancodes { - exam, err := p.dbClient.GetZpaExamByAncode(ctx, ancode) - if err != nil { - log.Error().Err(err).Int("ancode", ancode).Msg("cannot get zpa exam") - } - - constraints, err := p.ConstraintForAncode(ctx, ancode) - if err != nil { - log.Error().Err(err).Int("ancode", ancode).Msg("cannot get constraints") - } - if constraints != nil && constraints.NotPlannedByMe { - log.Debug().Int("ancode", ancode).Str("examer", exam.MainExamer).Str("module", exam.Module).Msg("exam not planned by me") - continue - } - log.Debug().Int("ancode", ancode).Str("examer", exam.MainExamer).Str("module", exam.Module).Msg("found exam") - - roomsForExam, err := p.dbClient.RoomsForAncode(ctx, ancode) - if err != nil { - log.Error().Err(err).Int("ancode", ancode).Msg("cannot get rooms") - } - for _, room := range roomsForExam { - for _, stud := range room.Students { - if nta.Nta.Mtknr == stud.Mtknr { - fmt.Printf("%d. %s: %s --- Raum %s\n", ancode, exam.MainExamer, exam.Module, room.RoomName) - continue ANCODES - } - } - } - - } - - return nil -} diff --git a/plexams/roomsPrepare.go b/plexams/roomsPrepare.go new file mode 100644 index 0000000..ec7404b --- /dev/null +++ b/plexams/roomsPrepare.go @@ -0,0 +1,777 @@ +package plexams + +import ( + "context" + "fmt" + "math" + "sort" + "time" + + set "github.com/deckarep/golang-set/v2" + "github.com/logrusorgru/aurora" + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" + "github.com/spf13/viper" + "github.com/theckman/yacspin" +) + +func (p *Plexams) RoomsForNTAsWithRoomAlone() error { + ctx := context.Background() + ntas, err := p.NtasWithRegs(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get ntas") + return err + } + + ntasMap := make(map[string]*model.Student) + type dayEntry struct { + slot int + ancode int + mtknr string + } + daysMap := make(map[int][]dayEntry) + examsMap := make(map[int]*model.PlannedExam) + + plannedRooms := make([]*model.PlannedRoom, 0) + + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: "", + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + for _, nta := range ntas { + if !nta.Nta.NeedsRoomAlone { + continue + } + + cfg.Suffix = aurora.Sprintf(aurora.Cyan(" finding exams for %s (%s)"), + aurora.Yellow(nta.Name), + aurora.Green(nta.Mtknr), + ) + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + ntasMap[nta.Mtknr] = nta + + regsNew := make([]int, 0, len(nta.Regs)) + for _, ancode := range nta.Regs { + exam, err := p.PlannedExam(ctx, ancode) + if err != nil { + log.Error().Err(err).Int("ancode", ancode).Msg("cannot get exam") + return err + } + if exam.Constraints == nil || !exam.Constraints.NotPlannedByMe { + examsMap[exam.Ancode] = exam + dayEntries, ok := daysMap[exam.PlanEntry.DayNumber] + if !ok { + dayEntries = make([]dayEntry, 0, 1) + } + daysMap[exam.PlanEntry.DayNumber] = append(dayEntries, dayEntry{ + slot: exam.PlanEntry.SlotNumber, + ancode: ancode, + mtknr: nta.Mtknr, + }) + regsNew = append(regsNew, ancode) + } + } + + nta.Regs = regsNew + + spinner.StopMessage(aurora.Sprintf(aurora.Cyan("found %v"), + aurora.Magenta(nta.Regs), + )) + + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + + days := make([]int, 0, len(daysMap)) + for day := range daysMap { + days = append(days, day) + } + sort.Ints(days) + + for _, day := range days { + + slotsMap := make(map[int][]dayEntry) + for _, entry := range daysMap[day] { + slotEntries, ok := slotsMap[entry.slot] + if !ok { + slotEntries = make([]dayEntry, 0, 1) + } + slotsMap[entry.slot] = append(slotEntries, entry) + } + + slots := make([]int, 0, len(slotsMap)) + for slot := range slotsMap { + slots = append(slots, slot) + } + sort.Ints(slots) + + prevSlot := -100 + roomsInPrevSlot := set.NewSet[string]() + for _, slot := range slots { + roomsInSlot := set.NewSet[string]() + if prevSlot+1 < slot { + roomsInPrevSlot = set.NewSet[string]() + } + + slotEntries := slotsMap[slot] + rooms, err := p.RoomsForSlot(ctx, day, slot) + if err != nil { + log.Error().Err(err).Int("day", day).Int("slot", slotEntries[0].slot).Msg("no rooms for slot found") + } + + cfg.Suffix = aurora.Sprintf(aurora.Cyan(" slot (%d/%d) with %d needed room(s)"), day, slot, len(slotEntries)) + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + for _, slotEntry := range slotEntries { + + var room *model.Room + exam := examsMap[slotEntry.ancode] + if exam.Constraints != nil && exam.Constraints.RoomConstraints != nil && exam.Constraints.RoomConstraints.ExahmRooms { + for _, exahmRoom := range rooms.ExahmRooms { + if exahmRoom.Handicap { + room = exahmRoom + break + } + } + if room == nil { + fmt.Printf("we need an exahm room!!!") + return fmt.Errorf("we need an exahm room") + } + } else { + for _, ntaRoom := range rooms.NtaRooms { + if roomsInPrevSlot.Contains(ntaRoom.Name) || roomsInSlot.Contains(ntaRoom.Name) { + continue + } + room = ntaRoom + break + } + } + roomsInSlot.Add(room.Name) + + nta := ntasMap[slotEntry.mtknr] + + ntaDuration := int(math.Ceil(float64(exam.ZpaExam.Duration*(100+nta.Nta.DeltaDurationPercent)) / 100)) + + plannedRooms = append(plannedRooms, &model.PlannedRoom{ + Day: day, + Slot: slot, + RoomName: room.Name, + Ancode: slotEntry.ancode, + Duration: ntaDuration, + Handicap: true, + HandicapRoomAlone: true, + Reserve: false, + StudentsInRoom: []string{nta.Nta.Mtknr}, + NtaMtknr: &nta.Nta.Mtknr, + }) + } + + prevSlot = slot + roomsInPrevSlot = roomsInSlot + + spinner.StopMessage(aurora.Sprintf(aurora.Green("using %v"), roomsInSlot.ToSlice())) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + // } + } + + for _, plannedRoom := range plannedRooms { + exam := examsMap[plannedRoom.Ancode] + fmt.Println(aurora.Sprintf(aurora.Cyan("(%d/%d) %d. %s (%s), Raum %s für %s (%d Minuten)"), plannedRoom.Day, plannedRoom.Slot, + exam.Ancode, aurora.Blue(exam.ZpaExam.Module), exam.ZpaExam.MainExamer, + aurora.Magenta(plannedRoom.RoomName), aurora.Green(ntasMap[*plannedRoom.NtaMtknr].Name), aurora.Green(plannedRoom.Duration), + )) + } + return p.dbClient.ReplaceRoomsForNTA(ctx, plannedRooms) +} + +// TODO: rewrite me. +func (p *Plexams) PrepareRoomForExams() error { + ctx := context.Background() + + additionalSeats := make(map[int]int) // ancode -> seats + additionalSeatsViper := viper.Get("roomconstraints.additionalseats") + + additionalSeatsSlice, ok := additionalSeatsViper.([]interface{}) + if ok { + for _, addSeat := range additionalSeatsSlice { + entry, ok := addSeat.(map[string]interface{}) + if !ok { + log.Error().Interface("addSeat", addSeat).Msg("cannot convert addSeat to map") + } + ancode, okAncode := entry["ancode"].(int) + seats, okSeats := entry["seats"].(int) + + if okAncode && okSeats { + additionalSeats[ancode] = seats + } + } + } + + log.Debug().Interface("additionalSeats", additionalSeats).Msg("found additional seats") + + allRooms, err := p.dbClient.Rooms(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get global rooms") + return err + } + + roomInfo := make(map[string]*model.Room) + for _, room := range allRooms { + roomInfo[room.Name] = room + } + + // only if room is needed more than 100 Minutes + roomsNotUsableInSlot := set.NewSet[string]() + + examRooms := make([]*model.PlannedRoom, 0) + for _, slot := range p.semesterConfig.Slots { + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Black("finding rooms for slot (%d/%d)"), + aurora.Yellow(slot.DayNumber), + aurora.Yellow(slot.SlotNumber), + ), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + log.Debug().Int("day", slot.DayNumber).Int("slot", slot.SlotNumber).Msg("preparing rooms for slot") + // get exams + if slot.SlotNumber == 1 { + roomsNotUsableInSlot = set.NewSet[string]() + } + examsInPlan, err := p.GetExamsInSlot(ctx, slot.DayNumber, slot.SlotNumber) + + if err != nil { + log.Error().Err(err).Int("day", slot.DayNumber).Int("time", slot.SlotNumber). + Msg("error while trying to find exams in slot") + return err + } + + // no exams in slot + if len(examsInPlan) == 0 { + spinner.StopMessage(aurora.Sprintf(aurora.Blue("no exams in slot"))) + err := spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + roomsNotUsableInSlot = set.NewSet[string]() + continue + } + + // no exams for me to plan in slot + needRooms := false + for _, exam := range examsInPlan { + if exam.Constraints == nil || !exam.Constraints.NotPlannedByMe { + needRooms = true + break + } + } + + if !needRooms { + spinner.StopMessage(aurora.Sprintf(aurora.Blue("no exams for me to plan in slot"))) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + roomsNotUsableInSlot = set.NewSet[string]() + continue + } + + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + + // planning for each exam starts here + exams := make([]*model.ExamWithRegsAndRooms, 0, len(examsInPlan)) + examsMap := make(map[int]*model.PlannedExam) + for _, examInPlan := range examsInPlan { + + if examInPlan.Constraints != nil && examInPlan.Constraints.NotPlannedByMe { + continue + } + + ntas := examInPlan.Ntas + ntaMtknrs := set.NewSet[string]() + ntasInNormalRooms := make([]*model.NTA, 0) + for _, nta := range ntas { + ntaMtknrs.Add(nta.Mtknr) + if !nta.NeedsRoomAlone { + ntasInNormalRooms = append(ntasInNormalRooms, nta) // nolint + } + } + + normalRegs := make([]string, 0) + for _, primussExam := range examInPlan.PrimussExams { + for _, studentRegs := range primussExam.StudentRegs { + if !ntaMtknrs.Contains(studentRegs.Mtknr) { + normalRegs = append(normalRegs, studentRegs.Mtknr) + } + } + } + + addSeats, ok := additionalSeats[examInPlan.Ancode] + if ok { + fmt.Println(aurora.Sprintf(aurora.BrightRed(" adding %d seats to %d. %s (%s)"), + addSeats, examInPlan.Ancode, examInPlan.ZpaExam.Module, examInPlan.ZpaExam.MainExamer)) + for i := 0; i < addSeats; i++ { + normalRegs = append(normalRegs, "dummy") + } + } + + exams = append(exams, &model.ExamWithRegsAndRooms{ + Exam: examInPlan, + NormalRegsMtknr: normalRegs, + Ntas: ntasInNormalRooms, + Rooms: make([]*model.PlannedRoom, 0), + }) + examsMap[examInPlan.Ancode] = examInPlan + } + + // get rooms + slotWithRooms, err := p.RoomsForSlot(ctx, slot.DayNumber, slot.SlotNumber) + if err != nil { + log.Error().Err(err).Int("day", slot.DayNumber).Int("time", slot.SlotNumber). + Msg("error while trying to get rooms for slot") + return err + } + + if roomsNotUsableInSlot.Cardinality() > 0 { + normalRooms := make([]*model.Room, 0, len(slotWithRooms.NormalRooms)) + for _, normalRoom := range slotWithRooms.NormalRooms { + if !roomsNotUsableInSlot.Contains(normalRoom.Name) { + normalRooms = append(normalRooms, normalRoom) + } + } + slotWithRooms.NormalRooms = normalRooms + + exahmRooms := make([]*model.Room, 0, len(slotWithRooms.ExahmRooms)) + for _, exahmRoom := range slotWithRooms.ExahmRooms { + if !roomsNotUsableInSlot.Contains(exahmRoom.Name) { + exahmRooms = append(exahmRooms, exahmRoom) + } + } + slotWithRooms.ExahmRooms = exahmRooms + + labRooms := make([]*model.Room, 0, len(slotWithRooms.LabRooms)) + for _, labRoom := range slotWithRooms.LabRooms { + if !roomsNotUsableInSlot.Contains(labRoom.Name) { + labRooms = append(labRooms, labRoom) + } + } + slotWithRooms.LabRooms = labRooms + + roomsNotUsableInSlot = set.NewSet[string]() + } + + type PlannedRoomsWithFreeSeats struct { + rooms []*model.PlannedRoom + freeSeats int + } + plannedRoomsWithFreeSeats := make(map[string]PlannedRoomsWithFreeSeats) + + // rooms without NTA + for { + if len(exams) == 0 { + break + } + + sort.Slice(exams, func(i, j int) bool { + return len(exams[i].NormalRegsMtknr)+len(exams[i].Ntas) > len(exams[j].NormalRegsMtknr)+len(exams[j].Ntas) + }) + + if len(exams[0].NormalRegsMtknr) == 0 { + break + } + + exam := exams[0] + exams = exams[1:] + + cfg.Suffix = aurora.Sprintf(aurora.Magenta(" ↪ %d. %s (%s): %d of %d studs left"), + exam.Exam.Ancode, exam.Exam.ZpaExam.Module, exam.Exam.ZpaExam.MainExamer, + len(exam.NormalRegsMtknr), exam.Exam.StudentRegsCount) + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + var room *model.Room + + neededSeats := len(exam.NormalRegsMtknr) + len(exam.Ntas) + + if neededSeats < 10 { + + type RoomWithSeatsLeft struct { + room *model.Room + seatsLeft int + } + var roomFound *RoomWithSeatsLeft + OUTER: + for _, plannedRoomWithFreeSeats := range plannedRoomsWithFreeSeats { + seatsLeft := plannedRoomWithFreeSeats.freeSeats - neededSeats + if seatsLeft <= 0 { + continue + } + for _, room := range plannedRoomWithFreeSeats.rooms { + roomInfo := roomInfo[room.RoomName] + otherExam := examsMap[room.Ancode] + if exam.Exam.Constraints != nil && exam.Exam.Constraints.RoomConstraints != nil { + if exam.Exam.Constraints.RoomConstraints.ExahmRooms && !roomInfo.Exahm || + exam.Exam.Constraints.RoomConstraints.Lab && !roomInfo.Lab || + exam.Exam.Constraints.RoomConstraints.PlacesWithSocket && !roomInfo.PlacesWithSocket || + exam.Exam.Constraints.RoomConstraints.Seb && !roomInfo.Seb { + continue OUTER + } + } + if exam.Exam.ZpaExam.Duration != otherExam.ZpaExam.Duration { + continue OUTER + } + + if exam.Exam.ZpaExam.MainExamerID == otherExam.ZpaExam.MainExamerID { + roomFound = &RoomWithSeatsLeft{ + room: roomInfo, + seatsLeft: plannedRoomWithFreeSeats.freeSeats - neededSeats, + } + break OUTER + } + if exam.Exam.ZpaExam.Module == otherExam.ZpaExam.Module { + roomFound = &RoomWithSeatsLeft{ + room: roomInfo, + seatsLeft: plannedRoomWithFreeSeats.freeSeats - neededSeats, + } + break OUTER + } + + if roomFound == nil || roomFound.seatsLeft < seatsLeft { + roomFound = &RoomWithSeatsLeft{ + room: roomInfo, + seatsLeft: seatsLeft, + } + } + } + } + if roomFound != nil { + room = roomFound.room + } + } + + if room == nil { + // TODO: room used to long in previous slot + if exam.Exam.Constraints != nil { + if exam.Exam.Constraints.Online { + room = &model.Room{ + Name: "ONLINE", + Seats: 1000, + } + } else if exam.Exam.Constraints.RoomConstraints != nil { + if exam.Exam.Constraints.RoomConstraints.ExahmRooms { + if len(slotWithRooms.ExahmRooms) > 0 { + room = slotWithRooms.ExahmRooms[0] + slotWithRooms.ExahmRooms = slotWithRooms.ExahmRooms[1:] + } + } else if exam.Exam.Constraints.RoomConstraints.Seb { + if len(slotWithRooms.ExahmRooms) > 0 { + room = slotWithRooms.ExahmRooms[0] + slotWithRooms.ExahmRooms = slotWithRooms.ExahmRooms[1:] + } + } else if exam.Exam.Constraints.RoomConstraints.Lab { + if len(slotWithRooms.LabRooms) > 0 { + room = slotWithRooms.LabRooms[0] + slotWithRooms.LabRooms = slotWithRooms.LabRooms[1:] + } + } else if exam.Exam.Constraints.RoomConstraints.PlacesWithSocket { + for i := 0; i < len(slotWithRooms.NormalRooms); i++ { + if slotWithRooms.NormalRooms[i].PlacesWithSocket { + room = slotWithRooms.NormalRooms[i] + slotWithRooms.NormalRooms = append(slotWithRooms.NormalRooms[:i], slotWithRooms.NormalRooms[i+1:]...) + break + } + } + } else { + room = slotWithRooms.NormalRooms[0] + slotWithRooms.NormalRooms = slotWithRooms.NormalRooms[1:] + } + } else { + room = slotWithRooms.NormalRooms[0] + slotWithRooms.NormalRooms = slotWithRooms.NormalRooms[1:] + } + } else { + room = slotWithRooms.NormalRooms[0] + slotWithRooms.NormalRooms = slotWithRooms.NormalRooms[1:] + } + } + + if room == nil { + log.Error().Int("ancode", exam.Exam.Ancode). + Msg("no room found for exam") + room = &model.Room{ + Name: "No Room", + Seats: 1000, + } + } + + // TODO: no if only room for exam + reserveRoom := false + studentCountInRoom := room.Seats + if studentCountInRoom > len(exam.NormalRegsMtknr) { + studentCountInRoom = len(exam.NormalRegsMtknr) + if len(exam.Rooms) > 0 && studentCountInRoom < 10 { + reserveRoom = true + } + } + + studentsInRoom := exam.NormalRegsMtknr[:studentCountInRoom] + exam.NormalRegsMtknr = exam.NormalRegsMtknr[studentCountInRoom:] + + examRoom := model.PlannedRoom{ + Day: slot.DayNumber, + Slot: slot.SlotNumber, + RoomName: room.Name, + Ancode: exam.Exam.Ancode, + Duration: exam.Exam.ZpaExam.Duration, + Handicap: false, + HandicapRoomAlone: false, + Reserve: reserveRoom, + StudentsInRoom: studentsInRoom, + NtaMtknr: nil, + } + + exam.Rooms = append(exam.Rooms, &examRoom) + examRooms = append(examRooms, &examRoom) // nolint + + exams = append(exams, exam) + + // for _, plannedRoom := range exam.Rooms { + plannedRoomWithFreeSeats, ok := plannedRoomsWithFreeSeats[examRoom.RoomName] + if !ok { + plannedRoomWithFreeSeats = PlannedRoomsWithFreeSeats{ + rooms: make([]*model.PlannedRoom, 0, 1), + freeSeats: roomInfo[examRoom.RoomName].Seats, + } + } + plannedRoomsWithFreeSeats[examRoom.RoomName] = PlannedRoomsWithFreeSeats{ + rooms: append(plannedRoomWithFreeSeats.rooms, &examRoom), + freeSeats: plannedRoomWithFreeSeats.freeSeats - (len(examRoom.StudentsInRoom) + len(exam.Ntas)), + } + // } + + spinner.StopMessage(aurora.Sprintf(aurora.Green("added %s for %d students (max. %d)"), + examRoom.RoomName, len(examRoom.StudentsInRoom), room.Seats)) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } // for exams + + // NTAs in normal rooms + for _, exam := range exams { + maxDuration := exam.Exam.ZpaExam.Duration + for _, nta := range exam.Ntas { + ntaDuration := int(math.Ceil(float64(exam.Exam.ZpaExam.Duration*(100+nta.DeltaDurationPercent)) / 100)) + if maxDuration < ntaDuration { + maxDuration = ntaDuration + } + } + + // find room with a seat left + var roomFound *model.Room + for _, room := range exam.Rooms { + if maxDuration > 100 && (room.RoomName == "R1.046" || room.RoomName == "R1.049") { + continue + } + + if roomInfo[room.RoomName].Seats >= len(room.StudentsInRoom)+len(exam.Ntas) { + roomFound = roomInfo[room.RoomName] + break + } + } + if roomFound == nil { + // need a new room + if exam.Exam.Constraints != nil { + if exam.Exam.Constraints.Online { + roomFound = &model.Room{ + Name: "ONLINE", + Seats: 1000, + } + } else if exam.Exam.Constraints.RoomConstraints != nil { + if exam.Exam.Constraints.RoomConstraints.ExahmRooms { + if len(slotWithRooms.ExahmRooms) > 0 { + roomFound = slotWithRooms.ExahmRooms[0] + slotWithRooms.ExahmRooms = slotWithRooms.ExahmRooms[1:] + } + } else if exam.Exam.Constraints.RoomConstraints.Seb { + if len(slotWithRooms.ExahmRooms) > 0 { + roomFound = slotWithRooms.ExahmRooms[0] + slotWithRooms.ExahmRooms = slotWithRooms.ExahmRooms[1:] + } + } else if exam.Exam.Constraints.RoomConstraints.Lab { + if len(slotWithRooms.LabRooms) > 0 { + roomFound = slotWithRooms.LabRooms[0] + slotWithRooms.LabRooms = slotWithRooms.LabRooms[1:] + } + } else if exam.Exam.Constraints.RoomConstraints.PlacesWithSocket { + for i := 0; i < len(slotWithRooms.NormalRooms); i++ { + if slotWithRooms.NormalRooms[i].PlacesWithSocket { + roomFound = slotWithRooms.NormalRooms[i] + slotWithRooms.NormalRooms = append(slotWithRooms.NormalRooms[:i], slotWithRooms.NormalRooms[i+1:]...) + break + } + } + } else { + roomFound = slotWithRooms.NormalRooms[0] + slotWithRooms.NormalRooms = slotWithRooms.NormalRooms[1:] + } + } else { + roomFound = slotWithRooms.NormalRooms[0] + slotWithRooms.NormalRooms = slotWithRooms.NormalRooms[1:] + } + } else { + roomFound = slotWithRooms.NormalRooms[0] + slotWithRooms.NormalRooms = slotWithRooms.NormalRooms[1:] + } + } + + for _, nta := range exam.Ntas { + ntaDuration := int(math.Ceil(float64(exam.Exam.ZpaExam.Duration*(100+nta.DeltaDurationPercent)) / 100)) + examRoom := model.PlannedRoom{ + Day: slot.DayNumber, + Slot: slot.SlotNumber, + RoomName: roomFound.Name, + Ancode: exam.Exam.Ancode, + Duration: ntaDuration, + Handicap: true, + HandicapRoomAlone: false, + Reserve: false, + StudentsInRoom: []string{nta.Mtknr}, + NtaMtknr: &nta.Mtknr, + } + + exam.Rooms = append(exam.Rooms, &examRoom) + examRooms = append(examRooms, &examRoom) + fmt.Println(aurora.Sprintf(aurora.Red(" adding NTA room %s for %s (%d minuntes)"), + aurora.Green(roomFound.Name), aurora.Green(nta.Name), aurora.Green(ntaDuration))) + + if ntaDuration > 100 { + roomsNotUsableInSlot.Add(roomFound.Name) + fmt.Println(aurora.Sprintf(aurora.Red(" room %s not usable in next slot!"), + aurora.Green(roomFound.Name))) + } + } + } + + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } // for slot + + // err := p.dbClient.DropAndSave(context.WithValue(ctx, db.CollectionName("collectionName"), "rooms_for_exams"), examRooms) + // if err != nil { + // log.Error().Err(err).Msg("cannot save rooms for exams") + // return err + // } + + return p.dbClient.ReplaceNonNTARooms(ctx, examRooms) +} + +// FIXME: rewrite me +func (p *Plexams) GetRoomsForNTA(name string) error { + // ctx := context.Background() + // ntas, err := p.NtasWithRegs(ctx) + // if err != nil { + // return err + // } + // var nta *model.NTAWithRegs + // for _, ntaInDB := range ntas { + // if strings.HasPrefix(ntaInDB.Nta.Name, name) { + // nta = ntaInDB + // break + // } + // } + // if nta == nil { + // return fmt.Errorf("NTA with name=%s not found", name) + // } + // log.Debug().Str("name", nta.Nta.Name).Msg("found nta") + + // ANCODES: + // for _, ancode := range nta.Regs.Ancodes { + // exam, err := p.dbClient.GetZpaExamByAncode(ctx, ancode) + // if err != nil { + // log.Error().Err(err).Int("ancode", ancode).Msg("cannot get zpa exam") + // } + + // constraints, err := p.ConstraintForAncode(ctx, ancode) + // if err != nil { + // log.Error().Err(err).Int("ancode", ancode).Msg("cannot get constraints") + // } + // if constraints != nil && constraints.NotPlannedByMe { + // log.Debug().Int("ancode", ancode).Str("examer", exam.MainExamer).Str("module", exam.Module).Msg("exam not planned by me") + // continue + // } + // log.Debug().Int("ancode", ancode).Str("examer", exam.MainExamer).Str("module", exam.Module).Msg("found exam") + + // roomsForExam, err := p.dbClient.RoomsForAncode(ctx, ancode) + // if err != nil { + // log.Error().Err(err).Int("ancode", ancode).Msg("cannot get rooms") + // } + // for _, room := range roomsForExam { + // for _, stud := range room.Students { + // if nta.Nta.Mtknr == stud.Mtknr { + // fmt.Printf("%d. %s: %s --- Raum %s\n", ancode, exam.MainExamer, exam.Module, room.RoomName) + // continue ANCODES + // } + // } + // } + + // } + + return fmt.Errorf("rewrite me") +} diff --git a/plexams/samename.go b/plexams/samename.go new file mode 100644 index 0000000..e0ab784 --- /dev/null +++ b/plexams/samename.go @@ -0,0 +1,46 @@ +package plexams + +import ( + "context" + "fmt" + "sort" + + "github.com/logrusorgru/aurora" + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" +) + +func (p *Plexams) PrintSameName() { + exams, err := p.GetZpaExamsToPlan(context.TODO()) + if err != nil { + log.Error().Err(err).Msg("cannot get zpa exams to plan") + } + + sameNames := make(map[string][]*model.ZPAExam) + + for _, exam := range exams { + _, ok := sameNames[exam.Module] + if ok { + sameNames[exam.Module] = append(sameNames[exam.Module], exam) + } else { + sameNames[exam.Module] = []*model.ZPAExam{exam} + } + } + + keys := make([]string, 0, len(sameNames)) + for k := range sameNames { + keys = append(keys, k) + } + + sort.Strings(keys) + + for _, name := range keys { + sameNameExams := sameNames[name] + if len(sameNameExams) > 1 { + fmt.Printf("- %s\n", aurora.Blue(name)) + for _, e := range sameNameExams { + fmt.Printf(" - %d. %s\n", aurora.Red(e.AnCode), aurora.Green(e.MainExamer)) + } + } + } +} diff --git a/plexams/studentRegs.go b/plexams/studentRegs.go index 5c06346..a484b34 100644 --- a/plexams/studentRegs.go +++ b/plexams/studentRegs.go @@ -3,7 +3,6 @@ package plexams import ( "context" "fmt" - "strings" set "github.com/deckarep/golang-set/v2" "github.com/obcode/plexams.go/graph/model" @@ -64,51 +63,102 @@ func (p *Plexams) GetStudentRegsForAncode(ancode int) (*model.StudentRegsForAnco }, nil } +// Deprecated: rm me func (p *Plexams) GetExamsForStudent(name string) error { - ctx := context.Background() - students, err := p.dbClient.StudentRegsPerStudentPlanned(ctx) - if err != nil { - return err - } - var student *model.StudentRegsPerStudent - for _, studentInDB := range students { - if strings.HasPrefix(studentInDB.Student.Name, name) { - student = studentInDB - break - } - } - if student == nil { - return fmt.Errorf("NTA with name=%s not found", name) - } - log.Debug().Str("name", student.Student.Name).Msg("found student") + // ctx := context.Background() + // students, err := p.dbClient.StudentRegsPerStudentPlanned(ctx) + // if err != nil { + // return err + // } + // var student *model.StudentRegsPerStudent + // for _, studentInDB := range students { + // if strings.HasPrefix(studentInDB.Student.Name, name) { + // student = studentInDB + // break + // } + // } + // if student == nil { + // return fmt.Errorf("NTA with name=%s not found", name) + // } + // log.Debug().Str("name", student.Student.Name).Msg("found student") + + // for _, ancode := range student.Ancodes { + // exam, err := p.dbClient.GetZpaExamByAncode(ctx, ancode) + // if err != nil { + // log.Error().Err(err).Int("ancode", ancode).Msg("cannot get zpa exam") + // } + + // constraints, err := p.ConstraintForAncode(ctx, ancode) + // if err != nil { + // log.Error().Err(err).Int("ancode", ancode).Msg("cannot get constraints") + // } + // if constraints != nil && constraints.NotPlannedByMe { + // log.Debug().Int("ancode", ancode).Str("examer", exam.MainExamer).Str("module", exam.Module).Msg("exam not planned by me") + // continue + // } + // log.Debug().Int("ancode", ancode).Str("examer", exam.MainExamer).Str("module", exam.Module).Msg("found exam") + + // fmt.Printf("%d. %s: %s\n", ancode, exam.MainExamer, exam.Module) + + // roomsForExam, err := p.dbClient.RoomsForAncode(ctx, ancode) + // if err != nil { + // log.Error().Err(err).Int("ancode", ancode).Msg("cannot get rooms") + // } + // for _, room := range roomsForExam { + // fmt.Printf(" - Raum %s\n", room.RoomName) + // } + + // } - for _, ancode := range student.Ancodes { - exam, err := p.dbClient.GetZpaExamByAncode(ctx, ancode) - if err != nil { - log.Error().Err(err).Int("ancode", ancode).Msg("cannot get zpa exam") - } + return nil +} - constraints, err := p.ConstraintForAncode(ctx, ancode) - if err != nil { - log.Error().Err(err).Int("ancode", ancode).Msg("cannot get constraints") - } - if constraints != nil && constraints.NotPlannedByMe { - log.Debug().Int("ancode", ancode).Str("examer", exam.MainExamer).Str("module", exam.Module).Msg("exam not planned by me") - continue - } - log.Debug().Int("ancode", ancode).Str("examer", exam.MainExamer).Str("module", exam.Module).Msg("found exam") +func (p *Plexams) StudentByMtknr(ctx context.Context, mtknr string, ntas map[string]*model.NTA) (*model.Student, error) { + return p.dbClient.StudentByMtknr(ctx, mtknr, ntas) +} - fmt.Printf("%d. %s: %s\n", ancode, exam.MainExamer, exam.Module) +func (p *Plexams) StudentsByName(ctx context.Context, regex string) ([]*model.Student, error) { + return p.dbClient.StudentsByName(ctx, regex) +} - roomsForExam, err := p.dbClient.RoomsForAncode(ctx, ancode) - if err != nil { - log.Error().Err(err).Int("ancode", ancode).Msg("cannot get rooms") - } - for _, room := range roomsForExam { - fmt.Printf(" - Raum %s\n", room.RoomName) +func (p *Plexams) Students(ctx context.Context) ([]*model.Student, error) { + return p.dbClient.StudentRegsPerStudentPlanned(ctx) +} + +func (p *Plexams) StudentsFromStudentRegs(ctx context.Context, studentRegs []*model.StudentRegsPerAncodeAndProgram) ( + regularStuds, ntaStuds []*model.Student, err error) { + regularStuds = make([]*model.Student, 0) + ntaStuds = make([]*model.Student, 0) + + ntaSlice, err := p.Ntas(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get ntas") + return nil, nil, err + } + + ntas := make(map[string]*model.NTA) + for _, nta := range ntaSlice { + ntas[nta.Mtknr] = nta + } + + for _, program := range studentRegs { + for _, studentReg := range program.StudentRegs { + student, err := p.StudentByMtknr(ctx, studentReg.Mtknr, ntas) + if err != nil { + log.Error().Err(err).Str("mtknr", studentReg.Mtknr).Msg("error while trying to get student") + return nil, nil, err + } + if student.Nta != nil { + ntaStuds = append(ntaStuds, student) + } else { + regularStuds = append(regularStuds, student) + } } + } + if len(ntaStuds) == 0 { + ntaStuds = nil } - return nil + return regularStuds, ntaStuds, nil } diff --git a/plexams/validate.go b/plexams/validate.go index 2eaec27..4fb58cf 100644 --- a/plexams/validate.go +++ b/plexams/validate.go @@ -2,24 +2,58 @@ package plexams import ( "context" + "fmt" "time" set "github.com/deckarep/golang-set/v2" "github.com/gookit/color" + "github.com/logrusorgru/aurora" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" + "github.com/spf13/viper" + "github.com/theckman/yacspin" ) // TODO: Validate if all NTAs have MTKNR -var count = 0 +var ( + count = 0 + knownConflictsCount = 0 +) + +type KnownConflict struct { + Mtknr, Ancode1, Ancode2 string +} func (p *Plexams) ValidateConflicts(onlyPlannedByMe bool, ancode int) error { count = 0 + knownConflictsCount = 0 ctx := context.Background() - color.Style{color.FgRed, color.BgGreen, color.OpBold}.Println(" --- validating conflicts --- ") + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating conflicts")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } - planAncodeEntries, err := p.dbClient.PlanAncodeEntries(ctx) + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) + + spinner.Message(aurora.Sprintf(aurora.Yellow(" get planned ancodes"))) + planAncodeEntries, err := p.dbClient.PlannedAncodes(ctx) if err != nil { log.Error().Err(err).Msg("cannot get plan entries") return err @@ -37,24 +71,67 @@ func (p *Plexams) ValidateConflicts(onlyPlannedByMe bool, ancode int) error { } } - studentRegs, err := p.StudentRegsPerStudentPlanned(ctx) + spinner.Message(aurora.Sprintf(aurora.Yellow(" get student regs"))) + students, err := p.StudentRegsPerStudentPlanned(ctx) if err != nil { log.Error().Err(err).Msg("cannot get student registries per student") return err } - for _, studentReg := range studentRegs { - validateStudentReg(studentReg, planAncodeEntries, planAncodeEntriesNotPlannedByMe, onlyPlannedByMe, ancode) + knownConflicts := set.NewSet[KnownConflict]() + + spinner.Message(aurora.Sprintf(aurora.Yellow(" get known conflicts"))) + knownConflictsConf := viper.Get("knownConflicts.studentRegs") + if knownConflictsConf != nil { + knownConflictsSlice := knownConflictsConf.([]interface{}) + for _, knownConflict := range knownConflictsSlice { + knownConflictSlice := knownConflict.([]interface{}) + knownConflicts.Add(KnownConflict{ + Mtknr: knownConflictSlice[0].(string), + Ancode1: knownConflictSlice[1].(string), + Ancode2: knownConflictSlice[2].(string), + }) + } + } + + log.Debug().Int("count", knownConflicts.Cardinality()).Interface("conflicts", knownConflicts).Msg("found known conflicts") + + spinner.Message(aurora.Sprintf(aurora.Yellow(" validating students"))) + for _, student := range students { + validateStudentReg(student, planAncodeEntries, planAncodeEntriesNotPlannedByMe, onlyPlannedByMe, + knownConflicts, ancode, &validationMessages) + } + + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d known conflicts, but %d problems found"), + knownConflictsCount, len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf("%s\n", msg) + } + + } else { + spinner.StopMessage(aurora.Sprintf(aurora.Green("%d known conflicts, no further problems found"), + knownConflictsCount)) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } } + return nil } -func validateStudentReg(studentReg *model.StudentRegsPerStudent, planAncodeEntries []*model.PlanAncodeEntry, - planAncodeEntriesNotPlannedByMe set.Set[int], onlyPlannedByMe bool, ancode int) { - log.Debug().Str("name", studentReg.Student.Name).Str("mtknr", studentReg.Student.Mtknr).Msg("checking regs for student") +func validateStudentReg(student *model.Student, planAncodeEntries []*model.PlanEntry, + planAncodeEntriesNotPlannedByMe set.Set[int], onlyPlannedByMe bool, knownConflicts set.Set[KnownConflict], ancode int, + validationMessages *[]string) { + log.Debug().Str("name", student.Name).Str("mtknr", student.Mtknr).Msg("checking regs for student") - planAncodeEntriesForStudent := make([]*model.PlanAncodeEntry, 0) - for _, ancode := range studentReg.Ancodes { + planAncodeEntriesForStudent := make([]*model.PlanEntry, 0) + for _, ancode := range student.Regs { for _, planEntry := range planAncodeEntries { if ancode == planEntry.Ancode { planAncodeEntriesForStudent = append(planAncodeEntriesForStudent, planEntry) @@ -63,10 +140,14 @@ func validateStudentReg(studentReg *model.StudentRegsPerStudent, planAncodeEntri } if len(planAncodeEntriesForStudent) == 0 { - log.Debug().Str("name", studentReg.Student.Name).Str("mtknr", studentReg.Student.Mtknr).Msg("no exam for student in plan") + log.Debug().Str("name", student.Name).Str("mtknr", student.Mtknr).Msg("no exam for student in plan") return } + log.Debug().Str("name", student.Name).Str("mtknr", student.Mtknr). + Int("count", len(planAncodeEntriesForStudent)). + Msg("found exams for student in plan") + p := planAncodeEntriesForStudent for i := 0; i < len(planAncodeEntriesForStudent); i++ { for j := i + 1; j < len(planAncodeEntriesForStudent); j++ { @@ -75,6 +156,15 @@ func validateStudentReg(studentReg *model.StudentRegsPerStudent, planAncodeEntri p[i].Ancode == p[j].Ancode { continue } + if knownConflicts.Contains(KnownConflict{ + Mtknr: student.Mtknr, + Ancode1: fmt.Sprint(p[i].Ancode), + Ancode2: fmt.Sprint(p[j].Ancode), + }) { + // fmt.Printf("found known conflict: [%s, %d, %d]\n", student.Mtknr, p[i].Ancode, p[j].Ancode) + knownConflictsCount++ + continue + } if onlyPlannedByMe && planAncodeEntriesNotPlannedByMe.Contains(p[i].Ancode) && planAncodeEntriesNotPlannedByMe.Contains(p[j].Ancode) { @@ -90,31 +180,34 @@ func validateStudentReg(studentReg *model.StudentRegsPerStudent, planAncodeEntri if p[i].DayNumber == p[j].DayNumber && p[i].SlotNumber == p[j].SlotNumber { count++ - color.Red.Printf("%3d. Same slot: ancodes %d (%d, %d) and %d (%d,%d) for student %s (%s/%s)\n", count, + *validationMessages = append(*validationMessages, aurora.Sprintf(aurora.Red(" - [\"%s\", \"%d\", \"%d\"] # %3d. Same slot: ancodes %d (%d, %d) and %d (%d,%d) for student %s (%s/%s)"), + aurora.Magenta(student.Mtknr), aurora.Magenta(p[i].Ancode), aurora.Magenta(p[j].Ancode), count, p[i].Ancode, p[i].DayNumber, p[i].SlotNumber, p[j].Ancode, p[j].DayNumber, p[j].SlotNumber, - studentReg.Student.Name, studentReg.Student.Program, studentReg.Student.Mtknr, - ) + aurora.Cyan(student.Name), aurora.Cyan(student.Program), aurora.Cyan(student.Mtknr), + )) } else // adjacent slots if p[i].DayNumber == p[j].DayNumber && (p[i].SlotNumber+1 == p[j].SlotNumber || p[i].SlotNumber-1 == p[j].SlotNumber) { count++ - color.Red.Printf("%3d. Adjacent slots: ancodes %d (%d, %d) and %d (%d,%d) for student %s (%s/%s)\n", count, + *validationMessages = append(*validationMessages, aurora.Sprintf(aurora.Red(" - [\"%s\", \"%d\", \"%d\"] # %3d. Adjacent slots: ancodes %d (%d, %d) and %d (%d,%d) for student %s (%s/%s)"), + aurora.Magenta(student.Mtknr), aurora.Magenta(p[i].Ancode), aurora.Magenta(p[j].Ancode), count, p[i].Ancode, p[i].DayNumber, p[i].SlotNumber, p[j].Ancode, p[j].DayNumber, p[j].SlotNumber, - studentReg.Student.Name, studentReg.Student.Program, studentReg.Student.Mtknr, - ) + aurora.Cyan(student.Name), aurora.Cyan(student.Program), aurora.Cyan(student.Mtknr), + )) } else // same day if p[i].DayNumber == p[j].DayNumber { count++ - color.Yellow.Printf("%3d. Same day: ancodes %d (%d, %d) and %d (%d,%d) for student %s (%s/%s)\n", count, + *validationMessages = append(*validationMessages, aurora.Sprintf(aurora.Yellow(" - [\"%s\", \"%d\", \"%d\"] # %3d. Same day: ancodes %d (%d, %d) and %d (%d,%d) for student %s (%s/%s)"), + aurora.Magenta(student.Mtknr), aurora.Magenta(p[i].Ancode), aurora.Magenta(p[j].Ancode), count, p[i].Ancode, p[i].DayNumber, p[i].SlotNumber, p[j].Ancode, p[j].DayNumber, p[j].SlotNumber, - studentReg.Student.Name, studentReg.Student.Program, studentReg.Student.Mtknr, - ) + aurora.Cyan(student.Name), aurora.Cyan(student.Program), aurora.Cyan(student.Mtknr), + )) } } } @@ -129,6 +222,11 @@ func (p *Plexams) ValidateConstraints() error { log.Error().Err(err).Msg("cannot get constraints") } + constraintsMap := make(map[int]*model.Constraints) + for _, constraint := range constraints { + constraintsMap[constraint.Ancode] = constraint + } + for _, constraint := range constraints { slot, err := p.SlotForAncode(ctx, constraint.Ancode) if err != nil { @@ -139,12 +237,43 @@ func (p *Plexams) ValidateConstraints() error { continue } + // if len(constraint.SameSlot) > 0 { + for _, otherAncode := range constraint.SameSlot { + log.Debug().Int("ancode", constraint.Ancode).Int("other ancode", otherAncode).Msg("checking same slot") + otherSlot, err := p.SlotForAncode(ctx, otherAncode) + if err != nil { + log.Error().Err(err).Int("ancode", otherAncode).Msg("cannot get slot for other ancode") + } + + if otherSlot == nil { + otherConstraint, ok := constraintsMap[otherAncode] + if ok && otherConstraint.NotPlannedByMe { + continue + } + + color.Red.Printf("Exams %d and %d must be in the same slot, are %v and %v\n", constraint.Ancode, otherAncode, slot, otherSlot) + continue + } + + if *slot != *otherSlot { + color.Red.Printf("Exams %d and %d must be in the same slot, are %v and %v\n", constraint.Ancode, otherAncode, slot, otherSlot) + } + } + // } + if constraint.FixedDay != nil { color.Red.Println("FIXME: FixedDay") } if constraint.FixedTime != nil { - color.Red.Println("FIXME: FixedTime") + log.Debug().Int("ancode", constraint.Ancode).Msg("checking fixed time") + fixed := constraint.FixedTime + if fixed.Day() != slot.Starttime.Day() || + fixed.Month() != slot.Starttime.Month() || + fixed.Local().Hour() != slot.Starttime.Local().Hour() || + fixed.Minute() != slot.Starttime.Minute() { + color.Red.Printf("Exams %d has fixed slot %s, is %s\n", constraint.Ancode, fixed.Format("02.01.06 15:04"), constraint.FixedTime.Format("02.01.06 15:04")) + } } for _, day := range constraint.ExcludeDays { @@ -167,6 +296,7 @@ func (p *Plexams) ValidateConstraints() error { color.Red.Printf("Exam #%d planned on day %s which is not a possible day\n", constraint.Ancode, dayPlanned.Format("02.01.06")) } } + } return nil diff --git a/plexams/validate_db.go b/plexams/validate_db.go new file mode 100644 index 0000000..8529aa9 --- /dev/null +++ b/plexams/validate_db.go @@ -0,0 +1,79 @@ +package plexams + +import ( + "context" + "fmt" + "time" + + "github.com/logrusorgru/aurora" + "github.com/obcode/plexams.go/graph/model" + "github.com/rs/zerolog/log" + "github.com/theckman/yacspin" +) + +// TODO: all planned_rooms okay? especially after moving an exam? check room -> slot -> ancode sameslot? +func (p *Plexams) ValidateDB() error { + ctx := context.Background() + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating data base entries")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) + + planEntries, err := p.dbClient.PlanEntries(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get planEntries") + } + + spinner.Message(aurora.Sprintf(aurora.Yellow(" validating only one plan entry per ancode"))) + planEntryMap := make(map[int]*model.PlanEntry) + for _, planEntry := range planEntries { + otherEntry, ok := planEntryMap[planEntry.Ancode] + if ok { + validationMessages = append(validationMessages, aurora.Sprintf( + aurora.Red("more than one plan entry for ancode %d: %v and %v"), + aurora.Magenta(planEntry.Ancode), + aurora.Cyan(otherEntry), aurora.Cyan(planEntry), + )) + } + } + + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d problems"), + len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf("%s\n", msg) + } + + } else { + spinner.StopMessage(aurora.Sprintf(aurora.Green("%d plan entries are okay"), + len(planEntries))) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + + return nil +} diff --git a/plexams/validate_invigilation.go b/plexams/validate_invigilation.go index 291c644..4a4aba6 100644 --- a/plexams/validate_invigilation.go +++ b/plexams/validate_invigilation.go @@ -4,30 +4,59 @@ import ( "context" "fmt" "sort" + "strings" + "time" set "github.com/deckarep/golang-set/v2" - "github.com/gookit/color" + "github.com/logrusorgru/aurora" + "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" + "github.com/spf13/viper" + "github.com/theckman/yacspin" ) func (p *Plexams) ValidateInvigilatorRequirements() error { - color.Style{color.FgRed, color.BgGreen, color.OpBold}. - Printf(" --- validating invigilator requirements --- \n") + + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating invigilator requirements")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) ctx := context.Background() - invigilationTodos, err := p.InvigilationTodos(ctx) + spinner.Message(aurora.Sprintf(aurora.Magenta("recalculating todos"))) + invigilationTodos, err := p.GetInvigilationTodos(ctx) if err != nil { return err } for _, invigilator := range invigilationTodos.Invigilators { + spinner.Message(aurora.Sprintf(aurora.Cyan("checking %s"), aurora.Magenta(invigilator.Teacher.Fullname))) log.Debug().Str("name", invigilator.Teacher.Shortname).Msg("checking constraints") // days ok for _, invigilationDay := range invigilator.Todos.InvigilationDays { for _, excludedDay := range invigilator.Requirements.ExcludedDays { if invigilationDay == excludedDay { - color.Red.Printf("%s has invigilation on excluded day %d\n", invigilator.Teacher.Shortname, invigilationDay) + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("%s has invigilation on excluded day %d"), + aurora.Magenta(invigilator.Teacher.Fullname), aurora.Cyan(invigilationDay))) } } } @@ -43,8 +72,8 @@ func (p *Plexams) ValidateInvigilatorRequirements() error { } } if !slotOk { - color.Red.Printf("%s has invigilation in not allowed slot [%d,%d]\n", invigilator.Teacher.Shortname, - invigilation.Slot.DayNumber, invigilation.Slot.SlotNumber) + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("%s has invigilation not allowed slot (%d,%d)"), + aurora.Magenta(invigilator.Teacher.Fullname), aurora.Cyan(invigilation.Slot.DayNumber), aurora.Cyan(invigilation.Slot.SlotNumber))) } } } @@ -54,15 +83,15 @@ func (p *Plexams) ValidateInvigilatorRequirements() error { for _, invigilation := range invigilator.Todos.Invigilations { combinedNumber := invigilation.Slot.DayNumber*10 + invigilation.Slot.SlotNumber if invigilationSlots.Contains(combinedNumber) { - color.Red.Printf("%s has more than one invigilation in slot (%d,%d)\n", invigilator.Teacher.Shortname, - invigilation.Slot.DayNumber, invigilation.Slot.SlotNumber) + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("%s has more than one invigilation in slot (%d,%d)"), + aurora.Magenta(invigilator.Teacher.Fullname), aurora.Cyan(invigilation.Slot.DayNumber), aurora.Cyan(invigilation.Slot.SlotNumber))) } invigilationSlots.Add(combinedNumber) } // wenn gleichzeitig Prüfung, dann nur self-invigilation - exams, err := p.dbClient.PlannedExamsByMainExamer(ctx, invigilator.Teacher.ID) + exams, err := p.dbClient.PlannedExamsByMainExamer(ctx, invigilator.Teacher.ID) //nolint if err != nil { log.Error().Err(err).Str("name", invigilator.Teacher.Shortname).Msg("cannot get exams") } @@ -72,8 +101,9 @@ func (p *Plexams) ValidateInvigilatorRequirements() error { if exam.Slot.DayNumber == invigilation.Slot.DayNumber && exam.Slot.SlotNumber == invigilation.Slot.SlotNumber { if invigilation.IsReserve { - color.Red.Printf("%s has reserve invigilation during own exam %d. %s in slot (%d,%d)\n", invigilator.Teacher.Shortname, - exam.Constraints.Ancode, exam.Exam.ZpaExam.Module, exam.Slot.DayNumber, exam.Slot.SlotNumber) + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("%s has reserve invigilation during own exam %d. %s in slot (%d,%d)"), + aurora.Magenta(invigilator.Teacher.Fullname), aurora.Cyan(exam.Constraints.Ancode), aurora.Cyan(exam.Exam.ZpaExam.Module), + aurora.Cyan(invigilation.Slot.DayNumber), aurora.Cyan(invigilation.Slot.SlotNumber))) } roomsForExam, err := p.dbClient.RoomsForAncode(ctx, exam.Exam.Ancode) @@ -86,8 +116,9 @@ func (p *Plexams) ValidateInvigilatorRequirements() error { log.Error().Err(err).Int("ancode", exam.Exam.Ancode).Msg("cannot get rooms for exam") } else { if rooms.Cardinality() > 1 { - color.Red.Printf("%s has invigilation during own exam with more than one room: %d. %s in slot (%d,%d): found rooms %v\n", invigilator.Teacher.Shortname, - exam.Constraints.Ancode, exam.Exam.ZpaExam.Module, exam.Slot.DayNumber, exam.Slot.SlotNumber, rooms) + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("%s has invigilation during own exam with more than one room: %d. %s in slot (%d,%d): found rooms %v"), + aurora.Magenta(invigilator.Teacher.Fullname), aurora.Cyan(exam.Constraints.Ancode), aurora.Cyan(exam.Exam.ZpaExam.Module), + aurora.Cyan(invigilation.Slot.DayNumber), aurora.Cyan(invigilation.Slot.SlotNumber), aurora.Cyan(rooms))) } } @@ -97,20 +128,155 @@ func (p *Plexams) ValidateInvigilatorRequirements() error { } + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d problems found"), + len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf("%s\n", msg) + } + + } else { + spinner.StopMessage(aurora.Sprintf(aurora.Green("no problems found"))) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + + return nil +} +func (p *Plexams) ValidateInvigilationDups() error { + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating invigilator duplicates")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) + + ctx := context.Background() + spinner.Message(aurora.Sprintf(aurora.Magenta("getting all invigilations"))) + invigilations, err := p.dbClient.GetAllInvigilations(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get all invigilations") + return err + } + + type key struct { + room string + day int + slot int + } + + invigilationsMap := make(map[key]*model.Invigilation) + + spinner.Message(aurora.Sprintf(aurora.Cyan("checking %d invigilations"), aurora.Magenta(len(invigilations)))) + for _, invigilation := range invigilations { + var room string + if invigilation.RoomName == nil { + room = "null" + } else { + room = *invigilation.RoomName + } + key := key{ + room: room, + day: invigilation.Slot.DayNumber, + slot: invigilation.Slot.SlotNumber, + } + + _, ok := invigilationsMap[key] + if ok { + var roomName string + if invigilation.RoomName == nil { + roomName = "null" + } else { + roomName = fmt.Sprintf("\"%s\"", *invigilation.RoomName) + } + validationMessages = append(validationMessages, + aurora.Sprintf(aurora.Red("double entry for {roomname: %s, \"slot.daynumber\": %d, \"slot.slotnumber\": %d}"), + aurora.Magenta(roomName), aurora.Cyan(invigilation.Slot.DayNumber), aurora.Cyan(invigilation.Slot.SlotNumber))) + } else { + invigilationsMap[key] = invigilation + } + } + + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d invigilations, %d problems found"), + len(invigilations), len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf("%s\n", msg) + } + + } else { + spinner.StopMessage(aurora.Sprintf(aurora.Green("%d invigilations, no problems found"), len(invigilations))) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + return nil } +// TODO: NTA- und Reserve-Aufsicht (wenn NTA) nicht im folgenden Slot einteilen! func (p *Plexams) ValidateInvigilatorSlots() error { - color.Style{color.FgRed, color.BgGreen, color.OpBold}. - Printf(" --- validating invigilator for all slots --- \n") + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating invigilator for all slots")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) ctx := context.Background() + // count rooms and reserves without and print number roomWithoutInvigilatorDay := make(map[int]int) slotWithoutReserveDay := make(map[int]int) // all rooms and reserve max one invigilator for _, slot := range p.semesterConfig.Slots { + spinner.Message(aurora.Sprintf(aurora.Magenta("checking slot (%d,%d)"), + aurora.Cyan(slot.DayNumber), aurora.Cyan(slot.SlotNumber))) + rooms, err := p.PlannedRoomNamesInSlot(ctx, slot.DayNumber, slot.SlotNumber) if err != nil { log.Error().Err(err).Int("day", slot.DayNumber).Int("slot", slot.SlotNumber).Msg("cannot get rooms for") @@ -126,10 +292,8 @@ func (p *Plexams) ValidateInvigilatorSlots() error { if len(invigilations) == 0 { slotWithoutReserveDay[slot.DayNumber]++ } else if len(invigilations) > 1 { - color.Red.Printf("more than one reserve invigilator in slot (%d,%d): ", slot.DayNumber, slot.SlotNumber) - for _, invigilation := range invigilations { - color.Red.Printf("%d, ", invigilation.InvigilatorID) - } + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("more than one reserve invigilator in slot (%d,%d)"), + aurora.Magenta(slot.DayNumber), aurora.Magenta(slot.SlotNumber))) } for _, room := range rooms { @@ -144,12 +308,8 @@ func (p *Plexams) ValidateInvigilatorSlots() error { if len(invigilations) == 0 { roomWithoutInvigilatorDay[slot.DayNumber]++ } else if len(invigilations) > 1 { - color.Red.Printf("more than one invigilator for room %s in slot (%d,%d): ", room, - slot.DayNumber, slot.SlotNumber) - for _, invigilation := range invigilations { - color.Red.Printf("%d, ", invigilation.InvigilatorID) - } - fmt.Println() + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("more than one invigilator for room %s in slot (%d,%d)"), + aurora.Magenta(room), aurora.Magenta(slot.DayNumber), aurora.Magenta(slot.SlotNumber))) } } } @@ -171,19 +331,193 @@ func (p *Plexams) ValidateInvigilatorSlots() error { slotsWithoutReserve := slotWithoutReserveDay[day] if roomsWithoutInvig+slotsWithoutReserve > 0 { - color.Red.Printf("Day %2d: %2d open invigilations, ", day, roomsWithoutInvig+slotsWithoutReserve) + var msg strings.Builder + msg.WriteString(aurora.Sprintf(aurora.Red("Day %2d: %2d open invigilations, "), + aurora.Magenta(day), aurora.Cyan(roomsWithoutInvig+slotsWithoutReserve))) + if roomsWithoutInvig > 0 { - color.Red.Printf("%2d rooms without invigilator", roomsWithoutInvig) + msg.WriteString(aurora.Sprintf(aurora.Red("%2d rooms without invigilator,"), aurora.Cyan(roomsWithoutInvig))) } else { - fmt.Print(" ") + msg.WriteString(" ") } if slotsWithoutReserve > 0 { - color.Red.Printf(", %2d slots without reserve", slotsWithoutReserve) + msg.WriteString(aurora.Sprintf(aurora.Red("%2d slots without reserve"), aurora.Cyan(slotsWithoutReserve))) + } + + validationMessages = append(validationMessages, msg.String()) + } + } + } + + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d problems found"), + len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf("%s\n", msg) + } + + } else { + spinner.StopMessage(aurora.Sprintf(aurora.Green("no problems found"))) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + + return nil +} + +func (p *Plexams) ValidateInvigilationsTimeDistance() error { + ctx := context.Background() + timelag := viper.GetInt("rooms.timelag") + + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating time lag of invigilations (%d minutes)"), timelag), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) + spinner.Message(aurora.Sprintf(aurora.Yellow("prepare invigilations)"))) + + allInvigilations, err := p.dbClient.GetAllInvigilations(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get all invigilations") + } + + type slot struct { + day int + slot int + } + + invigilations := make(map[slot][]*model.Invigilation) + for _, invigilation := range allInvigilations { + slot := slot{ + day: invigilation.Slot.DayNumber, + slot: invigilation.Slot.SlotNumber, + } + + invigilationsInSlot, ok := invigilations[slot] + if !ok { + invigilationsInSlot = make([]*model.Invigilation, 0, 1) + } + invigilations[slot] = append(invigilationsInSlot, invigilation) + } + + for _, day := range p.semesterConfig.Days { + spinner.Message(aurora.Sprintf(aurora.Yellow("checking day %d (%s)"), day.Number, day.Date.Format("02.01.06"))) + + for i := range p.semesterConfig.Starttimes { + if i == len(p.semesterConfig.Days)-1 { + continue + } + slot1, slot2 := slot{day: day.Number, slot: i + 1}, slot{day: day.Number, slot: i + 2} + log.Debug().Interface("slot 1", slot1).Interface("slot 2", slot2).Msg("checking slot") + + invigilationsSlot1, ok := invigilations[slot1] + if !ok || len(invigilationsSlot1) == 0 { + log.Debug().Interface("slot", slot1).Msg("no invigilations in slot") + continue + } + + invigilationsSlot2, ok := invigilations[slot2] + if !ok || len(invigilationsSlot2) == 0 { + log.Debug().Interface("slot", slot2).Msg("no invigilations in slot") + continue + } + + for _, invigilation1 := range invigilationsSlot1 { + for _, invigilation2 := range invigilationsSlot2 { + if invigilation1.InvigilatorID != invigilation2.InvigilatorID { + continue + } + + startSlot1 := p.getSlotTime(invigilation1.Slot.DayNumber, invigilation1.Slot.SlotNumber) + startSlot2 := p.getSlotTime(invigilation2.Slot.DayNumber, invigilation2.Slot.SlotNumber) + + realtime := invigilation1.Duration // TODO: calculate me + + if invigilation1.IsSelfInvigilation { + roomsInSlot, err := p.dbClient.PlannedRoomsInSlot(ctx, slot1.day, slot1.slot) + if err != nil { + log.Error().Err(err).Interface("slot", slot1).Msg("cannot get rooms in slot") + } + for _, room := range roomsInSlot { + if invigilation1.RoomName == &room.RoomName { + if room.Duration > realtime { + realtime = room.Duration + } + } + } + } + + if invigilation1.IsReserve { + roomsInSlot, err := p.dbClient.PlannedRoomsInSlot(ctx, slot1.day, slot1.slot) + if err != nil { + log.Error().Err(err).Interface("slot", slot1).Msg("cannot get rooms in slot") + } + for _, room := range roomsInSlot { + if room.Duration > realtime { + realtime = room.Duration + } + } + } + + endSlot1 := startSlot1.Add(time.Duration(realtime) * time.Minute) + + if startSlot2.Before(endSlot1.Add(time.Duration(timelag) * time.Minute)) { + comment := "" + if invigilation1.IsReserve { + comment = "(reserve in first slot)" + } + + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red( + "Not enough time for invigilator %4d between slot (%2d/%d) ends %s and slot (%2d/%d) begins %s: %2g minutes between %s"), + aurora.Magenta(invigilation1.InvigilatorID), aurora.BrightBlue(day.Number), aurora.BrightBlue(slot1.slot), aurora.Magenta(endSlot1.Format("15:04")), + aurora.BrightBlue(day.Number), aurora.BrightBlue(slot2.slot), aurora.Magenta(startSlot2.Format("15:04")), + aurora.Magenta(startSlot2.Sub(endSlot1).Minutes()), aurora.Cyan(comment), + )) + } } - fmt.Println() } } } + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d problems found"), len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf(" ↪ %s\n", msg) + } + + } else { + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + return nil } diff --git a/plexams/validate_rooms.go b/plexams/validate_rooms.go index 7d552ce..1ed0430 100644 --- a/plexams/validate_rooms.go +++ b/plexams/validate_rooms.go @@ -2,34 +2,63 @@ package plexams import ( "context" - "math" + "fmt" "strings" "time" set "github.com/deckarep/golang-set/v2" - "github.com/gookit/color" + "github.com/logrusorgru/aurora" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" "github.com/spf13/viper" + "github.com/theckman/yacspin" ) func (p *Plexams) ValidateRoomsPerSlot() error { ctx := context.Background() - color.Style{color.FgRed, color.BgGreen, color.OpBold}.Println(" --- validating rooms per slot --- ") + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating rooms per slot (allowed and enough seats)")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) slots := p.semesterConfig.Slots for _, slot := range slots { - plannedRooms, err := p.dbClient.RoomsPlannedInSlot(ctx, slot.DayNumber, slot.SlotNumber) + + plannedExams, err := p.dbClient.GetExamsInSlot(ctx, slot.DayNumber, slot.SlotNumber) if err != nil { log.Error().Err(err). Int("day", slot.DayNumber). Int("time", slot.SlotNumber). - Msg("error while getting rooms planned in slot") + Msg("error while getting exams planned in slot") return err } - // color.Style{color.FgRed, color.BgGreen, color.OpBold}.Println(" --- check if planned rooms are allowed in slot ") + plannedRooms := make([]*model.PlannedRoom, 0) + for _, plannedExam := range plannedExams { + plannedRooms = append(plannedRooms, plannedExam.PlannedRooms...) + } + + spinner.Message(aurora.Sprintf(aurora.Yellow("checking slot (%d/%d) with %d rooms in %d exams"), + slot.DayNumber, slot.SlotNumber, len(plannedRooms), len(plannedExams))) allowedRooms, err := p.RoomsForSlot(ctx, slot.DayNumber, slot.SlotNumber) if err != nil { @@ -46,8 +75,14 @@ func (p *Plexams) ValidateRoomsPerSlot() error { allowedRooms.NtaRooms...)...)...) for _, plannedRoom := range plannedRooms { - if plannedRoom.RoomName == "ONLINE" || plannedRoom.RoomName == "No Room" { - break + if plannedRoom.RoomName == "ONLINE" { + continue + } + + if plannedRoom.RoomName == "No Room" { + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("No Room for %d students in slot (%d/%d)"), + aurora.Magenta(len(plannedRoom.StudentsInRoom)), aurora.Blue(slot.DayNumber), aurora.Blue(slot.SlotNumber))) + continue } isAllowed := false @@ -58,12 +93,11 @@ func (p *Plexams) ValidateRoomsPerSlot() error { } } if !isAllowed { - color.Red.Printf("Room %s is not allowed in slot (%d,%d)\n", plannedRoom.RoomName, slot.DayNumber, slot.SlotNumber) + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("Room %s is not allowed in slot (%d/%d)"), + aurora.Magenta(plannedRoom.RoomName), aurora.Blue(slot.DayNumber), aurora.Blue(slot.SlotNumber))) } } - // color.Style{color.FgRed, color.BgGreen, color.OpBold}.Println(" --- check if seatsPlanned <= seats ") - type roomSeats struct { seatsPlanned, seats int } @@ -78,94 +112,249 @@ func (p *Plexams) ValidateRoomsPerSlot() error { } if !ok { - seats[plannedRoom.RoomName] = roomSeats{seatsPlanned: plannedRoom.SeatsPlanned, seats: p.GetRoomInfo(plannedRoom.RoomName).Seats} + seats[plannedRoom.RoomName] = roomSeats{seatsPlanned: len(plannedRoom.StudentsInRoom), seats: p.GetRoomInfo(plannedRoom.RoomName).Seats} } else { - seats[plannedRoom.RoomName] = roomSeats{seatsPlanned: plannedRoom.SeatsPlanned + entry.seatsPlanned, seats: p.GetRoomInfo(plannedRoom.RoomName).Seats} + seats[plannedRoom.RoomName] = roomSeats{seatsPlanned: len(plannedRoom.StudentsInRoom) + entry.seatsPlanned, seats: p.GetRoomInfo(plannedRoom.RoomName).Seats} } } for roomName, roomSeats := range seats { if roomSeats.seatsPlanned > roomSeats.seats { - color.Red.Printf("Room %s is overbooked in slot (%d, %d): %d seats planned, but only %d available \n", - roomName, slot.DayNumber, slot.SlotNumber, roomSeats.seatsPlanned, roomSeats.seats) + validationMessages = append(validationMessages, + aurora.Sprintf(aurora.Red("Room %s is overbooked in slot (%d/%d): %d seats planned, but only %d available"), + aurora.Magenta(roomName), aurora.Blue(slot.DayNumber), aurora.Blue(slot.SlotNumber), + aurora.Cyan(roomSeats.seatsPlanned), aurora.Cyan(roomSeats.seats))) } } } + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d problems found"), len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf(" ↪ %s\n", msg) + } + + } else { + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + + return nil +} +func (p *Plexams) ValidateRoomsNeedRequest() error { + ctx := context.Background() + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating rooms which needs requests")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) + + roomTimetables, err := p.GetReservations() + if err != nil { + log.Error().Err(err).Msg("cannot get reservations") + return err + } + + bookedEntries, err := p.ExahmRoomsFromBooked() + if err != nil { + log.Error().Err(err).Msg("cannot get booked entries") + return err + } + + for _, bookedEntry := range bookedEntries { + for _, roomName := range bookedEntry.Rooms { + timeRanges, ok := roomTimetables[roomName] + if !ok { + timeRanges = make([]TimeRange, 0, 1) + } + roomTimetables[roomName] = append(timeRanges, TimeRange{ + From: bookedEntry.From, + Until: bookedEntry.Until, + }) + } + } + + log.Debug().Interface("timetables", roomTimetables).Msg("found booked and reserved rooms") + + plannedRooms, err := p.PlannedRooms(ctx) + if err != nil { + log.Error().Err(err).Msg("cannot get all planned rooms") + } + + reservationFound := 0 + +PLANNEDROOM: + for _, plannedRoom := range plannedRooms { + + if !p.roomInfo[plannedRoom.RoomName].NeedsRequest { + log.Debug().Str("room", plannedRoom.RoomName).Msg("room needs no request") + continue + } + + spinner.Message(aurora.Sprintf(aurora.Yellow("checking room %s in slot (%d/%d)"), + plannedRoom.RoomName, plannedRoom.Day, plannedRoom.Slot)) + + startTime := p.getSlotTime(plannedRoom.Day, plannedRoom.Slot).Local() + endTime := startTime.Add(time.Duration(plannedRoom.Duration) * time.Minute) + + for _, timerange := range roomTimetables[plannedRoom.RoomName] { + if timerange.From.Before(startTime) && timerange.Until.After(endTime) { + log.Debug().Str("room", plannedRoom.RoomName).Msg("found reservation") + reservationFound++ + continue PLANNEDROOM + } + } + + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("No Reservation for room %s found in slot (%d/%d)"), + aurora.Magenta(plannedRoom.RoomName), aurora.Blue(plannedRoom.Day), aurora.Blue(plannedRoom.Slot))) + } + + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d problems found"), len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf(" ↪ %s\n", msg) + } + + } else { + spinner.StopMessage(aurora.Sprintf(aurora.Green("found %d reservations"), reservationFound)) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + return nil } func (p *Plexams) ValidateRoomsPerExam() error { ctx := context.Background() - color.Style{color.FgRed, color.BgGreen, color.OpBold}.Println(" --- validating rooms per exam --- ") + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating rooms per exam")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) - exams, err := p.ExamsInPlan(ctx) + exams, err := p.PlannedExams(ctx) if err != nil { log.Error().Err(err).Msg("cannot get exams in plan") } for _, exam := range exams { + if exam.PlanEntry == nil { + continue + } + + if exam.Constraints != nil && exam.Constraints.NotPlannedByMe { + continue + } + + spinner.Message(aurora.Sprintf(aurora.Yellow("checking rooms for %d. %s (%s) with %d students and %d ntas"), + exam.Ancode, exam.ZpaExam.Module, exam.ZpaExam.MainExamer, exam.StudentRegsCount, len(exam.Ntas))) // check if each student has a room allStudentRegs := make([]*model.StudentReg, 0) - for _, regs := range exam.Exam.StudentRegs { - allStudentRegs = append(allStudentRegs, regs.StudentRegs...) + for _, primussExam := range exam.PrimussExams { + allStudentRegs = append(allStudentRegs, primussExam.StudentRegs...) } - rooms, err := p.dbClient.RoomsForAncode(ctx, exam.Exam.Ancode) - if err != nil { - log.Error().Err(err).Int("andoce", exam.Exam.Ancode).Msg("cannot get rooms for ancode") - return err - } + // rooms, err := p.dbClient.RoomsForAncode(ctx, exam.Exam.Ancode) + // if err != nil { + // log.Error().Err(err).Int("ancode", exam.Exam.Ancode).Msg("cannot get rooms for ancode") + // return err + // } - allStudentsInRooms := make([]*model.StudentReg, 0) - for _, room := range rooms { + allStudentsInRooms := make([]string, 0) + for _, room := range exam.PlannedRooms { if room.RoomName != "No Room" { - allStudentsInRooms = append(allStudentsInRooms, room.Students...) + allStudentsInRooms = append(allStudentsInRooms, room.StudentsInRoom...) } } for _, studentReg := range allStudentRegs { studentHasSeat := false - for _, studentInRoom := range allStudentsInRooms { - if studentReg.Mtknr == studentInRoom.Mtknr { + for _, mtknr := range allStudentsInRooms { + if studentReg.Mtknr == mtknr { studentHasSeat = true break } } if !studentHasSeat { - color.Red.Printf("Student %s (%s) has no seat for exam %d. %s: %s in slot (%d,%d)\n", - studentReg.Name, studentReg.Mtknr, exam.Exam.Ancode, exam.Exam.ZpaExam.MainExamer, exam.Exam.ZpaExam.Module, - exam.Slot.DayNumber, exam.Slot.SlotNumber) + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("Student %s (%s) has no seat for exam %d. %s (%s) in slot (%d,%d)"), + aurora.Magenta(studentReg.Name), aurora.Magenta(studentReg.Mtknr), aurora.Cyan(exam.Ancode), aurora.Cyan(exam.ZpaExam.Module), aurora.Cyan(exam.ZpaExam.MainExamer), + aurora.BrightBlue(exam.PlanEntry.DayNumber), aurora.BrightBlue(exam.PlanEntry.SlotNumber))) } } // check if room constraints of exams are met if exam.Constraints != nil && exam.Constraints.RoomConstraints != nil { if exam.Constraints.RoomConstraints.ExahmRooms { - for _, room := range rooms { + for _, room := range exam.PlannedRooms { if !p.GetRoomInfo(room.RoomName).Exahm { - color.Red.Printf("Is not Exahm-Room %s for exam %d. %s: %s in slot (%d,%d)\n", - room.RoomName, exam.Exam.Ancode, exam.Exam.ZpaExam.MainExamer, exam.Exam.ZpaExam.Module, - exam.Slot.DayNumber, exam.Slot.SlotNumber) + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("Is not an exahm room %s for exam %d. %s (%s) in slot (%d,%d)"), + aurora.Magenta(room.RoomName), aurora.Cyan(exam.Ancode), aurora.Cyan(exam.ZpaExam.Module), aurora.Cyan(exam.ZpaExam.MainExamer), + aurora.BrightBlue(exam.PlanEntry.DayNumber), aurora.BrightBlue(exam.PlanEntry.SlotNumber))) } } } if exam.Constraints.RoomConstraints.Lab { - for _, room := range rooms { + for _, room := range exam.PlannedRooms { if !p.GetRoomInfo(room.RoomName).Lab { - color.Red.Printf("Is not Lab %s for exam %d. %s: %s in slot (%d,%d)\n", - room.RoomName, exam.Exam.Ancode, exam.Exam.ZpaExam.MainExamer, exam.Exam.ZpaExam.Module, - exam.Slot.DayNumber, exam.Slot.SlotNumber) + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("Is not a lab %s for exam %d. %s (%s) in slot (%d,%d)"), + aurora.Magenta(room.RoomName), aurora.Cyan(exam.Ancode), aurora.Cyan(exam.ZpaExam.Module), aurora.Cyan(exam.ZpaExam.MainExamer), + aurora.BrightBlue(exam.PlanEntry.DayNumber), aurora.BrightBlue(exam.PlanEntry.SlotNumber))) } } } if exam.Constraints.RoomConstraints.PlacesWithSocket { - for _, room := range rooms { + for _, room := range exam.PlannedRooms { if !p.GetRoomInfo(room.RoomName).PlacesWithSocket && !p.GetRoomInfo(room.RoomName).Lab { - color.Red.Printf("Is not Room with sockets %s for exam %d. %s: %s in slot (%d,%d)\n", - room.RoomName, exam.Exam.Ancode, exam.Exam.ZpaExam.MainExamer, exam.Exam.ZpaExam.Module, - exam.Slot.DayNumber, exam.Slot.SlotNumber) + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("Is not a room with places with sockets %s for exam %d. %s (%s) in slot (%d,%d)"), + aurora.Magenta(room.RoomName), aurora.Cyan(exam.Ancode), aurora.Cyan(exam.ZpaExam.Module), aurora.Cyan(exam.ZpaExam.MainExamer), + aurora.BrightBlue(exam.PlanEntry.DayNumber), aurora.BrightBlue(exam.PlanEntry.SlotNumber))) } } } @@ -173,81 +362,84 @@ func (p *Plexams) ValidateRoomsPerExam() error { // check rooms for NTAs // - needsRoomAlone okay - // - TODO: enough time between usage - - if exam.Nta != nil { - plannedRooms, err := p.dbClient.RoomsPlannedInSlot(ctx, exam.Slot.DayNumber, exam.Slot.SlotNumber) - if err != nil { - log.Error().Err(err). - Int("day", exam.Slot.DayNumber). - Int("time", exam.Slot.SlotNumber). - Msg("error while getting rooms planned in slot") - return err - } - - for _, nta := range exam.Nta { - if nta.Nta.NeedsRoomAlone { - var roomForNta *model.RoomForExam - for _, room := range plannedRooms { - for _, student := range room.Students { - if student.Mtknr == nta.Nta.Mtknr { - roomForNta = room - break - } + if len(exam.Ntas) > 0 { + spinner.Message(aurora.Sprintf(aurora.Yellow("checking rooms for ntas"))) + for _, nta := range exam.Ntas { + if nta.NeedsRoomAlone { + var roomForNta *model.PlannedRoom + for _, room := range exam.PlannedRooms { + if room.NtaMtknr != nil && *room.NtaMtknr == nta.Mtknr { + roomForNta = room + break } } OUTER: - for _, room := range plannedRooms { + for _, room := range exam.PlannedRooms { if room.RoomName == roomForNta.RoomName { - for _, student := range room.Students { - if student.Mtknr != nta.Nta.Mtknr { - color.Red.Printf("NTA %s has room %s not alone for exam %d. %s: %s in slot (%d,%d)\n", - nta.Nta.Name, room.RoomName, exam.Exam.Ancode, exam.Exam.ZpaExam.MainExamer, exam.Exam.ZpaExam.Module, - exam.Slot.DayNumber, exam.Slot.SlotNumber) + for _, mtknr := range room.StudentsInRoom { + if mtknr != nta.Mtknr { + validationMessages = append(validationMessages, aurora.Sprintf(aurora.Red("NTA %s has room %s not alone for exam %d. %s (%s) in slot (%d,%d)"), + aurora.Magenta(nta.Name), aurora.Magenta(room.RoomName), aurora.Cyan(exam.Ancode), aurora.Cyan(exam.ZpaExam.Module), aurora.Cyan(exam.ZpaExam.MainExamer), + aurora.BrightBlue(exam.PlanEntry.DayNumber), aurora.BrightBlue(exam.PlanEntry.SlotNumber))) break OUTER } } } } - } else /* do not need room alone */ { - var roomForNta *model.RoomForExam - for _, room := range plannedRooms { - for _, student := range room.Students { - if student.Mtknr == nta.Nta.Mtknr { - roomForNta = room - break - } - } - } - if roomForNta == nil { - color.Red.Printf("NTA %s has no room for exam %d. %s: %s in slot (%d,%d)\n", - nta.Nta.Name, exam.Exam.Ancode, exam.Exam.ZpaExam.MainExamer, exam.Exam.ZpaExam.Module, - exam.Slot.DayNumber, exam.Slot.SlotNumber) - } else { - ntaDuration := int(math.Ceil(float64((exam.Exam.ZpaExam.Duration * (100 + nta.Nta.DeltaDurationPercent))) / 100)) - if roomForNta.Duration != ntaDuration { - color.Red.Printf("NTA %s has room %s without correct duration %d for exam %d. %s: %s in slot (%d,%d): found %d\n", - nta.Nta.Name, roomForNta.RoomName, ntaDuration, exam.Exam.Ancode, exam.Exam.ZpaExam.MainExamer, exam.Exam.ZpaExam.Module, - exam.Slot.DayNumber, exam.Slot.SlotNumber, roomForNta.Duration) - } - } } } } - } + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d problems found"), len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf(" ↪ %s\n", msg) + } + + } else { + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } return nil } func (p *Plexams) ValidateRoomsTimeDistance() error { ctx := context.Background() timelag := viper.GetInt("rooms.timelag") - color.Style{color.FgRed, color.BgGreen, color.OpBold}. - Printf(" --- validating time lag of planned rooms (%d minutes) --- \n", timelag) + + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating time lag of planned rooms (%d minutes)"), timelag), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) for _, day := range p.semesterConfig.Days { - log.Debug().Interface("day", day).Msg("checking day") + spinner.Message(aurora.Sprintf(aurora.Yellow("checking day %d (%s)"), day.Number, day.Date.Format("02.01.06"))) + for i := range p.semesterConfig.Starttimes { if i == len(p.semesterConfig.Days)-1 { continue @@ -255,7 +447,7 @@ func (p *Plexams) ValidateRoomsTimeDistance() error { slot1, slot2 := i+1, i+2 log.Debug().Int("slot 1", slot1).Int("slot 2", slot2).Msg("checking slot") - plannedRoomsSlot1, err := p.dbClient.RoomsPlannedInSlot(ctx, day.Number, slot1) + plannedRoomsSlot1, err := p.dbClient.PlannedRoomsInSlot(ctx, day.Number, slot1) if err != nil { log.Error().Err(err). Int("day", day.Number). @@ -276,7 +468,7 @@ func (p *Plexams) ValidateRoomsTimeDistance() error { } } - plannedRoomsSlot2, err := p.dbClient.RoomsPlannedInSlot(ctx, day.Number, slot2) + plannedRoomsSlot2, err := p.dbClient.PlannedRoomsInSlot(ctx, day.Number, slot2) if err != nil { log.Error().Err(err). Int("day", day.Number). @@ -313,16 +505,33 @@ func (p *Plexams) ValidateRoomsTimeDistance() error { diff := time.Duration(timelag) * time.Minute if startSlot2.Before(endSlot1.Add(diff)) { - color.Red.Printf("Not enough time in room %s between slot (%d, %d) ends %s and slot (%d,%d) begins %s: %g minutes between\n", - roomName, day.Number, slot1, endSlot1.Format("15:04"), day.Number, slot2, startSlot2.Format("15:04"), - startSlot2.Sub(endSlot1).Minutes()) + validationMessages = append(validationMessages, aurora.Sprintf( + "Not enough time in room %s between slot (%d/%d) ends %s and slot (%d/%d) begins %s: %g minutes between", + aurora.Magenta(roomName), aurora.BrightBlue(day.Number), aurora.BrightBlue(slot1), aurora.Magenta(endSlot1.Format("15:04")), + aurora.BrightBlue(day.Number), aurora.BrightBlue(slot2), aurora.Magenta(startSlot2.Format("15:04")), + aurora.Magenta(startSlot2.Sub(endSlot1).Minutes()), + )) } - } } + } + } + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d problems found"), len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf(" ↪ %s\n", msg) } + } else { + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } } return nil diff --git a/plexams/validate_zpa.go b/plexams/validate_zpa.go index 42fb1a6..ae0510d 100644 --- a/plexams/validate_zpa.go +++ b/plexams/validate_zpa.go @@ -2,14 +2,42 @@ package plexams import ( "context" + "fmt" "strings" + "time" "github.com/gookit/color" + "github.com/logrusorgru/aurora" "github.com/obcode/plexams.go/graph/model" "github.com/rs/zerolog/log" + "github.com/theckman/yacspin" ) func (p *Plexams) ValidateZPADateTimes() error { + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating zpa dates and times")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) + + spinner.Message(aurora.Sprintf(aurora.Yellow("fetching exams from ZPA"))) if err := p.SetZPA(); err != nil { return err } @@ -21,75 +49,144 @@ func (p *Plexams) ValidateZPADateTimes() error { examsMap[exam.AnCode] = exam } - plannedExams, err := p.ExamsInPlan(context.Background()) + spinner.Message(aurora.Sprintf(aurora.Yellow("fetching planned exams from db"))) + plannedExams, err := p.PlannedExams(context.Background()) if err != nil { return err } - problems := 0 + notPlannedByMe := 0 for _, plannedExam := range plannedExams { - zpaExam := examsMap[plannedExam.Exam.Ancode] - delete(examsMap, plannedExam.Exam.Ancode) + spinner.Message(aurora.Sprintf(aurora.Yellow("checking exam %d. %s (%s)"), + plannedExam.Ancode, plannedExam.ZpaExam.Module, plannedExam.ZpaExam.MainExamer)) + zpaExam := examsMap[plannedExam.ZpaExam.AnCode] + delete(examsMap, plannedExam.ZpaExam.AnCode) + + shouldHaveNoTimeAndDate := false + if plannedExam.Constraints != nil && plannedExam.Constraints.NotPlannedByMe { + shouldHaveNoTimeAndDate = true + notPlannedByMe++ + } - plannedExamDate := plannedExam.Slot.Starttime.Local().Format("2006-01-02") - plannedExamStarttime := plannedExam.Slot.Starttime.Local().Format("15:04:05") + if zpaExam == nil { + log.Error().Int("ancode", plannedExam.ZpaExam.AnCode).Str("examer", plannedExam.ZpaExam.MainExamer). + Str("module", plannedExam.ZpaExam.Module).Msg("zpa exam not found") + continue + } + + plannedExamDate := "-" + plannedExamStarttime := "-" + if !shouldHaveNoTimeAndDate && plannedExam.PlanEntry != nil { + starttime := p.getSlotTime(plannedExam.PlanEntry.DayNumber, plannedExam.PlanEntry.SlotNumber) + plannedExamDate = starttime.Local().Format("2006-01-02") + plannedExamStarttime = starttime.Local().Format("15:04:05") + } if zpaExam.Date != plannedExamDate || zpaExam.Starttime != plannedExamStarttime { - problems++ - color.Red.Printf("wrong date for %d. %s: %s\nwant: %s %s\ngot: %s %s\n", - plannedExam.Exam.Ancode, plannedExam.Exam.ZpaExam.MainExamer, plannedExam.Exam.ZpaExam.Module, - plannedExamDate, plannedExamStarttime, - zpaExam.Date, zpaExam.Starttime) + validationMessages = append(validationMessages, aurora.Sprintf( + aurora.Red("wrong date for %d. %s (%s), want: %s %s, got: %s %s"), + aurora.Cyan(zpaExam.AnCode), aurora.Cyan(zpaExam.Module), aurora.Cyan(zpaExam.MainExamer), + aurora.Green(plannedExamDate), aurora.Green(plannedExamStarttime), + aurora.Magenta(zpaExam.Date), aurora.Magenta(zpaExam.Starttime), + )) } } - if problems == 0 { - color.Green.Printf("all %d planned exams in zpa with correct date/time\n", len(plannedExams)) - } - - problems = 0 - for _, zpaExam := range examsMap { if zpaExam.Date != "-" || zpaExam.Starttime != "-" { - problems++ - color.Red.Printf("exam %d. %s: %s has date %s %s, but should not", - zpaExam.AnCode, zpaExam.MainExamer, zpaExam.Module, - zpaExam.Date, zpaExam.Starttime) + validationMessages = append(validationMessages, aurora.Sprintf( + aurora.Red("exam %d. %s (%s) has date %s %s, but should not be planned"), + aurora.Cyan(zpaExam.AnCode), aurora.Cyan(zpaExam.Module), aurora.Cyan(zpaExam.MainExamer), + aurora.Magenta(zpaExam.Date), aurora.Magenta(zpaExam.Starttime))) } } - if problems == 0 { - color.Green.Printf("all %d not planned exams in zpa without date/time\n", len(examsMap)) + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d problems found"), len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf(" ↪ %s\n", msg) + } + + } else { + spinner.StopMessage(aurora.Sprintf( + aurora.Green("%d planned exams (%d not planned by me) & %d not planned are correct"), + len(plannedExams), notPlannedByMe, len(examsMap))) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } } return nil } func (p *Plexams) ValidateZPARooms() error { + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating zpa rooms")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) + + spinner.Message(aurora.Sprintf(aurora.Yellow("fetching exams from ZPA"))) + if err := p.SetZPA(); err != nil { + return err + } + plannedExamsFromZPA, err := p.zpa.client.GetPlannedExams() if err != nil { return err } - plannedExams, err := p.ExamsInPlan(context.Background()) + spinner.Message(aurora.Sprintf(aurora.Yellow("fetching planned exams from db"))) + plannedExams, err := p.PlannedExams(context.Background()) if err != nil { return err } - problems := 0 + notPlannedByMe := 0 + roomsChecked := 0 // check if plexams data is on zpa for _, plannedExam := range plannedExams { - roomsForAncode, err := p.dbClient.RoomsForAncode(context.Background(), plannedExam.Exam.Ancode) + if plannedExam.Constraints != nil && plannedExam.Constraints.NotPlannedByMe { + notPlannedByMe++ + continue + } + spinner.Message(aurora.Sprintf(aurora.Yellow("checking exam %d. %s (%s)"), + plannedExam.Ancode, plannedExam.ZpaExam.Module, plannedExam.ZpaExam.MainExamer)) + + roomsForAncode, err := p.dbClient.PlannedRoomsForAncode(context.Background(), plannedExam.Ancode) if err != nil { - log.Error().Err(err).Int("ancode", plannedExam.Exam.Ancode).Msg("cannot get planned rooms for ancode") + log.Error().Err(err).Int("ancode", plannedExam.Ancode).Msg("cannot get planned rooms for ancode") } for _, room := range roomsForAncode { if room.RoomName == "No Room" { continue } + roomsChecked++ found := false for _, zpaExam := range plannedExamsFromZPA { if room.Ancode == zpaExam.Ancode && @@ -97,21 +194,40 @@ func (p *Plexams) ValidateZPARooms() error { room.Duration == zpaExam.Duration && room.Handicap == zpaExam.IsHandicap && room.Reserve == zpaExam.IsReserve && - (room.SeatsPlanned == zpaExam.Number || zpaExam.RoomName == "ONLINE") { + (len(room.StudentsInRoom) <= zpaExam.Number || // if more than one NTA in the room + zpaExam.RoomName == "ONLINE") { found = true break } } if !found { - problems++ - color.Red.Printf("room not found in ZPA\n %+v\n", room) + validationMessages = append(validationMessages, aurora.Sprintf( + aurora.Red("room %s for exam %d. %s (%s) not found in ZPA"), + aurora.Magenta(room.RoomName), + aurora.Cyan(plannedExam.Ancode), aurora.Cyan(plannedExam.ZpaExam.Module), aurora.Cyan(plannedExam.ZpaExam.MainExamer))) } } } - if problems == 0 { - color.Green.Println("all rooms planned found in zpa") + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d problems found"), len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf(" ↪ %s\n", msg) + } + + } else { + spinner.StopMessage(aurora.Sprintf( + aurora.Green("%d planned exams (%d not planned by me) with %d room entries are correct"), + len(plannedExams), notPlannedByMe, roomsChecked)) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } } // TODO: check if zpa data is in plexams @@ -123,69 +239,147 @@ func (p *Plexams) ValidateZPARooms() error { } func (p *Plexams) ValidateZPAInvigilators() error { - ctx := context.Background() + cfg := yacspin.Config{ + Frequency: 100 * time.Millisecond, + CharSet: yacspin.CharSets[69], + Suffix: aurora.Sprintf(aurora.Cyan(" validating zpa invigilations")), + SuffixAutoColon: true, + StopCharacter: "✓", + StopColors: []string{"fgGreen"}, + StopFailMessage: "error", + StopFailCharacter: "✗", + StopFailColors: []string{"fgRed"}, + } + + spinner, err := yacspin.New(cfg) + if err != nil { + log.Debug().Err(err).Msg("cannot create spinner") + } + err = spinner.Start() + if err != nil { + log.Debug().Err(err).Msg("cannot start spinner") + } + + validationMessages := make([]string, 0) + + spinner.Message(aurora.Sprintf(aurora.Yellow("fetching exams from ZPA"))) + if err := p.SetZPA(); err != nil { + return err + } + plannedExamsFromZPA, err := p.zpa.client.GetPlannedExams() if err != nil { return err } - plannedExams, err := p.ExamsInPlan(ctx) + spinner.Message(aurora.Sprintf(aurora.Yellow("fetching planned exams from db"))) + plannedExams, err := p.PlannedExams(context.Background()) if err != nil { return err } - problems := 0 + ctx := context.Background() + // plannedExamsFromZPA, err := p.zpa.client.GetPlannedExams() + // if err != nil { + // return err + // } + + // plannedExams, err := p.ExamsInPlan(ctx) + // if err != nil { + // return err + // } + + // problems := 0 // check if plexams data is on zpa + notPlannedByMe := 0 + for _, plannedExam := range plannedExams { - roomsForAncode, err := p.dbClient.RoomsForAncode(ctx, plannedExam.Exam.Ancode) - if err != nil { - log.Error().Err(err).Int("ancode", plannedExam.Exam.Ancode).Msg("cannot get planned rooms for ancode") - problems++ + if plannedExam.Constraints != nil && plannedExam.Constraints.NotPlannedByMe { + notPlannedByMe++ + continue } - reserveInvigilator, err := p.GetInvigilatorInSlot(ctx, "reserve", plannedExam.Slot.DayNumber, plannedExam.Slot.SlotNumber) + + spinner.Message(aurora.Sprintf(aurora.Yellow("checking exam %d. %s (%s)"), + plannedExam.Ancode, plannedExam.ZpaExam.Module, plannedExam.ZpaExam.MainExamer)) + + roomsForAncode := plannedExam.PlannedRooms + reserveInvigilator, err := p.GetInvigilatorInSlot(ctx, "reserve", plannedExam.PlanEntry.DayNumber, plannedExam.PlanEntry.SlotNumber) if err != nil { - log.Error().Err(err).Int("day", plannedExam.Slot.DayNumber).Int("slot", plannedExam.Slot.SlotNumber). + log.Error().Err(err).Int("day", plannedExam.PlanEntry.DayNumber).Int("slot", plannedExam.PlanEntry.SlotNumber). Msg("cannot get reserve invigilator for slot") - problems++ } for _, room := range roomsForAncode { if room.RoomName == "No Room" { continue } - invigilator, err := p.GetInvigilatorInSlot(ctx, room.RoomName, plannedExam.Slot.DayNumber, plannedExam.Slot.SlotNumber) + invigilator, err := p.GetInvigilatorInSlot(ctx, room.RoomName, plannedExam.PlanEntry.DayNumber, plannedExam.PlanEntry.SlotNumber) if err != nil { - log.Error().Err(err).Int("day", plannedExam.Slot.DayNumber).Int("slot", plannedExam.Slot.SlotNumber). + log.Error().Err(err).Int("day", plannedExam.PlanEntry.DayNumber).Int("slot", plannedExam.PlanEntry.SlotNumber). Msg("cannot get reserve invigilator for slot") - problems++ } found := false for _, zpaExam := range plannedExamsFromZPA { if room.Ancode == zpaExam.Ancode && - roomNameOK(room.RoomName, zpaExam.RoomName) && - zpaExam.ReserveSupervisor == reserveInvigilator.Shortname && - zpaExam.Supervisor == invigilator.Shortname { + roomNameOK(room.RoomName, zpaExam.RoomName) { + if zpaExam.ReserveSupervisor != reserveInvigilator.Shortname { + validationMessages = append(validationMessages, + aurora.Sprintf(aurora.Red("%d. %s (%s), %s %s: wrong reserve invigilator in zpa: %s, wanted: %s"), + aurora.Magenta(zpaExam.Ancode), aurora.Magenta(zpaExam.Module), aurora.Magenta(zpaExam.MainExamer), + aurora.Magenta(zpaExam.Date), aurora.Magenta(zpaExam.Starttime), + aurora.Cyan(zpaExam.ReserveSupervisor), aurora.Cyan(reserveInvigilator.Shortname))) + } + if zpaExam.Supervisor != invigilator.Shortname { + validationMessages = append(validationMessages, + aurora.Sprintf(aurora.Red("%d. %s (%s), %s %s: wrong invigilator in zpa: %s, wanted: %s"), + aurora.Magenta(zpaExam.Ancode), aurora.Magenta(zpaExam.Module), aurora.Magenta(zpaExam.MainExamer), + aurora.Magenta(zpaExam.Date), aurora.Magenta(zpaExam.Starttime), + aurora.Magenta(zpaExam.Supervisor), aurora.Cyan(invigilator.Shortname))) + } found = true - break } } if !found { - problems++ + validationMessages = append(validationMessages, + aurora.Sprintf(aurora.Red("%d. %s (%s), (%d/%d): ancode or room not found"), + aurora.Magenta(plannedExam.Ancode), aurora.Magenta(plannedExam.ZpaExam.Module), aurora.Magenta(plannedExam.ZpaExam.MainExamer), + aurora.Magenta(plannedExam.PlanEntry.DayNumber), aurora.Magenta(plannedExam.PlanEntry.SlotNumber))) color.Red.Printf("supervisor or reserve supervisor not found in ZPA\n %+v\n", room) } } } - if problems == 0 { - color.Green.Println("all invigilators planned found in zpa") - } + // if problems == 0 { + // color.Green.Println("all invigilators planned found in zpa") + // } // TODO: check if zpa data is in plexams // for _, zpaExam := range plannedExamsFromZPA { // } + if len(validationMessages) > 0 { + spinner.StopFailMessage(aurora.Sprintf(aurora.Red("%d planned exams (%d not planned by me), %d problems found"), + len(plannedExams), notPlannedByMe, len(validationMessages))) + err = spinner.StopFail() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + for _, msg := range validationMessages { + fmt.Printf(" ↪ %s\n", msg) + } + + } else { + spinner.StopMessage(aurora.Sprintf( + aurora.Green("%d planned exams (%d not planned by me), no problems found"), + len(plannedExams), notPlannedByMe)) + err = spinner.Stop() + if err != nil { + log.Debug().Err(err).Msg("cannot stop spinner") + } + } + return nil } diff --git a/plexams/zpa.go b/plexams/zpa.go new file mode 100644 index 0000000..85db8b3 --- /dev/null +++ b/plexams/zpa.go @@ -0,0 +1,11 @@ +package plexams + +import ( + "context" + + "github.com/obcode/plexams.go/graph/model" +) + +func (p *Plexams) GetZPAExam(ctx context.Context, ancode int) (*model.ZPAExam, error) { + return p.dbClient.GetZpaExamByAncode(ctx, ancode) +} diff --git a/plexams/zpa_get.go b/plexams/zpa_get.go index 1b081b9..f3c26a0 100644 --- a/plexams/zpa_get.go +++ b/plexams/zpa_get.go @@ -180,18 +180,12 @@ func (p *Plexams) ZpaExamsToPlan(ctx context.Context, input []int) ([]*model.ZPA } } - err = p.dbClient.SetZPAExamsToPlan(ctx, examsToPlan) + err = p.dbClient.SetZPAExamsToPlan(ctx, examsToPlan, examsNotToPlan) if err != nil { log.Error().Err(err).Msg("cannot set zpa exams to plan") return nil, err } - err = p.dbClient.SetZPAExamsNotToPlan(ctx, examsNotToPlan) - if err != nil { - log.Error().Err(err).Msg("cannot set zpa exams not to plan") - return nil, err - } - return examsToPlan, nil } @@ -253,12 +247,12 @@ func (p *Plexams) ZpaExamsPlaningStatusUnknown(ctx context.Context) ([]*model.ZP return statusUnknown, nil } -func (p *Plexams) AddZpaExamToPlan(ctx context.Context, ancode int, unknown bool) (bool, error) { - return p.dbClient.AddZpaExamToPlan(ctx, ancode, unknown) +func (p *Plexams) AddZpaExamToPlan(ctx context.Context, ancode int) (bool, error) { + return p.dbClient.AddZpaExamToPlan(ctx, ancode) } -func (p *Plexams) RmZpaExamFromPlan(ctx context.Context, ancode int, unknown bool) (bool, error) { - return p.dbClient.RmZpaExamFromPlan(ctx, ancode, unknown) +func (p *Plexams) RmZpaExamFromPlan(ctx context.Context, ancode int) (bool, error) { + return p.dbClient.RmZpaExamFromPlan(ctx, ancode) } func (p *Plexams) GetSupervisorRequirements(ctx context.Context) ([]*zpa.SupervisorRequirements, error) { diff --git a/plexams/zpa_post.go b/plexams/zpa_post.go index 4b68b9e..277358c 100644 --- a/plexams/zpa_post.go +++ b/plexams/zpa_post.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/viper" ) -func (p *Plexams) PostStudentRegsToZPA(ctx context.Context) (int, []*model.RegWithError, error) { +func (p *Plexams) PostStudentRegsToZPA(ctx context.Context) ([]*model.ZPAStudentReg, []*model.RegWithError, error) { if err := p.SetZPA(); err != nil { - return 0, nil, err + return nil, nil, err } zpaStudentRegs := make([]*model.ZPAStudentReg, 0) @@ -23,7 +23,7 @@ func (p *Plexams) PostStudentRegsToZPA(ctx context.Context) (int, []*model.RegWi studentRegs, err := p.dbClient.StudentRegsForProgram(ctx, program) if err != nil { log.Error().Err(err).Str("program", program).Msg("error while getting student regs") - return 0, nil, err + return nil, nil, err } for _, studentReg := range studentRegs { zpaStudentRegs = append(zpaStudentRegs, p.zpa.client.StudentReg2ZPAStudentReg(studentReg)) @@ -51,11 +51,11 @@ func (p *Plexams) PostStudentRegsToZPA(ctx context.Context) (int, []*model.RegWi log.Debug().Str("status", status).Bytes("body", body).Msg("got answer from ZPA") regsWithErrors := make([]*model.RegWithError, 0) - chunkSize := 500 + chunkSize := 77 log.Info().Int("count", len(zpaStudentRegs)).Int("chunk size", chunkSize).Msg("Uploading a lot of regs in chunks.") - for from := 0; from <= len(zpaStudentRegs); from = from + chunkSize { + for from := 0; from <= len(zpaStudentRegs); from += chunkSize { to := from + chunkSize if to > len(zpaStudentRegs) { to = len(zpaStudentRegs) @@ -66,14 +66,14 @@ func (p *Plexams) PostStudentRegsToZPA(ctx context.Context) (int, []*model.RegWi _, body, err := p.zpa.client.PostStudentRegsToZPA(zpaStudentRegs[from:to]) if err != nil { log.Error().Err(err).Msg("error while posting student regs to zpa") - return 0, nil, err + return nil, nil, err } zpaStudentRegErrors := make([]*model.ZPAStudentRegError, 0) err = json.Unmarshal(body, &zpaStudentRegErrors) if err != nil { - log.Error().Err(err).Msg("error while unmarshalling errors from ZPA") - return 0, nil, err + log.Error().Err(err).Interface("zpa-errors", zpaStudentRegErrors).Msg("error while unmarshalling errors from ZPA") + return nil, nil, err } for i, e := range zpaStudentRegErrors { @@ -89,10 +89,10 @@ func (p *Plexams) PostStudentRegsToZPA(ctx context.Context) (int, []*model.RegWi err = p.dbClient.SetRegsWithErrors(ctx, regsWithErrors) if err != nil { - return 0, nil, err + return nil, nil, err } - return len(zpaStudentRegs) - len(regsWithErrors), regsWithErrors, nil + return zpaStudentRegs, regsWithErrors, nil } func noZPAStudRegError(zpaStudentRegError *model.ZPAStudentRegError) bool { @@ -108,7 +108,7 @@ func (p *Plexams) UploadPlan(ctx context.Context, withRooms, withInvigilators, u return nil, err } - examsInPlan, err := p.ExamsInPlan(ctx) + plannedExams, err := p.PlannedExams(ctx) if err != nil { log.Error().Err(err).Msg("cannot get exam groups") return nil, err @@ -120,31 +120,35 @@ func (p *Plexams) UploadPlan(ctx context.Context, withRooms, withInvigilators, u } exams := make([]*model.ZPAExamPlan, 0) - for _, exam := range examsInPlan { + for _, exam := range plannedExams { + if exam.PlanEntry == nil { + continue + } if exam.Constraints != nil && exam.Constraints.NotPlannedByMe { continue } for _, ancodeNotToPublish := range doNotPublish { - if exam.Exam.Ancode == ancodeNotToPublish { + if exam.ZpaExam.AnCode == ancodeNotToPublish { continue } } - slot, err := p.SlotForAncode(ctx, exam.Exam.Ancode) - if err != nil { - log.Error().Err(err).Int("ancode", exam.Exam.Ancode).Msg("cannot get slot for ancode") - } - timeForAncode := p.getSlotTime(slot.DayNumber, slot.SlotNumber) - studentCount := 0 - for _, studentRegs := range exam.Exam.StudentRegs { - studentCount += len(studentRegs.StudentRegs) - } - + // slot, err := p.SlotForAncode(ctx, exam.Exam.Ancode) + // if err != nil { + // log.Error().Err(err).Int("ancode", exam.Exam.Ancode).Msg("cannot get slot for ancode") + // } + // timeForAncode := p.getSlotTime(slot.DayNumber, slot.SlotNumber) + // studentCount := 0 + // for _, studentRegs := range exam.Exam.StudentRegs { + // studentCount += len(studentRegs.StudentRegs) + // } + + // FIXME: with rooms -> zpa var rooms []*model.ZPAExamPlanRoom reserveInvigilatorID := 0 if withInvigilators { - invigilator, err := p.GetInvigilatorInSlot(ctx, "reserve", slot.DayNumber, slot.SlotNumber) + invigilator, err := p.GetInvigilatorInSlot(ctx, "reserve", exam.PlanEntry.DayNumber, exam.PlanEntry.SlotNumber) if err != nil { - log.Error().Err(err).Int("ancode", exam.Exam.Ancode).Int("day", slot.DayNumber).Int("slot", slot.SlotNumber). + log.Error().Err(err).Int("ancode", exam.Ancode).Int("day", exam.PlanEntry.DayNumber).Int("slot", exam.PlanEntry.SlotNumber). Msg("cannot get reserve invigilator for slot") return nil, err } @@ -152,12 +156,17 @@ func (p *Plexams) UploadPlan(ctx context.Context, withRooms, withInvigilators, u } if withRooms { - roomsForAncode, err := p.dbClient.RoomsForAncode(ctx, exam.Exam.Ancode) + roomsForAncode, err := p.dbClient.PlannedRoomsForAncode(ctx, exam.Ancode) if err != nil { - log.Error().Err(err).Int("ancode", exam.Exam.Ancode).Msg("cannot get rooms for ancode") + log.Error().Err(err).Int("ancode", exam.Ancode).Msg("cannot get rooms for ancode") } else { if len(roomsForAncode) > 0 { - rooms = make([]*model.ZPAExamPlanRoom, 0, len(roomsForAncode)) + type roomNameWithDuration struct { + name string + duration int + } + roomsMap := make(map[roomNameWithDuration][]*model.ZPAExamPlanRoom) + for _, roomForAncode := range roomsForAncode { if roomForAncode.RoomName == "No Room" { continue @@ -165,9 +174,9 @@ func (p *Plexams) UploadPlan(ctx context.Context, withRooms, withInvigilators, u invigilatorID := 0 if withInvigilators { - invigilator, err := p.GetInvigilatorInSlot(ctx, roomForAncode.RoomName, slot.DayNumber, slot.SlotNumber) + invigilator, err := p.GetInvigilatorInSlot(ctx, roomForAncode.RoomName, exam.PlanEntry.DayNumber, exam.PlanEntry.SlotNumber) if err != nil { - log.Error().Err(err).Int("ancode", exam.Exam.Ancode).Str("room", roomForAncode.RoomName). + log.Error().Err(err).Int("ancode", exam.Ancode).Str("room", roomForAncode.RoomName). Msg("cannot get invigilator for room") return nil, err } @@ -179,25 +188,78 @@ func (p *Plexams) UploadPlan(ctx context.Context, withRooms, withInvigilators, u roomName = "ONLINE" } - rooms = append(rooms, &model.ZPAExamPlanRoom{ + roomNameWithDuration := roomNameWithDuration{ + name: roomName, + duration: roomForAncode.Duration, + } + + roomWithDuration, ok := roomsMap[roomNameWithDuration] + if !ok { + roomWithDuration = make([]*model.ZPAExamPlanRoom, 0, 1) + } + roomsMap[roomNameWithDuration] = append(roomWithDuration, &model.ZPAExamPlanRoom{ RoomName: roomName, InvigilatorID: invigilatorID, Duration: roomForAncode.Duration, IsReserve: roomForAncode.Reserve, - StudentCount: roomForAncode.SeatsPlanned, + StudentCount: len(roomForAncode.StudentsInRoom), IsHandicap: roomForAncode.Handicap, }) } + + mergeRooms := func(roomWithSameDuration []*model.ZPAExamPlanRoom) []*model.ZPAExamPlanRoom { + for i := 0; i < len(roomWithSameDuration); i++ { + current := roomWithSameDuration[i] + if current == nil { + continue + } + for j := i + 1; j < len(roomWithSameDuration); j++ { + other := roomWithSameDuration[j] + if other == nil { + continue + } + if current.IsHandicap && other.IsHandicap || + !current.IsHandicap && !other.IsHandicap { + log.Debug().Int("ancode", exam.Ancode).Str("room", current.RoomName).Msg("found rooms to merge") + roomWithSameDuration[i].StudentCount += other.StudentCount + roomWithSameDuration[i].IsReserve = false + roomWithSameDuration[j] = nil + } + } + } + + rooms := make([]*model.ZPAExamPlanRoom, 0) + for _, room := range roomWithSameDuration { + if room != nil { + rooms = append(rooms, room) + } + } + return rooms + } + rooms = make([]*model.ZPAExamPlanRoom, 0, len(roomsForAncode)) + for _, roomWithSameDuration := range roomsMap { + if len(roomWithSameDuration) == 0 { + continue + } + if len(roomWithSameDuration) == 1 { + rooms = append(rooms, roomWithSameDuration...) + } else { + log.Debug().Int("ancode", exam.Ancode).Interface("roomWithSameDuration", roomWithSameDuration).Msg("more than one room with same duration") + rooms = append(rooms, mergeRooms(roomWithSameDuration)...) + } + } } } } + starttime := p.getSlotTime(exam.PlanEntry.DayNumber, exam.PlanEntry.SlotNumber) + exams = append(exams, &model.ZPAExamPlan{ Semester: p.semester, - AnCode: exam.Exam.Ancode, - Date: timeForAncode.Format("02.01.2006"), - Time: timeForAncode.Format("15:04"), - StudentCount: studentCount, + AnCode: exam.ZpaExam.AnCode, + Date: starttime.Local().Format("02.01.2006"), + Time: starttime.Local().Format("15:04"), + StudentCount: exam.StudentRegsCount, ReserveInvigilatorID: reserveInvigilatorID, Rooms: rooms, }) diff --git a/tmpl/generatedExamEmail.tmpl b/tmpl/generatedExamEmail.tmpl new file mode 100644 index 0000000..5fd93c1 --- /dev/null +++ b/tmpl/generatedExamEmail.tmpl @@ -0,0 +1,48 @@ +Sehr geehrte:r {{ .Teacher.Fullname }}, + +{{ if not .HasStudentRegs }} +Für Ihre Prüfung "{{ .Exam.ZpaExam.AnCode }}. {{ .Exam.ZpaExam.Module }}" liegen überhaupt keine Anmeldungen vor, daher werde ich sie nicht +planen. + +Falls die Prüfung dennoch eingeplant werden soll, teilen Sie mir das bitte unmittelbar mit. +{{ else }} +Ihre Prüfung "{{ .Exam.ZpaExam.AnCode }}. {{ .Exam.ZpaExam.Module }}" plane ich auf Grund folgender Daten. + +Sollten die Daten aus Ihrer Sicht fehlerhaft sein, nehmen Sie bitte umgehend mit +mir Kontakt auf; insbesondere dann, wenn die Anzahl der Anmeldungen stark von der +tatsächlichen Anzahl zu Prüfenden abweicht (z.B. auf Grund des Nichtbestehens einer +Zulassungsvoraussetzung). + +Sofern mir bekannt, sind Studierende mit Nachteilsausgleich unten angegeben. +Sollten Ihnen weitere Studierende mit Nachteilsausgleich bekannt sein oder bekannt werden, +geben Sie mir bitte sofort Bescheid, damit ich sie in der Planung berücksichtigen kann. + +{{ range .Exam.PrimussExams }} + {{ if ne (len .StudentRegs) 0 }} + - Studiengang {{ .Exam.Program }} + + Anmeldungen: + {{- range .StudentRegs }} + - {{ .Name }} + {{- end}} + + {{if ne (len .Ntas) 0 -}} + Studierende mit Nachteilsausgleich im Studiengang {{ .Exam.Program }} (auch in der Liste aller Anmeldungen enthalten) + {{ range .Ntas -}} + - {{.Name}}: {{.Compensation}} + {{- end -}} + {{- else -}} + Im Studiengang {{ .Exam.Program }} sind mir keine Nachteilsausgleiche für diese Prüfung bekannt. + {{- end -}} + {{- else -}} + - Studiengang {{ .Exam.Program }}: Keine Anmeldungen + {{ end -}} +{{ end }} +{{ end }} + +Mit freundlichen Grüßen +{{ .PlanerName }} + +-- +Diese E-Mail wurde generiert und gesendet von https://github.com/obcode/plexams.go + diff --git a/tmpl/generatedExamEmailHTML.tmpl b/tmpl/generatedExamEmailHTML.tmpl new file mode 100644 index 0000000..6eef415 --- /dev/null +++ b/tmpl/generatedExamEmailHTML.tmpl @@ -0,0 +1,75 @@ +

Sehr geehrte:r {{ .Teacher.Fullname }},

+ +{{ if not .HasStudentRegs }} +

Für Ihre Prüfung {{ .Exam.ZpaExam.AnCode }}. {{ .Exam.ZpaExam.Module }} liegen überhaupt keine Anmeldungen vor, daher werde ich sie nicht +planen. Falls die Prüfung dennoch eingeplant werden soll, teilen Sie mir das bitte unmittelbar +mit.

+ +{{ else }} + +

Ihre Prüfung {{ .Exam.ZpaExam.AnCode }}. {{ .Exam.ZpaExam.Module }} plane ich auf Grund folgender Daten.

+ +

Sollten die Daten aus Ihrer Sicht fehlerhaft sein, nehmen Sie bitte umgehend mit +mir Kontakt auf; insbesondere dann, wenn die Anzahl der Anmeldungen stark von der +tatsächlichen Anzahl zu Prüfenden abweicht (z.B. auf Grund des Nichtbestehens einer +Zulassungsvoraussetzung).

+ +

Sofern mir bekannt, sind Studierende mit Nachteilsausgleich unten angegeben. +Sollten Ihnen weitere Studierende mit Nachteilsausgleich bekannt sein oder bekannt werden, +geben Sie mir bitte sofort Bescheid, damit ich sie in der Planung berücksichtigen kann.

+ +
    +{{ range .Exam.PrimussExams -}} + + {{ if ne (len .StudentRegs) 0 }} +
  • Studiengang {{ .Exam.Program }} +

    + Anmeldungen: +

    + +
      + {{ range .StudentRegs }} +
    1. + {{ .Name }} +
    2. + {{end}} +
    + + {{ if ne (len .Ntas) 0 }} +

    + Studierende mit Nachteilsausgleich im Studiengang {{ .Exam.Program }} (auch in der Liste aller Anmeldungen enthalten) +

    + +
      + {{ range .Ntas }} +
    1. + {{.Name}}: {{.Compensation}} +
    2. + {{end}} +
    +

    + + {{ else }} + +

    + Im Studiengang {{ .Exam.Program }} sind mir keine Nachteilsausgleiche für diese Prüfung bekannt. +

    + + {{ end }} +
  • + {{ else }} +
  • Studiengang {{ .Exam.Program }}: Keine Anmeldungen

  • + {{ end }} + +{{ end }} +
+ +{{ end }} + +

Mit freundlichen Grüßen
+{{ .PlanerName }}

+ +
+-- 
+Diese E-Mail wurde generiert und gesendet von https://github.com/obcode/plexams.go
+
diff --git a/tmpl/handicapEmailRoomAlone.tmpl b/tmpl/handicapEmailRoomAlone.tmpl new file mode 100644 index 0000000..2690b1b --- /dev/null +++ b/tmpl/handicapEmailRoomAlone.tmpl @@ -0,0 +1,24 @@ +Sehr geehrte:r {{ .NTA.Name }}, + +Sie haben gemäß den mir vorliegenden Informationen Anspruch auf einen eigenen Raum +bei Ihren Prüfungen. + +Für folgende Prüfungen, für die Sie sich angemeldet haben, plane ich einen extra Raum ein: + +{{ range .Exams -}} +{{ .ZpaExam.MainExamer }}: {{ .ZpaExam.Module }} +{{ end }} + +Den Raum entnehmen Sie nach Abschluss der Raumplanung dem im ZPA veröffentlichten Prüfungsplan +unter https://zpa.cs.hm.edu/public/exam_plan/. +Im Zweifelsfall fragen Sie gerne bei mir nach. + +Wenn Sie frühzeitig wissen, dass Sie an einer der oben genannten Prüfungen nicht teilnehmen werden, +teilen Sie mir das bitte mit, damit ich die eingeteilte Aufsicht darüber informieren kann bzw. keinen extra +Raum mit Aufsicht planen muss. + +Mit freundlichen Grüßen +{{ .PlanerName }} + +-- +Diese E-Mail wurde generiert und gesendet von https://github.com/obcode/plexams.go diff --git a/tmpl/handicapEmailRoomAloneHTML.tmpl b/tmpl/handicapEmailRoomAloneHTML.tmpl new file mode 100644 index 0000000..8c983ee --- /dev/null +++ b/tmpl/handicapEmailRoomAloneHTML.tmpl @@ -0,0 +1,30 @@ +

Sehr geehrte:r {{ .NTA.Name }},

+ +

Sie haben gemäß den mir vorliegenden Informationen Anspruch auf einen eigenen Raum +bei Ihren Prüfungen.

+ +

Für folgende Prüfungen, für die Sie sich angemeldet haben, plane ich einen extra Raum ein:

+ +
    +{{ range .Exams -}} +
  • +{{ .ZpaExam.MainExamer }}: {{ .ZpaExam.Module }} +
  • +{{ end }} +
+ +

Den Raum entnehmen Sie nach Abschluss der Raumplanung dem im ZPA veröffentlichten Prüfungsplan +unter https://zpa.cs.hm.edu/public/exam_plan/. +Im Zweifelsfall fragen Sie gerne bei mir nach.

+ +

Wenn Sie frühzeitig wissen, dass Sie an einer der oben genannten Prüfungen nicht teilnehmen werden, +teilen Sie mir das bitte mit, damit ich die eingeteilte Aufsicht darüber informieren kann bzw. keinen extra +Raum mit Aufsicht planen muss.

+ +

Mit freundlichen Grüßen
+{{ .PlanerName }}

+ +
+-- 
+Diese E-Mail wurde generiert und gesendet von https://github.com/obcode/plexams.go
+