Interface IBookingRepository

All Superinterfaces:
IRepository<Booking,String>
All Known Implementing Classes:
BookingRepository

public interface IBookingRepository extends IRepository<Booking,String>
Repository interface for accessing and manipulating Booking entities in the data store.

This interface defines the contract for booking data access operations, including: - Finding bookings by various criteria (ID, applicant, project) - Saving new bookings - Updating existing bookings - Deleting bookings

The repository follows the Repository pattern, abstracting the data access logic from the rest of the application and providing a collection-like interface for booking objects.

  • Method Details

    • findById

      Booking findById(String bookingId)
      Finds a booking by its unique identifier.
      Specified by:
      findById in interface IRepository<Booking,String>
      Parameters:
      bookingId - The unique identifier of the booking to retrieve
      Returns:
      The booking with the specified ID, or null if not found
    • findByApplicantNric

      Booking findByApplicantNric(String applicantNric)
      Finds all bookings made by a specific applicant.
      Parameters:
      applicantNric - The NRIC of the applicant
      Returns:
      A booking associated with the specified applicant, or null if not found
    • findByApplicationId

      Booking findByApplicationId(String applicationId)
      Finds a booking by its associated application ID.
      Parameters:
      applicationId - The unique identifier of the application
      Returns:
      The booking associated with the specified application ID, or null if not found
    • findByProjectId

      List<Booking> findByProjectId(String projectId)
      Finds all bookings associated with a specific project.
      Parameters:
      projectId - The unique identifier of the project
      Returns:
      A list of bookings for the specified project