Interface IEnquiryRepository
- All Superinterfaces:
IRepository<Enquiry,
String>
- All Known Implementing Classes:
EnquiryRepository
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 Summary
Modifier and TypeMethodDescriptionvoid
deleteById
(String id) Deletes the entity with the specified ID.findByProjectId
(String projectId) Retrieves all enquiries related to a specific project.findByUserNric
(String nric) Retrieves all enquiries submitted by a specific user.
-
Method Details
-
findByUserNric
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
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
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.
-