Please refer ReadMeAlso.pdf for problem statement and solution approach.
Language: C# Tools: Visual Studio 2007 Professional Version 15.7.4 Framework: .Net core 2.1
How to run:
- Clone the repo from https://github.com/Vikas-Kaushik/AgodaAssignmentV1/
- Configure max requests, slot time, time to block values in appsettings.json
- Get postman, dotNet sdk 2.1 and Visual studio code installed on your machine.
- Open the solution folder i.e. "AgodaAssignmentV1\code" in Visual Studio Code
- Hit F5 to run
- Open "AgodaAssignmentV1\Hotels.API.Tests.postman_collection.json" in postman.
- Run the collection
Just FYI:
- File: "AgodaAssignmentV1\code\RateLimitService\RateLimitService.cs" has the algorithm implemented
- Use this to test it, File: "AgodaAssignmentV1\code\RateLimitServiceTest\RateLimitServiceShould.cs"
- Enpoints exposed are: "/api/hotels/city/{cityName}" and "/api/hotels/room/{roomType}"
Here're more details: [embed]https://raw.githubusercontent.com/vkaushik/AgodaAssignmentV1/master/ReadMeAlso.pdf[/embed]
![embed]https://raw.githubusercontent.com/vkaushik/AgodaAssignmentV1/master/ReadMeAlso.pdf[/embed]