Index: src/main/java/com/tourMate/config/SecurityConfig.java
===================================================================
--- src/main/java/com/tourMate/config/SecurityConfig.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/config/SecurityConfig.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -7,5 +7,4 @@
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
 import org.springframework.security.config.annotation.web.builders.HttpSecurity;
 import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@@ -15,5 +14,4 @@
 import org.springframework.security.web.SecurityFilterChain;
 import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
-import org.springframework.security.web.authentication.logout.HttpStatusReturningLogoutSuccessHandler;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 import org.springframework.web.cors.CorsConfiguration;
@@ -76,9 +74,8 @@
                                         .anyRequest().authenticated()
                                         .and()
-                                        .formLogin()
+                                        .formLogin().loginPage("http://localhost:3000/login")
                                         .loginProcessingUrl("/api/login").usernameParameter("username").passwordParameter("password")
                                         .successHandler((request, response, authentication) -> {
                                             response.setStatus(HttpServletResponse.SC_OK);
-                                            response.setCharacterEncoding("UTF-8");
                                             response.setContentType("application/json");
                                             response.getWriter().print("{\"message\": \"Login successful\",");
@@ -88,6 +85,5 @@
                                         .failureHandler((request, response, exception) -> {
                                             response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
-                                            response.sendRedirect("/login");
-                                            response.getWriter().print("Neuspesna najava\n" + exception.getMessage());
+                                            response.getWriter().print("Pukla veza\n" + exception.getMessage());
                                             response.getWriter().flush();
                                         })
@@ -97,5 +93,5 @@
                                         .sessionCreationPolicy(SessionCreationPolicy.ALWAYS)
                                         .and()
-                                        .logout().logoutSuccessHandler((new HttpStatusReturningLogoutSuccessHandler(HttpStatus.OK)))
+                                        .logout()
                                         .permitAll();
 
Index: src/main/java/com/tourMate/controllers/HotelController.java
===================================================================
--- src/main/java/com/tourMate/controllers/HotelController.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/controllers/HotelController.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -2,6 +2,4 @@
 
 import com.tourMate.dto.HotelDto;
-import com.tourMate.dto.HotelReservationDto;
-import com.tourMate.dto.HotelReservationUserDto;
 import com.tourMate.entities.*;
 import com.tourMate.services.HotelManager;
@@ -106,8 +104,7 @@
     //HOTEL ROOM CRUD
     @PostMapping(path = "/hotel/rooms/add")
-    public void addRoom(@RequestBody HotelRoom room,
-                        @RequestParam(name = "hotelId") long hotelId) {
+    public void addRoom(@RequestBody HotelRoom room, @RequestParam(name = "hotelId") long hotelId) {
         Hotels h = hotelManager.findHotelByID(hotelId);
-        hotelManager.createRoom(h, room.getHotelRoomDescription(), room.getHotelRoomName(), room.getKitchenAvailable(), room.getAirConditioning(), room.getBalcony(), room.getPrice(), room.getNumOfBeds());
+        hotelManager.createRoom(h, room.getHotelRoomDescription(), room.getHotelRoomName(), room.getKitchenAvailable(), room.getAirConditioning(), room.getBalcony(), room.getPrice());
     }
 
@@ -152,6 +149,5 @@
         //HOTEL AVAILABILITY CRUD
     @PostMapping(path = "/hotel/rooms/available/{id}/add")
-    public void addRoomAvailible(@RequestBody HotelRoomAvailable hotelRoomAvailable,
-                                 @PathVariable long id)
+    public void addRoomAvailible(@RequestBody HotelRoomAvailable hotelRoomAvailable, @PathVariable long id)
     {
         HotelRoom hotelRoom = hotelManager.findRoomById(id);
@@ -182,12 +178,10 @@
     public List<HotelRoomAvailable> getRoomAvailability(@PathVariable Long id)
     {
-        return hotelManager.getRoomsAvailableById(id);
+        return hotelManager.getRoomsAvailibility();
     }
 
     @GetMapping(path = "/hotel/search")
-    public List<HotelDto> searchAvailibleRooms(@RequestParam(name = "hotelLocation") String hotelLocation,
-                                               @RequestParam(name = "dateFrom") @DateTimeFormat(pattern = "yyyy-MM-dd") Date dateFrom,
-                                               @RequestParam(name = "dateTo") @DateTimeFormat(pattern = "yyyy-MM-dd") Date dateTo,
-                                               @RequestParam(name = "numBeds") int numBeds)
+    public List<HotelDto> searchAvailibleRooms(@RequestParam(name = "hotelLocation") String hotelLocation, @RequestParam(name = "dateFrom") @DateTimeFormat(pattern = "yyyy-MM-dd") Date dateFrom,
+                                               @RequestParam(name = "dateTo") @DateTimeFormat(pattern = "yyyy-MM-dd") Date dateTo, @RequestParam(name = "numBeds") int numBeds)
     {
         System.out.println(hotelLocation);
@@ -209,4 +203,5 @@
     }
 
+<<<<<<< HEAD
     @GetMapping(path = "/hotel/{id}/reservations/active")
     public List<HotelReservationDto> getActiveReservationsForHotel(@PathVariable Long id)
@@ -238,3 +233,5 @@
         return hotelManager.getRoomImages(id);
     }
+=======
+>>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
 }
Index: src/main/java/com/tourMate/controllers/TransportController.java
===================================================================
--- src/main/java/com/tourMate/controllers/TransportController.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/controllers/TransportController.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -20,8 +20,7 @@
 
     // TRANSPORT CRUD //
-    @PostMapping(path = "/transport/add/{userId}")
-    public void add(@RequestBody Transport transport,
-                    @PathVariable Long userId) {
-        transportManager.createTransport(transport.getTransportName(), transport.getCarBrand(), transport.getCarType(), transport.getCarManufacturedYear(), transport.getNoPassengers(), transport.getNoBags(), transport.getEMBG(), userId, transport.getCarPlate());
+    @PostMapping(path = "/transport/add")
+    public void add(@RequestBody Transport transport) {
+        transportManager.createTransport(transport.getTransportName(), transport.getCarBrand(), transport.getCarType(), transport.getCarManufacturedYear(), transport.getNoPassengers(), transport.getNoBags(), transport.getEMBG(), new User(), transport.getCarPlate());
 
     }
@@ -46,4 +45,5 @@
     public TransportDto getTransport(@PathVariable(name = "id") long transportId)
     {
+        System.out.println("TUKA SUUUUUM");
         return transportManager.findTransportById(transportId);
     }
@@ -84,4 +84,6 @@
     @PostMapping(path = "/transport/available/add")
     public void add(@RequestBody TransportAvailible transportAvailable, @RequestParam(name = "transportId") long transportId) {
+        System.out.println("OREEEEEL");
+        System.out.println("DVA ORLA");
         Transport t = transportManager.getTransportById(transportId);
         List<TransportRoute> routes = transportAvailable.getRoutes().stream().toList();
@@ -125,9 +127,7 @@
 
     @GetMapping(path = "/transport/search")
-    public List<TransportListingDto> searchAvailableTransport(@RequestParam(name = "from") String from,
-                                                              @RequestParam(name = "to") String to,
-                                                              @RequestParam(name = "date") @DateTimeFormat(pattern = "yyyy-MM-dd") Date date,
-                                                              @RequestParam(name = "numPassengers") int numPassengers){
-        return transportManager.getTransportsAvailableByFilters(from, to, date, numPassengers);
+    public List<TransportListingDto> searchAvailableTransport(@RequestParam(name = "from") String from, @RequestParam(name = "to") String to,
+                                                              @RequestParam(name = "date") @DateTimeFormat(pattern = "yyyy-MM-dd") Date date){
+        return transportManager.getTransportsAvailableByFilters(from, to, date);
     }
 
Index: src/main/java/com/tourMate/controllers/UsersController.java
===================================================================
--- src/main/java/com/tourMate/controllers/UsersController.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/controllers/UsersController.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -11,4 +11,5 @@
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 
@@ -38,32 +39,4 @@
     {
         return businessManager.getUnapprovedBusinessesOfUser(userId);
-    }
-
-    @GetMapping(path = "/business/unapproved")
-    public List<Business> getAllUnapprovedBusinesses()
-    {
-        return businessManager.getUnapprovedBusinesses();
-    }
-
-    @GetMapping(path = "/users/unapproved")
-    public List<User> getAllUnapprovedUsers()
-    {
-        return usersManager.getUnapprovedUsers();
-    }
-
-    @GetMapping(path = "/users/approve/{userId}")
-    public ResponseEntity<?> approveUserProfile(@PathVariable Long userId)
-    {
-        usersManager.approveUserProfile(userId);
-        return new ResponseEntity<>(HttpStatus.OK);
-
-
-    }
-
-    @GetMapping(path = "/business/approve/{businessId}")
-    public ResponseEntity<?> approveBusiness(@PathVariable Long businessId)
-    {
-        businessManager.approveBusiness(businessId);
-        return new ResponseEntity<>(HttpStatus.OK);
     }
 
Index: src/main/java/com/tourMate/dao/BusinessDao.java
===================================================================
--- src/main/java/com/tourMate/dao/BusinessDao.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/dao/BusinessDao.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -11,15 +11,12 @@
     @Transactional
     void createBusiness(Business business, long userId);
-    List<Business> getUnapprovedBusinessesOfUser(long userId);
-    void deleteBusiness(long businessId);
-    List<Business> getCreatedBusinesses();
-    Business findBusinessById (long businessId);
+    public List<Business> getUnapprovedBusinessesOfUser(long userId);
+    public void deleteBusiness(long businessId);
+    public List<Business> getCreatedBusinesses();
+    public Business findBusinessById (long businessId);
 
     @Transactional
     void editBusiness(long businessId, String name, String phone, String address, String edbs, User user, boolean approved);
-    boolean hasBusiness(long userId);
+    public boolean hasBusiness(long userId);
 
-    List<Business> getUnapprovedBusinesses();
-
-    void approveBusiness(Business business);
 }
Index: src/main/java/com/tourMate/dao/HotelDao.java
===================================================================
--- src/main/java/com/tourMate/dao/HotelDao.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/dao/HotelDao.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -22,5 +22,5 @@
     public List<HotelRoomImages> getRoomImages(HotelRoom hotelRoom);
 
-    public void createRoom(Hotels hotel, String hotelRoomDescription, String hotelRoomName, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price, int numOfBeds);
+    public void createRoom(Hotels hotel, String hotelRoomDescription, String hotelRoomName, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price);
     public void editRoom(long hotelRoomId, Hotels hotel, String hotelRoomDescription, String HotelRoomName, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price);
     public void deleteRoom(long hotelRoomId);
Index: src/main/java/com/tourMate/dao/TransportDao.java
===================================================================
--- src/main/java/com/tourMate/dao/TransportDao.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/dao/TransportDao.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -12,5 +12,5 @@
 public interface TransportDao {
 
-    public void createTransport(String transportName, String carBrand, String carType, int carManufacturedYear, int noPassengers, int noBags, long EMBG, Long userId, String carPlate);
+    public void createTransport(String transportName, String carBrand, String carType, int carManufacturedYear, int noPassengers, int noBags, long EMBG, User owner, String carPlate);
 
     public void deleteTransport(long transportId);
@@ -47,5 +47,5 @@
     public List<TransportAvailible> getTransportsAvailable();
 
-    public List<TransportRoute> getTransportsAvailableByFilters (String from, String to, Date date, int numPassengers);
+    public List<TransportRoute> getTransportsAvailableByFilters (String from,String to,Date date);
 
     public void createTransportRoute(TransportAvailible parentRoute, String from, String to, double price, Date departure, Date arrival, int freeSpace, int order);
Index: src/main/java/com/tourMate/dao/UsersDao.java
===================================================================
--- src/main/java/com/tourMate/dao/UsersDao.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/dao/UsersDao.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -23,7 +23,3 @@
 
     UserDetails findUserByUsername(String username);
-
-    List<User> getUnapprovedUsers();
-
-    void approveUserProfile(User u);
 }
Index: src/main/java/com/tourMate/dao/impl/BusinessDaoImpl.java
===================================================================
--- src/main/java/com/tourMate/dao/impl/BusinessDaoImpl.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/dao/impl/BusinessDaoImpl.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -46,16 +46,4 @@
     }
 
-    @Override
-    public List<Business> getUnapprovedBusinesses() {
-        return em.createQuery("select b from Business b where not b.approved").getResultList();
-    }
-
-    @Override
-    @Transactional
-    public void approveBusiness(Business b) {
-        b.setApproved(true);
-        em.persist(b);
-    }
-
 
     @Override
Index: src/main/java/com/tourMate/dao/impl/HotelDaoImpl.java
===================================================================
--- src/main/java/com/tourMate/dao/impl/HotelDaoImpl.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/dao/impl/HotelDaoImpl.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -28,4 +28,5 @@
     public List<Hotels> getHotels() {
         List<Hotels> hoteli = em.createQuery("select h from Hotels h order by h.hotelId").getResultList();
+        System.out.println("OREEEEEEL");
         return hoteli;
         //return em.createQuery("select h from Hotels h order by h.hotelId").getResultList();
@@ -122,6 +123,6 @@
     @Transactional
     @Override
-    public void createRoom(Hotels hotel, String hotelRoomDescription, String hotelRoomName, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price, int numOfBeds) {
-        HotelRoom hotelRoom = new HotelRoom(hotel, hotelRoomDescription, hotelRoomName, kitchenAvailable, airConditioning, balcony, price, numOfBeds);
+    public void createRoom(Hotels hotel, String hotelRoomDescription, String hotelRoomName, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price) {
+        HotelRoom hotelRoom = new HotelRoom(hotel, hotelRoomDescription, hotelRoomName, kitchenAvailable, airConditioning, balcony, price);
         em.persist(hotelRoom);
     }
@@ -191,5 +192,9 @@
     public List<HotelRoomAvailable> getRoomsAvailibilityByDateAndLocation(String hotelLocation, Date dateFrom, Date dateTo, int numberOfBeds) {
         return em.createQuery("select hr from HotelRoomAvailable hr where hr.dateFrom <= :dateFrom and hr.dateTo >= :dateTo " +
+<<<<<<< HEAD
                         "and hr.hotelRoom.hotel.hotelLocation LIKE :hotelLocation and hr.hotelRoom.numOfBeds >= :numBeds")
+=======
+                "and hr.hotelRoom.hotel.hotelLocation LIKE :hotelLocation and hr.numberOfBeds >= :numBeds")
+>>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
                 .setParameter("hotelLocation", hotelLocation)
                 .setParameter("dateFrom", dateFrom)
@@ -240,5 +245,5 @@
     public List<HotelRoomReservations> findReservationByHotel(Hotels hotel) {
         List<HotelRoom> hotelRooms = getRoomsOfHotel(hotel.getHotelId());
-        return em.createQuery("select hr from HotelRoomReservations hr where hr.hotelRoom.hotel = :hotel").setParameter("hotel", hotel).getResultList();
+        return em.createQuery("select hr from HotelRoomReservations hr where hr.hotelRoom in :hotelRooms").setParameter("hotelRooms", hotelRooms).getResultList();
     }
 
Index: src/main/java/com/tourMate/dao/impl/TransportDaoImpl.java
===================================================================
--- src/main/java/com/tourMate/dao/impl/TransportDaoImpl.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/dao/impl/TransportDaoImpl.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -22,6 +22,6 @@
     @Override
     @Transactional
-    public void createTransport(String transportName, String carBrand, String carType, int carManufacturedYear, int noPassengers, int noBags, long EMBG, Long userId, String carPlate) {
-        User u = em.find(User.class, userId);
+    public void createTransport(String transportName, String carBrand, String carType, int carManufacturedYear, int noPassengers, int noBags, long EMBG, User owner, String carPlate) {
+        User u = em.find(User.class, 1);
         Transport t=new Transport(transportName,carBrand,carType,carManufacturedYear,noPassengers,noBags,EMBG,u,carPlate);
         em.persist(t);
@@ -62,13 +62,6 @@
                         y.getFreeSpace(),
                         y.getTime(),
-                        y.getRoutes(),
-                        y.getRoutes().stream()
-                                .mapToDouble(TransportRoute::getPrice)
-                                .max().orElse(0)
-                )).toList(),
-                x.getAvailableRoutes().stream()
-                        .flatMapToDouble(y -> y.getRoutes()
-                                .stream()
-                                .mapToDouble(TransportRoute::getPrice)).max().orElseGet(() -> 0)
+                        y.getRoutes()
+                )).toList()
         )).toList();
     }
