aboutsummaryrefslogtreecommitdiff
path: root/src/server/Model/Frequency.hs
blob: a6ba55ca16f21d3bee60ad79230dc0bd56b3ede7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}

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, Generic)

derivePersistField "Frequency"

instance Parsable Frequency where parseParam = readEither
instance FromJSON Frequency
instance ToJSON Frequency