aboutsummaryrefslogtreecommitdiff
path: root/server/src/Job
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/Job')
-rw-r--r--server/src/Job/MonthlyPayment.hs16
-rw-r--r--server/src/Job/WeeklyReport.hs8
2 files changed, 12 insertions, 12 deletions
diff --git a/server/src/Job/MonthlyPayment.hs b/server/src/Job/MonthlyPayment.hs
index 907be2b..dfbe8b4 100644
--- a/server/src/Job/MonthlyPayment.hs
+++ b/server/src/Job/MonthlyPayment.hs
@@ -2,19 +2,19 @@ module Job.MonthlyPayment
( monthlyPayment
) where
-import Data.Time.Clock (UTCTime, getCurrentTime)
+import Data.Time.Clock (UTCTime, getCurrentTime)
-import Common.Model (Frequency (..), Payment (..))
+import Common.Model (Frequency (..), Payment (..))
+import qualified Common.Util.Time as Time
-import qualified Model.Payment as Payment
-import qualified Model.Query as Query
-import Util.Time (timeToDay)
+import qualified Model.Query as Query
+import qualified Persistence.Payment as PaymentPersistence
monthlyPayment :: Maybe UTCTime -> IO UTCTime
monthlyPayment _ = do
- monthlyPayments <- Query.run Payment.listActiveMonthlyOrderedByName
+ monthlyPayments <- Query.run PaymentPersistence.listActiveMonthlyOrderedByName
now <- getCurrentTime
- actualDay <- timeToDay now
+ actualDay <- Time.timeToDay now
let punctualPayments = map
(\p -> p
{ _payment_frequency = Punctual
@@ -22,5 +22,5 @@ monthlyPayment _ = do
, _payment_createdAt = now
})
monthlyPayments
- _ <- Query.run (Payment.createMany punctualPayments)
+ _ <- Query.run (PaymentPersistence.createMany punctualPayments)
return now
diff --git a/server/src/Job/WeeklyReport.hs b/server/src/Job/WeeklyReport.hs
index 38d88b5..203c4e8 100644
--- a/server/src/Job/WeeklyReport.hs
+++ b/server/src/Job/WeeklyReport.hs
@@ -5,10 +5,10 @@ module Job.WeeklyReport
import Data.Time.Clock (UTCTime, getCurrentTime)
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 qualified Persistence.Income as IncomePersistence
+import qualified Persistence.Payment as PaymentPersistence
+import qualified Persistence.User as UserPersistence
import qualified SendMail
import qualified View.Mail.WeeklyReport as WeeklyReport
@@ -19,7 +19,7 @@ weeklyReport conf mbLastExecution = do
Nothing -> return ()
Just lastExecution -> do
(payments, incomes, users) <- Query.run $
- (,,) <$> Payment.listPunctual <*> Income.list <*> User.list
+ (,,) <$> PaymentPersistence.listPunctual <*> IncomePersistence.list <*> UserPersistence.list
_ <- SendMail.sendMail conf (WeeklyReport.mail conf users payments incomes lastExecution now)
return ()
return now