aboutsummaryrefslogtreecommitdiff
path: root/src/server/Model/Json/CreatePayment.hs
blob: f117dafbf20944cef92faa78cdda9bd5b901cb42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE DeriveGeneric #-}

module Model.Json.CreatePayment
  ( CreatePayment(..)
  ) where

import GHC.Generics

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

import Model.Frequency (Frequency)

data CreatePayment = CreatePayment
  { date :: Day
  , name :: Text
  , cost :: Int
  , frequency :: Frequency
  } deriving (Show, Generic)

instance FromJSON CreatePayment