{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE TemplateHaskell #-}
module Wire.PasswordResetCodeStore where
import Data.Id
import Data.Time.Clock
import Imports
import Polysemy
import Wire.API.User.Password
data PRQueryData f = PRQueryData
{ forall (f :: * -> *). PRQueryData f -> PasswordResetCode
prqdCode :: PasswordResetCode,
forall (f :: * -> *). PRQueryData f -> UserId
prqdUser :: UserId,
forall (f :: * -> *). PRQueryData f -> f Int32
prqdRetries :: f Int32,
forall (f :: * -> *). PRQueryData f -> f UTCTime
prqdTimeout :: f UTCTime
}
deriving instance (forall a. (Show a) => Show (f a)) => Show (PRQueryData f)
deriving instance (forall a. (Eq a) => Eq (f a)) => Eq (PRQueryData f)
mapPRQueryData :: (forall a. (f1 a -> f2 a)) -> PRQueryData f1 -> PRQueryData f2
mapPRQueryData :: forall (f1 :: * -> *) (f2 :: * -> *).
(forall a. f1 a -> f2 a) -> PRQueryData f1 -> PRQueryData f2
mapPRQueryData forall a. f1 a -> f2 a
f PRQueryData f1
prqd = PRQueryData f1
prqd {prqdRetries = f prqd.prqdRetries, prqdTimeout = f prqd.prqdTimeout}
data PasswordResetCodeStore m a where
GenerateEmailCode :: PasswordResetCodeStore m PasswordResetCode
GeneratePhoneCode :: PasswordResetCodeStore m PasswordResetCode
CodeSelect :: PasswordResetKey -> PasswordResetCodeStore m (Maybe (PRQueryData Maybe))
CodeInsert :: PasswordResetKey -> PRQueryData Identity -> Int32 -> PasswordResetCodeStore m ()
CodeDelete :: PasswordResetKey -> PasswordResetCodeStore m ()
makeSem ''PasswordResetCodeStore