Index: src/main/java/com/example/autopartz/config/WebSecurityConfig.java
===================================================================
--- src/main/java/com/example/autopartz/config/WebSecurityConfig.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/config/WebSecurityConfig.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -30,5 +30,6 @@
                 .antMatchers("/", "/products", "/services", "/filtered", "/login", "/register","/registerWarehouseman","/finishRegister","/test/*","/access_denied","/carCategoryReport","/partManufacturersReport","/mostPurchasedPart").permitAll()
                 .antMatchers("/orders","/repairs","/reviews","/part/*","/currentOrder","/addCarSampleForUser","/repairs/addReview/*").hasRole("CLIENT")
-                .antMatchers("/viewUsers","/approve/*").hasRole("ADMIN")
+                .antMatchers("/viewUsers","/approve/*","/addPart").hasRole("ADMIN")
+                .antMatchers("/myWarehouseReport","myWarehouse").hasRole("WAREHOUSEMAN")
                 .anyRequest()
                 .authenticated()
Index: src/main/java/com/example/autopartz/controller/AdminController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/AdminController.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/controller/AdminController.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -1,21 +1,19 @@
 package com.example.autopartz.controller;
 
-import com.example.autopartz.model.Deliveryman;
-import com.example.autopartz.model.Role;
-import com.example.autopartz.model.User;
-import com.example.autopartz.model.Warehouseman;
-import com.example.autopartz.repository.DeliverymanRepository;
-import com.example.autopartz.repository.WarehousemanRepository;
+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.repository.*;
+import com.example.autopartz.service.PriceService;
 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.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Objects;
@@ -25,11 +23,29 @@
 public class AdminController {
     private final UserService userService;
+    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;
 
-    public AdminController(UserService userService, WarehousemanRepository warehousemanRepository, DeliverymanRepository deliverymanRepository) {
+    public AdminController(UserService userService, PartIsFromCategoryRepository partIsFromCategoryRepository, PartIsAppropriateForCarRepository partIsAppropriateForCarRepository, WarehousemanRepository warehousemanRepository, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository, DeliverymanRepository deliverymanRepository, CategoryRepository categoryRepository, PartRepository partRepository, WarehouseRepository warehouseRepository, CarRepository carRepository, PartManufacturerRepository partManufacturerRepository, PriceService priceService) {
         this.userService = userService;
+        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;
     }
 
@@ -66,3 +82,36 @@
         }
     }
+    @GetMapping("/addPart")
+    public String addPart(Model model){
+        model.addAttribute("categories",categoryRepository.findAll());
+        model.addAttribute("warehouses",warehouseRepository.findAll());
+        model.addAttribute("cars",carRepository.findAll());
+        model.addAttribute("manufacturers",partManufacturerRepository.findAll());
+        model.addAttribute("bodyContent","addPart");
+        return "master-template";
+    }
+    @PostMapping("/addPart")
+    public void addPart(@RequestParam String name, @RequestParam(required = false) String description,
+                        @RequestParam Integer manufacturer, @RequestParam List<Car> cars,
+                        @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()));
+        }
+        try {
+            response.sendRedirect("/");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
 }
Index: src/main/java/com/example/autopartz/controller/HomeController.java
===================================================================
--- src/main/java/com/example/autopartz/controller/HomeController.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/controller/HomeController.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -6,4 +6,5 @@
 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;
@@ -42,6 +43,8 @@
     private final MostPurchasedPartRepository mostPurchasedPartRepository;
     private final PriceService priceService;
+    private final WarehousemanReportRepository warehousemanReportRepository;
+    private final PartRepository partRepository;
     public HomeController(LoginService loginService, PartService partService, PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository, CarService carService, CategoryService categoryService, RepairShopReviewSummaryRepository repairShopReviewSummaryRepository, WarehouseRepository warehouseRepository,
-                          OrderContainsPartRepository orderContainsPartRepository, OrderService orderService, UserService userService, DeliveriesInProgressRepository deliveriesInProgressRepository, DeliveryService deliveryService, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository, CarCategoryReportRepository carCategoryReportRepository, PartManufacturersReportRepository partManufacturersReportRepository, MostPurchasedPartRepository mostPurchasedPartRepository, PriceService priceService) {
+                          OrderContainsPartRepository orderContainsPartRepository, OrderService orderService, UserService userService, DeliveriesInProgressRepository deliveriesInProgressRepository, DeliveryService deliveryService, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository, CarCategoryReportRepository carCategoryReportRepository, PartManufacturersReportRepository partManufacturersReportRepository, MostPurchasedPartRepository mostPurchasedPartRepository, PriceService priceService, WarehousemanReportRepository warehousemanReportRepository, PartRepository partRepository) {
         this.loginService = loginService;
         this.partService = partService;
@@ -61,4 +64,6 @@
         this.mostPurchasedPartRepository = mostPurchasedPartRepository;
         this.priceService = priceService;
+        this.warehousemanReportRepository = warehousemanReportRepository;
+        this.partRepository = partRepository;
     }
 
