2019-05-06 21:41:05 +00:00
|
|
|
module Types.Reader where
|
|
|
|
|
2019-12-19 01:40:54 +00:00
|
|
|
import qualified Data.Text as T
|
|
|
|
|
2019-05-06 21:41:05 +00:00
|
|
|
import Servant (Handler)
|
|
|
|
|
2022-07-31 04:09:48 +00:00
|
|
|
import Control.Concurrent.STM (TQueue)
|
2019-05-06 21:41:05 +00:00
|
|
|
import Control.Monad.Reader (ReaderT)
|
|
|
|
|
|
|
|
import Database.PostgreSQL.Simple (Connection)
|
|
|
|
|
2022-07-31 04:09:48 +00:00
|
|
|
import Network.Mail.Mime (Mail)
|
|
|
|
|
2019-05-06 21:41:05 +00:00
|
|
|
-- internal imports
|
|
|
|
|
|
|
|
import Types.Auth (TicketStore)
|
|
|
|
|
|
|
|
data ReadState = ReadState
|
2021-07-12 11:29:40 +00:00
|
|
|
{ rsConnection :: Connection
|
|
|
|
, rsTicketStore :: TicketStore
|
|
|
|
, rsCurrencySymbol :: T.Text
|
|
|
|
, rsCurrencyFraction :: Word
|
|
|
|
, rsSoftwareVersion :: T.Text
|
|
|
|
, rsSendmailPath :: FilePath
|
2022-07-31 04:09:48 +00:00
|
|
|
, rsMailQueue :: TQueue Mail
|
2019-05-06 21:41:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type MateHandler = ReaderT ReadState Handler
|