mateamt/src/Types/Settings.hs

27 lines
533 B
Haskell
Raw Normal View History

2020-10-01 17:11:52 +00:00
{-# LANGUAGE TypeFamilies #-}
module Types.Settings where
2022-07-24 13:22:32 +00:00
import qualified Data.Text as T
-- internal imports
import Classes
2020-10-01 17:11:52 +00:00
data Settings = Settings
2021-10-16 15:49:50 +00:00
{ settingsBlockRegistration :: Bool
2022-07-24 13:22:32 +00:00
, settingsImprintText :: T.Text
2020-10-01 17:11:52 +00:00
}
deriving (Show)
2020-10-01 17:11:52 +00:00
instance DatabaseRepresentation Settings where
type Representation Settings = (Bool, T.Text)
2020-10-01 17:11:52 +00:00
instance ToDatabase Settings where
2020-10-01 17:11:52 +00:00
2022-07-24 13:22:32 +00:00
toDatabase (Settings reg imprint) = (reg, imprint)
2020-10-01 17:11:52 +00:00
instance FromDatabase Settings where
2020-10-01 17:11:52 +00:00
2022-07-24 13:22:32 +00:00
fromDatabase (reg, imprint) = Settings reg imprint