Index: src/main/java/edu/gjoko/schedlr/repositories/AppointmentRepository.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/repositories/AppointmentRepository.java	(revision 950fa0d7a6b439770e79c885947e9b7d6058b424)
+++ src/main/java/edu/gjoko/schedlr/repositories/AppointmentRepository.java	(revision 77205be723c8b2ffd1ee5618a05e1d12b1cee44a)
@@ -2,5 +2,4 @@
 
 import edu.gjoko.schedlr.entity.Appointment;
-import edu.gjoko.schedlr.entity.Business;
 import edu.gjoko.schedlr.entity.Stakeholder;
 import org.springframework.data.jpa.repository.JpaRepository;
@@ -10,21 +9,46 @@
 import java.time.LocalDateTime;
 import java.util.List;
+import java.util.Optional;
 
 @Repository
 public interface AppointmentRepository extends JpaRepository<Appointment, Long> {
 
-    List<Appointment> getAppointmentsByBusiness(Business business);
+    @Query(value = "select ap from Appointment as ap " +
+            "where ap.service.business.id = :businessId " +
+            "and ap.appointmentStatus = 'NEW'")
+    List<Appointment> getActiveAppointmentsByBusiness(Long businessId);
 
-    List<Appointment> getAppointmentsByCustomer(Stakeholder customer);
+    @Query( value = "select ap from Appointment as ap " +
+            "where ap.service.business.id = :businessId " +
+            "and (" +
+            "(ap.startTime between :startDate and :endDate) " +
+            "or (ap.endTime between :startDate and :endDate) " +
+            "or (:startDate = ap.startTime and ap.startTime = :endDate)" +
+            "or (:startDate > ap.startTime and ap.endTime > :endDate)" +
+            ")")
+    List<Appointment> findBlockingAppointments(Long businessId, LocalDateTime startDate, LocalDateTime endDate);
 
-    List<Appointment> findAppointmentsByBusinessAndStartTimeBetweenOrEndTimeBetween(Business business, LocalDateTime startTime, LocalDateTime endTime, LocalDateTime startTime1, LocalDateTime endTime1);
+    @Query(value = "select ap from Appointment  as ap " +
+            "where ap.service.business.owner.id = :businessOwnerId " +
+            "and ap.startTime > :now ")
+    List<Appointment> findFutureAppointmentsByBusinessOwnerId(Long businessOwnerId, LocalDateTime now);
 
-    @Query(value = "select a from Appointment a " +
-            "where business_id = :businessId " +
-            "and (" +
-            "(start_time between :startDate and :endDate) " +
-            "or (end_time between :startDate and :endDate) " +
-            "or (:startDate <= start_time and end_time >= :endDate)" +
-            ")", nativeQuery = true)
-    List<Appointment> findBlockingAppointments(Long businessId, LocalDateTime startDate, LocalDateTime endDate);
+    @Query(value = "select ap from Appointment  as ap " +
+            "where ap.customer.id = :customerId " +
+            "and ap.startTime < :now")
+    List<Appointment> findPastAppointmentsByCustomerId(Long customerId, LocalDateTime now);
+
+    @Query(value = "select ap from Appointment  as ap " +
+            "where ap.service.business.owner.id = :businessOwnerId " +
+            "and ap.startTime < :now ")
+    List<Appointment> findPastAppointmentsByBusinessOwnerId(Long businessOwnerId, LocalDateTime now);
+
+    @Query(value = "select ap from Appointment  as ap " +
+            "where ap.customer.id = :customerId " +
+            "and ap.startTime > :now ")
+    List<Appointment> findFutureAppointmentsByCustomerId(Long customerId, LocalDateTime now);
+
+    Optional<Appointment> findAppointmentByIdAndCustomer_Id(Long id, Long customerId);
+
+    Optional<Appointment> findAppointmentByIdAndService_Business_Owner_Id(Long id, Long ownerId);
 }
Index: src/main/java/edu/gjoko/schedlr/repositories/BusinessRepository.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/repositories/BusinessRepository.java	(revision 950fa0d7a6b439770e79c885947e9b7d6058b424)
+++ src/main/java/edu/gjoko/schedlr/repositories/BusinessRepository.java	(revision 77205be723c8b2ffd1ee5618a05e1d12b1cee44a)
@@ -17,3 +17,5 @@
 
     List<Business> findBusinessesByBusinessTypeAndBusinessStatus(BusinessType businessType, BusinessStatus businessStatus);
+
+    List<Business> findBusinessesByBusinessStatusAndBusinessType_Id(BusinessStatus businessStatus, Long id);
 }
Index: src/main/java/edu/gjoko/schedlr/repositories/ReviewRepository.java
===================================================================
--- src/main/java/edu/gjoko/schedlr/repositories/ReviewRepository.java	(revision 77205be723c8b2ffd1ee5618a05e1d12b1cee44a)
+++ src/main/java/edu/gjoko/schedlr/repositories/ReviewRepository.java	(revision 77205be723c8b2ffd1ee5618a05e1d12b1cee44a)
@@ -0,0 +1,16 @@
+package edu.gjoko.schedlr.repositories;
+
+import edu.gjoko.schedlr.entity.Review;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface ReviewRepository extends JpaRepository<Review, Long> {
+
+
+    List<Review> findAllByAppointment_Customer_Id(Long customerId);
+
+    List<Review> findAllByAppointment_Service_Id(Long serviceId);
+}