@@ -85,8 +78,5 @@
                 x.getFreeSpace(),
                 x.getTime(),
-                x.getRoutes(),
-                x.getRoutes().stream()
-                        .mapToDouble(TransportRoute::getPrice)
-                        .max().orElse(0)
+                x.getRoutes()
         )).toList();
     }
@@ -113,13 +103,6 @@
                         y.getFreeSpace(),
                         y.getTime(),
-                        y.getRoutes(),
-                        y.getRoutes().stream()
-                                .mapToDouble(TransportRoute::getPrice)
-                                .max().orElse(0)
-                )).toList(),
-                x.getAvailableRoutes().stream()
-                        .flatMapToDouble(y -> y.getRoutes()
-                                                        .stream()
-                                                        .mapToDouble(TransportRoute::getPrice)).max().orElseGet(() -> 0));
+                        y.getRoutes()
+                )).toList());
     }
 
@@ -167,11 +150,8 @@
 
     @Override
-    public List<TransportRoute> getTransportsAvailableByFilters(String fromL, String toL, Date date, int numPassengers) {
+    public List<TransportRoute> getTransportsAvailableByFilters(String fromL, String toL, Date date) {
         System.out.println(fromL + " " + toL);
-        return em.createQuery("select h from TransportRoute h where h.from = :froml and h.to = :tol and h.freeSpace >= :nump")
-                .setParameter("froml", fromL)
-                .setParameter("tol", toL)
-                .setParameter("nump", numPassengers)
-                .getResultList();
+        return em.createQuery("select h from TransportRoute h where h.from = :froml and h.to = :tol").setParameter("froml", fromL).
+                setParameter("tol", toL).getResultList();
     }
 
Index: src/main/java/com/tourMate/dao/impl/UsersDaoImpl.java
===================================================================
--- src/main/java/com/tourMate/dao/impl/UsersDaoImpl.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/dao/impl/UsersDaoImpl.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -74,15 +74,4 @@
     }
 
