Skip to content

Separação do projeto de cartões em microsserviços para o curso da Mastertech

Notifications You must be signed in to change notification settings

cardoso-thiago/cards-microservices-apps

Repository files navigation

Mastertech Sistema Cartões OAuth v1.0

Introdução

API para o sistema de cartões com autenticação OAuth

Overview

Sistema de testes criado no curso da Mastertech

Base URLs:

Authentication

  • HTTP Authentication, scheme: bearer

Misc

Get All Customers

Code samples

GET http://localhost:8081/cliente HTTP/1.1
Host: localhost:8081

GET /cliente

Request para obter todos os clientes.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Customer Wrong Validation

Code samples

POST http://localhost:8081/cliente HTTP/1.1
Host: localhost:8081
Content-Type: application/json

POST /cliente

Request para criar um novo cliente, deve dar erro de validação do campo.

Body parameter

{
  "nome": ""
}

Parameters

Name In Type Required Description
body body PostCustomerWrongValidationRequest true none

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Customer by id Wrong Validation

Code samples

GET http://localhost:8081/cliente/X HTTP/1.1
Host: localhost:8081

GET /cliente/X

Request para obter um cliente pelo id, deve dar erro de validação do campo.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Customer by id Not Exists

Code samples

GET http://localhost:8081/cliente/123456789 HTTP/1.1
Host: localhost:8081

GET /cliente/123456789

Request para obter um cliente que não existe. Deve retornar mensagem informativa.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Customer by id

Code samples

GET http://localhost:8081/cliente/3 HTTP/1.1
Host: localhost:8081

GET /cliente/3

Request para obter um cliente por id.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get All Cards

Code samples

GET http://localhost:8081/cartao HTTP/1.1
Host: localhost:8081

GET /cartao

Request para obter todos os cartões cadastrados.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Card

Code samples

POST http://localhost:8081/cartao HTTP/1.1
Host: localhost:8081
Content-Type: application/json

POST /cartao

Request para criar um novo cartão associado a um cliente que existe.

Body parameter

{
  "numero": "112358132134",
  "clienteId": 3
}

Parameters

Name In Type Required Description
body body PostCardRequest true none

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Card by id Wrong Validation

Code samples

GET http://localhost:8081/cartao/id/X HTTP/1.1
Host: localhost:8081

GET /cartao/id/X

Request para obter o cartão pelo id. Deve retornar erro de validação do campo.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Card by id Not Exists

Code samples

GET http://localhost:8081/cartao/id/123456 HTTP/1.1
Host: localhost:8081

GET /cartao/id/123456

Request para obter o cartão pelo id. Deve retornar que o cartão não existe.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Card by id

Code samples

GET http://localhost:8081/cartao/id/1 HTTP/1.1
Host: localhost:8081

GET /cartao/id/1

Request para obter o cartão pelo id.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Card by id Created

Code samples

GET http://localhost:8081/cartao/id/3 HTTP/1.1
Host: localhost:8081

GET /cartao/id/3

Request para obter o cartão pelo id recém criado.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Payment Deactivated Error

Code samples

POST http://localhost:8081/pagamento HTTP/1.1
Host: localhost:8081
Content-Type: application/json

POST /pagamento

Request para criar um pagamento no cartão. Deve retornar informando que o cartão está desativado.

Body parameter

{
  "cartao_id": 3,
  "descricao": "Compra de Cerveja",
  "valor": 10.5
}

Parameters

Name In Type Required Description
body body PostPaymentDeactivatedErrorRequest true none

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Patch Card Activation

Code samples

PATCH http://localhost:8081/cartao/112358132134 HTTP/1.1
Host: localhost:8081
Content-Type: application/json

PATCH /cartao/112358132134

Request para ativar um cartão.

Body parameter

{
  "ativo": true
}

Parameters

Name In Type Required Description
body body PatchCardActivationRequest true none

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Card by number

Code samples

GET http://localhost:8081/cartao/112358132134 HTTP/1.1
Host: localhost:8081

GET /cartao/112358132134

Request para obter um cartão pelo número.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Card by number Not Exists

Code samples

GET http://localhost:8081/cartao/123456789101212 HTTP/1.1
Host: localhost:8081

GET /cartao/123456789101212

Request para obter um cartão pelo número. Deve retornar informando que o cartão não existe.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Invoice Wrong Validation

Code samples

GET http://localhost:8081/X/3 HTTP/1.1
Host: localhost:8081

GET /X/3

Request para obter a fatura. Deve retornar erro de validação do campo.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Invoice Customer Not Exists

Code samples

GET http://localhost:8081/123456/3 HTTP/1.1
Host: localhost:8081

GET /123456/3

Request para obter a fatura. Deve retornar que o cliente não existe.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Invoice Card Not Exists

Code samples

GET http://localhost:8081/3/123456 HTTP/1.1
Host: localhost:8081

