aboutsummaryrefslogtreecommitdiff
path: root/src/server/Model/Json/Payment.hs
blob: 8923c131ee8a68f8429c53cc04c260b8fbd5fb4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{-# 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