Aplicación PHP 8 con Symfony, diseñada para optimizar reservas y calcular estadísticas.
- Docker ≥ 20.x
- Docker Compose ≥ 2.x
- Make ≥ 4.x
- Construir la imagen Docker y dependencias:
make start- Levantar los contenedores:
make docker-up- Acceder al bash del contenedor (opcional):
make bash- Detener contenedores:
make docker-down- Reiniciar contenedores:
make docker-restartEjecutar todos los tests:
make testTests unitarios únicamente:
make test-unitTests de integración únicamente:
make test-integrationVerificar estilo de código:
make cs-checkCorregir estilo de código automáticamente:
make cs-fixEjecutar análisis estático con PHPStan:
make phpstanEjecutar Rector (dry-run):
make rectorAplicar cambios con Rector:
make rector-fixPipeline completo de calidad:
make qualityAplicar correcciones automáticas de calidad:
make quality-fixLa aplicación expone los siguientes endpoints:
| Método | Ruta | Descripción |
|---|---|---|
| POST | /stats | Given a list of booking requests, return the average, minimum, and maximum profit per night taking into account all the booking requests in the payload. The concept “profit per night” follows this calculation: |
| POST | /maximize | Given a list of booking requests, return the best combination of requests that maximizes total profits. |
Ejemplo usando curl:
make api-test-stats
make api-test-maximize
make api-test-complexmake api-docsAccede a http://localhost:8081
make clean
make cache-clearInstalar dependencias, ejecutar tests y chequear calidad de código:
make ci