Class DefaultShoppingTravelProductBasedAutoAccommodationAllocationStrategy
java.lang.Object
de.hybris.platform.travelservices.strategies.impl.TravelProductBasedAutoAccommodationAllocationStrategy
de.hybris.platform.shoppingservices.strategies.impl.DefaultShoppingTravelProductBasedAutoAccommodationAllocationStrategy
- All Implemented Interfaces:
AutoAccommodationAllocationStrategy
public class DefaultShoppingTravelProductBasedAutoAccommodationAllocationStrategy
extends TravelProductBasedAutoAccommodationAllocationStrategy
Shopping extension of
TravelProductBasedAutoAccommodationAllocationStrategy class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidautoAllocateSeat(AbstractOrderModel abstractOrderModel, Integer legNumber, List<String> travellerReferences) This strategy follows one rule that is to allocate the first available seat.protected ShoppingAccommodationMapServiceGets the shoppingAccommodationMapServiceprotected voidgetTransportOfferingTravelAccommodationMap(AbstractOrderModel abstractOrderModel, List<TravellerModel> travellers, Map<TransportOfferingModel, Map<TravellerModel, ConfiguredAccommodationModel>> transportOfferingTravellerAccomodationMap, TransportOfferingModel transportOffering, Optional<TransportVehicleInfoModel> vehicleInfo, long numberOfSeatsToAllocate, ProductModel fareProduct) Gets the accommodation mapprotected booleanisSeatAvailable(ConfiguredAccommodationModel seat, List<SelectedAccommodationModel> selectedAccommodations, TransportOfferingModel transportOffering, Map<TravellerModel, ConfiguredAccommodationModel> travellerAccommodationMap) This method returns true if the seat is available, as in The stock for the seat product is greater than O or null (force in stock).voidsetShoppingAccommodationMapService(ShoppingAccommodationMapService shoppingAccommodationMapService) Sets the shoppingAccommodationMapServiceMethods inherited from class de.hybris.platform.travelservices.strategies.impl.TravelProductBasedAutoAccommodationAllocationStrategy
findAvailableSeat, getAccommodationMapConfiguration, getAccommodationMapService, getCommerceStockService, getConfiguredAccomNumberComparator, getFirstAvailableSeat, getModelService, getProductReferenceService, getSelectedAccommodations, getTransportOfferings, getTransportOfferingTravelAccommodationMap, getTravelCartService, getTravellerService, getTravelRoute, isSeatAllocatedForTravellerInTransportOffering, isSeatEnabledForProduct, saveAllocatedAccomodations, setAccommodationMapService, setCommerceStockService, setConfiguredAccomNumberComparator, setModelService, setProductReferenceService, setTravelCartService, setTravellerService
-
Constructor Details
-
DefaultShoppingTravelProductBasedAutoAccommodationAllocationStrategy
public DefaultShoppingTravelProductBasedAutoAccommodationAllocationStrategy()
-
-
Method Details
-
autoAllocateSeat
public void autoAllocateSeat(AbstractOrderModel abstractOrderModel, Integer legNumber, List<String> travellerReferences) This strategy follows one rule that is to allocate the first available seat. Accommodation types are represented in the following hierarchy Decks -> Cabin -> Rows -> Columns -> Seats. So, finding the first seat available, resembles the traditional DFS(Depth first search) algorithm.- Specified by:
autoAllocateSeatin interfaceAutoAccommodationAllocationStrategy- Overrides:
autoAllocateSeatin classTravelProductBasedAutoAccommodationAllocationStrategy- Parameters:
abstractOrderModel- the abstract order modellegNumber- the leg numbertravellerReferences- the traveller references
-
getTransportOfferingTravelAccommodationMap
protected void getTransportOfferingTravelAccommodationMap(AbstractOrderModel abstractOrderModel, List<TravellerModel> travellers, Map<TransportOfferingModel, Map<TravellerModel, ConfiguredAccommodationModel>> transportOfferingTravellerAccomodationMap, TransportOfferingModel transportOffering, Optional<TransportVehicleInfoModel> vehicleInfo, long numberOfSeatsToAllocate, ProductModel fareProduct) Gets the accommodation map- Parameters:
abstractOrderModel- the abstract order modeltravellers- the travellerstransportOfferingTravellerAccomodationMap- the transportOfferingTravellerAccomodationMaptransportOffering- the transportOfferingvehicleInfo- the vehicleInfonumberOfSeatsToAllocate- the number of seats to allocatefareProduct- the fare product
-
isSeatAvailable
protected boolean isSeatAvailable(ConfiguredAccommodationModel seat, List<SelectedAccommodationModel> selectedAccommodations, TransportOfferingModel transportOffering, Map<TravellerModel, ConfiguredAccommodationModel> travellerAccommodationMap) This method returns true if the seat is available, as in The stock for the seat product is greater than O or null (force in stock). The seat is not an already selected seat in the same transport offering. And it is not allocated to the one of the travellers in the current allocation process.- Overrides:
isSeatAvailablein classTravelProductBasedAutoAccommodationAllocationStrategy- Parameters:
seat-selectedAccommodations-transportOffering-travellerAccommodationMap-- Returns:
-
getShoppingAccommodationMapService
Gets the shoppingAccommodationMapService- Returns:
- the shoppingAccommodationMapService
-
setShoppingAccommodationMapService
public void setShoppingAccommodationMapService(ShoppingAccommodationMapService shoppingAccommodationMapService) Sets the shoppingAccommodationMapService- Parameters:
shoppingAccommodationMapService- the shoppingAccommodationMapService
-