@@ -201,5 +206,5 @@
         Warehouseman whm = (Warehouseman) userService.findByUsername(request.getRemoteUser());
         Warehouse warehouse = whm.getWarehouse();
-        List<PartIsInStockInWarehouse> partIsInStockInWarehouseList = partIsInStockInWarehouseRepository.findAllByWarehouseid(warehouse.getID_warehouse());
+        List<PartIsInStockInWarehouse> partIsInStockInWarehouseList = partIsInStockInWarehouseRepository.findAllByWarehouseid(warehouse.getId());
         model.addAttribute("bodyContent","myWarehouse");
         model.addAttribute("warehouse",warehouse);
@@ -274,3 +279,28 @@
         return "master-template";
     }
+    @GetMapping("/myWarehouseReport")
+    public String getMyWarehouseReport(Model model, HttpServletRequest request){
+        Warehouseman whm = (Warehouseman) userService.findByUsername(request.getRemoteUser());
+        Warehouse wh = whm.getWarehouse();
+        Integer whId = wh.getId();
+        model.addAttribute("data", warehousemanReportRepository.findByWid(whId));
+        model.addAttribute("bodyContent","myWarehouseReport");
+        return "master-template";
+    }
+    @PostMapping("/myWarehouse/{pname}")
+    public void addPartToWarehouse(@PathVariable String pname,@RequestParam Integer quantity, HttpServletRequest request, HttpServletResponse response){
+        Integer pId = partRepository.findAllByName(pname).stream().findFirst().get().getId();
+        Warehouseman whm = (Warehouseman) userService.findByUsername(request.getRemoteUser());
+        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);
+        try {
+            response.sendRedirect("/myWarehouseReport");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
 }
Index: src/main/java/com/example/autopartz/model/Category.java
===================================================================
--- src/main/java/com/example/autopartz/model/Category.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/model/Category.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -17,5 +17,6 @@
 public class Category {
     @Id
-    Integer ID_category;
+    @Column(name = "id_category")
+    Integer id;
     @Column(name = "category_name")
     String cname;
@@ -29,5 +30,5 @@
         if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
         Category category = (Category) o;
-        return ID_category != null && Objects.equals(ID_category, category.ID_category);
+        return id != null && Objects.equals(id, category.id);
     }
 
