Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/OfferReportController.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/OfferReportController.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/OfferReportController.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -0,0 +1,45 @@
+package finki.it.phoneluxbackend.controllers;
+
+import finki.it.phoneluxbackend.entities.OfferReport;
+import finki.it.phoneluxbackend.services.OfferReportService;
+import lombok.AllArgsConstructor;
+import org.apache.coyote.Response;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@AllArgsConstructor
+@RestController
+@RequestMapping(path = "/offerreport")
+public class OfferReportController {
+    private final OfferReportService offerReportService;
+
+    @GetMapping(path = "/allreports")
+    public List<OfferReport> getAllOfferReports(){
+        return offerReportService.getAllOfferReports();
+    }
+
+    @PostMapping(path = "/{offerId}/{userId}")
+    public ResponseEntity<Object> reportOffer(@PathVariable("offerId") Long offerId,
+                                              @PathVariable("userId") Long userId){
+
+        return offerReportService.reportOffer(offerId, userId);
+    }
+
+    @DeleteMapping(path = "/remove/{offerReportId}")
+    public ResponseEntity<Object> removeOfferReport(@PathVariable("offerReportId") Long offerReportId){
+
+        return offerReportService.removeOfferReport(offerReportId);
+    }
+
+    @DeleteMapping(path = "/removeall")
+    public ResponseEntity<Object> removeAllOfferReports(){
+
+        return offerReportService.removeAllOfferReports();
+    }
+
+
+
+}
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/ScrapperInfoController.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/ScrapperInfoController.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/controllers/ScrapperInfoController.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -0,0 +1,23 @@
+package finki.it.phoneluxbackend.controllers;
+
+import finki.it.phoneluxbackend.entities.ScrapperInfo;
+import finki.it.phoneluxbackend.services.ScrapperInfoService;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@AllArgsConstructor
+@RestController
+@RequestMapping(path = "/scrapperinfo")
+public class ScrapperInfoController{
+    private final ScrapperInfoService scrapperInfoService;
+
+    @GetMapping
+    public List<ScrapperInfo> getAllScrapperInfos(){
+        return scrapperInfoService.getAllScrapperInfos();
+    }
+
+}
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/OfferReport.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/OfferReport.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/OfferReport.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -0,0 +1,45 @@
+package finki.it.phoneluxbackend.entities;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.*;
+
+import javax.persistence.*;
+import java.time.LocalDateTime;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Getter
+@Setter
+@ToString
+@Entity
+public class OfferReport {
+    @SequenceGenerator(
+            name = "offer_report_sequence",
+            sequenceName = "offer_report_sequence",
+            allocationSize = 1
+    )
+    @Id
+    @GeneratedValue(
+            strategy = GenerationType.SEQUENCE,
+            generator = "offer_report_sequence"
+    )
+    private Long id;
+
+    @ManyToOne(fetch = FetchType.EAGER)
+    @JoinColumn(name = "offer_id", referencedColumnName = "offer_id")
+    private PhoneOffer phoneOffer;
+
+    private Integer times_reported;
+
+    private LocalDateTime reportedAt;
+
+    private String reportedBy;
+
+
+    public OfferReport(PhoneOffer phoneOffer, Integer times_reported, LocalDateTime reportedAt, String reportedBy) {
+        this.phoneOffer = phoneOffer;
+        this.times_reported = times_reported;
+        this.reportedAt = reportedAt;
+        this.reportedBy = reportedBy;
+    }
+}
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/ScrapperInfo.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/ScrapperInfo.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/ScrapperInfo.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -0,0 +1,35 @@
+package finki.it.phoneluxbackend.entities;
+
+import lombok.*;
+
+import javax.persistence.*;
+import java.time.LocalDateTime;
+
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Getter
+@Setter
+@ToString
+@Entity(name = "ScrapperInfo")
+@Table(name = "scrapper_info")
+public class ScrapperInfo {
+
+    @Id
+    @Column(name = "id")
+    @GeneratedValue(strategy=GenerationType.IDENTITY)
+    private Long id;
+    @Column(name = "store")
+    private String store;
+    @Column(name = "status")
+    private String status;
+    @Column(name = "recieved_at")
+    private LocalDateTime recievedAt;
+
+    public ScrapperInfo(String store, String status, LocalDateTime recievedAt) {
+        this.store = store;
+        this.status = status;
+        this.recievedAt = recievedAt;
+    }
+
+}
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/User.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/User.java	(revision ffd50db1e5e2b9839ba7546d8ca44b600150bd71)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/entities/User.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -78,4 +78,11 @@
     }
 
