/siso-api

Primary LanguageKotlin

SISO-API

Maven CI/CD

Micronaut 3.7.1 Documentation


Feature hibernate-jpa documentation

Feature security documentation

Feature jdbc-hikari documentation

Feature http-client documentation

Feature testcontainers documentation

Feature test-resources documentation

Feature security-jwt documentation

Feature flyway documentation

RUN THIS APP

docker-compose up

Requests

Login

curl --location --request POST 'localhost:9001/oauth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "username": "teste@gmail.com",
    "password": "Mudar@123"
}'

Create User

curl --location --request POST 'localhost:9001/users' \
--header 'Authorization: Bearer {admin_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "teste@gmail.com",
    "password": "Mudar@123"
}'

Refresh Token

curl --location --request POST 'localhost:9001/oauth/access_token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "grant_type": "refresh_token",
    "refresh_token": "eyJhbGciOiJIUzI1NiJ9.YTY3MWUzNTktMWYxZC00ZTBkLWE1OWEtZWNmNmNkMTk0MDQz.0sdzFhdfTQfjzhk3rl4pnFxrrN_h5Wnsaek6oLiDruU"
}'

Create Customer

curl --location --request POST 'localhost:9001/customers' \
--header 'Authorization: Bearer {user_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "customer teste",
    "document": "44444411111",
    "email": "customer@gmail.com",
    "birth_date": "1990-03-03"
}'

Find Customer By Id

curl --location --request GET 'localhost:9001/customers/1' \
--header 'Authorization: Bearer {user_token}'

Delete Customer By Id

curl --location --request DELETE 'localhost:9001/customers/1' \
--header 'Authorization: Bearer {user_token}'

Update Customer By Id

curl --location --request PUT 'localhost:9001/customers/1' \
--header 'Authorization: Bearer {user_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "customer teste Alterado ",
    "document": "11111111111 alterado",
    "email": "customer-alterado@gmail.com",
    "birth_date": "2019-01-14"
}'

Find all Customers By UserId

curl --location --request GET 'localhost:9001/customers?size=20&page=0' \
--header 'Authorization: Bearer {user_token}'

Search By Customer Name

curl --location --request GET 'localhost:9001/customers/search?name=Maria' \
--header 'Authorization: Bearer {user_token}'

Update User Password

curl --location --request PATCH 'localhost:9001/users/password' \
--header 'Authorization: Bearer {user_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "old_password": "Mudar@123",
    "new_password": "Teste1234",
    "new_password_confirmation": "Teste1234"
}'