-- | Description: Account credentials data type
module Polysemy.Account.Data.AccountCredentials where

import Polysemy.Account.Data.AccountName (AccountName)
import Polysemy.Account.Data.RawPassword (RawPassword)

-- | User-supplied credentials for login or registration.
data AccountCredentials =
  AccountCredentials {
    -- | Account name.
    AccountCredentials -> AccountName
username :: AccountName,
    -- | Account password.
    AccountCredentials -> RawPassword
password :: RawPassword
  }
  deriving stock (AccountCredentials -> AccountCredentials -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountCredentials -> AccountCredentials -> Bool
$c/= :: AccountCredentials -> AccountCredentials -> Bool
== :: AccountCredentials -> AccountCredentials -> Bool
$c== :: AccountCredentials -> AccountCredentials -> Bool
Eq, Int -> AccountCredentials -> ShowS
[AccountCredentials] -> ShowS
AccountCredentials -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountCredentials] -> ShowS
$cshowList :: [AccountCredentials] -> ShowS
show :: AccountCredentials -> String
$cshow :: AccountCredentials -> String
showsPrec :: Int -> AccountCredentials -> ShowS
$cshowsPrec :: Int -> AccountCredentials -> ShowS
Show)

json ''AccountCredentials