aboutsummaryrefslogtreecommitdiff
path: root/src/server/Job
diff options
context:
space:
mode:
authorJoris2017-09-24 22:14:48 +0200
committerJoris2017-11-07 09:33:01 +0100
commit898e7ed11ab0958fcdaf65b99b33f7b04787630a (patch)
tree8b5ab951c36d7d27550a7c4eaad16bbd2cd0edb1 /src/server/Job
parent14bdbc8c937f5d0b35c61350dba28cb41c3737cd (diff)
Bootstrap with GHCJS and reflex:
- setup login and logout, - first draft of payment view.
Diffstat (limited to 'src/server/Job')
-rw-r--r--src/server/Job/MonthlyPayment.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/server/Job/MonthlyPayment.hs b/src/server/Job/MonthlyPayment.hs
index 8c11ccf..ba24cca 100644
--- a/src/server/Job/MonthlyPayment.hs
+++ b/src/server/Job/MonthlyPayment.hs
@@ -4,7 +4,8 @@ module Job.MonthlyPayment
import Data.Time.Clock (UTCTime, getCurrentTime)
-import Model.Frequency
+import Common.Model (Frequency(..), Payment(..))
+
import qualified Model.Payment as Payment
import Utils.Time (timeToDay)
import qualified Model.Query as Query
@@ -14,6 +15,12 @@ monthlyPayment _ = do
monthlyPayments <- Query.run Payment.listMonthly
now <- getCurrentTime
actualDay <- timeToDay now
- let punctualPayments = map (\p -> p { Payment.frequency = Punctual, Payment.date = actualDay, Payment.createdAt = now }) monthlyPayments
+ let punctualPayments = map
+ (\p -> p
+ { _payment_frequency = Punctual
+ , _payment_date = actualDay
+ , _payment_createdAt = now
+ })
+ monthlyPayments
_ <- Query.run (Payment.createMany punctualPayments)
return now