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
The type Fare pros price calculation strategy.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddPriceModifier(PriceModifier priceModifier, AbstractOrderEntryModel orderEntryModel) Add price modifier.protected de.hybris.platform.util.PriceValuecalculateBasePriceSegment(AbstractOrderEntryModel orderEntryModel, SearchResponseWrapper searchResponseWrapper, PricingSolution pricingSolution, String ptc) Calculate the base price from segmentprotected ListconvertDiscountValues(AbstractOrderModel order, List discountValues) Converts the discount values list.protected Stringprotected de.hybris.platform.util.PriceValueFinds the base price from the repricer response price value.protected de.hybris.platform.util.PriceValuefindPROSFareProductBasePrice(AbstractOrderEntryModel orderEntryModel, SearchResponseWrapper searchResponseWrapper, PricingSolution pricingSolution) Find pros fare product base price price value.protected List<de.hybris.platform.util.TaxValue>findPROSFareProductTaxValues(AbstractOrderEntryModel orderEntryModel, SearchResponseWrapper searchResponseWrapper, PricingSolution pricingSolution) Find pros fare product tax values list.protected Collection<de.hybris.platform.util.TaxValue>Finds the taxes from repricer response collection.de.hybris.platform.util.PriceValueGet base price price value.protected de.hybris.platform.enumeration.EnumerationServiceGets enumeration service.protected de.hybris.platform.servicelayer.model.ModelServiceGets model service.protected ShoppingRepricingServiceGets shopping repricing service.protected ShoppingTravelCartServiceGets shopping travel cart service.Collection<de.hybris.platform.util.TaxValue>Get tax values collection.protected booleanisChangeFlightCart(AbstractOrderEntryModel orderEntryModel) Checks if the cart is an amended cart and a change flight solution has been performed.voidsetEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService) Sets enumeration service.voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.voidsetShoppingRepricingService(ShoppingRepricingService shoppingRepricingService) Sets shopping repricing service.voidsetShoppingTravelCartService(ShoppingTravelCartService shoppingTravelCartService) Sets shopping travel cart service.Methods inherited from class de.hybris.platform.prosservices.price.strategies.impl.AbstractPROSPriceCalculationStrategy
findPricingSolution, findPricingSolutionByFareReferenceEntry, findPricingSolutionID, findPricingSolutionIDFromSameODEntries, getCommonI18NService, getProsSearchResponseService, getProsTravelBundleTemplateService, getSearchResponseService, getSessionService, setCommonI18NService, setProsSearchResponseService, setProsTravelBundleTemplateService, setSearchResponseService, setSessionService
-
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:ShoppingPriceCalculationStrategyGet 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:ShoppingPriceCalculationStrategyGet 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
-
convertDiscountValues
Converts the discount values list.- Parameters:
order- the orderdiscountValues- 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 modelsearchResponseWrapper- the search response wrapperpricingSolution- 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 orderEntryModelsearchResponseWrapper- the searchResponseWrapperpricingSolution- the pricingSolutionptc- the ptc- Returns:
- the base price
-
addPriceModifier
protected void addPriceModifier(PriceModifier priceModifier, AbstractOrderEntryModel orderEntryModel) Add price modifier.- Parameters:
priceModifier- the price modifierorderEntryModel- 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. TheBookingSolutionlist is accessed with get(0) since only a bookingSolution is returned request. We are not expecting variations on theMemberin thePassengerGroupelement for the current integration.- Parameters:
orderEntryModel- the order entry modelsearchResponseWrapper- the search response messagepricingSolution- the pricing solution- Returns:
- the list
-
isChangeFlightCart
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
Gets shopping repricing service.- Returns:
- the shopping repricing service
-
setShoppingRepricingService
Sets shopping repricing service.- Parameters:
shoppingRepricingService- the shopping repricing service
-
getShoppingTravelCartService
Gets shopping travel cart service.- Returns:
- the shopping travel cart service
-
setShoppingTravelCartService
Sets shopping travel cart service.- Parameters:
shoppingTravelCartService- the shopping travel cart service
-