-- | Description: Account by name query data type
module Polysemy.Account.Data.AccountByName where

import Polysemy.Account.Data.AccountName (AccountName)

-- | Query payload for looking up accounts by name.
data AccountByName =
  AccountByName { AccountByName -> AccountName
name :: AccountName }
  deriving stock (AccountByName -> AccountByName -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountByName -> AccountByName -> Bool
$c/= :: AccountByName -> AccountByName -> Bool
== :: AccountByName -> AccountByName -> Bool
$c== :: AccountByName -> AccountByName -> Bool
Eq, Int -> AccountByName -> ShowS
[AccountByName] -> ShowS
AccountByName -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountByName] -> ShowS
$cshowList :: [AccountByName] -> ShowS
show :: AccountByName -> String
$cshow :: AccountByName -> String
showsPrec :: Int -> AccountByName -> ShowS
$cshowsPrec :: Int -> AccountByName -> ShowS
Show, forall x. Rep AccountByName x -> AccountByName
forall x. AccountByName -> Rep AccountByName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountByName x -> AccountByName
$cfrom :: forall x. AccountByName -> Rep AccountByName x
Generic, Eq AccountByName
AccountByName -> AccountByName -> Bool
AccountByName -> AccountByName -> Ordering
AccountByName -> AccountByName -> AccountByName
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: AccountByName -> AccountByName -> AccountByName
$cmin :: AccountByName -> AccountByName -> AccountByName
max :: AccountByName -> AccountByName -> AccountByName
$cmax :: AccountByName -> AccountByName -> AccountByName
>= :: AccountByName -> AccountByName -> Bool
$c>= :: AccountByName -> AccountByName -> Bool
> :: AccountByName -> AccountByName -> Bool
$c> :: AccountByName -> AccountByName -> Bool
<= :: AccountByName -> AccountByName -> Bool
$c<= :: AccountByName -> AccountByName -> Bool
< :: AccountByName -> AccountByName -> Bool
$c< :: AccountByName -> AccountByName -> Bool
compare :: AccountByName -> AccountByName -> Ordering
$ccompare :: AccountByName -> AccountByName -> Ordering
Ord)

instance IsString AccountByName where
  fromString :: String -> AccountByName
fromString =
    AccountName -> AccountByName
AccountByName forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. IsString a => String -> a
fromString