GET /3/123456

Request para obter a fatura. Deve retornar que o cartão não existe.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Get Invoice

Code samples

GET http://localhost:8081/3/3 HTTP/1.1
Host: localhost:8081

GET /3/3

Request para obter a fatura.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Pay Invoice Wrong Validation

Code samples

POST http://localhost:8081/X/3/pagar HTTP/1.1
Host: localhost:8081

POST /X/3/pagar

Request para pagar a fatura. Deve retornar erro de validação do campo.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Pay Invoice Customer Not Exists

Code samples

POST http://localhost:8081/123456/3/pagar HTTP/1.1
Host: localhost:8081

POST /123456/3/pagar

Request para pagar a fatura. Deve retornar informando que o cliente não existe.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Pay Invoice Card Not Exists

Code samples

POST http://localhost:8081/3/123456/pagar HTTP/1.1
Host: localhost:8081

POST /3/123456/pagar

Request para pagar a fatura. Deve retornar informando que o cartão não existe.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Pay Invoice

Code samples

POST http://localhost:8081/3/3/pagar HTTP/1.1
Host: localhost:8081

POST /3/3/pagar

Request para pagar a fatura.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Expire Card Wrong Validation

Code samples

POST http://localhost:8081/X/3/expirar HTTP/1.1
Host: localhost:8081

POST /X/3/expirar

Request para expirar o cartão do cliente. Deve retornar erro de validação do campo.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Expire Card Customer Not Exists

Code samples

POST http://localhost:8081/123456/3/expirar HTTP/1.1
Host: localhost:8081

POST /123456/3/expirar

Request para expirar o cartão do cliente. Deve retornar que o cliente não existe.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Expire Card Not Exists

Code samples

POST http://localhost:8081/3/123456/expirar HTTP/1.1
Host: localhost:8081

POST /3/123456/expirar

Request para expirar o cartão do cliente. Deve retornar que o cartão não existe.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Post Expire Card

Code samples

POST http://localhost:8081/3/3/expirar HTTP/1.1
Host: localhost:8081

POST /3/3/expirar

Request para expirar o cartão do cliente.

Responses

Status Meaning Description Schema
200 OK none None
To perform this operation, you must be authenticated by means of one of the following methods: httpBearer

Schemas

PostCustomerWrongValidationRequest

{
  "nome": ""
}

PostCustomerWrongValidationRequest

Properties

Name Type Required Restrictions Description
nome string true none none

PostCustomerRequest

{
  "nome": "Leonardo Fibonacci"
}

PostCustomerRequest

Properties

Name Type Required Restrictions Description
nome string true none none

PostCardRequest

{
  "numero": "112358132134",
  "clienteId": 3
}

PostCardRequest

Properties

Name Type Required Restrictions Description
numero string true none none
clienteId integer(int32) true none none

PostCardDuplicatedErrorRequest

{
  "numero": "112358132134",
  "clienteId": 3
}

PostCardDuplicatedErrorRequest

Properties

Name Type Required Restrictions Description
numero string true none none
clienteId integer(int32) true none none

PostPaymentDeactivatedErrorRequest

{
  "cartao_id": 3,
  "descricao": "Compra de Cerveja",
  "valor": 10.5
}

PostPaymentDeactivatedErrorRequest

Properties

Name Type Required Restrictions Description
cartao_id integer(int32) true none none
descricao string true none none
valor number true none none

PatchCardActivationRequest

{
  "ativo": true
}

PatchCardActivationRequest

Properties

Name Type Required Restrictions Description
ativo boolean true none none

PostPaymentWrongValidationsRequest

{
  "cartao_id": 3,
  "descricao": "",
  "valor": 0
}

PostPaymentWrongValidationsRequest

Properties

Name Type Required Restrictions Description
cartao_id integer(int32) true none none
descricao string true none none
valor integer(int32) true none none

PostPaymentCardNotExistsRequest

{
  "cartao_id": 123456,
  "descricao": "Compra de Cerveja",
  "valor": 10.5
}

PostPaymentCardNotExistsRequest

Properties

Name Type Required Restrictions Description
cartao_id integer(int32) true none none
descricao string true none none
valor number true none none

PostPaymentRequest

{
  "cartao_id": 3,
  "descricao": "Compra de Cerveja",
  "valor": 10.5
}

PostPaymentRequest

Properties

Name Type Required Restrictions Description
cartao_id integer(int32) true none none
descricao string true none none
valor number true none none

PostPaymentExpiredErrorRequest

{
  "cartao_id": 3,
  "descricao": "Compra de Cerveja",
  "valor": 10.5
}

PostPaymentExpiredErrorRequest

Properties

Name Type Required Restrictions Description
cartao_id integer(int32) true none none
descricao string true none none
valor number true none none

About

Separação do projeto de cartões em microsserviços para o curso da Mastertech

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages