Module: PackageServices

Defined in:
app/services/package_services/processor.rb,
app/services/package_services/dynamic_pricings.rb

Overview

Service class to handle the dynamic pricing logic for restaurant packages.

This service takes in parameters from the controller and applies filtering and calculations on restaurant packages based on dynamic pricing rules. The main functionality includes package filtering, calculating dynamic pricing, and building a result set formatted for JSON response.

Example usage:

service = PackageServices::DynamicPricings.new(params, restaurant)
service.process
render json: { success: service.success, message: service.message, data: service.data }

Attributes:

  • restaurant - the Restaurant object associated with the packages.

  • params - request parameters used for filtering and calculations.

  • message - a message indicating the success or failure of the service.

  • success - boolean indicating if the service succeeded.

  • data - result data containing calculated package information.

Defined Under Namespace

Classes: DynamicPricings, Processor