diff options
author | Joris | 2016-03-30 00:28:55 +0200 |
---|---|---|
committer | Joris | 2016-03-30 00:28:55 +0200 |
commit | baefda5a902a94cedf84cfcd2ae550267e5d932e (patch) | |
tree | 72fa7b4e6c49d025563e3d7cba1ec13af43aa1c2 /src/server/Model/Frequency.hs | |
parent | 76f8b85eb9f796d6df861a04f702ef5f48630795 (diff) |
Merge punctual and monthly payments in client model
Diffstat (limited to 'src/server/Model/Frequency.hs')
-rw-r--r-- | src/server/Model/Frequency.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/Model/Frequency.hs b/src/server/Model/Frequency.hs index 2b747b7..a6ba55c 100644 --- a/src/server/Model/Frequency.hs +++ b/src/server/Model/Frequency.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} @@ -5,15 +6,21 @@ module Model.Frequency ( Frequency(..) ) where +import GHC.Generics + import Web.Scotty import Database.Persist.TH +import Data.Aeson + data Frequency = Punctual | Monthly - deriving (Eq, Show, Read) + deriving (Eq, Show, Read, Generic) derivePersistField "Frequency" instance Parsable Frequency where parseParam = readEither +instance FromJSON Frequency +instance ToJSON Frequency |