DavidPDP / coupon_engine

Coupon Engine
http://coupon-engine-app.eba-2c4tzz2w.sa-east-1.elasticbeanstalk.com/webjars/swagger-ui/index.html
MIT License
0 stars 0 forks source link

[Api] Create coupon API #2

Closed DavidPDP closed 2 years ago

DavidPDP commented 2 years ago

Describe the solution you'd like [Level 2] Create a REST API, with the “/coupon/” service where the item_ids list and the amount coupon can be sent and return the items that the user would to buy.

POST → /coupon/

Body { "item_ids": ["MLA1", "MLA2", "MLA3", "MLA4", "MLA5"], "amount": 500 }

Response { "item_ids": ["MLA1", "MLA2", "MLA4", "MLA5"], "total": 480 }

Additional context ● There are users who have thousands of items in favorites. ● This api would need to scale to support traffic up to 100K rpm. ● Users usually mark the same items as favorites.

The price of the items can be consulted through the API: https://api.mercadolibre.com/items

DavidPDP commented 2 years ago

Slow response time seen on first request (https://github.com/reactor/reactor-netty/issues/560).