git.iko.soy/typeable/extra-time
on master help sign in
Add hotels cron service and payments settlement. (#4993)

* Add execEnvT to control-has. * Hotels cron. * Stack.yaml. * Fix broken things. * More hotels-cron things. * Fix SQL. * Hotels cron shell script. * Ceterum autem censeo Haslexinem esse delendam. * Rework SQL to get payment ids for settlement. * Log error on settlement. Add missing enum values to SQL types. * Mark old credit card payments as automatically charged. * Actually subtract instead of adding. * Fix sqitch.plan * Replace hardcoded values with macros in SQL. * Use Hours instead of Word.

commit3b3920ccae2e0415d7abcb2c087a451628684ddc authorNick <nick@typeable.io> dateMon 14 Sep 2020, 12:13 (6 years ago) parentce18945
1 file changed+5
src/Data/Time/Extra.hs+5
src/Data/Time/Extra.hs+5
@@ -20,6 +20,7 @@ module Data.Time.Extra
2020 , TimeFrameType(..)
2121 , Hours(..)
2222 , _Hours
23+ , addUTCHours
2324 , DateRange(..)
2425 , mkDateRange
2526 , drFromDate
@@ -59,6 +60,10 @@ instance NFData Hours
5960
6061makePrisms ''Hours
6162
63+addUTCHours :: Hours -> UTCTime -> UTCTime
64+addUTCHours (Hours h) t = addUTCTime s t
65+ where s = fromIntegral (h * 3600)
66+
6267duration :: ShortZonedTime -> ShortZonedTime -> Minutes
6368duration t1 t2 = Minutes (timeDiff `div` 60)
6469 where