-    @Override
-    public List<User> getUnapprovedUsers() {
-        return em.createQuery("select u from User u where not u.enabled").getResultList();
-    }
-
-    @Override
-    @Transactional
-    public void approveUserProfile(User u) {
-        u.setEnabled(true);
-        em.persist(u);
-    }
 
 
Index: src/main/java/com/tourMate/dto/RouteListingDto.java
===================================================================
--- src/main/java/com/tourMate/dto/RouteListingDto.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/dto/RouteListingDto.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -18,7 +18,6 @@
     private Date time;
     private Collection<String> routes;
-    private Double maxPrice;
 
-    public RouteListingDto(long transportAvailibleId, String from, String to, Date date, int freeSpace, Date time, Collection<TransportRoute> routes, Double maxPrice) {
+    public RouteListingDto(long transportAvailibleId, String from, String to, Date date, int freeSpace, Date time, Collection<TransportRoute> routes) {
         this.transportAvailibleId = transportAvailibleId;
         this.from = from;
@@ -28,5 +27,4 @@
         this.time = time;
         this.routes = routes.stream().map(x -> x.getFrom()).distinct().skip(1).toList();
-        this.maxPrice = maxPrice;
     }
 
@@ -86,7 +84,3 @@
         this.routes = routes;
     }
-
-    public Double getMaxPrice() {
-        return maxPrice;
-    }
 }
