updated readme

master
Alaudidae Lark 2017-05-07 19:08:57 +05:30
parent ae16b63e75
commit 5979f25ad8
2 changed files with 11 additions and 0 deletions

View File

@ -1 +1,11 @@
# coupon-servant
## Setup
* put the postgres connection string in `Main.hs`
* run `stack build` then
* run `stack exec coupon-servant-exe` to start the server
## Testing
* run `docker pull swaggerapi/swagger-ui` to download swagger-ui container
* run `docker run -d --name swui -e API_URL="http://localhost:3000/swagger.json" -p 5341:8080/tcp swaggerapi/swagger-ui`
* point your browser to [swagger-ui](http://localhost:5341)

View File

@ -95,6 +95,7 @@ computeBill c b = do productLimit <- couponApplicable
return $ customerLimit $ entityVal <$> cm
upsProdCoupon (ProductFlat cf) = do upsertBy (newUprod cf) (newProdCoupon cf b) [ProductCouponPused +=. 1]
return ()
--TODO - how to update product table for cart coupons
upsProdCoupon _ = return ()
priceLimit = couponMin_price c < billAmount b
couponUsageLimit = couponUsed c < couponUsage_limit c