Index: src/main/java/com/example/autopartz/model/Part.java
===================================================================
--- src/main/java/com/example/autopartz/model/Part.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/model/Part.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -18,4 +18,5 @@
 public class Part {
     @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Column(name = "ID_part")
     Integer id;
@@ -46,4 +47,13 @@
     List<Car> carList;
 
+    public Part(String name, String description, PartManufacturer manufacturer, List<Category> categoryList, List<Warehouse> warehouseList, List<Car> carList) {
+        this.name = name;
+        this.description = description;
+        this.manufacturer = manufacturer;
+        this.categoryList = categoryList;
+        this.warehouseList = warehouseList;
+        this.carList = carList;
+    }
+
     @Override
     public boolean equals(Object o) {
Index: src/main/java/com/example/autopartz/model/PartManufacturer.java
===================================================================
--- src/main/java/com/example/autopartz/model/PartManufacturer.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/model/PartManufacturer.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -21,5 +21,6 @@
 public class PartManufacturer {
     @Id
-    Integer ID_part_manufacturer;
+    @Column(name = "id_part_manufacturer")
+    Integer id;
     @Column(name = "pm_name")
     String name;
@@ -31,5 +32,5 @@
         if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
         PartManufacturer that = (PartManufacturer) o;
-        return ID_part_manufacturer != null && Objects.equals(ID_part_manufacturer, that.ID_part_manufacturer);
+        return id != null && Objects.equals(id, that.id);
     }
 
Index: src/main/java/com/example/autopartz/model/Price.java
===================================================================
--- src/main/java/com/example/autopartz/model/Price.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/model/Price.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -7,8 +7,5 @@
 import org.hibernate.Hibernate;
 
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
+import javax.persistence.*;
 import java.time.LocalDate;
 import java.util.Objects;
@@ -21,4 +18,5 @@
 public class Price {
     @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
     Integer ID_price;
     Integer amount;
@@ -28,4 +26,10 @@
     @JoinColumn(name = "id_part")
     Part part;
+
+    public Price(Integer amount, LocalDate price_from, Part part) {
+        this.amount = amount;
+        this.price_from = price_from;
+        this.part = part;
+    }
 
     @Override
Index: src/main/java/com/example/autopartz/model/Warehouse.java
===================================================================
--- src/main/java/com/example/autopartz/model/Warehouse.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/model/Warehouse.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -19,5 +19,6 @@
 public class Warehouse {
     @Id
-    Integer ID_warehouse;
+    @Column(name = "id_warehouse")
+    Integer id;
     @Column(name = "warehouse_location")
     String location;
@@ -28,5 +29,5 @@
         if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
         Warehouse warehouse = (Warehouse) o;
-        return ID_warehouse != null && Objects.equals(ID_warehouse, warehouse.ID_warehouse);
+        return id != null && Objects.equals(id, warehouse.id);
     }
 
Index: src/main/java/com/example/autopartz/model/manytomany/PartIsAppropriateForCar.java
===================================================================
--- src/main/java/com/example/autopartz/model/manytomany/PartIsAppropriateForCar.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/java/com/example/autopartz/model/manytomany/PartIsAppropriateForCar.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,29 @@
+package com.example.autopartz.model.manytomany;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+
+import javax.persistence.*;
+
+@Entity
+@Getter
+@Setter
+@ToString
+@NoArgsConstructor
+@Table(name = "`part_is_appropriate_for_car`")
+@IdClass(PartIsAppropriateForCarId.class)
+public class PartIsAppropriateForCar {
+    @Id
+    @Column(name = "id_part")
+    Integer partid;
+    @Column(name = "id_car")
+    @Id
+    Integer carid;
+
+    public PartIsAppropriateForCar(Integer partid, Integer carid) {
+        this.partid = partid;
+        this.carid = carid;
+    }
+}
Index: src/main/java/com/example/autopartz/model/manytomany/PartIsAppropriateForCarId.java
===================================================================
--- src/main/java/com/example/autopartz/model/manytomany/PartIsAppropriateForCarId.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/java/com/example/autopartz/model/manytomany/PartIsAppropriateForCarId.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,11 @@
+package com.example.autopartz.model.manytomany;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class PartIsAppropriateForCarId implements Serializable {
+    Integer partid;
+    Integer carid;
+}
Index: src/main/java/com/example/autopartz/model/manytomany/PartIsFromCategory.java
===================================================================
--- src/main/java/com/example/autopartz/model/manytomany/PartIsFromCategory.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/java/com/example/autopartz/model/manytomany/PartIsFromCategory.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,29 @@
+package com.example.autopartz.model.manytomany;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+
+import javax.persistence.*;
+
+@Entity
+@Getter
+@Setter
+@ToString
+@NoArgsConstructor
+@Table(name = "`part_is_from_category`")
+@IdClass(PartIsFromCategoryId.class)
+public class PartIsFromCategory {
+    @Id
+    @Column(name = "id_part")
+    Integer partid;
+    @Column(name = "id_category")
+    @Id
+    Integer categoryid;
+
+    public PartIsFromCategory(Integer partid, Integer categoryid) {
+        this.partid = partid;
+        this.categoryid = categoryid;
+    }
+}
Index: src/main/java/com/example/autopartz/model/manytomany/PartIsFromCategoryId.java
===================================================================
--- src/main/java/com/example/autopartz/model/manytomany/PartIsFromCategoryId.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/java/com/example/autopartz/model/manytomany/PartIsFromCategoryId.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,11 @@
+package com.example.autopartz.model.manytomany;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class PartIsFromCategoryId implements Serializable {
+    Integer partid;
+    Integer categoryid;
+}
Index: src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouse.java
===================================================================
--- src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouse.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouse.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -1,8 +1,5 @@
 package com.example.autopartz.model.manytomany;
 
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import lombok.Setter;
-import lombok.ToString;
+import lombok.*;
 
 import javax.persistence.*;
@@ -12,5 +9,5 @@
 @Setter
 @ToString
-@RequiredArgsConstructor
+@NoArgsConstructor
 @Table(name = "`part_is_in_stock_in_warehouse`")
 @IdClass(PartIsInStockInWarehouseId.class)
@@ -24,3 +21,9 @@
     @Column(name = "quantity_warehouse")
     Integer quantity;
+
+    public PartIsInStockInWarehouse(Integer partid, Integer warehouseid, Integer quantity) {
+        this.partid = partid;
+        this.warehouseid = warehouseid;
+        this.quantity = quantity;
+    }
 }
Index: src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouseId.java
===================================================================
--- src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouseId.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/model/manytomany/PartIsInStockInWarehouseId.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -9,3 +9,11 @@
     Integer partid;
     Integer warehouseid;
+
+    public PartIsInStockInWarehouseId(Integer pId, Integer whId) {
+        this.partid = pId;
+        this.warehouseid = whId;
+    }
+
+    public PartIsInStockInWarehouseId() {
+    }
 }
Index: src/main/java/com/example/autopartz/model/views/WarehousemanReport.java
===================================================================
--- src/main/java/com/example/autopartz/model/views/WarehousemanReport.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/java/com/example/autopartz/model/views/WarehousemanReport.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,35 @@
+package com.example.autopartz.model.views;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+import org.hibernate.annotations.Immutable;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+import java.io.Serial;
+import java.io.Serializable;
+
+@Entity
+@Getter
+@Setter
+@ToString
+@RequiredArgsConstructor
+@Immutable
+@Table(name = "`warehouseman_report`")
+@IdClass(WarehousemanReportId.class)
+public class WarehousemanReport implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1L;
+    @Id
+    Integer wid;
+    @Id
+    String pname;
+    Long quantityordered;
+    Integer quantitywarehouse;
+    Long quantitylast3months;
+    String hasenoughinstock;
+}
Index: src/main/java/com/example/autopartz/model/views/WarehousemanReportId.java
===================================================================
--- src/main/java/com/example/autopartz/model/views/WarehousemanReportId.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/java/com/example/autopartz/model/views/WarehousemanReportId.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,11 @@
+package com.example.autopartz.model.views;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class WarehousemanReportId implements Serializable {
+    Integer wid;
+    String pname;
+}
Index: src/main/java/com/example/autopartz/repository/PartIsAppropriateForCarRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/PartIsAppropriateForCarRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/java/com/example/autopartz/repository/PartIsAppropriateForCarRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,8 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.manytomany.PartIsAppropriateForCar;
+import com.example.autopartz.model.manytomany.PartIsAppropriateForCarId;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface PartIsAppropriateForCarRepository extends JpaRepository<PartIsAppropriateForCar, PartIsAppropriateForCarId> {
+}
Index: src/main/java/com/example/autopartz/repository/PartIsFromCategoryRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/PartIsFromCategoryRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/java/com/example/autopartz/repository/PartIsFromCategoryRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,8 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.manytomany.PartIsFromCategory;
+import com.example.autopartz.model.manytomany.PartIsFromCategoryId;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface PartIsFromCategoryRepository extends JpaRepository<PartIsFromCategory, PartIsFromCategoryId> {
+}
Index: src/main/java/com/example/autopartz/repository/PartManufacturerRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/PartManufacturerRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/java/com/example/autopartz/repository/PartManufacturerRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,7 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.PartManufacturer;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface PartManufacturerRepository extends JpaRepository<PartManufacturer,Integer> {
+}
Index: src/main/java/com/example/autopartz/repository/PartRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/PartRepository.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/repository/PartRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -5,5 +5,8 @@
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 @Repository
 public interface PartRepository extends JpaRepository<Part,Integer> {
+    List<Part> findAllByName(String name);
 }
