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/Payment.hs | |
parent | 5c110716cfda6e616a795edd12f2012b132dca9f (diff) |
Replace persistent by sqlite-simple
Diffstat (limited to 'src/server/Model/Json/Payment.hs')
-rw-r--r-- | src/server/Model/Json/Payment.hs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/server/Model/Json/Payment.hs b/src/server/Model/Json/Payment.hs index 04c6de8..e406c0f 100644 --- a/src/server/Model/Json/Payment.hs +++ b/src/server/Model/Json/Payment.hs @@ -2,16 +2,19 @@ module Model.Json.Payment ( Payment(..) + , fromPayment ) where -import GHC.Generics - -import Data.Text (Text) import Data.Aeson +import Data.Text (Text) import Data.Time.Calendar (Day) +import GHC.Generics +import Prelude hiding (id) -import Model.Database (PaymentId, UserId) import Model.Frequency +import Model.Payment (PaymentId) +import Model.User (UserId) +import qualified Model.Payment as M data Payment = Payment { id :: PaymentId @@ -24,3 +27,14 @@ data Payment = Payment instance FromJSON Payment instance ToJSON Payment + +fromPayment :: M.Payment -> Payment +fromPayment payment = + Payment + { id = M.id payment + , date = M.date payment + , name = M.name payment + , cost = M.cost payment + , userId = M.userId payment + , frequency = M.frequency payment + } |