aboutsummaryrefslogtreecommitdiff
path: root/common/src/Common/Model/CreatePayment.hs
blob: c61423ce7d731edb968e966bc25af6264efa4678 (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
27
28
29
30
31
32
33
34
module Common.Model.CreatePayment
  ( CreatePaymentError(..)
  , CreatePayment(..)
  ) where

import           Data.Aeson             (FromJSON, ToJSON)
import           Data.Text              (Text)
import           Data.Time.Calendar     (Day)
import           GHC.Generics           (Generic)

import           Common.Model.Category  (CategoryId)
import           Common.Model.Frequency (Frequency)

data CreatePaymentError = CreatePaymentError
  { _createPaymentError_name      :: Maybe Text
  , _createPaymentError_cost      :: Maybe Text
  , _createPaymentError_date      :: Maybe Text
  , _createPaymentError_category  :: Maybe Text
  , _createPaymentError_frequency :: Maybe Text
  } deriving (Show, Generic)

instance FromJSON CreatePaymentError
instance ToJSON CreatePaymentError

data CreatePayment = CreatePayment
  { _createPayment_name      :: Text
  , _createPayment_cost      :: Int
  , _createPayment_date      :: Day
  , _createPayment_category  :: CategoryId
  , _createPayment_frequency :: Frequency
  } deriving (Show, Generic)

instance FromJSON CreatePayment
instance ToJSON CreatePayment