LucasTheHacker / card-payment-api

This API receives payment data with credit cards through a JSON file and persists it in the database.
1 stars 0 forks source link

Descrição do Desafio (Enslish version below)

Desafio de Programação em Java Quarkus - Microsserviço de Recebimento e Armazenamento de Pagamento com Cartão de Crédito

Descrição: Você foi designado para desenvolver um microsserviço em Java Quarkus que recebe dados de um pagamento fictício realizado com cartão de crédito e armazena essas informações. O microsserviço deve validar se os dados recebidos estão no formato correto e, em seguida, persistir essas informações em um banco de dados relacional. Além disso, o microsserviço deve fornecer um endpoint HTTP para receber os dados do pagamento e um mecanismo para consulta posterior desses dados armazenados.

Requisitos Técnicos:

Utilize o framework Quarkus para criar o microsserviço Java.

Instruções:

Opcional:

Avaliação:

Java Quarkus Programming Challenge - Microservice for Receiving and Storing Credit Card Payments

Description: You have been assigned to develop a Java Quarkus microservice that receives data from a fictitious credit card payment and stores this information. The microservice should validate if the received data is in the correct format and then persist this information in a relational database. In addition, the microservice should provide an HTTP endpoint to receive the payment data and a mechanism for subsequent query of this stored data.

Technical Requirements:

Instructions:

Optional:

Evaluation:

Solution by Lucas Batista: card-payment-api

Modelo UML da camada REST

Arquitetura da camada REST


Modelo UML da camada MODEL

Arquitetura da camada model


Modelo UML do banco de dados

Arquitetura da camada de persistência

end of authorial documentation.


The documentation below has been generated by Quarkus.

This project uses Quarkus, the Supersonic Subatomic Java Framework.

If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .

Running the application in dev mode

You can run your application in dev mode that enables live coding using:

./mvnw compile quarkus:dev

NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.

Packaging and running the application

The application can be packaged using:

./mvnw package

It produces the quarkus-run.jar file in the target/quarkus-app/ directory. Be aware that it’s not an über-jar as the dependencies are copied into the target/quarkus-app/lib/ directory.

The application is now runnable using java -jar target/quarkus-app/quarkus-run.jar.

If you want to build an über-jar, execute the following command:

./mvnw package -Dquarkus.package.type=uber-jar

The application, packaged as an über-jar, is now runnable using java -jar target/*-runner.jar.

Creating a native executable

You can create a native executable using:

./mvnw package -Dnative

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:

./mvnw package -Dnative -Dquarkus.native.container-build=true

You can then execute your native executable with: ./target/api-pagamento-cartao-1.0-runner

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.

Related Guides

Provided Code

RESTEasy JAX-RS

Easily start your RESTful Web Services

Related guide section...