aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJoris2019-08-05 21:53:30 +0200
committerJoris2019-08-05 21:53:30 +0200
commitbc81084933f8ec1bfe6c2834defd12243117fdd9 (patch)
tree116d5e8ccd5f234d7376f4f14c74657d7c7e4792 /common
parent2741f47ef7b87255203bc2f7f7b2b9140c70b8f0 (diff)
downloadbudget-bc81084933f8ec1bfe6c2834defd12243117fdd9.tar.gz
budget-bc81084933f8ec1bfe6c2834defd12243117fdd9.tar.bz2
budget-bc81084933f8ec1bfe6c2834defd12243117fdd9.zip
Use updated payment categories from payment add in payment’s table
Diffstat (limited to 'common')
-rw-r--r--common/common.cabal1
-rw-r--r--common/src/Common/Model.hs1
-rw-r--r--common/src/Common/Model/CreatedPayment.hs17
3 files changed, 19 insertions, 0 deletions
diff --git a/common/common.cabal b/common/common.cabal
index 9881c64..b7e0416 100644
--- a/common/common.cabal
+++ b/common/common.cabal
@@ -29,6 +29,7 @@ Library
Exposed-modules:
Common.Model
Common.Model.CreatePayment
+ Common.Model.CreatedPayment
Common.Model.Email
Common.Model.Payment
Common.Model.SignInForm
diff --git a/common/src/Common/Model.hs b/common/src/Common/Model.hs
index b0e0491..64db890 100644
--- a/common/src/Common/Model.hs
+++ b/common/src/Common/Model.hs
@@ -2,6 +2,7 @@ module Common.Model (module X) where
import Common.Model.Category as X
import Common.Model.CreateCategory as X
+import Common.Model.CreatedPayment as X
import Common.Model.CreateIncome as X
import Common.Model.CreatePayment as X
import Common.Model.Currency as X
diff --git a/common/src/Common/Model/CreatedPayment.hs b/common/src/Common/Model/CreatedPayment.hs
new file mode 100644
index 0000000..c1bba29
--- /dev/null
+++ b/common/src/Common/Model/CreatedPayment.hs
@@ -0,0 +1,17 @@
+module Common.Model.CreatedPayment
+ ( CreatedPayment(..)
+ ) where
+
+import Data.Aeson (FromJSON, ToJSON)
+import GHC.Generics (Generic)
+
+import Common.Model.Payment (Payment)
+import Common.Model.PaymentCategory (PaymentCategory)
+
+data CreatedPayment = CreatedPayment
+ { _createdPayment_payment :: Payment
+ , _createdPayment_paymentCategory :: PaymentCategory
+ } deriving (Show, Generic)
+
+instance FromJSON CreatedPayment
+instance ToJSON CreatedPayment