aboutsummaryrefslogtreecommitdiff
path: root/src/server/Controller/Payer.hs
diff options
context:
space:
mode:
authorJoris2015-10-04 20:48:32 +0200
committerJoris2015-10-04 20:48:32 +0200
commit8c24464a4bd0a486cd0ddf846d3b5a323a7aaa9a (patch)
treecdd1bb79846b3d8865d833a122152528b03a4746 /src/server/Controller/Payer.hs
parent303dfd66c6434e19ba226a133a35a74a557b3e93 (diff)
downloadbudget-8c24464a4bd0a486cd0ddf846d3b5a323a7aaa9a.tar.gz
budget-8c24464a4bd0a486cd0ddf846d3b5a323a7aaa9a.tar.bz2
budget-8c24464a4bd0a486cd0ddf846d3b5a323a7aaa9a.zip
Using incomes to compute a fair computation to designate the payer
Diffstat (limited to 'src/server/Controller/Payer.hs')
-rw-r--r--src/server/Controller/Payer.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/server/Controller/Payer.hs b/src/server/Controller/Payer.hs
new file mode 100644
index 0000000..70760ae
--- /dev/null
+++ b/src/server/Controller/Payer.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Controller.Payer
+ ( getPayers
+ ) where
+
+import Web.Scotty
+
+import Control.Monad.IO.Class (liftIO)
+
+import Model.Database
+import qualified Model.Payer as P
+
+import Secure (loggedAction)
+
+getPayers :: ActionM ()
+getPayers =
+ Secure.loggedAction (\_ ->
+ (liftIO $ runDb P.getPayers) >>= json
+ )