aboutsummaryrefslogtreecommitdiff
path: root/server/src/Persistence
diff options
context:
space:
mode:
authorJoris2020-01-27 22:07:18 +0100
committerJoris2020-01-27 22:07:18 +0100
commit79e1d8b0099d61b580a499311f1714b1b7eb07b5 (patch)
treea4c35442914b3a59119ddfc1e6c2ce358ecd4758 /server/src/Persistence
parent47c2a4d6b68c54eed5f7b45671b1ccaf8c0db200 (diff)
Show total incom by month in statistics
Diffstat (limited to 'server/src/Persistence')
-rw-r--r--server/src/Persistence/Income.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/src/Persistence/Income.hs b/server/src/Persistence/Income.hs
index 76cb952..1b5364c 100644
--- a/server/src/Persistence/Income.hs
+++ b/server/src/Persistence/Income.hs
@@ -1,5 +1,6 @@
module Persistence.Income
- ( count
+ ( listAll
+ , count
, list
, listModifiedSince
, create
@@ -43,6 +44,16 @@ data CountRow = CountRow Int
instance FromRow CountRow where
fromRow = CountRow <$> SQLite.field
+listAll :: Query [Income]
+listAll =
+ Query (\conn ->
+ map (\(Row i) -> i) <$>
+ SQLite.query_
+ conn
+ "SELECT * FROM income WHERE deleted_at IS NULL ORDER BY date DESC"
+ )
+
+
count :: Query Int
count =
Query (\conn ->