diff options
author | Joris | 2016-06-12 23:54:17 +0200 |
---|---|---|
committer | Joris | 2016-06-12 23:54:17 +0200 |
commit | 6a0c5087f716ed6c876a666db6573491bfd3e094 (patch) | |
tree | bf439109143c7a1749c2661fc8b805b83a993027 /src/server/Model/Json | |
parent | 38896af4281d2e191cbde15836a23e4c0274fff6 (diff) |
Design income form
Diffstat (limited to 'src/server/Model/Json')
-rw-r--r-- | src/server/Model/Json/AddIncome.hs | 17 | ||||
-rw-r--r-- | src/server/Model/Json/Income.hs | 5 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/server/Model/Json/AddIncome.hs b/src/server/Model/Json/AddIncome.hs new file mode 100644 index 0000000..6570ba9 --- /dev/null +++ b/src/server/Model/Json/AddIncome.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE DeriveGeneric #-} + +module Model.Json.AddIncome + ( AddIncome(..) + ) where + +import GHC.Generics + +import Data.Aeson +import Data.Time.Calendar (Day) + +data AddIncome = AddIncome + { day :: Day + , amount :: Int + } deriving (Show, Generic) + +instance FromJSON AddIncome diff --git a/src/server/Model/Json/Income.hs b/src/server/Model/Json/Income.hs index 6ad331a..e80ab63 100644 --- a/src/server/Model/Json/Income.hs +++ b/src/server/Model/Json/Income.hs @@ -7,16 +7,15 @@ module Model.Json.Income import GHC.Generics import Data.Aeson -import Data.Time.Clock (UTCTime) +import Data.Time.Calendar (Day) import Model.Database (IncomeId, UserId) data Income = Income { id :: IncomeId , userId :: UserId - , creation :: UTCTime + , day :: Day , amount :: Int } deriving (Show, Generic) -instance FromJSON Income instance ToJSON Income |