add imprint field to settings

This commit is contained in:
nek0 2022-07-24 15:22:32 +02:00
parent 9f88c158ff
commit 80f68bf86c

View file

@ -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