aboutsummaryrefslogtreecommitdiff
path: root/src/server/Model/Payer
diff options
context:
space:
mode:
authorJoris2016-03-27 17:36:33 +0200
committerJoris2016-03-27 17:59:32 +0200
commit869bab77e93e2a6c776a4b1fc35ef0fd5df22f5f (patch)
tree917a9e871eff1c487da63ea2407234d7e3829dda /src/server/Model/Payer
parenta8882071da12cbb5b0bf2f003322e42e181b0c82 (diff)
Compute payers client side rather than server side
Diffstat (limited to 'src/server/Model/Payer')
-rw-r--r--src/server/Model/Payer/Income.hs22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/server/Model/Payer/Income.hs b/src/server/Model/Payer/Income.hs
deleted file mode 100644
index f4bc9fd..0000000
--- a/src/server/Model/Payer/Income.hs
+++ /dev/null
@@ -1,22 +0,0 @@
-module Model.Payer.Income
- ( incomeDefinedForAll
- ) where
-
-import Data.Time.Clock (UTCTime)
-import Data.List (sort)
-import Data.Maybe
-
-import Database.Persist
-
-import Model.Database
-import Model.User (getUsers)
-import Model.Income (getFirstIncome)
-
-incomeDefinedForAll :: Persist (Maybe UTCTime)
-incomeDefinedForAll = do
- userIds <- map entityKey <$> getUsers
- firstIncomes <- mapM getFirstIncome userIds
- return $
- if all isJust firstIncomes
- then listToMaybe . reverse . sort . map incomeCreation . catMaybes $ firstIncomes
- else Nothing