add imprint field to settings
This commit is contained in:
parent
9f88c158ff
commit
80f68bf86c
1 changed files with 9 additions and 4 deletions
|
@ -1,21 +1,26 @@
|
||||||
{-# LANGUAGE TypeFamilies #-}
|
{-# LANGUAGE TypeFamilies #-}
|
||||||
module Types.Settings where
|
module Types.Settings where
|
||||||
|
|
||||||
|
import qualified Data.Text as T
|
||||||
|
|
||||||
|
-- internal imports
|
||||||
|
|
||||||
import Classes
|
import Classes
|
||||||
|
|
||||||
data Settings = Settings
|
data Settings = Settings
|
||||||
{ settingsBlockRegistration :: Bool
|
{ settingsBlockRegistration :: Bool
|
||||||
|
, settingsImprintText :: T.Text
|
||||||
}
|
}
|
||||||
deriving (Show)
|
deriving (Show)
|
||||||
|
|
||||||
instance ToDatabase Settings where
|
instance ToDatabase Settings where
|
||||||
|
|
||||||
type InTuple Settings = Bool
|
type InTuple Settings = (Bool, T.Text)
|
||||||
|
|
||||||
toDatabase (Settings reg) = reg
|
toDatabase (Settings reg imprint) = (reg, imprint)
|
||||||
|
|
||||||
instance FromDatabase Settings where
|
instance FromDatabase Settings where
|
||||||
|
|
||||||
type OutTuple Settings = Bool
|
type OutTuple Settings = (Bool, T.Text)
|
||||||
|
|
||||||
fromDatabase reg = Settings reg
|
fromDatabase (reg, imprint) = Settings reg imprint
|
||||||
|
|
Loading…
Reference in a new issue