aboutsummaryrefslogtreecommitdiff
path: root/src/server/Model/Json
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Model/Json')
-rw-r--r--src/server/Model/Json/AddIncome.hs17
-rw-r--r--src/server/Model/Json/Income.hs5
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