mateamt/src/Types/Reader.hs

28 lines
621 B
Haskell

module Types.Reader where
import qualified Data.Text as T
import Servant (Handler)
import Control.Concurrent.STM (TQueue)
import Control.Monad.Reader (ReaderT)
import Database.PostgreSQL.Simple (Connection)
import Network.Mail.Mime (Mail)
-- internal imports
import Types.Auth (TicketStore)
data ReadState = ReadState
{ rsConnection :: Connection
, rsTicketStore :: TicketStore
, rsCurrencySymbol :: T.Text
, rsCurrencyFraction :: Word
, rsSoftwareVersion :: T.Text
, rsSendmailPath :: FilePath
, rsMailQueue :: TQueue Mail
}
type MateHandler = ReaderT ReadState Handler