simple-transaction-api
Requisitos:
- Docker
>=
20.10 - Docker Compose
>=
1.29
Docker:
Instalação
- Subir o ambiente:
docker-compose up -d nginx
- Instalar dependências:
docker-compose run --rm composer install
- Copiar .env:
cp .env.example .env
- Gerar
APP_KEY
:
docker-compose run --rm artisan key:generate
- Gerar
migrations
eseeds
:
docker-compose run --rm artisan migrate --seed
- Iniciar serviço de filas:
docker-compose run -d queue-work
Endpoints:
Transaction
POST api/transaction
// Payload Example
{
"payer_id": 1,
"payee_id": 2,
"value": 100
}
Users
GET|HEAD api/users
GET|HEAD api/users/{user}
POST api/users
// Payload Example
{
"full_name": "Google",
"user_type": "company",
"document": "83834383000120",
"email": "google@google.com",
"password": "12345678"
}
PUT|PATCH api/users/{user}
// Payload Example
{
"full_name": "Christian Bale",
"user_type": "person",
"document": "33850997065",
"email": "c.bale@gmail.com",
"password": "12345678"
}
DELETE api/users/{user}
Testes
docker-compose run --rm test