aboutsummaryrefslogtreecommitdiff
path: root/src/server/Model/Json/Payment.hs
blob: 04c6de8217488dee01189a0f37fcf3d9b7dec443 (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
25
26
{-# LANGUAGE DeriveGeneric #-}

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

import GHC.Generics

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

import Model.Database (PaymentId, UserId)
import Model.Frequency

data Payment = Payment
  { id :: PaymentId
  , date :: Day
  , name :: Text
  , cost :: Int
  , userId :: UserId
  , frequency :: Frequency
  } deriving (Show, Generic)

instance FromJSON Payment
instance ToJSON Payment