aboutsummaryrefslogtreecommitdiff
path: root/src/server/Model/Json/EditPayment.hs
blob: 4e91000cba5728ec7cf2318a33d23d1205e9c82b (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.EditPayment
  ( EditPayment(..)
  ) where

import GHC.Generics

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

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

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

instance FromJSON EditPayment