Class DirectorHandler

java.lang.Object
com.university.bookstore.chain.DiscountHandler
com.university.bookstore.chain.DirectorHandler

public class DirectorHandler extends DiscountHandler
Director-level discount approval handler. Can approve discounts up to 25%.
Since:
2024-09-15
Version:
3.0
Author:
Navid Mohaghegh
  • Constructor Details

    • DirectorHandler

      public DirectorHandler()
  • Method Details

    • handleRequest

      public void handleRequest(DiscountRequest request)
      Description copied from class: DiscountHandler
      Handles a discount request. Subclasses must implement this method to define their approval logic.
      Specified by:
      handleRequest in class DiscountHandler
      Parameters:
      request - the discount request to handle
    • getHandlerName

      public String getHandlerName()
      Description copied from class: DiscountHandler
      Gets the name of this handler for identification purposes.
      Specified by:
      getHandlerName in class DiscountHandler
      Returns:
      the handler name
    • getMaxDiscount

      public double getMaxDiscount()
      Description copied from class: DiscountHandler
      Gets the maximum discount this handler can approve.
      Specified by:
      getMaxDiscount in class DiscountHandler
      Returns:
      the maximum discount rate (0.0 to 1.0)