Class FarePROSPriceCalculationStrategy

java.lang.Object
de.hybris.platform.prosservices.price.strategies.impl.AbstractPROSPriceCalculationStrategy
de.hybris.platform.prosservices.price.strategies.impl.FarePROSPriceCalculationStrategy
All Implemented Interfaces:
ShoppingPriceCalculationStrategy

public class FarePROSPriceCalculationStrategy extends AbstractPROSPriceCalculationStrategy
The type Fare pros price calculation strategy.
  • Constructor Details

    • FarePROSPriceCalculationStrategy

      public FarePROSPriceCalculationStrategy()
  • Method Details

    • getTaxValues

      public Collection<de.hybris.platform.util.TaxValue> getTaxValues(AbstractOrderEntryModel entry) throws de.hybris.platform.order.exceptions.CalculationException
      Description copied from interface: ShoppingPriceCalculationStrategy
      Get tax values collection.
      Parameters:
      entry - the entry
      Returns:
      the collection
      Throws:
      de.hybris.platform.order.exceptions.CalculationException - the calculation exception
    • getBasePrice

      public de.hybris.platform.util.PriceValue getBasePrice(AbstractOrderEntryModel entry) throws de.hybris.platform.order.exceptions.CalculationException
      Description copied from interface: ShoppingPriceCalculationStrategy
      Get base price price value.
      Parameters:
      entry - the entry
      Returns:
      the price value
      Throws:
      de.hybris.platform.order.exceptions.CalculationException - the calculation exception
    • findBasePriceFromRepricerResponse

      protected de.hybris.platform.util.PriceValue findBasePriceFromRepricerResponse(AbstractOrderEntryModel entry) throws de.hybris.platform.order.exceptions.CalculationException
      Finds the base price from the repricer response price value. If the EvenExchange field is true, the price is set to 0, otherwise to the BasePrice in the NewPrice field of tktExchange.
      Parameters:
      entry - the entry
      Returns:
      the price value
      Throws:
      de.hybris.platform.order.exceptions.CalculationException
    • createTransportOfferingCode

      protected String createTransportOfferingCode(RepricerResponseFlight flight)
    • convertDiscountValues

      protected List convertDiscountValues(AbstractOrderModel order, List discountValues)
      Converts the discount values list.
      Parameters:
      order - the order
      discountValues - the discount values
      Returns:
      the list
    • findTaxesFromRepricerResponse

      protected Collection<de.hybris.platform.util.TaxValue> findTaxesFromRepricerResponse(AbstractOrderEntryModel entry) throws de.hybris.platform.order.exceptions.CalculationException
      Finds the taxes from repricer response collection. In order to calculate properly the taxes, this method retrieves the original entry and for each tax checks: 1) if the tax is present in TktExchange/NewPrice/TaxBreakdown, then it means that the new amount of the tax is greater than the old amount. 2) if the tax is not present in the NewPrice/TaxBreakdown but is present in TktExchange/Refund/TaxBreakdown, then the new price is the difference between the old amount and the amount in this breakdown. 3) For all the taxes present in the TktExchange/NewPrice/TaxBreakdown but not in the order entry, a new tax is added to the list. Note: if the original order entry does not exist, it means that the change is related to a new itinerary (different origin/destination) and all the taxes in the TktExchange/Refund/TaxBreakdown have to be added to the list of the taxValues.
      Parameters:
      entry - the entry
      Returns:
      the collection
      Throws:
      de.hybris.platform.order.exceptions.CalculationException
    • findPROSFareProductBasePrice

      protected de.hybris.platform.util.PriceValue findPROSFareProductBasePrice(AbstractOrderEntryModel orderEntryModel, SearchResponseWrapper searchResponseWrapper, PricingSolution pricingSolution)
      Find pros fare product base price price value. Since the response is coming from the IntelliPricer, only one solution should be available.
      Parameters:
      orderEntryModel - the order entry model
      searchResponseWrapper - the search response wrapper
      pricingSolution - the pricing solution
      Returns:
      the price value
    • calculateBasePriceSegment

      protected de.hybris.platform.util.PriceValue calculateBasePriceSegment(AbstractOrderEntryModel orderEntryModel, SearchResponseWrapper searchResponseWrapper, PricingSolution pricingSolution, String ptc)
      Calculate the base price from segment
      Parameters:
      orderEntryModel - the orderEntryModel
      searchResponseWrapper - the searchResponseWrapper
      pricingSolution - the pricingSolution
      ptc - the ptc
      Returns:
      the base price
    • addPriceModifier

      protected void addPriceModifier(PriceModifier priceModifier, AbstractOrderEntryModel orderEntryModel)
      Add price modifier.
      Parameters:
      priceModifier - the price modifier
      orderEntryModel - the order entry model
    • findPROSFareProductTaxValues

      protected List<de.hybris.platform.util.TaxValue> findPROSFareProductTaxValues(AbstractOrderEntryModel orderEntryModel, SearchResponseWrapper searchResponseWrapper, PricingSolution pricingSolution)
      Find pros fare product tax values list. The BookingSolution list is accessed with get(0) since only a bookingSolution is returned request. We are not expecting variations on the Member in the PassengerGroup element for the current integration.
      Parameters:
      orderEntryModel - the order entry model
      searchResponseWrapper - the search response message
      pricingSolution - the pricing solution
      Returns:
      the list
    • isChangeFlightCart

      protected boolean isChangeFlightCart(AbstractOrderEntryModel orderEntryModel)
      Checks if the cart is an amended cart and a change flight solution has been performed.
      Parameters:
      orderEntryModel - the order entry model
      Returns:
      true if a change flight is performed on the cart
    • getEnumerationService

      protected de.hybris.platform.enumeration.EnumerationService getEnumerationService()
      Gets enumeration service.
      Returns:
      the enumeration service
    • setEnumerationService

      public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)
      Sets enumeration service.
      Parameters:
      enumerationService - the enumeration service
    • getModelService

      protected de.hybris.platform.servicelayer.model.ModelService getModelService()
      Gets model service.
      Returns:
      the model service
    • setModelService

      public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService)
      Sets model service.
      Parameters:
      modelService - the model service
    • getShoppingRepricingService

      protected ShoppingRepricingService getShoppingRepricingService()
      Gets shopping repricing service.
      Returns:
      the shopping repricing service
    • setShoppingRepricingService

      public void setShoppingRepricingService(ShoppingRepricingService shoppingRepricingService)
      Sets shopping repricing service.
      Parameters:
      shoppingRepricingService - the shopping repricing service
    • getShoppingTravelCartService

      protected ShoppingTravelCartService getShoppingTravelCartService()
      Gets shopping travel cart service.
      Returns:
      the shopping travel cart service
    • setShoppingTravelCartService

      public void setShoppingTravelCartService(ShoppingTravelCartService shoppingTravelCartService)
      Sets shopping travel cart service.
      Parameters:
      shoppingTravelCartService - the shopping travel cart service