diff options
author | Joris | 2016-03-31 00:06:50 +0200 |
---|---|---|
committer | Joris | 2016-03-31 00:13:25 +0200 |
commit | c95e19407d492a0d4e9e14e320520fe29ce379e5 (patch) | |
tree | ca6a14ad1396af6a4bc36e17ce89278d5dbea0a0 /src/server/Model/Json | |
parent | c542551ad043260e6a4a6569b4af5c748f7b6001 (diff) |
Add init data in html page
Diffstat (limited to 'src/server/Model/Json')
-rw-r--r-- | src/server/Model/Json/Init.hs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/server/Model/Json/Init.hs b/src/server/Model/Json/Init.hs new file mode 100644 index 0000000..5e6d2a2 --- /dev/null +++ b/src/server/Model/Json/Init.hs @@ -0,0 +1,33 @@ +{-# LANGUAGE DeriveGeneric #-} + +module Model.Json.Init + ( Init(..) + , InitResult(..) + ) where + +import GHC.Generics + +import Data.Aeson + +import Model.Database (UserId) +import Model.Json.User (User) +import Model.Json.Payment (Payment) +import Model.Json.Income (Income) +import Model.Message.Key (Key) + +data Init = Init + { users :: [User] + , me :: UserId + , payments :: [Payment] + , incomes :: [Income] + } deriving (Show, Generic) + +instance ToJSON Init + +data InitResult = + InitEmpty + | InitSuccess Init + | InitError Key + deriving (Show, Generic) + +instance ToJSON InitResult |