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 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 operation
      applicantNric - The NRIC of the applicant for whom the booking is being made
      flatType - The type of flat being booked
      Returns:
      The newly created Booking object
      Throws:
      BookingException - If there is an issue with the booking process
      InvalidInputException - If the provided input parameters are invalid
    • getBookingsByProject

      List<Booking> getBookingsByProject(String projectId) throws BookingException
      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