{-# LANGUAGE DeriveGeneric #-}

module Model.Json.Payment
  ( Payment(..)
  ) where

import GHC.Generics

import Data.Time
import Data.Text (Text)
import Data.Aeson

import Model.Database (PaymentId, UserId)

data Payment = Payment
  { id :: PaymentId
  , creation :: UTCTime
  , name :: Text
  , cost :: Int
  , userId :: UserId
  } deriving (Show, Generic)

instance FromJSON Payment
instance ToJSON Payment