draft out types for journal
This commit is contained in:
parent
64aaec2b98
commit
6fa47c0e1e
1 changed files with 45 additions and 8 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue