This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package br.com.residencia18.api.component; | |
| import org.springframework.stereotype.Component; | |
| import org.springframework.web.servlet.HandlerInterceptor; | |
| import jakarta.servlet.http.HttpServletRequest; | |
| import jakarta.servlet.http.HttpServletResponse; | |
| @Component | |
| public class IpAddressInterceptor implements HandlerInterceptor { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package br.com.residencia18.api.repository; | |
| import static org.assertj.core.api.Assertions.*; | |
| import java.util.Date; | |
| import org.junit.jupiter.api.Test; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package br.com.residencia18.api.component; | |
| import org.aspectj.lang.JoinPoint; | |
| import org.aspectj.lang.annotation.Aspect; | |
| import org.aspectj.lang.annotation.Before; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.security.core.Authentication; | |
| import org.springframework.security.core.context.SecurityContextHolder; | |
| import org.springframework.security.core.userdetails.User; | |
| import org.springframework.stereotype.Component; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package br.com.residencia18.api.component; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.security.core.Authentication; | |
| import org.springframework.security.core.context.SecurityContextHolder; | |
| import org.springframework.security.core.userdetails.User; | |
| import org.springframework.stereotype.Component; | |
| import org.springframework.web.servlet.HandlerInterceptor; | |
| import org.springframework.web.servlet.ModelAndView; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package br.com.residencia18.api.service; | |
| import java.util.Date; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Service; | |
| import br.com.residencia18.api.entity.AuditLog; | |
| import br.com.residencia18.api.repository.AuditLogRepository; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package br.com.residencia18.api.repository; | |
| import org.springframework.data.jpa.repository.JpaRepository; | |
| import br.com.residencia18.api.entity.AuditLog; | |
| public interface AuditLogRepository extends JpaRepository<AuditLog, Long> { | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package br.com.residencia18.api.entity; | |
| import java.util.Date; | |
| import jakarta.persistence.Column; | |
| import jakarta.persistence.Entity; | |
| import jakarta.persistence.GeneratedValue; | |
| import jakarta.persistence.GenerationType; | |
| import jakarta.persistence.Id; | |
| import jakarta.validation.constraints.NotNull; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <parent> | |
| <groupId>org.springframework.boot</groupId> | |
| <artifactId>spring-boot-starter-parent</artifactId> | |
| <version>3.2.5</version> | |
| <relativePath/> <!-- lookup parent from repository --> | |
| </parent> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package br.com.residencia18.api; | |
| import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; | |
| import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; | |
| import org.hamcrest.Matchers; | |
| import org.junit.jupiter.api.Test; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; | |
| import org.springframework.boot.test.context.SpringBootTest; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | CREATE SEQUENCE users_id_seq | |
| START WITH 1 | |
| INCREMENT BY 1 | |
| NO MINVALUE | |
| NO MAXVALUE | |
| CACHE 1; | |
| CREATE TABLE IF NOT EXISTS public.users | |
| ( | 
NewerOlder