Interface IEnquiryRepository

All Superinterfaces:
IRepository<Enquiry,String>
All Known Implementing Classes:
EnquiryRepository

public interface IEnquiryRepository extends IRepository<Enquiry,String>
Repository interface for accessing and manipulating Enquiry entities in the BTO Management System.

This interface extends the generic IRepository interface, inheriting standard CRUD operations while adding enquiry-specific query methods. It handles the persistence and retrieval of Enquiry records, supporting the enquiry management functionality in the application.

Enquiries represent questions or information requests submitted by users about BTO projects or general topics. This repository provides methods for querying enquiries based on user or project associations.

  • Method Details

    • findByUserNric

      List<Enquiry> findByUserNric(String nric)
      Retrieves all enquiries submitted by a specific user.

      This method finds all enquiry records associated with the specified user NRIC, allowing retrieval of a user's complete enquiry history.

      Parameters:
      nric - The NRIC of the user whose enquiries should be retrieved
      Returns:
      A list of all enquiries submitted by the specified user
    • findByProjectId

      List<Enquiry> findByProjectId(String projectId)
      Retrieves all enquiries related to a specific project.

      This method finds all enquiry records associated with the specified project, which is useful for project management and responding to project-specific queries.

      Parameters:
      projectId - The ID of the project whose enquiries should be retrieved
      Returns:
      A list of all enquiries related to the specified project
    • deleteById

      void deleteById(String id) throws DataAccessException
      Deletes the entity with the specified ID. If the ID does not exist, the method might do nothing or throw an exception, depending on implementation preference.
      Parameters:
      id - The ID of the entity to delete.
      Throws:
      DataAccessException - If an error occurs during persistence.