Index: src/main/java/com/example/rezevirajmasa/demo/repository/RestaurantRepository.java
===================================================================
--- src/main/java/com/example/rezevirajmasa/demo/repository/RestaurantRepository.java	(revision d24f17cb212e43f94a77a44d655ba10b4b8143d2)
+++ src/main/java/com/example/rezevirajmasa/demo/repository/RestaurantRepository.java	(revision 65b6638865a1485e9cc722615973d9fb675b9d84)
@@ -8,3 +8,5 @@
 
 public interface RestaurantRepository extends JpaRepository<Restaurant, Long> {
+
+
 }
Index: src/main/java/com/example/rezevirajmasa/demo/service/RestaurantService.java
===================================================================
--- src/main/java/com/example/rezevirajmasa/demo/service/RestaurantService.java	(revision d24f17cb212e43f94a77a44d655ba10b4b8143d2)
+++ src/main/java/com/example/rezevirajmasa/demo/service/RestaurantService.java	(revision 65b6638865a1485e9cc722615973d9fb675b9d84)
@@ -2,7 +2,9 @@
 
 import com.example.rezevirajmasa.demo.model.Restaurant;
+import com.example.rezevirajmasa.demo.model.TableEntity;
 
 import java.math.BigDecimal;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.List;
 
@@ -18,3 +20,4 @@
     List<Restaurant> listRestaurantBy(String search);
     List<Restaurant> getRestaurantsWithAvailableTimeSlotsForToday();
+    public List<Restaurant> findRestaurantsByDateTimeAndPartySize(LocalDateTime dateTime, int partySize, String search);
 }
Index: src/main/java/com/example/rezevirajmasa/demo/service/impl/RestaurantServiceImpl.java
===================================================================
--- src/main/java/com/example/rezevirajmasa/demo/service/impl/RestaurantServiceImpl.java	(revision d24f17cb212e43f94a77a44d655ba10b4b8143d2)
+++ src/main/java/com/example/rezevirajmasa/demo/service/impl/RestaurantServiceImpl.java	(revision 65b6638865a1485e9cc722615973d9fb675b9d84)
@@ -143,3 +143,25 @@
         return restaurantsWithAvailableTimeSlots;
     }
+
+    @Override
+    public List<Restaurant> findRestaurantsByDateTimeAndPartySize(LocalDateTime dateTime, int partySize, String search) {
+        List<Restaurant> allRestaurants = restaurantRepository.findAll();
+        return allRestaurants.stream()
+                .filter(restaurant -> hasAvailableTable(restaurant, dateTime, partySize))
+                .filter(restaurant -> isMatch(restaurant, search))
+                .collect(Collectors.toList());
+    }
+
+    private boolean hasAvailableTable(Restaurant restaurant, LocalDateTime dateTime, int partySize) {
+        for (TableEntity table : restaurant.getTablesList()) {
+            if (table.isAvailable(dateTime) && table.getCapacity() >= partySize) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private boolean isMatch(Restaurant restaurant, String name) {
+        return name == null || name.isEmpty() || restaurant.getName().contains(name);
+    }
 }
Index: src/main/java/com/example/rezevirajmasa/demo/web/rest/testController.java
===================================================================
--- src/main/java/com/example/rezevirajmasa/demo/web/rest/testController.java	(revision d24f17cb212e43f94a77a44d655ba10b4b8143d2)
+++ src/main/java/com/example/rezevirajmasa/demo/web/rest/testController.java	(revision 65b6638865a1485e9cc722615973d9fb675b9d84)
@@ -6,5 +6,7 @@
 import com.example.rezevirajmasa.demo.service.RestaurantService;
 import com.example.rezevirajmasa.demo.service.TableService;
+import jdk.jfr.consumer.RecordingStream;
 import org.apache.coyote.Response;
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -12,5 +14,7 @@
 
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.List;
+import java.util.Map;
 
 @CrossOrigin(origins = "http://localhost:3000/")
@@ -34,4 +38,6 @@
     }
 
+    //restaurants
+
     @RequestMapping("/api/restaurants")
     public ResponseEntity<List<Restaurant>> getAllRestaurants() {
@@ -42,4 +48,23 @@
     public ResponseEntity<Restaurant> getRestaurantById(@PathVariable Long restaurantId) {
         return new ResponseEntity<Restaurant>(restaurantService.findById(restaurantId), HttpStatus.OK);
+    }
+
+    @PostMapping("/api/search")
+    public ResponseEntity<List<Restaurant>> searchRestaurants(@RequestBody Map<String, Object> requestData) {
+        String dateTime = (String) requestData.get("dateTime");
+        Integer partySize = (Integer) requestData.get("partySize");
+        String search = (String) requestData.get("search");
+
+        // Now proceed with parsing dateTime and performing the search based on the received parameters
+
+        LocalDateTime parsedDateTime = null;
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
+        if (dateTime != null) {
+            parsedDateTime = LocalDateTime.parse(dateTime, formatter);
+        }
+
+        List<Restaurant> filteredRestaurants = restaurantService.findRestaurantsByDateTimeAndPartySize(parsedDateTime, partySize, search);
+
+        return new ResponseEntity<List<Restaurant>>(filteredRestaurants, HttpStatus.OK);
     }
 
