Test design for an api with a product crud, external api consumption, automated tests and design standards
- Docker Compose
-
Init docker
docker-compose up -d
-
Access terminal from docker
docker-compose exec api sh
-
Run commands to migrate
php artisan migrate --seed
-
Queue (if you needed)
php artisan queue:work
Headers
Content-Type = application/json
Accept = application/json
- Get all products
GET /api/product
- Create product
POST /api/product
Body params required
{
"name": "name",
"quantity": 0,
"type": 1
}
- Get product
GET /api/product/{id}
- Update product
PUT /api/product/{id}
- Delete product
DELETE /api/product/{id}
- Get all types
GET /api/type
- Create type
POST /api/type
Body
{
"name": "name",
}
- Update type
PUT /api/type/{id}