draft out types for journal

This commit is contained in:
nek0 2019-08-09 19:21:38 +02:00
parent 64aaec2b98
commit 6fa47c0e1e

View file

@ -1,11 +1,48 @@
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-} -- {-# LANGUAGE OverloadedStrings #-}
module Types.Journal where module Types.Journal where
data JournalEntry import GHC.Generics
= JournalEntry
{ journalEntryDescription :: String import qualified Data.Text as T (Text)
, journalEntryTimestamp :: UTCTime
, journalEntryAmount :: Int import Data.Aeson
, journalEntryIsCheck :: Bool
} import Data.Time.Clock (UTCTime)
data JournalEntry = JournalEntry
{ journalEntryDescription :: T.Text
, journalEntryTimestamp :: UTCTime
, journalEntryAmount :: Int
, journalEntryTotalAmount :: Int
, journalEntryIsCheck :: Bool
}
deriving (Generic, Show)
instance ToJSON JournalEntry where
toEncoding = genericToEncoding defaultOptions
instance FromJSON JournalEntry
data JournalSubmit = JournalSubmit
{ journalSubmitDescription :: T.Text
, journalSubmitAmount :: Int
}
deriving (Generic, Show)
instance ToJSON JournalSubmit where
toEncoding = genericToEncoding defaultOptions
instance FromJSON JournalSubmit
data JournalCashCheck = JournalCashCheck
{ journalCashCheckTotalAmount :: Int
}
deriving (Generic, Show)
instance ToJSON JournalCashCheck where
toEncoding = genericToEncoding defaultOptions
instance FromJSON JournalCashCheck