mirror of
https://github.com/alaudidaelark/coupon-servant.git
synced 2026-03-07 22:12:34 +00:00
updated readme
This commit is contained in:
10
README.md
10
README.md
@@ -1 +1,11 @@
|
|||||||
# coupon-servant
|
# 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)
|
||||||
@@ -95,6 +95,7 @@ computeBill c b = do productLimit <- couponApplicable
|
|||||||
return $ customerLimit $ entityVal <$> cm
|
return $ customerLimit $ entityVal <$> cm
|
||||||
upsProdCoupon (ProductFlat cf) = do upsertBy (newUprod cf) (newProdCoupon cf b) [ProductCouponPused +=. 1]
|
upsProdCoupon (ProductFlat cf) = do upsertBy (newUprod cf) (newProdCoupon cf b) [ProductCouponPused +=. 1]
|
||||||
return ()
|
return ()
|
||||||
|
--TODO - how to update product table for cart coupons
|
||||||
upsProdCoupon _ = return ()
|
upsProdCoupon _ = return ()
|
||||||
priceLimit = couponMin_price c < billAmount b
|
priceLimit = couponMin_price c < billAmount b
|
||||||
couponUsageLimit = couponUsed c < couponUsage_limit c
|
couponUsageLimit = couponUsed c < couponUsage_limit c
|
||||||
|
|||||||
Reference in New Issue
Block a user