Index: src/main/java/com/example/autopartz/controller/AdminController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/AdminController.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/controller/AdminController.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -2,10 +2,7 @@
 
 import com.example.autopartz.model.*;
-import com.example.autopartz.model.manytomany.PartIsAppropriateForCar;
-import com.example.autopartz.model.manytomany.PartIsFromCategory;
-import com.example.autopartz.model.manytomany.PartIsInStockInWarehouse;
-import com.example.autopartz.model.manytomany.RsForCm;
 import com.example.autopartz.repository.*;
-import com.example.autopartz.service.PriceService;
+import com.example.autopartz.service.PartService;
+import com.example.autopartz.service.RepairShopService;
 import com.example.autopartz.service.UserService;
 import org.springframework.stereotype.Controller;
@@ -24,34 +21,24 @@
     private final UserService userService;
     private final CarManufacturerRepository carManufacturerRepository;
-    private final PartIsFromCategoryRepository partIsFromCategoryRepository;
-    private final PartIsAppropriateForCarRepository partIsAppropriateForCarRepository;
     private final WarehousemanRepository warehousemanRepository;
-    private final PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository;
     private final DeliverymanRepository deliverymanRepository;
     private final CategoryRepository categoryRepository;
-    private final PartRepository partRepository;
     private final WarehouseRepository warehouseRepository;
     private final CarRepository carRepository;
     private final PartManufacturerRepository partManufacturerRepository;
-    private final PriceService priceService;
-    private final RepairShopRepository repairShopRepository;
-    private final RsForCmRepository rsForCmRepository;
+    private final PartService partService;
+    private final RepairShopService repairShopService;
 
