Class AddExactlyNQuantityExtrasStrategy
java.lang.Object
de.hybris.platform.travelfacades.facades.accommodation.strategies.AbstractRestrictionExtrasStrategy
de.hybris.platform.travelfacades.facades.accommodation.strategies.impl.AddExactlyNQuantityExtrasStrategy
- All Implemented Interfaces:
AccommodationRestrictionExtrasStrategy
public class AddExactlyNQuantityExtrasStrategy
extends AbstractRestrictionExtrasStrategy
implements AccommodationRestrictionExtrasStrategy
Implementation of
AccommodationRestrictionExtrasStrategy interface, to check if the stockLevel is greater or
equals to the specified quantity in the restriction for each dates in the accommodationReservationData and create the
restrictionData for the given product.-
Field Summary
Fields inherited from class de.hybris.platform.travelfacades.facades.accommodation.strategies.AbstractRestrictionExtrasStrategy
travelCartService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyStrategy(ProductModel productModel, ReservedRoomStayData reservedRoomStayData, AccommodationReservationData accommodationReservationData) Applies the strategy to check the availability of the product against the reservedRoomStayData for each date.booleancheckRequestedQuantity(ProductModel productModel, AccommodationOrderEntryGroupModel requestedAccommodationOrderEntryGroupModel, List<AccommodationOrderEntryGroupModel> accommodationOrderEntryGroups, long requestedQuantity) Check if the given restriction allows the requested quantityMethods inherited from class de.hybris.platform.travelfacades.facades.accommodation.strategies.AbstractRestrictionExtrasStrategy
getAccommodationOfferingService, getAvailableQuantity, getCommerceStockService, getQuantityForReservedService, getServiceAvailableQuantity, getServiceAvailableQuantity, getTravelCartService, setAccommodationOfferingService, setCommerceStockService, setTravelCartService
-
Constructor Details
-
AddExactlyNQuantityExtrasStrategy
public AddExactlyNQuantityExtrasStrategy()
-
-
Method Details
-
applyStrategy
public AccommodationRestrictionData applyStrategy(ProductModel productModel, ReservedRoomStayData reservedRoomStayData, AccommodationReservationData accommodationReservationData) throws AccommodationPipelineException Description copied from interface:AccommodationRestrictionExtrasStrategyApplies the strategy to check the availability of the product against the reservedRoomStayData for each date. If the product is available it returns the corresponding restrictionData, otherwise it throws aAccommodationPipelineException- Specified by:
applyStrategyin interfaceAccommodationRestrictionExtrasStrategy- Parameters:
productModel- the product modelreservedRoomStayData- the reserved room stay dataaccommodationReservationData- the accommodation reservation data- Returns:
- the accommodationRestrictionData if the product is available
- Throws:
AccommodationPipelineException- if the product is not available for the given accommodationOffering in the selected dates.
-
checkRequestedQuantity
public boolean checkRequestedQuantity(ProductModel productModel, AccommodationOrderEntryGroupModel requestedAccommodationOrderEntryGroupModel, List<AccommodationOrderEntryGroupModel> accommodationOrderEntryGroups, long requestedQuantity) Description copied from interface:AccommodationRestrictionExtrasStrategyCheck if the given restriction allows the requested quantity- Specified by:
checkRequestedQuantityin interfaceAccommodationRestrictionExtrasStrategy- Parameters:
productModel- the product modelrequestedAccommodationOrderEntryGroupModel- the requestedAccommodationOrderEntryGroupModelrequestedQuantity- the requestedQuantity- Returns:
- true if the requested quantity is available
-