Interface IBookingService
- All Known Implementing Classes:
BookingService
public interface IBookingService
Interface defining the service operations for handling booking functionality
in the BTO Management System.
This service provides methods to: - Create new bookings for applicants - Retrieve bookings by various criteria - Cancel existing bookings
The service acts as part of the business logic layer in the application's architecture, positioned between controllers and repositories, implementing all booking-related business rules and validation.
-
Method Summary
Modifier and TypeMethodDescriptiongetBookingsByProject
(String projectId) Retrieves all bookings associated with a specific project.performBooking
(HDBOfficer officer, String applicantNric, FlatType flatType) Performs a booking operation for an applicant by an HDB officer.
-
Method Details
-
performBooking
Booking performBooking(HDBOfficer officer, String applicantNric, FlatType flatType) throws BookingException, InvalidInputException Performs a booking operation for an applicant by an HDB officer.This method handles the complete booking process including: 1. Validating the officer's authorization to perform bookings 2. Checking the applicant's eligibility for the specified flat type 3. Creating and persisting the booking record
- Parameters:
officer
- The HDB officer performing the booking operationapplicantNric
- The NRIC of the applicant for whom the booking is being madeflatType
- The type of flat being booked- Returns:
- The newly created Booking object
- Throws:
BookingException
- If there is an issue with the booking processInvalidInputException
- If the provided input parameters are invalid
-
getBookingsByProject
Retrieves all bookings associated with a specific project.This method allows for retrieving and analyzing all bookings that have been made for a particular HDB project.
- Parameters:
projectId
- The unique identifier of the project- Returns:
- A list of Booking objects associated with the specified project
- Throws:
BookingException
- If there is an error retrieving the bookings
-