From 439520794d0387ee168d5f316a65e4be8cd4da9f Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Fri, 29 Jul 2022 14:57:36 +0200 Subject: [PATCH] chore(lms): more testdata --- test/Database/Fill.hs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/test/Database/Fill.hs b/test/Database/Fill.hs index 673a62124..6797a3515 100644 --- a/test/Database/Fill.hs +++ b/test/Database/Fill.hs @@ -63,6 +63,7 @@ fillDb = do addBDays = addBusinessDays Fraport -- holiday area to use n_day n = addBDays n $ utctDay now + n_day' n = now { utctDay = n_day n } currentTerm = TermIdentifier . fst3 . toGregorian $ utctDay now -- (currentYear, currentMonth, currentDay) = toGregorian $ getTermDay currentTerm nextTerm n = toEnum . (+n) $ fromEnum currentTerm @@ -491,16 +492,18 @@ fillDb = do void . insert' $ QualificationUser fhamann qid_r (n_day $ -3) (n_day $ -1) (n_day $ -2) void . insert' $ QualificationUser svaupel qid_l (n_day 1) (n_day $ -1) (n_day $ -2) void . insert' $ QualificationUser gkleen qid_l (n_day 9) (n_day $ -1) (n_day $ -7) - -- void . insert' $ LmsResult qid_f (LmsIdent "hijklmn") (n_day (-1)) now - -- void . insert' $ LmsResult qid_f (LmsIdent "opqgrs" ) (n_day (-2)) now - -- void . insert' $ LmsResult qid_f (LmsIdent "pqgrst" ) (n_day (-3)) now - -- void . insert' $ LmsUserlist qid_f (LmsIdent "hijklmn") False now - -- void . insert' $ LmsUserlist qid_f (LmsIdent "abcdefg") True now - -- void . insert' $ LmsUserlist qid_f (LmsIdent "ijk" ) False now - -- void . insert' $ LmsUser qid_f jost (LmsIdent "ijk" ) "123" False Nothing now Nothing Nothing - -- void . insert' $ LmsUser qid_f svaupel (LmsIdent "abcdefg") "abc" False (Just $ LmsSuccess $ utctDay now) now (Just now) Nothing - -- void . insert' $ LmsUser qid_f gkleen (LmsIdent "hijklmn") "@#!" True (Just $ LmsBlocked $ utctDay now) now (Just now) Nothing - + void . insert' $ LmsResult qid_f (LmsIdent "hijklmn") (n_day (-1)) now + void . insert' $ LmsResult qid_f (LmsIdent "opqgrs" ) (n_day (-2)) now + void . insert' $ LmsResult qid_f (LmsIdent "pqgrst" ) (n_day (-3)) now + void . insert' $ LmsUserlist qid_f (LmsIdent "hijklmn") False now + void . insert' $ LmsUserlist qid_f (LmsIdent "abcdefg") True now + void . insert' $ LmsUserlist qid_f (LmsIdent "ijk" ) False now + void . insert' $ LmsUser qid_f jost (LmsIdent "ijk" ) "123" False now Nothing now Nothing Nothing + void . insert' $ LmsUser qid_f svaupel (LmsIdent "abcdefg") "abc" False now (Just $ LmsSuccess $ n_day 1) now (Just now) Nothing + void . insert' $ LmsUser qid_f gkleen (LmsIdent "hijklmn") "@#!" True now (Just $ LmsBlocked $ utctDay now) now (Just now) Nothing + void . insert' $ LmsUser qid_f tinaTester (LmsIdent "qwvu") "45678" True now (Just $ LmsSuccess $ n_day (-2)) now Nothing Nothing + void . insert' $ LmsUser qid_f maxMuster (LmsIdent "xyz") "a1b2c3" False now (Just $ LmsBlocked $ n_day (-1)) now (Just $ n_day' (-2)) (Just $ n_day' (-1)) + let examLabels = Map.fromList [ ( sbarth