+    public User(String firstName, String lastName, String email, UserRole userRole) {
+        this.firstName = firstName;
+        this.lastName = lastName;
+        this.email = email;
+        this.userRole = userRole;
+    }
+
     @Override
     public Collection<? extends GrantedAuthority> getAuthorities() {
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/repositories/OfferReportRepository.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/repositories/OfferReportRepository.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/repositories/OfferReportRepository.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -0,0 +1,13 @@
+package finki.it.phoneluxbackend.repositories;
+
+import finki.it.phoneluxbackend.entities.OfferReport;
+import finki.it.phoneluxbackend.entities.PhoneOffer;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.Optional;
+
+@Repository
+public interface OfferReportRepository extends JpaRepository<OfferReport,Long> {
+    Optional<OfferReport> findOfferReportByPhoneOffer(PhoneOffer phoneOffer);
+}
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/repositories/ScrapperInfoRepository.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/repositories/ScrapperInfoRepository.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/repositories/ScrapperInfoRepository.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -0,0 +1,9 @@
+package finki.it.phoneluxbackend.repositories;
+
+import finki.it.phoneluxbackend.entities.ScrapperInfo;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ScrapperInfoRepository extends JpaRepository<ScrapperInfo, Long> {
+}
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/security/configs/WebSecurityConfig.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/security/configs/WebSecurityConfig.java	(revision ffd50db1e5e2b9839ba7546d8ca44b600150bd71)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/security/configs/WebSecurityConfig.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -5,4 +5,5 @@
 import finki.it.phoneluxbackend.services.UserService;
 import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -17,6 +18,4 @@
 import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
 
-import static org.springframework.http.HttpMethod.GET;
-
 @Configuration
 @AllArgsConstructor
@@ -26,5 +25,4 @@
     private final UserService userService;
     private final BCryptPasswordEncoder bCryptPasswordEncoder;
-
     @Override
     protected void configure(HttpSecurity http) throws Exception {
@@ -47,6 +45,15 @@
                 .antMatchers("/admin/**")
                 .hasAnyAuthority("ADMIN","SUPERADMIN")
+                .and()
+                .authorizeRequests()
+                .antMatchers("/offerreport/**")
+                .hasAnyAuthority("USER", "ADMIN", "SUPERADMIN")
+                .and()
+                .authorizeRequests()
+                .antMatchers("/scrapperinfo/**")
+                .hasAnyAuthority("SUPERADMIN")
+                .and()
+                .authorizeRequests()
                 .anyRequest().permitAll();
-
 
 
@@ -55,4 +62,5 @@
 
     }
+
 
     @Override
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/OfferReportService.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/OfferReportService.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/OfferReportService.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -0,0 +1,78 @@
+package finki.it.phoneluxbackend.services;
+
+import finki.it.phoneluxbackend.entities.OfferReport;
+import finki.it.phoneluxbackend.entities.PhoneOffer;
+import finki.it.phoneluxbackend.entities.User;
+import finki.it.phoneluxbackend.repositories.OfferReportRepository;
+import finki.it.phoneluxbackend.repositories.PhoneOfferRepository;
+import finki.it.phoneluxbackend.repositories.UserRepository;
+import lombok.AllArgsConstructor;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@AllArgsConstructor
+@Service
+public class OfferReportService {
+    private final OfferReportRepository offerReportRepository;
+    private final PhoneOfferRepository phoneOfferRepository;
+    private final UserRepository userRepository;
+
+    public ResponseEntity<Object> reportOffer(Long offerId, Long userId) {
+        boolean exists = phoneOfferRepository.findById(offerId).isPresent();
+
+        if(!exists){
+            return ResponseEntity.badRequest().body("Понудата не постои");
+        }
+
+        exists = userRepository.findById(userId).isPresent();
+
+        if(!exists){
+            return ResponseEntity.badRequest().body("Корисникот не постои");
+        }
+
+        User user = userRepository.findById(userId).get();
+        PhoneOffer offer = phoneOfferRepository.findById(offerId).get();
+
+        exists = offerReportRepository.findOfferReportByPhoneOffer(offer).isPresent();
+        OfferReport offerReport;
+        if(exists)
+        {
+            offerReport = offerReportRepository.findOfferReportByPhoneOffer(offer).get();
+            offerReport.setTimes_reported(offerReport.getTimes_reported()+1);
+            offerReport.setReportedAt(LocalDateTime.now());
+            offerReport.setReportedBy(user.getEmail());
+        }
+        else{
+            offerReport = new OfferReport(offer, 1, LocalDateTime.now(), user.getEmail());
+        }
+
+        offerReportRepository.save(offerReport);
+
+        return ResponseEntity.ok().build();
+    }
+
+    public List<OfferReport> getAllOfferReports() {
+        return offerReportRepository.findAll();
+    }
+
+    public ResponseEntity<Object> removeOfferReport(Long offerReportId) {
+        boolean exists = offerReportRepository.findById(offerReportId).isPresent();
+
+        if(!exists){
+            return ResponseEntity.badRequest().body("Пријавата не постои");
+        }
+
+        offerReportRepository.deleteById(offerReportId);
+
+        return ResponseEntity.ok().build();
+    }
+
+    public ResponseEntity<Object> removeAllOfferReports() {
+        offerReportRepository.deleteAll();
+        return ResponseEntity.ok().build();
+    }
+}
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/RegistrationService.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/RegistrationService.java	(revision ffd50db1e5e2b9839ba7546d8ca44b600150bd71)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/RegistrationService.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -1,8 +1,4 @@
 package finki.it.phoneluxbackend.services;
 
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.io.JsonStringEncoder;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.util.JSONPObject;
 import finki.it.phoneluxbackend.data.RegistrationRequest;
 import finki.it.phoneluxbackend.data.UserRole;
@@ -12,6 +8,4 @@
 import finki.it.phoneluxbackend.security.email.EmailValidator;
 import lombok.AllArgsConstructor;
-import org.apache.coyote.Response;
-import org.apache.tomcat.util.json.JSONParser;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -20,5 +14,4 @@
 
 import java.time.LocalDateTime;
-import java.util.HashMap;
 
 @Service
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/ScrapperInfoService.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/ScrapperInfoService.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/ScrapperInfoService.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -0,0 +1,18 @@
+package finki.it.phoneluxbackend.services;
+
+import finki.it.phoneluxbackend.entities.ScrapperInfo;
+import finki.it.phoneluxbackend.repositories.ScrapperInfoRepository;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@AllArgsConstructor
+@Service
+public class ScrapperInfoService {
+    private final ScrapperInfoRepository scrapperInfoRepository;
+
+    public List<ScrapperInfo> getAllScrapperInfos() {
+        return scrapperInfoRepository.findAll();
+    }
+}
Index: phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/UserService.java
===================================================================
--- phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/UserService.java	(revision ffd50db1e5e2b9839ba7546d8ca44b600150bd71)
+++ phonelux-backend/src/main/java/finki/it/phoneluxbackend/services/UserService.java	(revision 47f4eafa88902f713d8f8cfe5d10306816c61ea3)
@@ -41,4 +41,6 @@
     }
 
+
+
     public ResponseEntity<Object> signUpUser(User user)
     {
