{-# LANGUAGE DeriveGeneric #-}

-- | Provides the 'Donation' type
--
-- Generally instantiated by 'Web.ExtraLife.API.recentDonations'
module Web.ExtraLife.Donation where

import Prelude
import Data.Time    as Time
import Data.Text             ( Text )
import GHC.Generics          ( Generic )

import Data.Aeson   as Aeson

-- | Represents a single donation made to a donation drive.
data Donation = Donation
    { Donation -> Maybe Text
displayName    :: Maybe Text
    , Donation -> Maybe Text
message        :: Maybe Text
    , Donation -> Int
participantID  :: Int
    , Donation -> Float
amount         :: Float
    , Donation -> Maybe Text
donorID        :: Maybe Text
    , Donation -> UTCTime
createdDateUTC :: !Time.UTCTime
    , Donation -> String
avatarImageURL :: !String
    } deriving ( Int -> Donation -> ShowS
[Donation] -> ShowS
Donation -> String
(Int -> Donation -> ShowS)
-> (Donation -> String) -> ([Donation] -> ShowS) -> Show Donation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Donation] -> ShowS
$cshowList :: [Donation] -> ShowS
show :: Donation -> String
$cshow :: Donation -> String
showsPrec :: Int -> Donation -> ShowS
$cshowsPrec :: Int -> Donation -> ShowS
Show, (forall x. Donation -> Rep Donation x)
-> (forall x. Rep Donation x -> Donation) -> Generic Donation
forall x. Rep Donation x -> Donation
forall x. Donation -> Rep Donation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Donation x -> Donation
$cfrom :: forall x. Donation -> Rep Donation x
Generic )
instance FromJSON Donation
instance ToJSON Donation