Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.79 KB

File metadata and controls

62 lines (46 loc) · 1.79 KB

Test for auth service

node src/server.js (this is to run the server, keeping auth_service folder as root; .env can be accessed like this , you can change the path in the dotconfig file
curl -X POST http://localhost:4000/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"123456","role":"developer"}'

curl -X POST http://localhost:4000/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"123456"}'

curl -X POST http://localhost:4000/auth/api-key
)

Test for negotiation service

curl -X POST http://localhost:5000/negotiate/start \
-H "Content-Type: application/json" \
-d '{"productId":"P1","basePrice":1000,"minPrice":700}'

curl -X POST http://localhost:5000/negotiate/message \
-H "Content-Type: application/json" \
-d '{"sessionId":"SESSION_ID_HERE","message":"Too expensive"}'

curl -X POST http://localhost:5000/negotiate/offer \
-H "Content-Type: application/json" \
-d '{"sessionId":"SESSION_ID_HERE","offer":650}'

Test for pricing engine

curl -X POST http://localhost:6000/pricing/validate \
-H "Content-Type: application/json" \
-d '{"productId":"P1","finalPrice":650}'




curl -X POST http://localhost:6000/pricing/validate \
-H "Content-Type: application/json" \
-d '{"productId":"P1","finalPrice":800}'

curl http://localhost:6000/pricing/rules/P1

Test for coupon service

curl -X POST http://localhost:7000/coupon/generate \
-H "Content-Type: application/json" \
-d '{"productId":"P1","userId":"U1","finalPrice":800}'

curl -X POST http://localhost:7000/coupon/validate \
-H "Content-Type: application/json" \
-d '{"code":"COUPON_CODE","productId":"P1","userId":"U1"}'

curl -X POST http://localhost:7000/coupon/redeem \
-H "Content-Type: application/json" \
-d '{"code":"COUPON_CODE"}'