Index: src/main/java/com/example/autopartz/controller/UserController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/UserController.java	(revision f484b14ac6839719d4237822f088e088abec9846)
+++ src/main/java/com/example/autopartz/controller/UserController.java	(revision d4b888e8c58f07ca9c34c64e3184cceecd9b65a8)
@@ -1,20 +1,19 @@
 package com.example.autopartz.controller;
 
-import com.example.autopartz.model.CarSample;
-import com.example.autopartz.model.Client;
-import com.example.autopartz.model.ServiceBook;
+import com.example.autopartz.model.*;
+import com.example.autopartz.model.views.RepairsForUser;
 import com.example.autopartz.repository.*;
 import com.example.autopartz.service.CarService;
+import com.example.autopartz.service.RepairService;
 import com.example.autopartz.service.UserService;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 
 @Controller
@@ -28,5 +27,12 @@
     private final CarSampleRepository carSampleRepository;
     private final ServiceBookRepository serviceBookRepository;
-    public UserController(OrdersForUserRepository ordersForUserRepository, RepairsForUserRepository repairsForUserRepository, ReviewsForUserRepository reviewsForUserRepository, UserService userService, CarService carService, CarSampleRepository carSampleRepository, ServiceBookRepository serviceBookRepository) {
+    private final RepairService repairService;
+    private final ReviewRepository reviewRepository;
+    private final RepairRepository repairRepository;
+    private final OrderRepository orderRepository;
+
+    public UserController(OrdersForUserRepository ordersForUserRepository, RepairsForUserRepository repairsForUserRepository, ReviewsForUserRepository reviewsForUserRepository, UserService userService, CarService carService, CarSampleRepository carSampleRepository, ServiceBookRepository serviceBookRepository, RepairService repairService, ReviewRepository reviewRepository,
+                          RepairRepository repairRepository,
+                          OrderRepository orderRepository) {
         this.ordersForUserRepository = ordersForUserRepository;
         this.repairsForUserRepository = repairsForUserRepository;
@@ -36,4 +42,8 @@
         this.carSampleRepository = carSampleRepository;
         this.serviceBookRepository = serviceBookRepository;
+        this.repairService = repairService;
+        this.reviewRepository = reviewRepository;
+        this.repairRepository = repairRepository;
+        this.orderRepository = orderRepository;
     }
     @GetMapping("orders")
@@ -48,4 +58,17 @@
         Integer id = userService.findByUsername(request.getRemoteUser()).getId();
         model.addAttribute("userRepairs",repairsForUserRepository.findAllByUserid(id));
+        List<Boolean> hasReview = new ArrayList<>(100);
+        for (int i = 0; i < orderRepository.findAll().size(); i++) {
+            hasReview.add(false);
+        }
+        for(RepairsForUser rfu: repairsForUserRepository.findAll()){
+            if(reviewRepository.findByRepair(repairService.findById(rfu.getRepairid()))==null){
+                hasReview.set(rfu.getRepairid(),false);
+            }
+            else {
+                hasReview.set(rfu.getRepairid(),true);
+            }
+        }
+        model.addAttribute("hasReview", hasReview);
         model.addAttribute("bodyContent","repairsForUser");
         return "master-template";
@@ -78,3 +101,22 @@
         }
     }
+    @GetMapping("/repairs/addReview/{id}")
+    public String addReviewFor(@PathVariable Integer id, Model model){
+        model.addAttribute("bodyContent","addReviewPage");
+        model.addAttribute("repair", repairService.findById(id));
+        return "master-template";
+    }
+    @PostMapping("/repairs/addReview/{id}")
+    public void addReview(@PathVariable Integer id, @RequestParam Integer rating, @RequestParam(required = false) String comment,
+                          Model model, HttpServletResponse response, HttpServletRequest request){
+        Client client = (Client) userService.findByUsername(request.getRemoteUser());
+        Repair repair = repairService.findById(id);
+        reviewRepository.save(new Review(rating,
+                comment==null ? "" : comment, repair,client));
+        try {
+            response.sendRedirect("/repairs");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
 }