Index: src/main/java/com/tourMate/dto/TransportDto.java
===================================================================
--- src/main/java/com/tourMate/dto/TransportDto.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/dto/TransportDto.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -16,8 +16,7 @@
     private User owner;
     private String carPlate;
-    private Double maxPrice;
     private Collection<RouteListingDto> availableRoutes;
 
-    public TransportDto(long transportID, String transportName, String carBrand, String carType, int carManufacturedYear, int noPassengers, int noBags, long EMBG, User owner, String carPlate, Collection<RouteListingDto> availableRoutes, Double maxPrice) {
+    public TransportDto(long transportID, String transportName, String carBrand, String carType, int carManufacturedYear, int noPassengers, int noBags, long EMBG, User owner, String carPlate, Collection<RouteListingDto> availableRoutes) {
         this.transportID = transportID;
         this.transportName = transportName;
@@ -31,5 +30,4 @@
         this.carPlate = carPlate;
         this.availableRoutes = availableRoutes;
-        this.maxPrice = maxPrice;
     }
 
Index: src/main/java/com/tourMate/entities/Business.java
===================================================================
--- src/main/java/com/tourMate/entities/Business.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/entities/Business.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -88,5 +88,5 @@
     }
 
-    @OneToOne(fetch = FetchType.EAGER)
+    @OneToOne(fetch = FetchType.LAZY)
     @JoinColumn(name = "owner_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_biznis_kon_korisnik"))
     public User getUser() {
@@ -107,4 +107,3 @@
         this.approved = approved;
     }