Index: src/main/java/com/example/autopartz/repository/WarehouseRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/WarehouseRepository.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/repository/WarehouseRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -8,3 +8,4 @@
 public interface WarehouseRepository extends JpaRepository<Warehouse,Integer> {
     List<Warehouse> findAllByLocation(String location);
+    List<Warehouse> findAllById(Integer id);
 }
Index: src/main/java/com/example/autopartz/repository/WarehousemanReportRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/WarehousemanReportRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/java/com/example/autopartz/repository/WarehousemanReportRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,11 @@
+package com.example.autopartz.repository;
+
+import com.example.autopartz.model.views.WarehousemanReport;
+import com.example.autopartz.model.views.WarehousemanReportId;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.List;
+
+public interface WarehousemanReportRepository extends JpaRepository<WarehousemanReport, WarehousemanReportId> {
+    List<WarehousemanReport> findByWid(Integer wid);
+}
Index: src/main/java/com/example/autopartz/repository/WarehousemanRepository.java
===================================================================
--- src/main/java/com/example/autopartz/repository/WarehousemanRepository.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/repository/WarehousemanRepository.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -1,7 +1,11 @@
 package com.example.autopartz.repository;
 
+import com.example.autopartz.model.Warehouse;
 import com.example.autopartz.model.Warehouseman;
 import org.springframework.data.jpa.repository.JpaRepository;
 
