This is a report api microservice build using laravel 9. The goal is only demonstrate knowledge:
git clone https://github.com/danilo4web/reports-api-php.git
docker-compose up -d --build
docker-compose run --rm php composer install
cp .env.example .env
docker-compose run --rm php php artisan migrate --seed
docker-compose run --rm php composer check-psr12
docker-compose run --rm php vendor/bin/phpunit --colors=always
POST http://0.0.0.0:8080/api/v1/reports
{
"sql": "select u.name, t.amount, t.created_at from users u inner join transfers t on u.id = t.user_id"
}
POST http://0.0.0.0:8080/api/v1/reports/export
{
"id": "1",
"dateStart": "2022-11-02",
"dateEnd": "2022-12-30"
}
GET http://0.0.0.0:8080/api/v1/reports/download/fileExample.csv
Download the postman collection: Download Collection