Index: src/main/java/com/example/autopartz/controller/HomeController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/HomeController.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/controller/HomeController.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,47 @@
+package com.example.autopartz.controller;
+
+import com.example.autopartz.model.User;
+import com.example.autopartz.service.LoginService;
+import com.example.autopartz.service.PartService;
+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;
+
+@Controller
+@RequestMapping("/")
+public class HomeController {
+    private final LoginService loginService;
+    private final PartService partService;
+
+    public HomeController(LoginService loginService, PartService partService) {
+        this.loginService = loginService;
+        this.partService = partService;
+    }
+
+    @GetMapping()
+    public String getHomePage(Model model){
+        model.addAttribute("parts",partService.findAll());
+        return "homepage";
+    }
+    @GetMapping("/login")
+    public String getLoginPage(){
+        return "login";
+    }
+    @GetMapping("/register")
+    public String getRegisterPage(){
+        return "register";
+    }
+    @PostMapping("/login")
+    public void handleLogin(@RequestParam String username, @RequestParam String password){
+        User u = loginService.login(username,password);
+    }
+    @PostMapping("/register")
+    public void handleRegister(@RequestParam String username, @RequestParam String name,
+                               @RequestParam String password, @RequestParam String email,
+                               @RequestParam String number){
+        User u = loginService.register(name,username,email,number,password);
+    }
+}
Index: src/main/java/com/example/autopartz/controller/PartController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/PartController.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/controller/PartController.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,57 @@
+package com.example.autopartz.controller;
+
+import com.example.autopartz.model.Part;
+import com.example.autopartz.service.PartService;
+import com.example.autopartz.service.PriceService;
+import com.example.autopartz.service.RepairShopService;
+import jakarta.servlet.http.HttpServletResponse;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+
+@Controller
+@RequestMapping("/part")
+public class PartController {
+    private final PartService partService;
+    private final RepairShopService repairShopService;
+    private final PriceService priceService;
+    public PartController(PartService partService, RepairShopService repairShopService, PriceService priceService) {
+        this.partService = partService;
+        this.repairShopService = repairShopService;
+        this.priceService = priceService;
+    }
+    @GetMapping("/{id}")
+    public String getPartPage(@PathVariable Long id, Model model){
+        Part temp = partService.findById(id);
+        Integer amount = priceService.findPriceForPart(temp).stream().findFirst().orElseThrow(RuntimeException::new).getAmount();
+        model.addAttribute("part",temp);
+        model.addAttribute("amount",amount);
+        return "partinfo";
+    }
+    @GetMapping("/delivery/{id}")
+    public String getDeliveryPage(@PathVariable Long id, Model model){
+        model.addAttribute("repairShops",repairShopService.findAll());
+        model.addAttribute("partId",id);
+        return "deliveryForPart";
+    }
+    @PostMapping("/repairshopdelivery")
+    public void setRepairShopDelivery(@RequestParam String name, HttpServletResponse response){
+        // insert into project.repair (vin, id_repair_shop, id_service_book) values (1111,3,1)
+        try {
+            response.sendRedirect("/");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+    @PostMapping("/homedelivery")
+    public void setHomeDelivery(@RequestParam String address, HttpServletResponse response){
+        // insert into delivery (delivery_status, delivery_address,id_user,id_order) values ('in progress','Aerodrom',4,1)
+        try {
+            response.sendRedirect("/");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
Index: src/main/java/com/example/autopartz/controller/UserController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/UserController.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/controller/UserController.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -2,11 +2,14 @@
 
 import com.example.autopartz.model.*;
+import com.example.autopartz.model.views.*;
 import com.example.autopartz.repository.*;
 import com.example.autopartz.service.UserService;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-@RestController
+@Controller
 @RequestMapping("/")
 public class UserController {
@@ -39,14 +42,17 @@
     }
     @GetMapping("orders/{id}")
-    public List<OrdersForUser> getOrdersForUser(@PathVariable Long id){
-        return ordersForUserRepository.findAllByUserid(id);
+    public String getOrdersForUser(@PathVariable Long id, Model model){
+        model.addAttribute("userOrders",ordersForUserRepository.findAllByUserid(id));
+        return "ordersForUser";
     }
     @GetMapping("repairs/{id}")
-    public List<RepairsForUser> getRepairsForUser(@PathVariable Long id){
-        return repairsForUserRepository.findAllByUserid(id);
+    public String getRepairsForUser(@PathVariable Long id,Model model){
+        model.addAttribute("userRepairs",repairsForUserRepository.findAllByUserid(id));
+        return "repairsForUser";
     }
     @GetMapping("reviews/{id}")
-    public List<ReviewsForUser> getReviewsForUser(@PathVariable Long id){
-        return reviewsForUserRepository.findAllByUserid(id);
+    public String getReviewsForUser(@PathVariable Long id, Model model){
+        model.addAttribute("userReviews",reviewsForUserRepository.findAllByUserid(id));
+        return "reviewsForUser";
     }
 }
Index: src/main/java/com/example/autopartz/model/OrdersForUser.java
===================================================================
--- src/main/java/com/example/autopartz/model/OrdersForUser.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ 	(revision )
@@ -1,40 +1,0 @@
-package com.example.autopartz.model;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.IdClass;
-import jakarta.persistence.Table;
-import lombok.*;
-import org.hibernate.Hibernate;
-import org.hibernate.annotations.Immutable;
-import org.hibernate.annotations.Subselect;
-
-import java.io.Serial;
-import java.io.Serializable;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.Objects;
-
-// извештај за сите сервиси и за сите број на reviews и avg рејтинг
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@Immutable
-@Table(name = "`orders_for_user`")
-@IdClass(OrdersForUserId.class)
-public class OrdersForUser implements Serializable {
-    @Serial
-    private static final long serialVersionUID = 1L;
-    @Id
-    Long userid;
-    @Id
-    LocalDateTime orderdate;
-    @Id
-    String partname;
-    Integer amount;
-    Integer quantity;
-    String status;
-}
-
Index: src/main/java/com/example/autopartz/model/OrdersForUserId.java
===================================================================
--- src/main/java/com/example/autopartz/model/OrdersForUserId.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ 	(revision )
@@ -1,13 +1,0 @@
-package com.example.autopartz.model;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.time.LocalDateTime;
-
-@Data
-public class OrdersForUserId implements Serializable {
-    Long userid;
-    LocalDateTime orderdate;
-    String partname;
-}
Index: src/main/java/com/example/autopartz/model/Part.java
===================================================================
--- src/main/java/com/example/autopartz/model/Part.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/model/Part.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -18,10 +18,13 @@
 public class Part {
     @Id
-    Long ID_part;
-    String part_name;
-    String part_description;
+    @Column(name = "ID_part")
+    Long id;
+    @Column(name = "part_name")
+    String name;
+    @Column(name = "part_description")
+    String description;
     @ManyToOne
     @JoinColumn(name = "id_part_manufacturer")
-    PartManufacturer partManufacturer;
+    PartManufacturer manufacturer;
     @ManyToMany
     @JoinTable(name = "part_is_from_category", joinColumns =
@@ -48,5 +51,5 @@
         if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
         Part part = (Part) o;
-        return ID_part != null && Objects.equals(ID_part, part.ID_part);
+        return id != null && Objects.equals(id, part.id);
     }
 
Index: src/main/java/com/example/autopartz/model/PartManufacturer.java
===================================================================
--- src/main/java/com/example/autopartz/model/PartManufacturer.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/model/PartManufacturer.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -1,4 +1,5 @@
 package com.example.autopartz.model;
 
+import jakarta.persistence.Column;
 import jakarta.persistence.Entity;
 import jakarta.persistence.Id;
@@ -18,5 +19,6 @@
     @Id
     Long ID_part_manufacturer;
-    String pm_name;
+    @Column(name = "pm_name")
+    String name;
     String pm_location;
 
Index: src/main/java/com/example/autopartz/model/PartsForCarTypeAndCategory.java
===================================================================
--- src/main/java/com/example/autopartz/model/PartsForCarTypeAndCategory.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ 	(revision )
@@ -1,27 +1,0 @@
-package com.example.autopartz.model;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.Table;
-import lombok.*;
-import org.hibernate.annotations.Immutable;
-
-import java.io.Serial;
-import java.io.Serializable;
-
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@Immutable
-@Table(name = "`parts_for_car_type_and_category`")
-public class PartsForCarTypeAndCategory implements Serializable {
-    @Serial
-    private static final long serialVersionUID = 1L;
-    @Id
-    Long partid;
-    String partname;
-    String cartype;
-    String category;
-}
Index: src/main/java/com/example/autopartz/model/RepairShop.java
===================================================================
--- src/main/java/com/example/autopartz/model/RepairShop.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/model/RepairShop.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -16,8 +16,12 @@
 public class RepairShop {
     @Id
-    Long ID_repair_shop;
-    String rs_name;
-    String rs_location;
-    String rs_phone_number;
+    @Column(name = "ID_repair_shop")
+    Long id;
+    @Column(name = "rs_name")
+    String name;
+    @Column(name = "rs_location")
+    String location;
+    @Column(name = "rs_phone_number")
+    String number;
     @ManyToMany
     @JoinTable(name = "repair_shop_is_authorized_for_car_make", joinColumns =
@@ -32,5 +36,5 @@
         if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
         RepairShop that = (RepairShop) o;
-        return ID_repair_shop != null && Objects.equals(ID_repair_shop, that.ID_repair_shop);
+        return id != null && Objects.equals(id, that.id);
     }
 
Index: src/main/java/com/example/autopartz/model/RepairShopReviewsSummary.java
===================================================================
--- src/main/java/com/example/autopartz/model/RepairShopReviewsSummary.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ 	(revision )
@@ -1,44 +1,0 @@
-package com.example.autopartz.model;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.Table;
-import lombok.*;
-import org.hibernate.Hibernate;
-import org.hibernate.annotations.Immutable;
-import org.hibernate.annotations.Subselect;
-
-import java.io.Serial;
-import java.io.Serializable;
-import java.util.Objects;
-
-// извештај за сите сервиси и за сите број на reviews и avg рејтинг
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@Immutable
-@Table(name = "`repair_shop_reviews_summary`")
-public class RepairShopReviewsSummary implements Serializable {
-    @Serial
-    private static final long serialVersionUID = 1L;
-    @Id
-    Long rsid;
-    String rsname;
-    Integer reviewcount;
-    Float reviewaverage;
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
-        RepairShopReviewsSummary that = (RepairShopReviewsSummary) o;
-        return rsid != null && Objects.equals(rsid, that.rsid);
-    }
-
-    @Override
-    public int hashCode() {
-        return getClass().hashCode();
-    }
-}
Index: src/main/java/com/example/autopartz/model/RepairsForUser.java
===================================================================
--- src/main/java/com/example/autopartz/model/RepairsForUser.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ 	(revision )
@@ -1,40 +1,0 @@
-package com.example.autopartz.model;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.IdClass;
-import jakarta.persistence.Table;
-import lombok.*;
-import org.hibernate.Hibernate;
-import org.hibernate.annotations.Immutable;
-import org.hibernate.annotations.Subselect;
-
-import java.io.Serial;
-import java.io.Serializable;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.Objects;
-
-// извештај за сите сервиси и за сите број на reviews и avg рејтинг
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@Immutable
-@Table(name = "`repairs_for_user`")
-@IdClass(OrdersForUserId.class)
-public class RepairsForUser implements Serializable {
-    @Serial
-    private static final long serialVersionUID = 1L;
-    @Id
-    Long userid;
-    @Id
-    LocalDateTime orderdate;
-    @Id
-    String partname;
-    Integer vin;
-    String rsname;
-}
-
-
Index: src/main/java/com/example/autopartz/model/ReviewsForUser.java
===================================================================
--- src/main/java/com/example/autopartz/model/ReviewsForUser.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ 	(revision )
@@ -1,38 +1,0 @@
-package com.example.autopartz.model;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
-import jakarta.persistence.IdClass;
-import jakarta.persistence.Table;
-import lombok.*;
-import org.hibernate.Hibernate;
-import org.hibernate.annotations.Immutable;
-import org.hibernate.annotations.Subselect;
-
-import java.io.Serial;
-import java.io.Serializable;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.Objects;
-
-// извештај за сите сервиси и за сите број на reviews и avg рејтинг
-@Entity
-@Getter
-@Setter
-@ToString
-@RequiredArgsConstructor
-@Immutable
-@Table(name = "`reviews_for_user`")
-public class ReviewsForUser implements Serializable {
-    @Serial
-    private static final long serialVersionUID = 1L;
-    @Id
-    Long repairid;
-    Long userid;
-    Integer rating;
-    String rcomment;
-    String rsname;
-    String rslocation;
-}
-
-
Index: src/main/java/com/example/autopartz/model/User.java
===================================================================
--- src/main/java/com/example/autopartz/model/User.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/model/User.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -21,5 +21,6 @@
     String email;
     String name_user;
-    String password_user;
+    @Column(name = "password_user")
+    String password;
     LocalDateTime user_created_on;
     String phone_number;
@@ -27,4 +28,13 @@
     @JoinColumn(name = "id_administrator")
     Administrator administrator;
+
+    public User(String username, String name, String email, String password, String number) {
+        this.username = username;
+        this.name_user = name;
+        this.email = email;
+        this.password = password;
+        this.phone_number = number;
+        this.user_created_on = LocalDateTime.now();
+    }
 
     @Override
Index: src/main/java/com/example/autopartz/model/views/OrdersForUser.java
===================================================================
--- src/main/java/com/example/autopartz/model/views/OrdersForUser.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/model/views/OrdersForUser.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,36 @@
+package com.example.autopartz.model.views;
+
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.IdClass;
+import jakarta.persistence.Table;
+import lombok.*;
+import org.hibernate.annotations.Immutable;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+// извештај за сите сервиси и за сите број на reviews и avg рејтинг
+@Entity
+@Getter
+@Setter
+@ToString
+@RequiredArgsConstructor
+@Immutable
+@Table(name = "`orders_for_user`")
+@IdClass(OrdersForUserId.class)
+public class OrdersForUser implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1L;
+    @Id
+    Long userid;
+    @Id
+    LocalDateTime orderdate;
+    @Id
+    String partname;
+    Integer amount;
+    Integer quantity;
+    String status;
+}
+
Index: src/main/java/com/example/autopartz/model/views/OrdersForUserId.java
===================================================================
--- src/main/java/com/example/autopartz/model/views/OrdersForUserId.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/model/views/OrdersForUserId.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,13 @@
+package com.example.autopartz.model.views;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+@Data
+public class OrdersForUserId implements Serializable {
+    Long userid;
+    LocalDateTime orderdate;
+    String partname;
+}
Index: src/main/java/com/example/autopartz/model/views/PartsForCarTypeAndCategory.java
===================================================================
--- src/main/java/com/example/autopartz/model/views/PartsForCarTypeAndCategory.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/model/views/PartsForCarTypeAndCategory.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,27 @@
+package com.example.autopartz.model.views;
+
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
+import lombok.*;
+import org.hibernate.annotations.Immutable;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+@Entity
+@Getter
+@Setter
+@ToString
+@RequiredArgsConstructor
+@Immutable
+@Table(name = "`parts_for_car_type_and_category`")
+public class PartsForCarTypeAndCategory implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1L;
+    @Id
+    Long partid;
+    String partname;
+    String cartype;
+    String category;
+}
Index: src/main/java/com/example/autopartz/model/views/RepairShopReviewsSummary.java
===================================================================
--- src/main/java/com/example/autopartz/model/views/RepairShopReviewsSummary.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/model/views/RepairShopReviewsSummary.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,43 @@
+package com.example.autopartz.model.views;
+
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
+import lombok.*;
+import org.hibernate.Hibernate;
+import org.hibernate.annotations.Immutable;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Objects;
+
+// извештај за сите сервиси и за сите број на reviews и avg рејтинг
+@Entity
+@Getter
+@Setter
+@ToString
+@RequiredArgsConstructor
+@Immutable
+@Table(name = "`repair_shop_reviews_summary`")
+public class RepairShopReviewsSummary implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1L;
+    @Id
+    Long rsid;
+    String rsname;
+    Integer reviewcount;
+    Float reviewaverage;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
+        RepairShopReviewsSummary that = (RepairShopReviewsSummary) o;
+        return rsid != null && Objects.equals(rsid, that.rsid);
+    }
+
+    @Override
+    public int hashCode() {
+        return getClass().hashCode();
+    }
+}
Index: src/main/java/com/example/autopartz/model/views/RepairsForUser.java
===================================================================
--- src/main/java/com/example/autopartz/model/views/RepairsForUser.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/model/views/RepairsForUser.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,39 @@
+package com.example.autopartz.model.views;
+
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.IdClass;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+import org.hibernate.annotations.Immutable;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+// извештај за сите сервиси и за сите број на reviews и avg рејтинг
+@Entity
+@Getter
+@Setter
+@ToString
+@RequiredArgsConstructor
+@Immutable
+@Table(name = "`repairs_for_user`")
+@IdClass(OrdersForUserId.class)
+public class RepairsForUser implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1L;
+    @Id
+    Long userid;
+    @Id
+    LocalDateTime orderdate;
+    @Id
+    String partname;
+    Integer vin;
+    String rsname;
+}
+
+
Index: src/main/java/com/example/autopartz/model/views/ReviewsForUser.java
===================================================================
--- src/main/java/com/example/autopartz/model/views/ReviewsForUser.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/model/views/ReviewsForUser.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,35 @@
+package com.example.autopartz.model.views;
+
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
+import jakarta.persistence.Table;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+import org.hibernate.annotations.Immutable;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+// извештај за сите сервиси и за сите број на reviews и avg рејтинг
+@Entity
+@Getter
+@Setter
+@ToString
+@RequiredArgsConstructor
+@Immutable
+@Table(name = "`reviews_for_user`")
+public class ReviewsForUser implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1L;
+    @Id
+    Long repairid;
+    Long userid;
+    Integer rating;
+    String rcomment;
+    String rsname;
+    String rslocation;
+}
+
+
Index: src/main/java/com/example/autopartz/repository/OrdersForUserRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/OrdersForUserRepository.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/repository/OrdersForUserRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -1,6 +1,6 @@
 package com.example.autopartz.repository;
 
-import com.example.autopartz.model.OrdersForUser;
-import com.example.autopartz.model.OrdersForUserId;
+import com.example.autopartz.model.views.OrdersForUser;
+import com.example.autopartz.model.views.OrdersForUserId;
 import jakarta.transaction.Transactional;
 import org.springframework.data.jpa.repository.JpaRepository;
Index: src/main/java/com/example/autopartz/repository/PartRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/PartRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/repository/PartRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,9 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.Part;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface PartRepository extends JpaRepository<Part,Long> {
+}
Index: src/main/java/com/example/autopartz/repository/PartsForCarTypeAndCategoryRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/PartsForCarTypeAndCategoryRepository.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/repository/PartsForCarTypeAndCategoryRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -1,5 +1,5 @@
 package com.example.autopartz.repository;
 
-import com.example.autopartz.model.PartsForCarTypeAndCategory;
+import com.example.autopartz.model.views.PartsForCarTypeAndCategory;
 import jakarta.transaction.Transactional;
 import org.springframework.data.jpa.repository.JpaRepository;
Index: src/main/java/com/example/autopartz/repository/PriceRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/PriceRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/repository/PriceRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,11 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.Part;
+import com.example.autopartz.model.Price;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.List;
+
+public interface PriceRepository extends JpaRepository<Price,Long> {
+    List<Price> findAllByPart(Part part);
+}
Index: src/main/java/com/example/autopartz/repository/RepairShopRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/RepairShopRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/repository/RepairShopRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,10 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.RepairShop;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface RepairShopRepository extends JpaRepository<RepairShop,Long> {
+
+}
Index: src/main/java/com/example/autopartz/repository/RepairShopReviewSummaryRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/RepairShopReviewSummaryRepository.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/repository/RepairShopReviewSummaryRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -1,10 +1,8 @@
 package com.example.autopartz.repository;
 
-import com.example.autopartz.model.RepairShopReviewsSummary;
+import com.example.autopartz.model.views.RepairShopReviewsSummary;
 import jakarta.transaction.Transactional;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
-
-import java.util.List;
 
 // извештај за сите сервиси и за сите број на reviews и avg рејтинг
@@ -12,4 +10,4 @@
 @Transactional
 public interface RepairShopReviewSummaryRepository extends JpaRepository<RepairShopReviewsSummary,Long> {
-    List<RepairShopReviewsSummary> findAllByRsid(Long rsid);
+    // List<RepairShopReviewsSummary> findAllByRsid(Long rsid);
 }
Index: src/main/java/com/example/autopartz/repository/RepairsForUserRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/RepairsForUserRepository.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/repository/RepairsForUserRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -1,10 +1,12 @@
 package com.example.autopartz.repository;
 
-import com.example.autopartz.model.OrdersForUserId;
-import com.example.autopartz.model.RepairsForUser;
+import com.example.autopartz.model.views.OrdersForUserId;
+import com.example.autopartz.model.views.RepairsForUser;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
 
 import java.util.List;
 
+@Repository
 public interface RepairsForUserRepository extends JpaRepository<RepairsForUser, OrdersForUserId> {
     List<RepairsForUser> findAllByUserid(Long userid);
Index: src/main/java/com/example/autopartz/repository/ReviewsForUserRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/ReviewsForUserRepository.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/repository/ReviewsForUserRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -1,9 +1,11 @@
 package com.example.autopartz.repository;
 
-import com.example.autopartz.model.ReviewsForUser;
+import com.example.autopartz.model.views.ReviewsForUser;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
 
 import java.util.List;
 
+@Repository
 public interface ReviewsForUserRepository extends JpaRepository<ReviewsForUser,Long> {
     List<ReviewsForUser> findAllByUserid(Long id);
Index: src/main/java/com/example/autopartz/repository/UserRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/UserRepository.java	(revision eaf0f1bcf5974cc3751c51ac14c683d4bf72288a)
+++ src/main/java/com/example/autopartz/repository/UserRepository.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -5,8 +5,11 @@
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 // import java.util.List;
 
 @Repository
 public interface UserRepository extends JpaRepository<User,Long> {
-    // List<User> findAllByUsername(String username);
+     // List<User> findAllByUsername(String username);
+     List<User> findAllByUsernameAndPassword(String username, String password);
 }
Index: src/main/java/com/example/autopartz/service/LoginService.java
===================================================================
--- src/main/java/com/example/autopartz/service/LoginService.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/service/LoginService.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,10 @@
+package com.example.autopartz.service;
+
+import com.example.autopartz.model.User;
+
+public interface LoginService {
+    User register(String name, String username, String email, String number, String password);
+    User login(String username, String password);
+    // User findByUsername(String username);
+
+}
Index: src/main/java/com/example/autopartz/service/PartService.java
===================================================================
--- src/main/java/com/example/autopartz/service/PartService.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/service/PartService.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,10 @@
+package com.example.autopartz.service;
+
+import com.example.autopartz.model.Part;
+
+import java.util.List;
+
+public interface PartService {
+    List<Part> findAll();
+    Part findById(Long id);
+}
Index: src/main/java/com/example/autopartz/service/PriceService.java
===================================================================
--- src/main/java/com/example/autopartz/service/PriceService.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/service/PriceService.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,10 @@
+package com.example.autopartz.service;
+
+import com.example.autopartz.model.Part;
+import com.example.autopartz.model.Price;
+
+import java.util.List;
+
+public interface PriceService {
+    List<Price> findPriceForPart(Part part);
+}
Index: src/main/java/com/example/autopartz/service/RepairShopService.java
===================================================================
--- src/main/java/com/example/autopartz/service/RepairShopService.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/service/RepairShopService.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,9 @@
+package com.example.autopartz.service;
+
+import com.example.autopartz.model.RepairShop;
+
+import java.util.List;
+
+public interface RepairShopService {
+    List<RepairShop> findAll();
+}
Index: src/main/java/com/example/autopartz/service/impl/LoginServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/LoginServiceImpl.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/service/impl/LoginServiceImpl.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,30 @@
+package com.example.autopartz.service.impl;
+
+import com.example.autopartz.model.User;
+import com.example.autopartz.repository.UserRepository;
+import com.example.autopartz.service.LoginService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class LoginServiceImpl implements LoginService {
+    private final UserRepository userRepository;
+
+    public LoginServiceImpl(UserRepository userRepository) {
+        this.userRepository = userRepository;
+    }
+
+    @Override
+    public User register(String name, String username, String email, String number, String password) {
+        return userRepository.save(new User(username,name,email,password,number));
+    }
+
+    @Override
+    public User login(String username, String password) {
+        return userRepository.findAllByUsernameAndPassword(username,password).stream().findFirst().orElseThrow(RuntimeException::new);
+    }
+
+//    @Override
+//    public User findByUsername(String username) {
+//        return userRepository.findAllByUsername(username).stream().findFirst().orElseThrow(RuntimeException::new);
+//    }
+}
Index: src/main/java/com/example/autopartz/service/impl/PartServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/PartServiceImpl.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/service/impl/PartServiceImpl.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,27 @@
+package com.example.autopartz.service.impl;
+
+import com.example.autopartz.model.Part;
+import com.example.autopartz.repository.PartRepository;
+import com.example.autopartz.service.PartService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PartServiceImpl implements PartService {
+    private final PartRepository partRepository;
+
+    public PartServiceImpl(PartRepository partRepository) {
+        this.partRepository = partRepository;
+    }
+
+    @Override
+    public List<Part> findAll() {
+        return partRepository.findAll();
+    }
+
+    @Override
+    public Part findById(Long id) {
+        return partRepository.findById(id).orElseThrow(RuntimeException::new);
+    }
+}
Index: src/main/java/com/example/autopartz/service/impl/PriceServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/PriceServiceImpl.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/service/impl/PriceServiceImpl.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,24 @@
+package com.example.autopartz.service.impl;
+
+import com.example.autopartz.model.Part;
+import com.example.autopartz.model.Price;
+import com.example.autopartz.repository.PriceRepository;
+import com.example.autopartz.service.PriceService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PriceServiceImpl implements PriceService {
+
+    private final PriceRepository priceRepository;
+
+    public PriceServiceImpl(PriceRepository priceRepository) {
+        this.priceRepository = priceRepository;
+    }
+
+    @Override
+    public List<Price> findPriceForPart(Part part) {
+        return priceRepository.findAllByPart(part);
+    }
+}
Index: src/main/java/com/example/autopartz/service/impl/RepairShopServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/RepairShopServiceImpl.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
+++ src/main/java/com/example/autopartz/service/impl/RepairShopServiceImpl.java	(revision feffc2f2cd32d404ed9e1a40029cc8a2c9401475)
@@ -0,0 +1,22 @@
+package com.example.autopartz.service.impl;
+
+import com.example.autopartz.model.RepairShop;
+import com.example.autopartz.repository.RepairShopRepository;
+import com.example.autopartz.service.RepairShopService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class RepairShopServiceImpl implements RepairShopService {
+    private final RepairShopRepository repairShopRepository;
+
+    public RepairShopServiceImpl(RepairShopRepository repairShopRepository) {
+        this.repairShopRepository = repairShopRepository;
+    }
+
+    @Override
+    public List<RepairShop> findAll() {
+        return repairShopRepository.findAll();
+    }
+}
