diff options
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 |