+import java.util.List;
+
 public interface WarehousemanRepository extends JpaRepository<Warehouseman,Integer> {
+    List<Warehouseman> findAllByWarehouse(Warehouse warehouse);
 }
Index: src/main/java/com/example/autopartz/service/PriceService.java
===================================================================
--- src/main/java/com/example/autopartz/service/PriceService.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/service/PriceService.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -8,3 +8,4 @@
 public interface PriceService {
     List<Price> findPriceForPart(Part part);
+    void save(Price p);
 }
Index: src/main/java/com/example/autopartz/service/impl/PriceServiceImpl.java
===================================================================
--- src/main/java/com/example/autopartz/service/impl/PriceServiceImpl.java	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/java/com/example/autopartz/service/impl/PriceServiceImpl.java	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -22,3 +22,8 @@
         return priceRepository.findAllByPart(part);
     }
+
+    @Override
+    public void save(Price p) {
+        priceRepository.save(p);
+    }
 }
Index: src/main/resources/templates/addPart.html
===================================================================
--- src/main/resources/templates/addPart.html	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/resources/templates/addPart.html	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,69 @@
+<div>
+  <form class="form-signin mt-xl-4" method="post" action="/addPart">
+    <h2 class="form-signin-heading mb-3">Додај дел во системот</h2>
+    <p>
+      <label for="name" class="sr-only">Име на делот</label>
+      <input type="text" id="name" name="name" class="form-control" placeholder="Внеси го името на делот..." required="" autofocus=""/>
+    </p>
+    <p>
+      <label for="description" class="sr-only">Опис на делот</label>
+      <input type="text" id="description" name="description" class="form-control" placeholder="Внеси опис за делот..." autofocus=""/>
+    </p>
+    <p>
+      <label for="manufacturer" class="sr-only">
+        Одбери производител
+      </label><select class="form-control" id="manufacturer" name="manufacturer" required>
+      <option  th:each="m : ${manufacturers}"
+               th:text="${m.getName()}"
+               th:value="${m.getId()}">
+      </option>
+    </select>
+    </p>
+    <p>
+      <label for="cars">Соодветно за</label>
+<!--      <select class="form-control" id="cars" name="cars" required multiple="multiple">-->
+<!--        <option  th:each="c : ${cars}"-->
+<!--                 th:text="${c.getCartype()}"-->
+<!--                 th:value="${c.getId()}">-->
+<!--        </option>-->
+<!--      </select>-->
+        <input type="checkbox" name="cars" id="cars"
+               th:each="c : ${cars}"
+               th:text="${c.getCartype()}"
+               th:value="${c.getId()}"
+        />
+    </p>
+    <p>
+      <label for="categories">Во категории</label>
+<!--      <select class="form-control" id="categories" name="categories" required multiple="multiple">-->
+<!--        <option  th:each="c : ${categories}"-->
+<!--                 th:text="${c.getCname()}"-->
+<!--                 th:value="${c.getId()}">-->
+<!--        </option>-->
+<!--      </select>-->
+      <input type="checkbox" name="categories" id="categories"
+             th:each="c : ${categories}"
+             th:text="${c.getCname()}"
+             th:value="${c.getId()}"
+      />
+    </p>
+    <p>
+      <label for="warehouse">Во магацин</label>
+      <select class="form-control" id="warehouse" name="warehouse" required>
+        <option  th:each="w : ${warehouses}"
+                 th:text="${w.getLocation()}"
+                 th:value="${w.getId()}">
+        </option>
+      </select>
+    </p>
+    <p>
+      <label for="quantity" class="sr-only">Количина во магацин</label>
+      <input required type="number" min="1" id="quantity" name="quantity" class="form-control" placeholder="Внеси количина..." autofocus=""/>
+    </p>
+    <p>
+      <label for="amount" class="sr-only">Цена</label>
+      <input required type="number" min="1" id="amount" name="amount" class="form-control" placeholder="Внеси цена..." autofocus=""/>
+    </p>
+    <button class="btn btn-lg btn-primary btn-block" type="submit">Додај дел</button>
+  </form>
+</div>
Index: src/main/resources/templates/carCategoryReport.html
===================================================================
--- src/main/resources/templates/carCategoryReport.html	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/resources/templates/carCategoryReport.html	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -11,5 +11,5 @@
     <tbody>
     <tr th:each="d : ${data}">