-
 }
Index: src/main/java/com/tourMate/entities/HotelRoom.java
===================================================================
--- src/main/java/com/tourMate/entities/HotelRoom.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/entities/HotelRoom.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -1,2 +1,3 @@
+<<<<<<< HEAD
 package com.tourMate.entities;
 
@@ -159,2 +160,140 @@
     }
 }
+=======
+package com.tourMate.entities;
+
+import jakarta.persistence.*;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import javax.validation.constraints.NotNull;
+
+@Entity
+@Table(name="hotel_rooms", schema = "public")
+public class HotelRoom {
+    private long hotelRoomId;
+    @JsonIgnore
+    private Hotels hotel;
+    private String hotelRoomDescription;
+    @Enumerated(EnumType.STRING)
+    private String hotelRoomName;
+    private double price;
+    private Boolean kitchenAvailable;
+    private Boolean airConditioning;
+    private Boolean balcony;
+
+    public HotelRoom(long hotelRoomId, Hotels hotel, String hotelRoomDescription, String hotelRoomName, double price, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony) {
+        this.hotelRoomId = hotelRoomId;
+        this.hotel = hotel;
+        this.hotelRoomDescription = hotelRoomDescription;
+        this.hotelRoomName = hotelRoomName;
+        this.price = price;
+        this.kitchenAvailable = kitchenAvailable;
+        this.airConditioning = airConditioning;
+        this.balcony = balcony;
+    }
+
+    public HotelRoom(Hotels hotel, String hotelRoomDescription, String type,
+                     Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price) {
+        this.hotel = hotel;
+        this.hotelRoomDescription = hotelRoomDescription;
+        this.hotelRoomName = type;
+        this.kitchenAvailable = kitchenAvailable;
+        this.airConditioning = airConditioning;
+        this.balcony = balcony;
+        this.price = price;
+    }
+
+    public HotelRoom(String hotelRoomDescription, String type,
+                     Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price) {
+        this.hotel = hotel;
+        this.hotelRoomDescription = hotelRoomDescription;
+        this.hotelRoomName = type;
+        this.kitchenAvailable = kitchenAvailable;
+        this.airConditioning = airConditioning;
+        this.balcony = balcony;
+        this.price = price;
+    }
+
+    public HotelRoom() {
+
+    }
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "room_id",unique = true,nullable = false)
+    public long getHotelRoomId() {
+        return hotelRoomId;
+    }
+
+    public void setHotelRoomId(long hotelRoomId) {
+        this.hotelRoomId = hotelRoomId;
+    }
+
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "hotel_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_room_kon_hotel"))
+    public Hotels getHotel() {
+        return hotel;
+    }
+
+    public void setHotel(Hotels hotelId) {
+        this.hotel = hotelId;
+    }
+
+    @Column(name="hotel_room_description",unique = false,nullable = false)
+    @NotNull
+    public String getHotelRoomDescription() {
+        return hotelRoomDescription;
+    }
+
+    public void setHotelRoomDescription(String hotelRoomDescription) {
+        this.hotelRoomDescription = hotelRoomDescription;
+    }
+
+    @Column(name="hotel_room_price",unique = false,nullable = false)
+    @NotNull
+    public double getPrice() {
+        return price;
+    }
+
+    @Column(name="hotel_room_name",unique = false,nullable = false)
+    @NotNull
+    public String getHotelRoomName() {
+        return hotelRoomName;
+    }
+
+
+    public void setHotelRoomName(String name) {
+        this.hotelRoomName = name;
+    }
+    public void setPrice(double type) {
+        this.price = type;
+    }
+    @Column(name="hotel_room_kitchen",unique = false,nullable = false)
+    @NotNull
+    public Boolean getKitchenAvailable() {
+        return kitchenAvailable;
+    }
+
+    public void setKitchenAvailable(Boolean kitchenAvailable) {
+        this.kitchenAvailable = kitchenAvailable;
+    }
+    @Column(name="hotel_room_ac",unique = false,nullable = false)
+    @NotNull
+    public Boolean getAirConditioning() {
+        return airConditioning;
+    }
+
+    public void setAirConditioning(Boolean airConditioning) {
+        this.airConditioning = airConditioning;
+    }
+    @Column(name="hotel_room_balcony",unique = false,nullable = false)
+    @NotNull
+    public Boolean getBalcony() {
+        return balcony;
+    }
+
+    public void setBalcony(Boolean balcony) {
+        this.balcony = balcony;
+    }
+}
+>>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
Index: src/main/java/com/tourMate/entities/HotelRoomReservations.java
===================================================================
--- src/main/java/com/tourMate/entities/HotelRoomReservations.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/entities/HotelRoomReservations.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -43,5 +43,5 @@
     }
 
