Trivago Case Study Solution
Assumption
In the real world, pooling rooms from advertisers would be done by a background job. For a faster feedback loop for testing purposes, I created a command that will do this and save the data pooled.
Run testcases with composer test
Setup Instructions
After extracting the project, run the following commands to get started
- run
docker-compose up --build -d
to build docker images - run
docker-compose exec trivago_api php artisan migrate
to run database migrations - run
docker-compose exec trivago_api php artisan advertisers:pool
to pool advertisers for rooms - visit `http://localhost:9002/v1/rooms
Tools Used
- Framework: Lumen.
- Database: Mysql
- Api Documentation: OpenApi aka Swagger
Design Patterns and Principles
- Repository Pattern
- Factory Pattern
- Solid Principles