-    public AdminController(UserService userService, CarManufacturerRepository carManufacturerRepository, PartIsFromCategoryRepository partIsFromCategoryRepository, PartIsAppropriateForCarRepository partIsAppropriateForCarRepository, WarehousemanRepository warehousemanRepository, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository, DeliverymanRepository deliverymanRepository, CategoryRepository categoryRepository, PartRepository partRepository, WarehouseRepository warehouseRepository, CarRepository carRepository, PartManufacturerRepository partManufacturerRepository, PriceService priceService, RepairShopRepository repairShopRepository, RsForCmRepository rsForCmRepository) {
+    public AdminController(UserService userService, CarManufacturerRepository carManufacturerRepository, WarehousemanRepository warehousemanRepository, DeliverymanRepository deliverymanRepository, CategoryRepository categoryRepository, WarehouseRepository warehouseRepository, CarRepository carRepository, PartManufacturerRepository partManufacturerRepository, PartService partService, RepairShopService repairShopService) {
         this.userService = userService;
         this.carManufacturerRepository = carManufacturerRepository;
-        this.partIsFromCategoryRepository = partIsFromCategoryRepository;
-        this.partIsAppropriateForCarRepository = partIsAppropriateForCarRepository;
         this.warehousemanRepository = warehousemanRepository;
-        this.partIsInStockInWarehouseRepository = partIsInStockInWarehouseRepository;
         this.deliverymanRepository = deliverymanRepository;
         this.categoryRepository = categoryRepository;
-        this.partRepository = partRepository;
         this.warehouseRepository = warehouseRepository;
         this.carRepository = carRepository;
         this.partManufacturerRepository = partManufacturerRepository;
-        this.priceService = priceService;
-        this.repairShopRepository = repairShopRepository;
-        this.rsForCmRepository = rsForCmRepository;
+        this.partService = partService;
+        this.repairShopService = repairShopService;
     }
 
@@ -107,17 +94,5 @@
                         @RequestParam List<Category> categories, @RequestParam Integer warehouse,
                         @RequestParam Integer quantity, @RequestParam Integer amount, HttpServletResponse response){
-        // Part(String name, String description, PartManufacturer manufacturer, List<Category> categoryList, List<Warehouse> warehouseList, List<Car> carList) {
-        Part newPart = new Part(name, description==null ? "" : description, partManufacturerRepository.findById(manufacturer).get(),
-                categories, List.of(warehouseRepository.findById(warehouse).get()),cars);
-        partRepository.save(newPart);
-        priceService.save(new Price(amount, LocalDate.now(),newPart));
-        partIsInStockInWarehouseRepository.save(new PartIsInStockInWarehouse(newPart.getId(),warehouse,quantity));
-        for (Category c:categories
-             ) {
-            partIsFromCategoryRepository.save(new PartIsFromCategory(newPart.getId(),c.getId()));
-        }
-        for (Car car:cars){
-            partIsAppropriateForCarRepository.save(new PartIsAppropriateForCar(newPart.getId(),car.getId()));
-        }
+        partService.addPart(name,description,manufacturer,cars,categories,warehouse,quantity,amount);
         try {
             response.sendRedirect("/");
@@ -133,5 +108,5 @@
     @PostMapping("/addCarManufacturer")
     public void saveCarManufacturer(@RequestParam String name,@RequestParam String location,
-                                    Model model, HttpServletResponse response) {
+                                    HttpServletResponse response) {
         carManufacturerRepository.save(new CarManufacturer(name,location));
         try {
@@ -148,5 +123,5 @@
     @PostMapping("/addPartManufacturer")
     public void savePartManufacturer(@RequestParam String name,@RequestParam String location,
-                                    Model model, HttpServletResponse response) {
+                                     HttpServletResponse response) {
         partManufacturerRepository.save(new PartManufacturer(name,location));
         try {
@@ -163,5 +138,5 @@
     @PostMapping("/addCategory")
     public void saveCategory(@RequestParam String name,
-                                    Model model, HttpServletResponse response) {
+                             HttpServletResponse response) {
         categoryRepository.save(new Category(name));
         try {
@@ -198,8 +173,5 @@
                         @RequestParam String number,@RequestParam Integer carMId,
                         HttpServletResponse response) {
-        RepairShop newRs = new RepairShop(name,location,number,
-                List.of(carManufacturerRepository.findById(carMId).get()));
-        repairShopRepository.save(newRs);
-        rsForCmRepository.save(new RsForCm(newRs.getId(), carMId));
+        repairShopService.save(name,location,number,carMId);
         try {
             response.sendRedirect("/");
Index: src/main/java/com/example/autopartz/controller/HomeController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/HomeController.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/controller/HomeController.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -1,10 +1,9 @@
 package com.example.autopartz.controller;
 
-import com.example.autopartz.model.*;
 import com.example.autopartz.model.DTO.CurrentOrderDTO;
 import com.example.autopartz.model.DTO.OrderInfo;
+import com.example.autopartz.model.*;
 import com.example.autopartz.model.manytomany.OrderContainsPart;
 import com.example.autopartz.model.manytomany.PartIsInStockInWarehouse;
-import com.example.autopartz.model.manytomany.PartIsInStockInWarehouseId;
 import com.example.autopartz.model.views.DeliveriesInProgress;
 import com.example.autopartz.model.views.PartsForCarTypeAndCategory;
@@ -20,5 +19,4 @@
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Comparator;
 import java.util.List;
 import java.util.Objects;
@@ -103,14 +101,14 @@
             int total = 0;
             List<OrderContainsPart> qList = orderContainsPartRepository.findAllByOrderid(o.getOrderid());
-            for (int i = 0; i < qList.size(); i++) {
-                int pr = qList.get(i).getQuantity_order()*
-                        priceService.findPriceForPart(partService.findById(qList.get(i).getPartid())).stream().findFirst().get().getAmount();
+            for (OrderContainsPart orderContainsPart : qList) {
+                int pr = orderContainsPart.getQuantity_order() *
+                        priceService.findPriceForPart(partService.findById(orderContainsPart.getPartid())).stream().findFirst().get().getAmount();
                 CurrentOrderDTO temp = new CurrentOrderDTO(
-                        partService.findById(qList.get(i).getPartid()).getName(),
-                        partService.findById(qList.get(i).getPartid()).getManufacturer().getName(),
-                        qList.get(i).getQuantity_order(),
+                        partService.findById(orderContainsPart.getPartid()).getName(),
+                        partService.findById(orderContainsPart.getPartid()).getManufacturer().getName(),
+                        orderContainsPart.getQuantity_order(),
                         pr);
                 list.add(temp);
-                total+=pr;
+                total += pr;
             }
             model.addAttribute("total",total);
@@ -188,5 +186,5 @@
     }
     @PostMapping("/finishRegister")
-    public void handleWarehousemanRegister(@RequestParam String location,Model model, HttpServletResponse response, HttpSession session){
+    public void handleWarehousemanRegister(@RequestParam String location, HttpServletResponse response, HttpSession session){
         System.out.println("here?");
         String username = (String) session.getAttribute("username");
@@ -243,5 +241,5 @@
     }
     @PostMapping("/finishDelivery/{id}")
-    public void finishDelivery(@PathVariable Integer id, Model model, HttpServletResponse response){
+    public void finishDelivery(@PathVariable Integer id, HttpServletResponse response){
         Delivery d = deliveryService.findByOrder(orderService.findById(id));
         d.setStatus("finished");
@@ -257,7 +255,7 @@
         List<OrderContainsPart> list = orderContainsPartRepository.findAllByOrderid(id);
         List<OrderInfo> partList = new ArrayList<>();
-        for (int i = 0; i < list.size(); i++) {
-            OrderInfo oi = new OrderInfo(partService.findById(list.get(i).getPartid()).getName(),
-                    list.get(i).getQuantity_order(),partService.findById(list.get(i).getPartid()).getManufacturer().getName());
+        for (OrderContainsPart orderContainsPart : list) {
+            OrderInfo oi = new OrderInfo(partService.findById(orderContainsPart.getPartid()).getName(),
+                    orderContainsPart.getQuantity_order(), partService.findById(orderContainsPart.getPartid()).getManufacturer().getName());
             partList.add(oi);
         }
@@ -301,8 +299,5 @@
         Warehouse wh = whm.getWarehouse();
         Integer whId = wh.getId();
-        PartIsInStockInWarehouseId tmp = new PartIsInStockInWarehouseId(pId,whId);
-        PartIsInStockInWarehouse temp = partIsInStockInWarehouseRepository.findById(tmp).get();
-        temp.setQuantity(temp.getQuantity()+quantity);
-        partIsInStockInWarehouseRepository.save(temp);
+        partService.addPartToWarehouse(pId,quantity,whId);
         try {
             response.sendRedirect("/myWarehouseReport");
Index: src/main/java/com/example/autopartz/controller/PartController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/PartController.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/controller/PartController.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -71,5 +71,5 @@
     }
     @PostMapping("/repairshopdelivery")
-    public void setRepairShopDelivery(@RequestParam Integer vin, HttpServletResponse response, HttpSession session, HttpServletRequest request){
+    public void setRepairShopDelivery(@RequestParam Integer vin, HttpServletResponse response, HttpSession session){
         // insert into project.repair (vin, id_repair_shop, id_service_book) values (1111,3,1)
         session.setAttribute("carVin",vin);
@@ -107,6 +107,4 @@
         RepairShop repairShop = repairShopService.getById(rs);
         repairRepository.save(new Repair(o,repairShop,sb));
-//        o.setOrder_status("finished");
-//        orderService.save(o);
         session.removeAttribute("order");
         try {
@@ -125,6 +123,4 @@
         Deliveryman dm = deliverymanList.get(deliverer);
         deliveryRepository.save(new Delivery("in progress",address,dm,o));
-//        o.setOrder_status("finished");
-//        orderService.save(o);
         session.removeAttribute("order");
         try {
@@ -138,9 +134,10 @@
         if(session.getAttribute("order")==null){
             User u = userService.findByUsername(request.getRemoteUser());
-            Order newOrder = orderService.create((Client) u);
+            Order newOrder = orderService.createOrderAndAddPartToOrder((Client) u, id, quantity);
             session.setAttribute("order",newOrder);
+        } else {
+            Order order = (Order) session.getAttribute("order");
+            orderContainsPartRepository.save(new OrderContainsPart(id, order.getOrderid(), quantity));
         }
-        Order order = (Order) session.getAttribute("order");
-        orderContainsPartRepository.save(new OrderContainsPart(id,order.getOrderid(),quantity));
         try {
             response.sendRedirect("/products");
Index: src/main/java/com/example/autopartz/controller/UserController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/UserController.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/controller/UserController.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -25,13 +25,9 @@
     private final UserService userService;
     private final CarService carService;
-    private final CarSampleRepository carSampleRepository;
-    private final 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,
+    public UserController(OrdersForUserRepository ordersForUserRepository, RepairsForUserRepository repairsForUserRepository, ReviewsForUserRepository reviewsForUserRepository, UserService userService, CarService carService, RepairService repairService, ReviewRepository reviewRepository,
                           OrderRepository orderRepository) {
         this.ordersForUserRepository = ordersForUserRepository;
@@ -40,9 +36,6 @@
         this.userService = userService;
         this.carService = carService;
-        this.carSampleRepository = carSampleRepository;
-        this.serviceBookRepository = serviceBookRepository;
         this.repairService = repairService;
         this.reviewRepository = reviewRepository;
-        this.repairRepository = repairRepository;
         this.orderRepository = orderRepository;
     }
@@ -92,7 +85,5 @@
                                     @RequestParam Integer km, @RequestParam Integer cartype,
                                     HttpServletRequest request, HttpServletResponse response){
-        CarSample cs = new CarSample(vin,year,power,displacement,fuel,km, (Client) userService.findByUsername(request.getRemoteUser()),carService.findById(cartype));
-        carSampleRepository.save(cs);
-        serviceBookRepository.save(new ServiceBook(cs));
+        userService.addCarSampleForUser(vin,year,power,displacement,fuel,km,cartype,request.getRemoteUser());
         try {
             response.sendRedirect("/");
@@ -109,5 +100,5 @@
     @PostMapping("/repairs/addReview/{id}")
     public void addReview(@PathVariable Integer id, @RequestParam Integer rating, @RequestParam(required = false) String comment,
-                          Model model, HttpServletResponse response, HttpServletRequest request){
+                          HttpServletResponse response, HttpServletRequest request){
         Client client = (Client) userService.findByUsername(request.getRemoteUser());
         Repair repair = repairService.findById(id);
Index: src/main/java/com/example/autopartz/repository/OrdersForUserRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/OrdersForUserRepository.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/repository/OrdersForUserRepository.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -6,9 +6,7 @@
 import org.springframework.stereotype.Repository;
 
-import javax.transaction.Transactional;
 import java.util.List;
 
 @Repository
-@Transactional
 public interface OrdersForUserRepository extends JpaRepository<OrdersForUser, OrdersForUserId> {
     List<OrdersForUser> findAllByUserid(Integer userid);
Index: src/main/java/com/example/autopartz/repository/PartsForCarTypeAndCategoryRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/PartsForCarTypeAndCategoryRepository.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/repository/PartsForCarTypeAndCategoryRepository.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -5,9 +5,7 @@
 import org.springframework.stereotype.Repository;
 
-import javax.transaction.Transactional;
 import java.util.List;
 
 @Repository
-@Transactional
 public interface PartsForCarTypeAndCategoryRepository extends JpaRepository<PartsForCarTypeAndCategory,Integer> {
     List<PartsForCarTypeAndCategory> findAllByCartypeAndCategory(String cartype, String category);
Index: src/main/java/com/example/autopartz/repository/RepairShopReviewSummaryRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/RepairShopReviewSummaryRepository.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/repository/RepairShopReviewSummaryRepository.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -5,10 +5,6 @@
 import org.springframework.stereotype.Repository;
 
-import javax.transaction.Transactional;
-
 // извештај за сите сервиси и за сите број на reviews и avg рејтинг
 @Repository
-@Transactional
 public interface RepairShopReviewSummaryRepository extends JpaRepository<RepairShopReviewsSummary,Integer> {
-    // List<RepairShopReviewsSummary> findAllByRsid(Integer rsid);
 }
Index: src/main/java/com/example/autopartz/service/OrderService.java
===================================================================
--- src/main/java/com/example/autopartz/service/OrderService.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/service/OrderService.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -8,5 +8,5 @@
 public interface OrderService {
     List<Order> findAll();
-    Order create(Client user);
+    Order createOrderAndAddPartToOrder(Client user, Integer partId, Integer quantity);
     Order findById(Integer id);
     void save(Order o);
Index: src/main/java/com/example/autopartz/service/PartService.java
===================================================================
--- src/main/java/com/example/autopartz/service/PartService.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/service/PartService.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -1,4 +1,6 @@
 package com.example.autopartz.service;
 
+import com.example.autopartz.model.Car;
+import com.example.autopartz.model.Category;
 import com.example.autopartz.model.Part;
 
@@ -7,4 +9,10 @@
 public interface PartService {
     List<Part> findAll();
+
     Part findById(Integer id);
+
+    void addPartToWarehouse(Integer partId, Integer quantity, Integer warehouseId);
+
+    void addPart(String name, String description, Integer manufacturer, List<Car> cars, List<Category> categories, Integer warehouse, Integer quantity, Integer amount
+    );
 }
Index: src/main/java/com/example/autopartz/service/RepairShopService.java
===================================================================
--- src/main/java/com/example/autopartz/service/RepairShopService.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/service/RepairShopService.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -9,3 +9,4 @@
     RepairShop getByName(String name);
     RepairShop getById(Integer id);
+    void save(String name, String location, String number, Integer carMId);
 }
Index: src/main/java/com/example/autopartz/service/UserService.java
===================================================================
--- src/main/java/com/example/autopartz/service/UserService.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/service/UserService.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -7,5 +7,10 @@
 public interface UserService {
     List<User> findAllUsers();
+
     User findByUsername(String username);
+
     User findById(Integer id);
+
+    void addCarSampleForUser(Integer vin, Integer year, Integer power, Integer displacement, String fuel, Integer km, Integer cartype, String username);
+
 }
Index: src/main/java/com/example/autopartz/service/impl/OrderServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/OrderServiceImpl.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/service/impl/OrderServiceImpl.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -3,15 +3,20 @@
 import com.example.autopartz.model.Client;
 import com.example.autopartz.model.Order;
+import com.example.autopartz.model.manytomany.OrderContainsPart;
+import com.example.autopartz.repository.OrderContainsPartRepository;
 import com.example.autopartz.repository.OrderRepository;
 import com.example.autopartz.service.OrderService;
 import org.springframework.stereotype.Service;
 
+import javax.transaction.Transactional;
 import java.util.List;
 @Service
 public class OrderServiceImpl implements OrderService {
     private final OrderRepository orderRepository;
+    private final OrderContainsPartRepository orderContainsPartRepository;
 
-    public OrderServiceImpl(OrderRepository orderRepository) {
+    public OrderServiceImpl(OrderRepository orderRepository, OrderContainsPartRepository orderContainsPartRepository) {
         this.orderRepository = orderRepository;
+        this.orderContainsPartRepository = orderContainsPartRepository;
     }
 
@@ -22,6 +27,9 @@
 
     @Override
-    public Order create(Client user) {
-        return orderRepository.save(new Order(user));
+    @Transactional
+    public Order createOrderAndAddPartToOrder(Client user, Integer partId, Integer quantity) {
+        Order order = orderRepository.save(new Order(user));
+        orderContainsPartRepository.save(new OrderContainsPart(partId, order.getOrderid(), quantity));
+        return order;
     }
 
Index: src/main/java/com/example/autopartz/service/impl/PartServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/PartServiceImpl.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/service/impl/PartServiceImpl.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -1,9 +1,19 @@
 package com.example.autopartz.service.impl;
 
+import com.example.autopartz.model.Car;
+import com.example.autopartz.model.Category;
 import com.example.autopartz.model.Part;
-import com.example.autopartz.repository.PartRepository;
+import com.example.autopartz.model.Price;
+import com.example.autopartz.model.manytomany.PartIsAppropriateForCar;
+import com.example.autopartz.model.manytomany.PartIsFromCategory;
+import com.example.autopartz.model.manytomany.PartIsInStockInWarehouse;
+import com.example.autopartz.model.manytomany.PartIsInStockInWarehouseId;
+import com.example.autopartz.repository.*;
 import com.example.autopartz.service.PartService;
+import com.example.autopartz.service.PriceService;
 import org.springframework.stereotype.Service;
 
+import javax.transaction.Transactional;
+import java.time.LocalDate;
 import java.util.List;
 
@@ -11,7 +21,19 @@
 public class PartServiceImpl implements PartService {
     private final PartRepository partRepository;
+    private final PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository;
+    private final PartIsFromCategoryRepository partIsFromCategoryRepository;
+    private final PartIsAppropriateForCarRepository partIsAppropriateForCarRepository;
+    private final WarehouseRepository warehouseRepository;
+    private final PartManufacturerRepository partManufacturerRepository;
+    private final PriceService priceService;
 
-    public PartServiceImpl(PartRepository partRepository) {
+    public PartServiceImpl(PartRepository partRepository, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository, PartIsFromCategoryRepository partIsFromCategoryRepository, PartIsAppropriateForCarRepository partIsAppropriateForCarRepository, WarehouseRepository warehouseRepository, PartManufacturerRepository partManufacturerRepository, PriceService priceService) {
         this.partRepository = partRepository;
+        this.partIsInStockInWarehouseRepository = partIsInStockInWarehouseRepository;
+        this.partIsFromCategoryRepository = partIsFromCategoryRepository;
+        this.partIsAppropriateForCarRepository = partIsAppropriateForCarRepository;
+        this.warehouseRepository = warehouseRepository;
+        this.partManufacturerRepository = partManufacturerRepository;
+        this.priceService = priceService;
     }
 
@@ -25,3 +47,29 @@
         return partRepository.findById(id).orElseThrow(RuntimeException::new);
     }
+
+    @Override
+    @Transactional
+    public void addPartToWarehouse(Integer partId, Integer quantity, Integer warehouseId) {
+        PartIsInStockInWarehouseId tmp = new PartIsInStockInWarehouseId(partId, warehouseId);
+        PartIsInStockInWarehouse temp = partIsInStockInWarehouseRepository.findById(tmp).get();
+        temp.setQuantity(temp.getQuantity() + quantity);
+        partIsInStockInWarehouseRepository.save(temp);
+    }
+
+    @Override
+    @Transactional
+    public void addPart(String name, String description, Integer manufacturer, List<Car> cars, List<Category> categories, Integer warehouse, Integer quantity, Integer amount) {
+        Part newPart = new Part(name, description==null ? "" : description, partManufacturerRepository.findById(manufacturer).get(),
+                categories, List.of(warehouseRepository.findById(warehouse).get()),cars);
+        partRepository.save(newPart);
+        priceService.save(new Price(amount, LocalDate.now(),newPart));
+        partIsInStockInWarehouseRepository.save(new PartIsInStockInWarehouse(newPart.getId(),warehouse,quantity));
+        for (Category c:categories
+        ) {
+            partIsFromCategoryRepository.save(new PartIsFromCategory(newPart.getId(),c.getId()));
+        }
+        for (Car car:cars){
+            partIsAppropriateForCarRepository.save(new PartIsAppropriateForCar(newPart.getId(),car.getId()));
+        }
+    }
 }
Index: src/main/java/com/example/autopartz/service/impl/RepairShopServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/RepairShopServiceImpl.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/service/impl/RepairShopServiceImpl.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -2,8 +2,12 @@
 
 import com.example.autopartz.model.RepairShop;
+import com.example.autopartz.model.manytomany.RsForCm;
+import com.example.autopartz.repository.CarManufacturerRepository;
 import com.example.autopartz.repository.RepairShopRepository;
+import com.example.autopartz.repository.RsForCmRepository;
 import com.example.autopartz.service.RepairShopService;
 import org.springframework.stereotype.Service;
 
+import javax.transaction.Transactional;
 import java.util.List;
 
@@ -11,7 +15,11 @@
 public class RepairShopServiceImpl implements RepairShopService {
     private final RepairShopRepository repairShopRepository;
+    private final CarManufacturerRepository carManufacturerRepository;
+    private final RsForCmRepository rsForCmRepository;
 
-    public RepairShopServiceImpl(RepairShopRepository repairShopRepository) {
+    public RepairShopServiceImpl(RepairShopRepository repairShopRepository, CarManufacturerRepository carManufacturerRepository, RsForCmRepository rsForCmRepository) {
         this.repairShopRepository = repairShopRepository;
+        this.carManufacturerRepository = carManufacturerRepository;
+        this.rsForCmRepository = rsForCmRepository;
     }
 
@@ -30,3 +38,12 @@
         return repairShopRepository.findById(id).get();
     }
+
+    @Override
+    @Transactional
+    public void save(String name, String location, String number, Integer carMId) {
+        RepairShop newRs = new RepairShop(name,location,number,
+                List.of(carManufacturerRepository.findById(carMId).get()));
+        repairShopRepository.save(newRs);
+        rsForCmRepository.save(new RsForCm(newRs.getId(), carMId));
+    }
 }
Index: src/main/java/com/example/autopartz/service/impl/UserServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/UserServiceImpl.java	(revision c79897fe7d1636c1dadb63a832434a111d670825)
+++ src/main/java/com/example/autopartz/service/impl/UserServiceImpl.java	(revision 2a552fe252508ef26ee2a3e2b504f88d6ff7e5ae)
@@ -1,11 +1,13 @@
 package com.example.autopartz.service.impl;
 
-import com.example.autopartz.model.Role;
-import com.example.autopartz.model.User;
+import com.example.autopartz.model.*;
+import com.example.autopartz.repository.CarRepository;
+import com.example.autopartz.repository.CarSampleRepository;
+import com.example.autopartz.repository.ServiceBookRepository;
 import com.example.autopartz.repository.UserRepository;
 import com.example.autopartz.service.UserService;
 import org.springframework.stereotype.Service;
 
-import java.util.Collections;
+import javax.transaction.Transactional;
 import java.util.List;
 
@@ -13,7 +15,13 @@
 public class UserServiceImpl implements UserService {
     private final UserRepository userRepository;
+    private final CarRepository carRepository;
+    private final CarSampleRepository carSampleRepository;
+    private final ServiceBookRepository serviceBookRepository;
 
-    public UserServiceImpl(UserRepository userRepository) {
+    public UserServiceImpl(UserRepository userRepository, CarRepository carRepository, CarSampleRepository carSampleRepository, ServiceBookRepository serviceBookRepository) {
         this.userRepository = userRepository;
+        this.carRepository = carRepository;
+        this.carSampleRepository = carSampleRepository;
+        this.serviceBookRepository = serviceBookRepository;
     }
 
@@ -32,3 +40,11 @@
         return userRepository.findById(id).get();
     }
+
+    @Override
+    @Transactional
+    public void addCarSampleForUser(Integer vin, Integer year, Integer power, Integer displacement, String fuel, Integer km, Integer cartype, String username) {
+        CarSample cs = new CarSample(vin, year, power, displacement, fuel, km, (Client) this.findByUsername(username), carRepository.findById(cartype).get());
+        carSampleRepository.save(cs);
+        serviceBookRepository.save(new ServiceBook(cs));
+    }
 }
