diff options
author | Joris | 2017-06-05 18:02:13 +0200 |
---|---|---|
committer | Joris | 2017-06-05 18:02:13 +0200 |
commit | 0b191f5c48edffc9da3e38c284e9640fd82e7cb1 (patch) | |
tree | c729e53822e7c41c1a854d82d25636e58ee65c9f /src/server/Model/Json/PaymentCategory.hs | |
parent | 5c110716cfda6e616a795edd12f2012b132dca9f (diff) |
Replace persistent by sqlite-simple
Diffstat (limited to 'src/server/Model/Json/PaymentCategory.hs')
-rw-r--r-- | src/server/Model/Json/PaymentCategory.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/server/Model/Json/PaymentCategory.hs b/src/server/Model/Json/PaymentCategory.hs index edd4388..fd97674 100644 --- a/src/server/Model/Json/PaymentCategory.hs +++ b/src/server/Model/Json/PaymentCategory.hs @@ -2,14 +2,15 @@ module Model.Json.PaymentCategory ( PaymentCategory(..) + , fromPaymentCategory ) where -import GHC.Generics - import Data.Aeson import Data.Text (Text) +import GHC.Generics -import Model.Database (CategoryId) +import Model.Category (CategoryId) +import qualified Model.PaymentCategory as M data PaymentCategory = PaymentCategory { name :: Text @@ -17,3 +18,6 @@ data PaymentCategory = PaymentCategory } deriving (Show, Generic) instance ToJSON PaymentCategory + +fromPaymentCategory :: M.PaymentCategory -> PaymentCategory +fromPaymentCategory pc = PaymentCategory (M.name pc) (M.category pc) |