blob: 74d917210d43e9457468c37b004f2dff8e23c12c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
module Persistence.Init
( getInit
) where
import Common.Model (Init (Init), User (..))
import Conf (Conf)
import qualified Conf
import Model.Query (Query)
import qualified Persistence.Category as CategoryPersistence
import qualified Persistence.Income as IncomePersistence
import qualified Persistence.Payment as PaymentPersistence
import qualified Persistence.PaymentCategory as PaymentCategoryPersistence
import qualified Persistence.User as UserPersistence
getInit :: User -> Conf -> Query Init
getInit user conf =
Init <$>
UserPersistence.list <*>
(return . _user_id $ user) <*>
PaymentPersistence.listActive <*>
IncomePersistence.list <*>
CategoryPersistence.list <*>
PaymentCategoryPersistence.list <*>
(return . Conf.currency $ conf)
|