diff options
author | Joris | 2015-10-01 14:10:45 +0200 |
---|---|---|
committer | Joris | 2015-10-01 14:10:45 +0200 |
commit | fff7336e06ab4c98adda3fea8a86c7d4d4b9b9bb (patch) | |
tree | 702cec84587d18e692e6877557a05f15cbd5fc4f /src/server/Model/Payment.hs | |
parent | d7f737db7329acfedb87c5ad02a56023a9670fe4 (diff) |
Factor job listener
Diffstat (limited to 'src/server/Model/Payment.hs')
-rw-r--r-- | src/server/Model/Payment.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/server/Model/Payment.hs b/src/server/Model/Payment.hs index 469f0d3..25b1bb7 100644 --- a/src/server/Model/Payment.hs +++ b/src/server/Model/Payment.hs @@ -42,11 +42,12 @@ getUserMonthlyPayments userId = getMonthlyPayments :: Persist [Entity Payment] getMonthlyPayments = - selectList - [ PaymentDeletedAt P.==. Nothing - , PaymentFrequency P.==. Monthly - ] - [ Desc PaymentCreation ] + select $ + from $ \payment -> do + where_ (isNothing (payment ^. PaymentDeletedAt)) + where_ (payment ^. PaymentFrequency E.==. val Monthly) + orderBy [desc (lower_ (payment ^. PaymentName))] + return payment getJsonPayment :: Entity Payment -> P.Payment getJsonPayment paymentEntity = |