From 64aaec2b986e8a0c7451c8264b31649c63b90fa1 Mon Sep 17 00:00:00 2001 From: nek0 Date: Thu, 8 Aug 2019 18:59:23 +0200 Subject: [PATCH] make draft fro journal --- src/API.hs | 3 +++ src/Types/Journal.hs | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/Types/Journal.hs diff --git a/src/API.hs b/src/API.hs index 4016b85..8ad9f98 100644 --- a/src/API.hs +++ b/src/API.hs @@ -46,3 +46,6 @@ type UserAPI = :<|> "buy" :> AuthProtect "header-auth" :> ReqBody '[JSON] [PurchaseDetail] :> Post '[JSON] PurchaseResult + + :<|> "journal" :> AuthProtect "header-auth" :> QueryParam "limit" Int + :> QueryParam "offset" Int :> Get '[JSON] [JournalEntry] diff --git a/src/Types/Journal.hs b/src/Types/Journal.hs new file mode 100644 index 0000000..a39492c --- /dev/null +++ b/src/Types/Journal.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +module Types.Journal where + +data JournalEntry + = JournalEntry + { journalEntryDescription :: String + , journalEntryTimestamp :: UTCTime + , journalEntryAmount :: Int + , journalEntryIsCheck :: Bool + }