summaryrefslogtreecommitdiff
path: root/src/Shop/Handler.hs
diff options
context:
space:
mode:
authorFélix Sipma <felix.sipma@no-log.org>2018-02-16 16:26:59 +0100
committerFélix Sipma <felix.sipma@no-log.org>2018-02-16 16:26:59 +0100
commit6540c36d87d26c024fa453576aceb1f755f76ded (patch)
tree50d454c205fb820ff86cc0340a35f1011b3c1577 /src/Shop/Handler.hs
parent0f91cabd1e0bc04e632cf1c258a77ada12fef673 (diff)
add TODOs
Diffstat (limited to 'src/Shop/Handler.hs')
-rw-r--r--src/Shop/Handler.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Shop/Handler.hs b/src/Shop/Handler.hs
index c3b0eda..f873535 100644
--- a/src/Shop/Handler.hs
+++ b/src/Shop/Handler.hs
@@ -9,7 +9,6 @@ module Shop.Handler where
import Control.Monad.Logger (LoggingT, runStdoutLoggingT,
logInfo, logWarn)
import Formatting (format, (%), fixed)
---import Formatting.Formatters (fixed)
import Shop.Config
import Shop.Types
import Protolude hiding (product, (%))
@@ -46,9 +45,13 @@ charge chargeform = do
cfg <- ask
-- TODO: send email
let cid = "TODO"
- a = "TODO"
+ -- ^ generate id (uuid)
+ a = show total
$(logInfo) $ "Charge successfully created: \"" <> email chargeform <> "\" (" <> showPrice total <> ")"
- return $ ChargeResponse cid a
+ return ChargeResponse
+ { chargeid = cid
+ , chargeamount = a
+ }
where
total = foldl (\n a -> n + quantity a * prix (product a)) 0 (articles chargeform)