-    @ManyToOne(fetch = FetchType.EAGER)
+    @ManyToOne(fetch = FetchType.LAZY)
     @JoinColumn(name = "room_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_roomres_kon_room"))
     public HotelRoom getHotelRoom() {
@@ -59,5 +59,5 @@
     }
 
-    @OneToOne(fetch = FetchType.EAGER)
+    @OneToOne(fetch = FetchType.LAZY)
     @JoinColumn(name = "user_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_roomres_kon_user"))
     public User getUser() {
Index: src/main/java/com/tourMate/entities/Reviews.java
===================================================================
--- src/main/java/com/tourMate/entities/Reviews.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/entities/Reviews.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -75,5 +75,5 @@
 
     @ManyToOne(fetch = FetchType.LAZY)
-    @JoinColumn(name = "hotel_id", unique = false, nullable = true, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_hotel"))
+    @JoinColumn(name = "hotel_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_hotel"))
     public Hotels getHotel () {
         return hotel;
@@ -85,5 +85,5 @@
 
     @ManyToOne(fetch = FetchType.LAZY)
-    @JoinColumn(name = "restaurant_id", unique = false, nullable = true, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_restorani"))
+    @JoinColumn(name = "restaurant_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_restorani"))
     public Restaurant getRestaurant () {
         return restaurant;
@@ -95,5 +95,5 @@
 
     @ManyToOne(fetch = FetchType.LAZY)
-    @JoinColumn(name = "transport_id", unique = false, nullable = true, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_transport"))
+    @JoinColumn(name = "transport_id", unique = false, nullable = false, foreignKey = @ForeignKey(name = "fk_ref_od_review_kon_transport"))
     public Transport getTransport () {
         return transport;
Index: src/main/java/com/tourMate/entities/User.java
===================================================================
--- src/main/java/com/tourMate/entities/User.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/entities/User.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -52,5 +52,5 @@
     private Role role;
     @Column(name = "locked", unique = false, nullable = false)
-    boolean locked = false;
+    boolean locked;
 
     @Column(name = "enabled", unique = false, nullable = false)
@@ -162,5 +162,5 @@
     @Override
     public boolean isAccountNonLocked() {
-        return locked;
+        return true;
     }
 
Index: src/main/java/com/tourMate/services/BusinessManager.java
===================================================================
--- src/main/java/com/tourMate/services/BusinessManager.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/services/BusinessManager.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -9,6 +9,5 @@
     public List<Business> getUnapprovedBusinessesOfUser(long userId);
     public void deleteBusiness(long businessId);
-    public List<Business> getUnapprovedBusinesses();
-    public void approveBusiness(Long businessId);
+    public List<Business> getCreatedBusinesses();
     public Business findBusinessById (long businessId);
     public void editBusiness(long businessId, String name, String phone, String address, String edbs, User user, boolean approved);
Index: src/main/java/com/tourMate/services/HotelManager.java
===================================================================
--- src/main/java/com/tourMate/services/HotelManager.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/services/HotelManager.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -2,6 +2,4 @@
 
 import com.tourMate.dto.HotelDto;
-import com.tourMate.dto.HotelReservationDto;
-import com.tourMate.dto.HotelReservationUserDto;
 import com.tourMate.entities.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -26,8 +24,14 @@
     public List<HotelRoom> getRoomsOfHotel (long hotelId);
     public HotelRoom findRoomById (long hotelRoomId);
+<<<<<<< HEAD
     public List<HotelRoomImages> getRoomImages(Long hotelRoom);
     public void createRoom(Hotels hotel, String hotelRoomDescription, String hotelRoomName, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price, int numOfBeds);
+=======
+    public List<HotelRoomImages> getRoomImages(HotelRoom hotelRoom);
+    public void createRoom(Hotels hotel, String hotelRoomDescription, String hotelRoomName, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price);
+>>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
     public void editRoom(long hotelRoomId, Hotels hotel, String hotelRoomDescription, String hotelRoomName, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price);
     public void deleteRoom(long hotelRoomId);
+    public List<HotelRoomAvailable> getRoomsAvailable(Long id);
     public void createRoomAvailible(HotelRoom hotelRoom, Date dateFrom, Date dateTo, int numberOfBeds);
     public void editRoomAvailible(long hotelRoomAvailableId, HotelRoom hotelRoom, Date dateFrom, Date dateTo, int numberOfBeds);
@@ -36,5 +40,4 @@
     public HotelRoomAvailable findAvailibleRoomById(long hotelRoomAvailableId);
     public List<HotelRoomAvailable> getRoomsAvailibility();
-    public List<HotelRoomAvailable> getRoomsAvailableById(Long id);
     public List<HotelRoomAvailable> getRoomsAvailibilityByHotel(Hotels hotel);
     public List<HotelDto> getRoomsAvailibilityByDateAndLocation(String hotelLocation, Date dateFrom, Date dateTo, int numberOfBeds);
@@ -42,6 +45,4 @@
     public void editReservation(long hotelRoomReservedId, User user, HotelRoom hotelRoom, Date dateFrom, Date dateTo, Integer numberOfBeds);
     public void deleteReservation(long hotelRoomReservedId);
-    public List<HotelReservationDto> findVaidReseravtionsByHotel(Long hotelId);
-    public List<HotelReservationUserDto> findValidHotelReservationsByUser(Long userId);
     public HotelRoomReservations findReservationById(long hotelRoomReservedId);
     public List<HotelRoomReservations> findReservationByUser(User user);
Index: src/main/java/com/tourMate/services/TransportManager.java
===================================================================
--- src/main/java/com/tourMate/services/TransportManager.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/services/TransportManager.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -13,5 +13,5 @@
 public interface TransportManager {
 
-    public void createTransport(String transportName, String carBrand, String carType, int carManufacturedYear, int noPassengers, int noBags, long EMBG, Long userId, String carPlate);
+    public void createTransport(String transportName, String carBrand, String carType, int carManufacturedYear, int noPassengers, int noBags, long EMBG, User owner, String carPlate);
 
     public void deleteTransport(long transportId);
@@ -35,7 +35,11 @@
     public Transport getTransportById(long transportId);
 
+<<<<<<< HEAD
     List<Reviews> getReviewsForTransport(long transportId);
 
     public List<TransportListingDto> getTransportsAvailableByFilters (String from, String to, Date date, int numPassengers);
+=======
+    public List<TransportListingDto> getTransportsAvailableByFilters (String from, String to, Date date);
+>>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
 
     public List<TransportReservation> getTransportsReservationsByUserID(long userID);
Index: src/main/java/com/tourMate/services/UsersManager.java
===================================================================
--- src/main/java/com/tourMate/services/UsersManager.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/services/UsersManager.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -16,5 +16,3 @@
 
     public void editUser(long userID, String name, String surname, String email, Date birthDate, String address, String contact);
-    public List<User> getUnapprovedUsers();
-    public void approveUserProfile(long userId);
 }
Index: src/main/java/com/tourMate/services/impl/BusinessManagerImpl.java
===================================================================
--- src/main/java/com/tourMate/services/impl/BusinessManagerImpl.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/services/impl/BusinessManagerImpl.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -34,17 +34,11 @@
 
     @Override
-    public List<Business> getUnapprovedBusinesses() {
-        return businessDao.getUnapprovedBusinesses();
+    public boolean hasBusiness(long userId){
+        return businessDao.hasBusiness(userId);
     }
 
     @Override
-    public void approveBusiness(Long businessId) {
-        Business b = findBusinessById(businessId);
-        businessDao.approveBusiness(b);
-    }
-
-    @Override
-    public boolean hasBusiness(long userId){
-        return businessDao.hasBusiness(userId);
+    public List<Business> getCreatedBusinesses() {
+        return businessDao.getCreatedBusinesses();
     }
 
Index: src/main/java/com/tourMate/services/impl/HotelManagerImpl.java
===================================================================
--- src/main/java/com/tourMate/services/impl/HotelManagerImpl.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/services/impl/HotelManagerImpl.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -4,6 +4,4 @@
 import com.tourMate.dao.UsersDao;
 import com.tourMate.dto.HotelDto;
-import com.tourMate.dto.HotelReservationDto;
-import com.tourMate.dto.HotelReservationUserDto;
 import com.tourMate.entities.*;
 import com.tourMate.services.HotelManager;
@@ -13,4 +11,5 @@
 
 import java.time.Duration;
+import java.util.Collection;
 import java.util.Date;
 import java.util.List;
@@ -109,6 +108,6 @@
 
     @Override
-    public void createRoom(Hotels hotel, String hotelRoomDescription, String hotelRoomName, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price, int numOfBeds) {
-        hotelDao.createRoom(hotel, hotelRoomDescription, hotelRoomName, kitchenAvailable, airConditioning, balcony, price, numOfBeds);
+    public void createRoom(Hotels hotel, String hotelRoomDescription, String hotelRoomName, Boolean kitchenAvailable, Boolean airConditioning, Boolean balcony, double price) {
+        hotelDao.createRoom(hotel, hotelRoomDescription, hotelRoomName, kitchenAvailable, airConditioning, balcony, price);
     }
 
@@ -123,7 +122,6 @@
     }
 
-
-    @Override
-    public List<HotelRoomAvailable> getRoomsAvailableById(Long id) {
+    @Override
+    public List<HotelRoomAvailable> getRoomsAvailable(Long id) {
         return hotelDao.getRoomsAvailable(id);
     }
@@ -212,4 +210,5 @@
 
     @Override
+<<<<<<< HEAD
     public List<HotelReservationDto> findVaidReseravtionsByHotel(Long hotelId) {
         Hotels hotel = findHotelByID(hotelId);
@@ -245,4 +244,6 @@
 
     @Override
+=======
+>>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
     public HotelRoomReservations findReservationById(long hotelRoomReservedId) {
         return hotelDao.findReservationById(hotelRoomReservedId);
Index: src/main/java/com/tourMate/services/impl/TransportManagerImpl.java
===================================================================
--- src/main/java/com/tourMate/services/impl/TransportManagerImpl.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/services/impl/TransportManagerImpl.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -25,6 +25,6 @@
 
     @Override
-    public void createTransport(String transportName, String carBrand, String carType, int carManufacturedYear, int noPassengers, int noBags, long EMBG, Long userId, String carPlate) {
-        transportDao.createTransport(transportName, carBrand, carType, carManufacturedYear, noPassengers, noBags, EMBG, userId, carPlate);
+    public void createTransport(String transportName, String carBrand, String carType, int carManufacturedYear, int noPassengers, int noBags, long EMBG, User owner, String carPlate) {
+        transportDao.createTransport(transportName, carBrand, carType, carManufacturedYear, noPassengers, noBags, EMBG, owner, carPlate);
     }
 
@@ -93,4 +93,5 @@
 
     @Override
+<<<<<<< HEAD
     public List<Reviews> getReviewsForTransport(long transportId) {
         Transport transport = getTransportById(transportId);
@@ -101,4 +102,8 @@
     public List<TransportListingDto> getTransportsAvailableByFilters(String from, String to, Date date, int numPassengers) {
         List<TransportRoute> transportAvailable = transportDao.getTransportsAvailableByFilters(from, to, date, numPassengers);
+=======
+    public List<TransportListingDto> getTransportsAvailableByFilters(String from, String to, Date date) {
+        List<TransportRoute> transportAvailable = transportDao.getTransportsAvailableByFilters(from, to, date);
+>>>>>>> parent of ac19a0c (authContext impl, admin panel impl, search bar fixes, reservations listings impl)
         Map<TransportAvailible, List<TransportRoute>> transportsByTransporter = transportAvailable.stream().collect(Collectors.groupingBy(x -> x.getParentRoute()));
         List<TransportListingDto> transportList = transportsByTransporter.keySet().stream().toList().stream()
Index: src/main/java/com/tourMate/services/impl/UsersManagerImpl.java
===================================================================
--- src/main/java/com/tourMate/services/impl/UsersManagerImpl.java	(revision e6c2521bc7455763be50cf2e37427887b6efb4b9)
+++ src/main/java/com/tourMate/services/impl/UsersManagerImpl.java	(revision 5528b99794e1d3a36baa8eb2f1829125b75f0174)
@@ -45,15 +45,4 @@
 
     @Override
-    public List<User> getUnapprovedUsers() {
-        return usersDao.getUnapprovedUsers();
-    }
-
-    @Override
-    public void approveUserProfile(long userId) {
-        User u = findUserByID(userId);
-        usersDao.approveUserProfile(u);
-    }
-
-    @Override
     public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
         return usersDao.findUserByUsername(username);
