chore(lms): add notifications stub forgotten in previous commit

This commit is contained in:
Steffen Jost 2022-04-07 18:06:42 +02:00
parent 41a05edcd4
commit d4c4a60e7c

View File

@ -0,0 +1,49 @@
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} -- ihamletFile discards do results
module Jobs.Handler.SendNotification.Qualification
( dispatchNotificationQualificationExpiry
, dispatchNotificationQualificationRenewal
) where
import Import
{-
import Handler.Utils
import Jobs.Handler.SendNotification.Utils
import Handler.Info (FAQItem(..))
import Text.Hamlet
import qualified Database.Esqueleto.Experimental as E
import qualified Database.Esqueleto.Utils as E
-}
dispatchNotificationQualificationExpiry :: QualificationId -> Day -> UserId -> Handler ()
dispatchNotificationQualificationExpiry _nQualification _nExpiry _jRecipient =
error "dispatchNotificationQualificationExpiry not yet implemented TODO"
{- userMailT jRecipient $ do
(Allocation{..}, Course{..}, hasApplied) <- liftHandler . runDB $ (,,)
<$> getJust nAllocation
<*> getJust nCourse
<*> exists [CourseApplicationAllocation ==. Just nAllocation, CourseApplicationUser ==. jRecipient]
replaceMailHeader "Auto-Submitted" $ Just "auto-generated"
setSubjectI $ MsgMailSubjectAllocationNewCourse allocationName
editNotifications <- mkEditNotifications jRecipient
cID <- encrypt nCourse
mayApply <- lift $ orM
[ is _Authorized <$> evalAccessFor (Just jRecipient) (AllocationR allocationTerm allocationSchool allocationShorthand ARegisterR) True
, is _Authorized <$> evalAccessFor (Just jRecipient) (AllocationR allocationTerm allocationSchool allocationShorthand $ AApplyR cID) True
]
allocUrl <- toTextUrl $ AllocationR allocationTerm allocationSchool allocationShorthand AShowR :#: cID
addHtmlMarkdownAlternatives $(ihamletFile "templates/mail/allocationNewCourse.hamlet")
-}
dispatchNotificationQualificationRenewal :: QualificationId -> Day -> UserId -> Handler ()
dispatchNotificationQualificationRenewal _nQualification _nExpiry _jRecipient =
error "dispatchNotificationQualificationRenewal not yet implemented TODO"
-- userMailT jRecipient $ do