-      <td th:text="${d.getCname}"></td>
+      <td th:text="${d.getCname()}"></td>
       <td th:text="${d.getCmname()}"></td>
       <td th:text="${d.getPartsordered()}"></td>
Index: src/main/resources/templates/fragments/header.html
===================================================================
--- src/main/resources/templates/fragments/header.html	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/resources/templates/fragments/header.html	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -40,4 +40,9 @@
             </li>
           </th:block>
+          <th:block sec:authorize="hasAuthority('ROLE_WAREHOUSEMAN')">
+            <li class="nav-item m-auto">
+              <a class="nav-link active" href="/myWarehouseReport">Информации за потреби</a>
+            </li>
+          </th:block>
           <th:block sec:authorize="hasAuthority('ROLE_DELIVERYMAN')">
             <li class="nav-item m-auto">
@@ -48,4 +53,9 @@
             <li class="nav-item m-auto">
               <a class="nav-link active" href="/viewUsers">Корисници</a>
+            </li>
+          </th:block>
+          <th:block sec:authorize="hasAuthority('ROLE_ADMIN')">
+            <li class="nav-item m-auto">
+              <a class="nav-link active" href="/addPart">Додај дел во системот</a>
             </li>
           </th:block>
Index: src/main/resources/templates/myDeliveries.html
===================================================================
--- src/main/resources/templates/myDeliveries.html	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/resources/templates/myDeliveries.html	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -2,5 +2,5 @@
     <h1 class="mt-3 mb-3">Мои достави</h1>
     <form class="form-signin mt-xl-5" method="get" action="/myNextDeliveries">
-    <button id="submit" class="btn btn-lg btn-primary btn-block w-50" type="submit">Мои следни нарачки</button>
+    <button id="submit" class="btn btn-lg btn-primary btn-block w-50" type="submit">Мои следни достави</button>
     </form>
     <table class="table table-bordered mt-3">
Index: src/main/resources/templates/myNextDeliveries.html
===================================================================
--- src/main/resources/templates/myNextDeliveries.html	(revision 89865ae53ceeadf02cbda43e41ca9d085eb75548)
+++ src/main/resources/templates/myNextDeliveries.html	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -1,4 +1,4 @@
 <div>
-  <h1 class="mb-3 mt-3">Мои следни нарачки</h1>
+  <h1 class="mb-3 mt-3">Мои следни достави</h1>
   <h1 th:if="${hasError}" th:text="${error}"></h1>
   <div th:if="${!hasError}">
Index: src/main/resources/templates/myWarehouseReport.html
===================================================================
--- src/main/resources/templates/myWarehouseReport.html	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
+++ src/main/resources/templates/myWarehouseReport.html	(revision ed7ef92880a58a5d3f4b2dd53a678c007d46bb9b)
@@ -0,0 +1,33 @@
+<div>
+  <table class="table table-bordered mt-3">
+    <thead class="thead-dark">
+    <tr>
+      <th scope="col">Магацин</th>
+      <th scope="col">Име на дел</th>
+      <th scope="col">Моментално нарачани</th>
+      <th scope="col">Моментално достапни</th>
+      <th scope="col">Потрошени во последните 3 месеци</th>
+      <th scope="col">Дали треба да се нарача?</th>
+      <th scope="col">Нарачај</th>
+    </tr>
+    </thead>
+    <tbody>
+    <tr th:each="d : ${data}">
+      <td th:text="${d.getWid()}"></td>
+      <td th:text="${d.getPname()}"></td>
+      <td th:text="${d.getQuantityordered()}"></td>
+      <td th:text="${d.getQuantitywarehouse()}"></td>
+      <td th:text="${d.getQuantitylast3months()}"></td>
+      <td th:text="${d.getHasenoughinstock()}"></td>
+      <td>
+        <form method="post" th:action="@{'/myWarehouse/{pname}' (pname=${d.getPname()}) }">
+          <label for="quantity">
+            <input type="number" id="quantity" class="form-control" min="1" required name="quantity" placeholder="Количина">
+          </label>
+          <button class="btn btn-primary btn-block btn-lg" type="submit">Нарачај</button>
+        </form>
+      </td>
+    </tr>
+    </tbody>
+  </table>
+</div>
