├── frontend ├── src │ ├── Img │ │ ├── acessoInformacao.png │ │ ├── govbrNegativa.svg │ │ └── govbr.svg │ ├── main.jsx │ ├── utils │ │ ├── formatCurrency.js │ │ └── formatDate.js │ ├── contexto │ │ ├── PrivateRoute.jsx │ │ └── AuthProvider.jsx │ ├── components │ │ ├── Mask │ │ │ └── CpfMask.jsx │ │ ├── Botoes │ │ │ └── ButtonMenu.module.css │ │ ├── Header │ │ │ ├── Header.module.css │ │ │ └── Header.jsx │ │ └── Footer │ │ │ └── Footer.jsx │ ├── pages │ │ ├── Table.module.css │ │ ├── Cpf.module.css │ │ ├── ClienteNaoTemRequisicao.module.css │ │ ├── ClienteNaoCadastrado.jsx │ │ ├── ClienteNaoTemRequisicao.jsx │ │ ├── CadastroCliente.module.css │ │ ├── ClienteNaoCadastrado.module.css │ │ ├── CadastroRequisicao.module.css │ │ ├── Home.jsx │ │ ├── Login.module.css │ │ ├── Home.module.css │ │ ├── CustomSelect.jsx │ │ └── BuscarRequisicao.jsx │ ├── App.jsx │ ├── services │ │ └── appService.jsx │ ├── dtos │ │ └── clienteCompletoDto.types.ts │ └── assets │ │ └── react.svg ├── vite.config.js ├── .gitignore ├── package.json ├── index.html ├── eslint.config.js ├── public │ └── vite.svg └── README.md ├── src ├── main │ ├── java │ │ └── com │ │ │ └── analisedecredito │ │ │ └── aplicacao_analise_credito │ │ │ ├── exception │ │ │ └── ResourceNotFoundException.java │ │ │ ├── repository │ │ │ ├── DespesaTipoRepository.java │ │ │ ├── PatrimonioTipoRepository.java │ │ │ ├── EmprestimoObjetivoRepository.java │ │ │ ├── EmprestimoUrgenciaRepository.java │ │ │ ├── EmprestimoModalidadeRepository.java │ │ │ ├── ModalidadePagamentoRepository.java │ │ │ ├── ClienteRepository.java │ │ │ ├── RendaTipoRepository.java │ │ │ ├── JurosRepository.java │ │ │ ├── IofAtualRepository.java │ │ │ ├── PerfilClienteRepository.java │ │ │ ├── DespesaRepository.java │ │ │ ├── RendaFonteRepository.java │ │ │ ├── PatrimonioRepository.java │ │ │ └── EmprestimoRequisicaoRepository.java │ │ │ ├── AplicacaoAnaliseCreditoApplication.java │ │ │ ├── config │ │ │ ├── RestTemplateConfig.java │ │ │ ├── SpringDocConfig.java │ │ │ ├── WebConfig.java │ │ │ └── SecurityConfig.java │ │ │ ├── dto │ │ │ ├── BeneficiadoDto.java │ │ │ ├── JurosDto.java │ │ │ ├── RendaTipoDto.java │ │ │ ├── EmprestimoUrgenciaDto.java │ │ │ ├── DespesaTipoDto.java │ │ │ ├── EmprestimoObjetivoDto.java │ │ │ ├── PatrimonioTipoDto.java │ │ │ ├── EmprestimoModalidadeDto.java │ │ │ ├── ModalidadePagamentoDto.java │ │ │ ├── IofAtualDto.java │ │ │ ├── AnaliseCreditoDto.java │ │ │ ├── PerfilClienteReadDto.java │ │ │ ├── PerfilClienteDto.java │ │ │ ├── RendaFonteDto.java │ │ │ ├── DespesaReadDto.java │ │ │ ├── PatrimonioDto.java │ │ │ ├── RendaFonteReadDto.java │ │ │ ├── DespesaDto.java │ │ │ ├── PatrimonioReadDto.java │ │ │ ├── ClienteReadDto.java │ │ │ ├── ClienteDto.java │ │ │ └── ClienteCompletoReadDto.java │ │ │ ├── service │ │ │ ├── BeneficiadoService.java │ │ │ ├── IofAtualService.java │ │ │ ├── RendaTipoService.java │ │ │ ├── DespesaTipoService.java │ │ │ ├── PatrimonioTipoService.java │ │ │ ├── EmprestimoUrgenciaService.java │ │ │ ├── EmprestimoObjetivoService.java │ │ │ ├── ModalidadePagamentoService.java │ │ │ ├── EmprestimoModalidadeService.java │ │ │ ├── PerfilClienteService.java │ │ │ ├── RendaFonteService.java │ │ │ └── PatrimonioService.java │ │ │ ├── controller │ │ │ ├── BeneficiadoController.java │ │ │ ├── ModalidadePagamentoController.java │ │ │ ├── PerfilClienteController.java │ │ │ ├── IofAtualController.java │ │ │ ├── DespesaTipoController.java │ │ │ └── PatrimonioController.java │ │ │ └── model │ │ │ ├── Juros.java │ │ │ ├── RendaTipo.java │ │ │ ├── EmprestimoUrgencia.java │ │ │ ├── EmprestimoObjetivo.java │ │ │ ├── DespesaTipo.java │ │ │ ├── EmprestimoModalidade.java │ │ │ ├── PatrimonioTipo.java │ │ │ ├── ModalidadePagamento.java │ │ │ ├── IofAtual.java │ │ │ ├── PerfilCliente.java │ │ │ ├── RendaFonte.java │ │ │ ├── Despesa.java │ │ │ ├── Patrimonio.java │ │ │ └── Cliente.java │ └── resources │ │ ├── META-INF │ │ └── additional-spring-configuration-metadata.json │ │ └── application.properties ├── stubs │ └── mappings │ │ └── beneficiado.json └── .mvn │ └── wrapper │ └── maven-wrapper.properties ├── .gitignore ├── .env ├── docker-compose.yml ├── pom.xml └── README.md /frontend/src/Img/acessoInformacao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/renatajane/analise-credito/HEAD/frontend/src/Img/acessoInformacao.png -------------------------------------------------------------------------------- /frontend/src/main.jsx: -------------------------------------------------------------------------------- 1 | import { StrictMode } from 'react' 2 | import { createRoot } from 'react-dom/client' 3 | import App from './App.jsx' 4 | 5 | createRoot(document.getElementById('root')).render( 6 | 7 | 8 | , 9 | ) 10 | -------------------------------------------------------------------------------- /frontend/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | // server: { 8 | // proxy: { 9 | // '/api': 'http://localhost:8080', 10 | // }, 11 | // }, 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.exception; 2 | 3 | public class ResourceNotFoundException extends RuntimeException{ 4 | public ResourceNotFoundException(String message) { 5 | super(message); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /frontend/src/utils/formatCurrency.js: -------------------------------------------------------------------------------- 1 | // Função para formatar valores no formato R$ 00,00 2 | export const formatCurrency = (value) => { 3 | const formatter = new Intl.NumberFormat('pt-BR', { 4 | style: 'currency', 5 | currency: 'BRL', 6 | }); 7 | return formatter.format(value); 8 | }; 9 | 10 | export default formatCurrency; -------------------------------------------------------------------------------- /src/stubs/mappings/beneficiado.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "method": "GET", 4 | "url": "/beneficiado/84688392052" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "body": "{ \"cpf\": \"84688392052\", \"valorBeneficio\": 750.00 }", 9 | "headers": { 10 | "Content-Type": "application/json" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /frontend/src/contexto/PrivateRoute.jsx: -------------------------------------------------------------------------------- 1 | import { Outlet, Navigate } from 'react-router-dom'; 2 | import { useAuth } from './AuthProvider'; 3 | 4 | const PrivateRoute = () => { 5 | const { token } = useAuth(); 6 | if (!token) { 7 | return ; 8 | } 9 | 10 | return ; 11 | }; 12 | 13 | export default PrivateRoute; -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /frontend/src/utils/formatDate.js: -------------------------------------------------------------------------------- 1 | // Função para formatar a data no formato dd/mm/yyyy 2 | export const formatDate = (dateString) => { 3 | if (!dateString) return ''; 4 | 5 | const date = new Date(dateString); 6 | const day = String(date.getDate()).padStart(2, '0'); 7 | const month = String(date.getMonth() + 1).padStart(2, '0'); 8 | const year = date.getFullYear(); 9 | 10 | return `${day}/${month}/${year}`; 11 | }; 12 | 13 | export default formatDate; -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/DespesaTipoRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.analisedecredito.aplicacao_analise_credito.model.DespesaTipo; 7 | 8 | @Repository 9 | public interface DespesaTipoRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/PatrimonioTipoRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.analisedecredito.aplicacao_analise_credito.model.PatrimonioTipo; 7 | 8 | @Repository 9 | public interface PatrimonioTipoRepository extends JpaRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/AplicacaoAnaliseCreditoApplication.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class AplicacaoAnaliseCreditoApplication { 8 | public static void main(String[] args) { 9 | SpringApplication.run(AplicacaoAnaliseCreditoApplication.class, args); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/config/RestTemplateConfig.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.client.RestTemplate; 6 | 7 | @Configuration 8 | public class RestTemplateConfig { 9 | @Bean 10 | public RestTemplate restTemplate() { 11 | return new RestTemplate(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/EmprestimoObjetivoRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.analisedecredito.aplicacao_analise_credito.model.EmprestimoObjetivo; 7 | 8 | @Repository 9 | public interface EmprestimoObjetivoRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/EmprestimoUrgenciaRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.analisedecredito.aplicacao_analise_credito.model.EmprestimoUrgencia; 7 | 8 | @Repository 9 | public interface EmprestimoUrgenciaRepository extends JpaRepository{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/EmprestimoModalidadeRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.analisedecredito.aplicacao_analise_credito.model.EmprestimoModalidade; 7 | 8 | @Repository 9 | public interface EmprestimoModalidadeRepository extends JpaRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/ModalidadePagamentoRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.analisedecredito.aplicacao_analise_credito.model.ModalidadePagamento; 7 | 8 | @Repository 9 | public interface ModalidadePagamentoRepository extends JpaRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/ClienteRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import java.util.Optional; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.analisedecredito.aplicacao_analise_credito.model.Cliente; 9 | 10 | @Repository 11 | public interface ClienteRepository extends JpaRepository { 12 | 13 | Optional findByCpf(String cpf); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /frontend/src/components/Mask/CpfMask.jsx: -------------------------------------------------------------------------------- 1 | export const cpfMask = value => { 2 | return value 3 | .replace(/\D/g, '') // substitui qualquer caracter que nao seja numero por nada 4 | .replace(/(\d{3})(\d)/, '$1.$2') // captura 2 grupos de numero o primeiro de 3 e o segundo de 1, apos capturar o primeiro grupo ele adiciona um ponto antes do segundo grupo de numero 5 | .replace(/(\d{3})(\d)/, '$1.$2') 6 | .replace(/(\d{3})(\d{1,2})/, '$1-$2') 7 | .replace(/(-\d{2})\d+?$/, '$1') // captura 2 numeros seguidos de um traço e não deixa ser digitado mais nada 8 | } -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/config/SpringDocConfig.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.config; 2 | import org.springdoc.core.models.GroupedOpenApi; 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | public class SpringDocConfig { 8 | 9 | @Bean 10 | public GroupedOpenApi publicApi() { 11 | return GroupedOpenApi.builder() 12 | .group("public") 13 | .pathsToMatch("/**") 14 | .build(); 15 | } 16 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | 35 | 36 | ### Ignora o node_modules ### 37 | /frontend/node_modules/ -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/RendaTipoRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.analisedecredito.aplicacao_analise_credito.model.RendaTipo; 7 | 8 | @Repository 9 | public interface RendaTipoRepository extends JpaRepository{ 10 | 11 | // @Query(""" 12 | // SELECT rt FROM RendaTipo rt WHERE idTipoRenda = :id 13 | // """) 14 | 15 | // public String findAllRendaTipos(); 16 | } 17 | -------------------------------------------------------------------------------- /frontend/src/pages/Table.module.css: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 1200px; /* Largura máxima para o container */ 3 | margin: 0 auto; /* Centraliza o container horizontalmente */ 4 | padding: 20px; /* Adiciona algum espaçamento interno */ 5 | background-color: #f8f9fa; /* Cor de fundo leve */ 6 | border-radius: 8px; /* Bordas arredondadas */ 7 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Sombra leve para profundidade */ 8 | margin-bottom: 5%; 9 | /* margin-top: 5%; */ 10 | } 11 | 12 | .color { 13 | color: #0c326f; 14 | text-align: center; 15 | } 16 | 17 | .negritoBold{ 18 | font-weight: bold; 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/JurosRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.analisedecredito.aplicacao_analise_credito.model.Juros; 11 | 12 | @Repository 13 | public interface JurosRepository extends JpaRepository { 14 | 15 | @Query("SELECT j FROM Juros j WHERE j.dataVigencia >= :data") 16 | Juros findByDataJuros(@Param("data") Date data); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | @Configuration 8 | public class WebConfig implements WebMvcConfigurer { 9 | 10 | @Override 11 | public void addCorsMappings(CorsRegistry registry) { 12 | registry.addMapping("/**") 13 | .allowedOrigins("http://localhost:5173") 14 | .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") 15 | .allowedHeaders("*"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/IofAtualRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.analisedecredito.aplicacao_analise_credito.model.IofAtual; 11 | 12 | @Repository 13 | public interface IofAtualRepository extends JpaRepository{ 14 | 15 | @Query("SELECT i FROM IofAtual i WHERE i.dataCalculo >= :data") 16 | IofAtual findByDataIof(@Param("data") Date data); 17 | } 18 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # Configure as variáveis de ambiente abaixo com suas próprias credenciais. 2 | 3 | # Endereço do host do banco de dados 4 | DB_HOST=172.18.0.2 5 | 6 | # Nome do banco de dados 7 | DB_NAME=db_analise 8 | 9 | # Usuário do banco de dados (substitua por seu usuário) 10 | DB_USER=**** 11 | 12 | # Senha do usuário do banco de dados (substitua pela sua senha) 13 | DB_PASS=**** 14 | 15 | # Porta do banco de dados 16 | DB_PORT=5432 17 | 18 | # Email do administrador do PgAdmin (substitua pelo seu email) 19 | PGADMIN_EMAIL=seu_email@email.com 20 | 21 | # Senha do administrador do PgAdmin (substitua pela sua senha) 22 | PGADMIN_PASSWORD=**** 23 | 24 | # Nome de usuário do administrador do Keycloak 25 | KEYCLOAK_ADMIN=**** 26 | 27 | # Senha do administrador do Keycloak (substitua pela sua senha) 28 | KEYCLOAK_ADMIN_PASSWORD=**** 29 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/additional-spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | {"properties": [ 2 | { 3 | "name": "dotenv.location", 4 | "type": "java.lang.String", 5 | "description": "A description for 'dotenv.location'" 6 | }, 7 | { 8 | "name": "dotenv.enabled", 9 | "type": "java.lang.String", 10 | "description": "A description for 'dotenv.enabled'" 11 | }, 12 | { 13 | "name": "hibernate.hbm2ddl.auto", 14 | "type": "java.lang.String", 15 | "description": "A description for 'hibernate.hbm2ddl.auto'" 16 | }, 17 | { 18 | "name": "wiremock.url", 19 | "type": "java.lang.String", 20 | "description": "A description for 'wiremock.url'" 21 | }, 22 | { 23 | "name": "security", 24 | "type": "java.lang.String", 25 | "description": "A description for 'security'" 26 | } 27 | ]} -------------------------------------------------------------------------------- /frontend/src/pages/Cpf.module.css: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 445px; 3 | /* Largura máxima para o container */ 4 | margin: 0 auto; 5 | /* Centraliza o container horizontalmente */ 6 | padding: 20px; 7 | /* Adiciona algum espaçamento interno */ 8 | background-color: #f8f9fa; 9 | /* Cor de fundo leve */ 10 | border-radius: 8px; 11 | /* Bordas arredondadas */ 12 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 13 | /* Sombra leve para profundidade */ 14 | margin-bottom: 5%; 15 | margin-top: 5%; 16 | 17 | 18 | } 19 | 20 | .button-container { 21 | display: flex; 22 | justify-content: center; 23 | /* Centraliza o botão horizontalmente */ 24 | margin-top: 20px; 25 | /* Adiciona um espaçamento opcional acima do botão */ 26 | } 27 | 28 | .color { 29 | color: #0c326f; 30 | text-align: center; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/dto/BeneficiadoDto.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.dto; 2 | 3 | public class BeneficiadoDto { 4 | 5 | // Propriedades 6 | private String cpf; 7 | private Double valorBeneficio; 8 | 9 | // Construtor 10 | public BeneficiadoDto() { 11 | } 12 | 13 | public BeneficiadoDto(String cpf, Double valorBeneficio) { 14 | this.cpf = cpf; 15 | this.valorBeneficio = valorBeneficio; 16 | } 17 | 18 | // Getters e Setters 19 | public String getCpf() { 20 | return cpf; 21 | } 22 | 23 | public void setCpf(String cpf) { 24 | this.cpf = cpf; 25 | } 26 | 27 | public Double getValorBeneficio() { 28 | return valorBeneficio; 29 | } 30 | 31 | public void setValorBeneficio(Double valorBeneficio) { 32 | this.valorBeneficio = valorBeneficio; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /frontend/src/pages/ClienteNaoTemRequisicao.module.css: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 445px; 3 | width: 100%; 4 | padding: 20px; 5 | background-color: #f8f9fa; 6 | border-radius: 8px; 7 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 8 | text-align: center; 9 | display: flex; 10 | flex-direction: column; 11 | justify-content: center; 12 | align-items: center; 13 | } 14 | 15 | .text-large { 16 | font-size: 1.5rem; /* Tamanho da fonte aumentado */ 17 | margin-bottom: 1rem; /* Margem inferior ajustada */ 18 | } 19 | 20 | .buttonContainer { 21 | margin-top: 1rem; /* Margem superior ajustada */ 22 | display: flex; 23 | justify-content: center; 24 | align-items: center; /* Certifica-se de que o botão esteja verticalmente centralizado */ 25 | } 26 | 27 | .br-button.primary { 28 | padding: 10px 20px; /* Ajusta o padding do botão */ 29 | font-size: 1rem; /* Tamanho da fonte do botão */ 30 | } 31 | -------------------------------------------------------------------------------- /frontend/src/components/Botoes/ButtonMenu.module.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | .menu-container { 8 | position: relative; 9 | } 10 | 11 | .menu-button-container { 12 | position: relative; 13 | z-index: 2000; 14 | } 15 | 16 | .menu-button { 17 | z-index: 2000; 18 | } 19 | 20 | .menu { 21 | position: absolute; 22 | top: 90px; 23 | left: 100px; 24 | z-index: 55000; 25 | background-color: #fff; 26 | box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); 27 | } 28 | 29 | .menu-scrim { 30 | position: fixed; 31 | top: 0; 32 | left: 0; 33 | width: 100%; 34 | height: 100%; 35 | z-index: 1000; 36 | background: rgba(0, 0, 0, 0.5); 37 | } 38 | 39 | 40 | @media (max-width: 758px) { 41 | .menu { 42 | top: 70px; 43 | right: 0; 44 | width: 100%; 45 | box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/PerfilClienteRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import java.util.Optional; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.analisedecredito.aplicacao_analise_credito.model.PerfilCliente; 11 | 12 | @Repository 13 | public interface PerfilClienteRepository extends JpaRepository { 14 | 15 | // Método para encontrar um perfil de cliente pelo nome do perfil 16 | Optional findByNomePerfil(String nomePerfil); 17 | 18 | @Query(value = "SELECT * FROM perfil_cliente p WHERE p.score >= :score ORDER BY p.score LIMIT 1", 19 | nativeQuery = true) 20 | PerfilCliente findScore(@Param("score") Integer score); 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | wrapperVersion=3.3.2 18 | distributionType=only-script 19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip 20 | -------------------------------------------------------------------------------- /frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint .", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "@govbr-ds/core": "^3.5.2", 14 | "axios": "^1.7.4", 15 | "jwt-decode": "^3.1.2", 16 | "oidc-client": "^1.11.5", 17 | "react": "^18.3.1", 18 | "react-dom": "^18.3.1", 19 | "react-input-mask": "^2.0.4", 20 | "react-router-dom": "^6.26.1", 21 | "react-select": "^5.8.0", 22 | "styled-components": "^6.1.13" 23 | }, 24 | "devDependencies": { 25 | "@eslint/js": "^9.9.0", 26 | "@types/react": "^18.3.3", 27 | "@types/react-dom": "^18.3.0", 28 | "@vitejs/plugin-react": "^4.3.1", 29 | "eslint": "^9.9.0", 30 | "eslint-plugin-react": "^7.35.0", 31 | "eslint-plugin-react-hooks": "^5.1.0-rc.0", 32 | "eslint-plugin-react-refresh": "^0.4.9", 33 | "globals": "^15.9.0", 34 | "vite": "^5.4.1" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/dto/JurosDto.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.dto; 2 | 3 | import java.util.Date; 4 | 5 | public class JurosDto { 6 | 7 | // Propriedades 8 | private Integer idJuros; 9 | private Double taxaJurosMensal; 10 | private Date dataVigencia; 11 | 12 | // Construtor 13 | public JurosDto() { 14 | } 15 | 16 | // Getters e Setters 17 | public Integer getIdJuros() { 18 | return idJuros; 19 | } 20 | 21 | public void setIdJuros(Integer idJuros) { 22 | this.idJuros = idJuros; 23 | } 24 | 25 | public Double getTaxaJurosMensal() { 26 | return taxaJurosMensal; 27 | } 28 | 29 | public void setTaxaJurosMensal(Double taxaJurosMensal) { 30 | this.taxaJurosMensal = taxaJurosMensal; 31 | } 32 | 33 | public Date getDataVigencia() { 34 | return dataVigencia; 35 | } 36 | 37 | public void setDataVigencia(Date dataVigencia) { 38 | this.dataVigencia = dataVigencia; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /frontend/src/components/Header/Header.module.css: -------------------------------------------------------------------------------- 1 | .header_bottom { 2 | padding: 10px; 3 | background-color: #fff; 4 | position: relative; /* Adicionar para garantir que o z-index funcione corretamente */ 5 | z-index: 1000; /* Certifique-se de que seja menor que o z-index do menu */ 6 | } 7 | 8 | .header_menu { 9 | display: flex; 10 | align-items: center; 11 | } 12 | 13 | .header_menu_trigger { 14 | display: flex; 15 | align-items: center; 16 | margin-right: 20px; 17 | margin-left: -14px; 18 | } 19 | 20 | .header_info { 21 | display: flex; 22 | align-items: center; 23 | } 24 | 25 | .header_title { 26 | margin-left: -14px; 27 | margin-bottom: 4px; 28 | font-size: 24px; 29 | } 30 | 31 | .img_logo { 32 | margin-left: 14px; 33 | } 34 | 35 | .container { 36 | text-align: center; /* Alinha o texto ao centro */ 37 | font-family: 'IBM Plex Sans', sans-serif; /* Aplica a fonte padrão do governo */ 38 | padding: 20px; /* Adiciona um pouco de espaçamento interno */ 39 | } 40 | 41 | -------------------------------------------------------------------------------- /frontend/src/pages/ClienteNaoCadastrado.jsx: -------------------------------------------------------------------------------- 1 | import Styles from './Cpf.module.css'; 2 | import { Link, useLocation } from "react-router-dom"; 3 | 4 | const ClienteNaoCadastrado = () => { 5 | return ( 6 |
7 |
Você precisa fazer o cadastro primeiro.
8 |
Clique no botão abaixo para fazer o
9 |
10 | cadastro. 11 |
12 | 17 | 20 | 21 |
22 | ); 23 | }; 24 | 25 | export default ClienteNaoCadastrado; -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/dto/RendaTipoDto.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.dto; 2 | 3 | import org.springframework.beans.BeanUtils; 4 | 5 | import com.analisedecredito.aplicacao_analise_credito.model.RendaTipo; 6 | 7 | public class RendaTipoDto { 8 | 9 | // Propriedades 10 | private Integer idRendaTipo; 11 | private String descricaoRendaTipo; 12 | 13 | // Construtores 14 | public RendaTipoDto() { 15 | 16 | } 17 | public RendaTipoDto(RendaTipo rendaTipo) { 18 | BeanUtils.copyProperties(rendaTipo, this); 19 | } 20 | 21 | // Getters e Setters 22 | public Integer getIdRendaTipo() { 23 | return idRendaTipo; 24 | } 25 | 26 | public void setIdRendaTipo(Integer idRendaTipo) { 27 | this.idRendaTipo = idRendaTipo; 28 | } 29 | 30 | public String getDescricaoRendaTipo() { 31 | return descricaoRendaTipo; 32 | } 33 | 34 | public void setDescricaoRendaTipo(String descricaoRendaTipo) { 35 | this.descricaoRendaTipo = descricaoRendaTipo; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/dto/EmprestimoUrgenciaDto.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.dto; 2 | 3 | import org.springframework.beans.BeanUtils; 4 | 5 | import com.analisedecredito.aplicacao_analise_credito.model.EmprestimoUrgencia; 6 | 7 | public class EmprestimoUrgenciaDto { 8 | 9 | // Propriedades 10 | private Integer idUrgencia; 11 | private String prazoUrgencia; 12 | 13 | // Construtor 14 | public EmprestimoUrgenciaDto() { 15 | 16 | } 17 | 18 | public EmprestimoUrgenciaDto(EmprestimoUrgencia EmprestimoUrgencia) { 19 | BeanUtils.copyProperties(EmprestimoUrgencia, this); 20 | } 21 | 22 | // Getters e Setters 23 | public Integer getIdUrgencia() { 24 | return idUrgencia; 25 | } 26 | 27 | public void setIdUrgencia(Integer idUrgencia) { 28 | this.idUrgencia = idUrgencia; 29 | } 30 | 31 | public String getPrazoUrgencia() { 32 | return prazoUrgencia; 33 | } 34 | 35 | public void setPrazoUrgencia(String prazoUrgencia) { 36 | this.prazoUrgencia = prazoUrgencia; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Análise de Crédito 25 | 26 | 27 | 28 | 29 |
30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/dto/DespesaTipoDto.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.dto; 2 | 3 | import org.springframework.beans.BeanUtils; 4 | 5 | import com.analisedecredito.aplicacao_analise_credito.model.DespesaTipo; 6 | 7 | public class DespesaTipoDto { 8 | 9 | // Propriedades 10 | private Integer idDespesaTipo; 11 | private String descricaoDespesaTipo; 12 | 13 | // Construtor 14 | public DespesaTipoDto() { 15 | 16 | } 17 | 18 | public DespesaTipoDto(DespesaTipo despesaTipo) { 19 | BeanUtils.copyProperties(despesaTipo, this); 20 | } 21 | 22 | // Getters e Setters 23 | public Integer getIdDespesaTipo() { 24 | return idDespesaTipo; 25 | } 26 | 27 | public void setIdDespesaTipo(Integer idDespesaTipo) { 28 | this.idDespesaTipo = idDespesaTipo; 29 | } 30 | 31 | public String getDescricaoDespesaTipo() { 32 | return descricaoDespesaTipo; 33 | } 34 | 35 | public void setDescricaoDespesaTipo(String descricaoDespesaTipo) { 36 | this.descricaoDespesaTipo = descricaoDespesaTipo; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/dto/EmprestimoObjetivoDto.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.dto; 2 | 3 | import org.springframework.beans.BeanUtils; 4 | 5 | import com.analisedecredito.aplicacao_analise_credito.model.EmprestimoObjetivo; 6 | 7 | public class EmprestimoObjetivoDto { 8 | 9 | // Propriedades 10 | private Integer idObjetivo; 11 | private String descricaoObjetivo; 12 | 13 | // Construtor 14 | public EmprestimoObjetivoDto() { 15 | 16 | } 17 | 18 | public EmprestimoObjetivoDto(EmprestimoObjetivo emprestimoObjetivo) { 19 | BeanUtils.copyProperties(emprestimoObjetivo, this); 20 | } 21 | 22 | // Getters e Setters 23 | public Integer getIdObjetivo() { 24 | return idObjetivo; 25 | } 26 | 27 | public void setIdObjetivo(Integer idObjetivo) { 28 | this.idObjetivo = idObjetivo; 29 | } 30 | 31 | public String getDescricaoObjetivo() { 32 | return descricaoObjetivo; 33 | } 34 | 35 | public void setDescricaoObjetivo(String descricaoObjetivo) { 36 | this.descricaoObjetivo = descricaoObjetivo; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /frontend/eslint.config.js: -------------------------------------------------------------------------------- 1 | import js from '@eslint/js' 2 | import globals from 'globals' 3 | import react from 'eslint-plugin-react' 4 | import reactHooks from 'eslint-plugin-react-hooks' 5 | import reactRefresh from 'eslint-plugin-react-refresh' 6 | 7 | export default [ 8 | { ignores: ['dist'] }, 9 | { 10 | files: ['**/*.{js,jsx}'], 11 | languageOptions: { 12 | ecmaVersion: 2020, 13 | globals: globals.browser, 14 | parserOptions: { 15 | ecmaVersion: 'latest', 16 | ecmaFeatures: { jsx: true }, 17 | sourceType: 'module', 18 | }, 19 | }, 20 | settings: { react: { version: '18.3' } }, 21 | plugins: { 22 | react, 23 | 'react-hooks': reactHooks, 24 | 'react-refresh': reactRefresh, 25 | }, 26 | rules: { 27 | ...js.configs.recommended.rules, 28 | ...react.configs.recommended.rules, 29 | ...react.configs['jsx-runtime'].rules, 30 | ...reactHooks.configs.recommended.rules, 31 | 'react/jsx-no-target-blank': 'off', 32 | 'react-refresh/only-export-components': [ 33 | 'warn', 34 | { allowConstantExport: true }, 35 | ], 36 | }, 37 | }, 38 | ] 39 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/DespesaRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.analisedecredito.aplicacao_analise_credito.model.Despesa; 11 | 12 | @Repository 13 | public interface DespesaRepository extends JpaRepository { 14 | 15 | @Query("SELECT COALESCE(SUM(p.valorDespesa), 0) FROM Despesa p WHERE p.cliente.idCliente = :clienteId") 16 | Double 17 | findDespesaTotalCliente(@Param("clienteId") Integer clienteId); 18 | 19 | @Query("SELECT d FROM Despesa d JOIN d.cliente c WHERE c.idCliente = :id") 20 | List findByIdCliente(@Param("id") Integer id); 21 | 22 | @Query("SELECT d FROM Despesa d JOIN d.cliente c WHERE c.cpf = :cpf") 23 | List findByCpfCliente(@Param("cpf") String cpf); 24 | 25 | void deleteByClienteIdCliente(Integer idCliente); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/RendaFonteRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.analisedecredito.aplicacao_analise_credito.model.RendaFonte; 11 | 12 | @Repository 13 | public interface RendaFonteRepository extends JpaRepository { 14 | 15 | @Query("SELECT COALESCE(SUM(r.valorRenda), 0) FROM RendaFonte r WHERE r.cliente.idCliente = :clienteId") 16 | Double findRendaTotalCliente(@Param("clienteId") Integer clienteId); 17 | 18 | @Query("SELECT er FROM RendaFonte er JOIN er.cliente c WHERE c.idCliente = :id") 19 | List findByIdCliente(@Param("id") Integer id); 20 | 21 | @Query("SELECT er FROM RendaFonte er JOIN er.cliente c WHERE c.cpf = :cpf") 22 | List findByCpfCliente(@Param("cpf") String cpf); 23 | 24 | void deleteByClienteIdCliente(Integer idCliente); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/dto/PatrimonioTipoDto.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.dto; 2 | 3 | import org.springframework.beans.BeanUtils; 4 | 5 | import com.analisedecredito.aplicacao_analise_credito.model.PatrimonioTipo; 6 | 7 | public class PatrimonioTipoDto { 8 | 9 | // Propriedades 10 | private Integer idPatrimonioTipo; 11 | private String descricaoPatrimonioTipo; 12 | 13 | // Construtor 14 | public PatrimonioTipoDto() { 15 | 16 | } 17 | public PatrimonioTipoDto(PatrimonioTipo patrimonioTipo) { 18 | BeanUtils.copyProperties(patrimonioTipo, this); 19 | } 20 | 21 | // Getters e Setters 22 | public Integer getIdPatrimonioTipo() { 23 | return idPatrimonioTipo; 24 | } 25 | public void setIdPatrimonioTipo(Integer idPatrimonioTipo) { 26 | this.idPatrimonioTipo = idPatrimonioTipo; 27 | } 28 | public String getDescricaoPatrimonioTipo() { 29 | return descricaoPatrimonioTipo; 30 | } 31 | public void setDescricaoPatrimonioTipo(String descricaoPatrimonioTipo) { 32 | this.descricaoPatrimonioTipo = descricaoPatrimonioTipo; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/repository/PatrimonioRepository.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.query.Param; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.analisedecredito.aplicacao_analise_credito.model.Patrimonio; 11 | 12 | @Repository 13 | public interface PatrimonioRepository extends JpaRepository { 14 | 15 | @Query("SELECT COALESCE(SUM(p.valorPatrimonio), 0) FROM Patrimonio p WHERE p.cliente.idCliente = :clienteId") 16 | Double findPatrimonioTotalCliente(@Param("clienteId") Integer clienteId); 17 | 18 | @Query("SELECT p FROM Patrimonio p JOIN p.cliente c WHERE c.idCliente = :id") 19 | List findByIdCliente(@Param("id") Integer id); 20 | 21 | @Query("SELECT p FROM Patrimonio p JOIN p.cliente c WHERE c.cpf = :cpf") 22 | List findByCpfCliente(@Param("cpf") String cpf); 23 | 24 | void deleteByClienteIdCliente(Integer idCliente); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=aplicacao-analise-credito 2 | 3 | # DataSource configuration 4 | spring.datasource.url=jdbc:postgresql://localhost:5432/postgres 5 | spring.datasource.username=db_admin 6 | spring.datasource.password=db_p@ssword 7 | spring.datasource.driver-class-name=org.postgresql.Driver 8 | 9 | # Hibernate properties 10 | #spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect 11 | spring.jpa.hibernate.ddl-auto=update 12 | 13 | # Disable open-in-view to avoid performance issues 14 | spring.jpa.open-in-view=false 15 | 16 | # Caminho para o script SQL de inicialização do banco de dados 17 | spring.sql.init.mode=always 18 | spring.sql.init.schema-locations=classpath:schema.sql 19 | 20 | wiremock.url=http://localhost:8082 21 | 22 | #Key cloak 23 | spring.security.oauth2.resourceserver.jwt.issuer-uri: http://localhost:8088/realms/analise-credito-realm 24 | 25 | keycloak.auth-server-url: http://localhost:8088/auth 26 | keycloak.realm: analise-credito-realm 27 | keycloak.resource: account 28 | keycloak.public-client: true 29 | keycloak.bearer-only: true 30 | keycloak.ssl-required: external 31 | keycloak.principal-attribute: preferred_username 32 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/dto/EmprestimoModalidadeDto.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.dto; 2 | 3 | import org.springframework.beans.BeanUtils; 4 | 5 | import com.analisedecredito.aplicacao_analise_credito.model.EmprestimoModalidade; 6 | 7 | public class EmprestimoModalidadeDto { 8 | 9 | // Propriedades 10 | private Integer idModalidade; 11 | private String descricaoModalidade; 12 | 13 | // Construtor 14 | public EmprestimoModalidadeDto() { 15 | 16 | } 17 | 18 | public EmprestimoModalidadeDto(EmprestimoModalidade emprestimoModalidade) { 19 | BeanUtils.copyProperties(emprestimoModalidade, this); 20 | } 21 | 22 | // Getters e Setters 23 | public String getDescricaoModalidade() { 24 | return descricaoModalidade; 25 | } 26 | 27 | public void setDescricaoModalidade(String descricaoModalidade) { 28 | this.descricaoModalidade = descricaoModalidade; 29 | } 30 | 31 | public Integer getIdModalidade() { 32 | return idModalidade; 33 | } 34 | 35 | public void setIdModalidade(Integer idModalidade) { 36 | this.idModalidade = idModalidade; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/service/BeneficiadoService.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.stereotype.Service; 6 | import org.springframework.web.client.RestClientException; 7 | import org.springframework.web.client.RestTemplate; 8 | 9 | import com.analisedecredito.aplicacao_analise_credito.dto.BeneficiadoDto; 10 | 11 | @Service 12 | public class BeneficiadoService { 13 | 14 | @Autowired 15 | private RestTemplate restTemplate; 16 | 17 | @Value("${wiremock.url}") 18 | private String wiremockBaseUrl; 19 | 20 | public BeneficiadoService() { 21 | } 22 | 23 | public BeneficiadoDto buscaBeneficiado(String cpf) throws RestClientException { 24 | String url = wiremockBaseUrl + "/beneficiado/" + cpf; 25 | 26 | try { 27 | return restTemplate.getForObject(url, BeneficiadoDto.class); 28 | } catch (Exception e) { 29 | // Retorna null ou um objeto padrão, conforme sua necessidade 30 | return null; 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/dto/ModalidadePagamentoDto.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.dto; 2 | 3 | import org.springframework.beans.BeanUtils; 4 | 5 | import com.analisedecredito.aplicacao_analise_credito.model.ModalidadePagamento; 6 | 7 | public class ModalidadePagamentoDto { 8 | 9 | // Propriedades 10 | private Integer idModalidadePagamento; 11 | private String descricaoPagamento; 12 | 13 | // Construtor 14 | public ModalidadePagamentoDto() { 15 | } 16 | 17 | public ModalidadePagamentoDto(ModalidadePagamento modalidadePagamento) { 18 | BeanUtils.copyProperties(modalidadePagamento, this); 19 | } 20 | 21 | // Getters e Setters 22 | public Integer getIdModalidadePagamento() { 23 | return idModalidadePagamento; 24 | } 25 | 26 | public void setIdModalidadePagamento(Integer idModalidadePagamento) { 27 | this.idModalidadePagamento = idModalidadePagamento; 28 | } 29 | 30 | public String getDescricaoPagamento() { 31 | return descricaoPagamento; 32 | } 33 | 34 | public void setDescricaoPagamento(String descricaoPagamento) { 35 | this.descricaoPagamento = descricaoPagamento; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/dto/IofAtualDto.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.dto; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.beans.BeanUtils; 6 | 7 | import com.analisedecredito.aplicacao_analise_credito.model.IofAtual; 8 | 9 | public class IofAtualDto { 10 | 11 | // Propriedades 12 | private Integer idIof; 13 | private Double taxaIof; 14 | private Date dataCalculo; 15 | 16 | // Construtor 17 | public IofAtualDto() { 18 | 19 | } 20 | 21 | public IofAtualDto(IofAtual iofAtual) { 22 | BeanUtils.copyProperties(iofAtual, this); 23 | } 24 | 25 | // Getters e Setters 26 | public Integer getIdIof() { 27 | return idIof; 28 | } 29 | 30 | public void setIdIof(Integer idIof) { 31 | this.idIof = idIof; 32 | } 33 | 34 | public Date getDataCalculo() { 35 | return dataCalculo; 36 | } 37 | 38 | public void setDataCalculo(Date dataCalculo) { 39 | this.dataCalculo = dataCalculo; 40 | } 41 | 42 | public Double getTaxaIof() { 43 | return taxaIof; 44 | } 45 | 46 | public void setTaxaIof(Double taxaIof) { 47 | this.taxaIof = taxaIof; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/analisedecredito/aplicacao_analise_credito/controller/BeneficiadoController.java: -------------------------------------------------------------------------------- 1 | package com.analisedecredito.aplicacao_analise_credito.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | import com.analisedecredito.aplicacao_analise_credito.dto.BeneficiadoDto; 11 | import com.analisedecredito.aplicacao_analise_credito.service.BeneficiadoService; 12 | 13 | @RestController 14 | @RequestMapping("/beneficiado") 15 | public class BeneficiadoController { 16 | 17 | @Autowired 18 | private BeneficiadoService beneficiadoService; 19 | 20 | @GetMapping("/{cpf}") 21 | public ResponseEntity getBeneficiado(@PathVariable String cpf) { 22 | try { 23 | BeneficiadoDto beneficiado = beneficiadoService.buscaBeneficiado(cpf); 24 | return ResponseEntity.ok(beneficiado); 25 | } catch (Exception e) { 26 | return ResponseEntity.status(404).body(null); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /frontend/src/App.jsx: -------------------------------------------------------------------------------- 1 | import { BrowserRouter, Routes, Route } from 'react-router-dom'; 2 | import Header from "./components/Header/Header"; 3 | import Footer from "./components/Footer/Footer"; 4 | import Home from "./pages/Home"; 5 | import CadastroCliente from './pages/CadastroCliente'; 6 | import ListarRequisicoes from './pages/ListarRequisicoes'; 7 | import StatusRequisicao from './pages/StatusRequisicao'; 8 | import CadastroRequisicao from './pages/CadastroRequisicao'; 9 | import Login from './pages/Login'; 10 | import AuthProvider from './contexto/AuthProvider'; 11 | import PrivateRoute from './contexto/PrivateRoute'; 12 | 13 | function App() { 14 | return ( 15 | 16 | 17 |
18 | 19 | } /> 20 | } /> 21 | }> 22 | } /> 23 | } /> 24 | } /> 25 | } /> 26 | 27 | 28 | 29 |