Skip to content

Instantly share code, notes, and snippets.

View RodrigoVazOliveira's full-sized avatar

Rodrigo Vaz De Oliveira RodrigoVazOliveira

View GitHub Profile
@cami-la
cami-la / API para Sistema de Avaliação de Créditos.md
Last active February 27, 2025 17:54
API para Sistema de Avaliação de Créditos

API para Sistema de Avaliação de Créditos

Uma empresa de empréstimo precisa criar um sistema de análise de solicitação de crédito. Sua tarefa será criar uma API REST SPRING BOOT E KOTLIN 🍃💜 para a empresa fornecer aos seus clientes as seguintes funcionalidades:

  • Cliente (Customer):

    • Cadastrar:
      1. Request: firstName, lastName, cpf, income, email, password, zipCode e street
      2. Response: String

To access the api in this example, first we have to procure the Auth Token (using one of the OAuth2 Flows) containing a scope "canGreet".

Assumption is that the Authorization Server supports OpenId Connect 1.0 specifications.

@adrianoluis
adrianoluis / DocumentUtil.java
Last active May 4, 2024 16:12
Utility class to validate CPF and CNPJ document types. For CPF use isValidSsn and for CNPJ use isValidTfn. Added to repo https://github.com/adrianoluis/misc-tools
public class DocumentUtil {
// CPF
private static final int[] WEIGHT_SSN = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2};
// CNPJ
private static final int[] WEIGHT_TFN = {6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2};
private static int sum(int[] weight, char[] numbers, int length) {
if (length <= 0) return 0;