diff options
author | Joris | 2017-06-05 18:02:13 +0200 |
---|---|---|
committer | Joris | 2017-06-05 18:02:13 +0200 |
commit | 0b191f5c48edffc9da3e38c284e9640fd82e7cb1 (patch) | |
tree | c729e53822e7c41c1a854d82d25636e58ee65c9f /src/server/Job/WeeklyReport.hs | |
parent | 5c110716cfda6e616a795edd12f2012b132dca9f (diff) |
Replace persistent by sqlite-simple
Diffstat (limited to 'src/server/Job/WeeklyReport.hs')
-rw-r--r-- | src/server/Job/WeeklyReport.hs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/server/Job/WeeklyReport.hs b/src/server/Job/WeeklyReport.hs index 5cde3e9..5737c75 100644 --- a/src/server/Job/WeeklyReport.hs +++ b/src/server/Job/WeeklyReport.hs @@ -4,16 +4,13 @@ module Job.WeeklyReport import Data.Time.Clock (UTCTime, getCurrentTime) -import Model.Database (runDb) -import qualified Model.Payment as Payment +import Conf (Conf) import qualified Model.Income as Income +import qualified Model.Payment as Payment +import qualified Model.Query as Query import qualified Model.User as User - -import SendMail - -import Conf (Conf) - -import View.Mail.WeeklyReport (mail) +import qualified SendMail +import qualified View.Mail.WeeklyReport as WeeklyReport weeklyReport :: Conf -> Maybe UTCTime -> IO UTCTime weeklyReport conf mbLastExecution = do @@ -21,11 +18,11 @@ weeklyReport conf mbLastExecution = do case mbLastExecution of Nothing -> return () Just lastExecution -> do - (payments, incomes, users) <- runDb $ + (payments, incomes, users) <- Query.run $ (,,) <$> Payment.modifiedDuring lastExecution now <*> Income.modifiedDuring lastExecution now <*> User.list - _ <- sendMail (mail conf users payments incomes lastExecution now) + _ <- SendMail.sendMail (WeeklyReport.mail conf users payments incomes lastExecution now) return () return now |