Class DefaultNDCOrderService
java.lang.Object
de.hybris.platform.ndc182services.services.impl.DefaultNDCOrderService
- All Implemented Interfaces:
NDCOrderService
The ndc 18.2 implementation of
NDCOrderService interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateOrderEntry(OrderModel order, ProductModel product, Set<Integer> orderEntryGroupNumber, List<TransportOfferingModel> transportOfferings, TravellerModel traveller, String routeCode, int originDestinationRefNumber, long quantity, Integer bundleNumber, BundleTemplateModel bundleTemplate) Creates an order entry.protected StringcreateSeatIdentifier(BigDecimal seatRowNumber, String columnSeat, String transportOfferingCode, String routeCode, OrderModel order) Creates the seat identifier as concatenation of vehicle configuration + row + column.protected SelectedAccommodationModelcreateSelectedAccommodation(String transportOfferingCode, TravellerModel traveller, OrderModel order, ConfiguredAccommodationModel configuredAccommodation) Creates the selected accommodation and set the configured accommodation and the traveller.voidcreateSelectedAccommodations(ProductModel product, BigDecimal rowSeat, String columnSeat, List<String> transportOfferingCodes, TravellerModel traveller, OrderModel order, String routeCode) Creates a selected accommodation for each transport offering associated to the selected seat.protected TravelOrderEntryInfoModelcreateTravelOrderEntryInfoModel(ProductModel product, int originDestinationRefNumber, List<TransportOfferingModel> transportOfferings, String routeCode, TravellerModel traveller) Creates the travel order entry info.protected AccommodationMapServiceGets accommodation map service.protected de.hybris.platform.site.BaseSiteServiceGets base site service.getCategoryMapping(ProductModel ancillaryProduct) Returns the mapping extracted from the category that the providedProductModelbelongs to.protected de.hybris.platform.servicelayer.model.ModelServiceGets model service.Gets offer group to origin destination mapping.getOriginalOrderCode(OrderModel orderModel) Gets original order code.protected StringgetPriceLevelCode(ProductModel product, List<TransportOfferingModel> transportOfferings, String routeCode) Returns the price level associated to a particular productGets product catalog id from baseSite.protected TransportOfferingServiceGets transport offering service.protected TravelCommercePriceServiceGets travel commerce price service.protected TravellerServiceGets traveller service.protected TravelRouteServiceGets travel route service.protected de.hybris.platform.product.UnitServiceGets unit service.booleanisAmendedOrderEntry(AbstractOrderEntryModel orderEntry) Checks if the order entry has amend status equal to NEW or CHANGED.isAmendmentOrder(OrderModel orderModel) Is amendment order boolean.booleanisSamePassenger(AbstractOrderEntryModel orderEntry, TravellerModel traveller) Checks if the traveller in the orderEntry is the same.booleanisSameTransportOfferingList(AbstractOrderEntryModel orderEntry, List<String> transportOfferings, int originDestiRefNumber) Checks if the list of transport offerings is the same with the one in the order entry, together with the originDestinationRefNumber.protected booleanisSeatNotAvailable(ConfiguredAccommodationModel configuredAccommodation, String transportOfferingCode, String travellerCode, ProductModel product, OrderModel order, String travellerLabel) Checks if 1) the accommodation is configured in the system.voidremoveOrder(OrderModel order) Checks if the order has already been saved and, in case, deletes it.voidsetAccommodationMapService(AccommodationMapService accommodationMapService) Sets accommodation map service.voidsetBaseSiteService(de.hybris.platform.site.BaseSiteService baseSiteService) Sets base site service.voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.voidsetOfferGroupToOriginDestinationMapping(Map<String, String> offerGroupToOriginDestinationMapping) Sets offer group to origin destination mapping.voidsetTransportOfferingService(TransportOfferingService transportOfferingService) Sets transport offering service.voidsetTravelCommercePriceService(TravelCommercePriceService travelCommercePriceService) Sets travel commerce price service.voidsetTravellerService(TravellerService travellerService) Sets traveller service.voidsetTravelRouteService(TravelRouteService travelRouteService) Sets travel route service.voidsetUnitService(de.hybris.platform.product.UnitService unitService) Sets unit service.voidupdateEntriesAmendStatus(List<AbstractOrderEntryModel> entries, AmendStatus status) Update entries amend status.voidvalidatePaymentInfoAgainstOrderEntries(OrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount) Validates the amount of the payment info against the total amount of the order entries associated to it.voidvalidateProductAgainstMaximumQuantityRestriction(long selectedOfferItemQty, AbstractOrderEntryModel existingProduct, ProductModel product, OrderModel order) Validates the product against the maximum quantity restriction.
-
Constructor Details
-
DefaultNDCOrderService
public DefaultNDCOrderService()
-
-
Method Details
-
removeOrder
Checks if the order has already been saved and, in case, deletes it.- Specified by:
removeOrderin interfaceNDCOrderService- Parameters:
order- the order
-
validatePaymentInfoAgainstOrderEntries
public void validatePaymentInfoAgainstOrderEntries(OrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount) throws NDCException Validates the amount of the payment info against the total amount of the order entries associated to it.- Specified by:
validatePaymentInfoAgainstOrderEntriesin interfaceNDCOrderService- Parameters:
order- the orderorderEntries- the order entriespaymentInfoAmount- the payment info amount- Throws:
NDCException- the ndc exception
-
createSelectedAccommodations
public void createSelectedAccommodations(ProductModel product, BigDecimal rowSeat, String columnSeat, List<String> transportOfferingCodes, TravellerModel traveller, OrderModel order, String routeCode) throws NDCException Creates a selected accommodation for each transport offering associated to the selected seat. Verifies if the seat belongs to the right class of the fare product, is already present in the order for the same traveller and if it is already occupied by someone else.- Specified by:
createSelectedAccommodationsin interfaceNDCOrderService- Parameters:
product- the productrowSeat- the row seatcolumnSeat- the column seattransportOfferingCodes- the transport offering codestraveller- the travellerorder- the orderrouteCode- the route code- Throws:
NDCException- the ndc exception
-
updateEntriesAmendStatus
Update entries amend status.- Specified by:
updateEntriesAmendStatusin interfaceNDCOrderService- Parameters:
entries- the entriesstatus- the status
-
getCategoryMapping
Returns the mapping extracted from the category that the providedProductModelbelongs to.- Parameters:
ancillaryProduct- the ancillary product- Returns:
- category mapping
-
isSeatNotAvailable
protected boolean isSeatNotAvailable(ConfiguredAccommodationModel configuredAccommodation, String transportOfferingCode, String travellerCode, ProductModel product, OrderModel order, String travellerLabel) Checks if 1) the accommodation is configured in the system. 2) the accomodation is bookable. 3) the accommodation is already booked by any other passenger in the transport offering. 4) the accommodation refers to a valid class of the fare product. 5) the same traveller has already a seat in the order.- Parameters:
configuredAccommodation- the configured accommodationtransportOfferingCode- the transport offering codetravellerCode- the traveller codeproduct- the productorder- the ordertravellerLabel- the traveller label- Returns:
- true if one of these check fails.
-
createSeatIdentifier
protected String createSeatIdentifier(BigDecimal seatRowNumber, String columnSeat, String transportOfferingCode, String routeCode, OrderModel order) throws NDCException Creates the seat identifier as concatenation of vehicle configuration + row + column.- Parameters:
seatRowNumber- the seat row numbercolumnSeat- the column seattransportOfferingCode- the transport offering coderouteCode- the route codeorder- the order- Returns:
- the string
- Throws:
NDCException- the ndc exception
-
createSelectedAccommodation
protected SelectedAccommodationModel createSelectedAccommodation(String transportOfferingCode, TravellerModel traveller, OrderModel order, ConfiguredAccommodationModel configuredAccommodation) throws NDCException Creates the selected accommodation and set the configured accommodation and the traveller.- Parameters:
transportOfferingCode- the transport offering codetraveller- the travellerorder- the orderconfiguredAccommodation- the configured accommodation- Returns:
- the selected accommodation model
- Throws:
NDCException- the ndc exception
-
validateProductAgainstMaximumQuantityRestriction
public void validateProductAgainstMaximumQuantityRestriction(long selectedOfferItemQty, AbstractOrderEntryModel existingProduct, ProductModel product, OrderModel order) throws NDCException Validates the product against the maximum quantity restriction.- Specified by:
validateProductAgainstMaximumQuantityRestrictionin interfaceNDCOrderService- Parameters:
selectedOfferItemQty- the selectedOfferItemQtyexistingProduct- the existing productproduct- the productorder- the order- Throws:
NDCException- the ndc exception
-
isSameTransportOfferingList
public boolean isSameTransportOfferingList(AbstractOrderEntryModel orderEntry, List<String> transportOfferings, int originDestiRefNumber) Checks if the list of transport offerings is the same with the one in the order entry, together with the originDestinationRefNumber.- Specified by:
isSameTransportOfferingListin interfaceNDCOrderService- Parameters:
orderEntry- the order entrytransportOfferings- the transport offeringsoriginDestiRefNumber- the origin desti ref number- Returns:
- true if the transport offerings and the originDestinationRefNumber is the same.
-
isSamePassenger
Checks if the traveller in the orderEntry is the same.- Specified by:
isSamePassengerin interfaceNDCOrderService- Parameters:
orderEntry- the order entrytraveller- the traveller- Returns:
- the boolean
-
isAmendedOrderEntry
Checks if the order entry has amend status equal to NEW or CHANGED.- Specified by:
isAmendedOrderEntryin interfaceNDCOrderService- Parameters:
orderEntry- the order entry- Returns:
- the boolean
-
isAmendmentOrder
Description copied from interface:NDCOrderServiceIs amendment order boolean.- Specified by:
isAmendmentOrderin interfaceNDCOrderService- Parameters:
orderModel- the order model- Returns:
- the boolean
-
getOriginalOrderCode
Description copied from interface:NDCOrderServiceGets original order code.- Specified by:
getOriginalOrderCodein interfaceNDCOrderService- Parameters:
orderModel- the order model- Returns:
- the original order code
-
getProductCatalogIdFromBaseSite
Gets product catalog id from baseSite.- Specified by:
getProductCatalogIdFromBaseSitein interfaceNDCOrderService- Returns:
- the product catalog
- Throws:
NDCException- the ndc exception
-
createOrderEntry
public OrderEntryModel createOrderEntry(OrderModel order, ProductModel product, Set<Integer> orderEntryGroupNumber, List<TransportOfferingModel> transportOfferings, TravellerModel traveller, String routeCode, int originDestinationRefNumber, long quantity, Integer bundleNumber, BundleTemplateModel bundleTemplate) Creates an order entry.- Specified by:
createOrderEntryin interfaceNDCOrderService- Parameters:
order- the orderproduct- the productorderEntryGroupNumber- the order entry group numbertransportOfferings- the transport offeringstraveller- the travellerrouteCode- the route codeoriginDestinationRefNumber- the origin destination ref numberquantity- the quantitybundleNumber- the bundleNumberbundleTemplate- the bundleTemplate- Returns:
- the order entry model
-
createTravelOrderEntryInfoModel
protected TravelOrderEntryInfoModel createTravelOrderEntryInfoModel(ProductModel product, int originDestinationRefNumber, List<TransportOfferingModel> transportOfferings, String routeCode, TravellerModel traveller) Creates the travel order entry info.- Parameters:
product- the productoriginDestinationRefNumber- the origin destination ref numbertransportOfferings- the transport offeringsrouteCode- the route codetraveller- the traveller- Returns:
- the travel order entry info model
-
getPriceLevelCode
protected String getPriceLevelCode(ProductModel product, List<TransportOfferingModel> transportOfferings, String routeCode) Returns the price level associated to a particular product- Parameters:
product- the producttransportOfferings- the transport offeringsrouteCode- the route code- Returns:
- price level code
-
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
-
getTransportOfferingService
Gets transport offering service.- Returns:
- the transport offering service
-
setTransportOfferingService
Sets transport offering service.- Parameters:
transportOfferingService- the transport offering service
-
getAccommodationMapService
Gets accommodation map service.- Returns:
- the accommodation map service
-
setAccommodationMapService
Sets accommodation map service.- Parameters:
accommodationMapService- the accommodation map service
-
getTravellerService
Gets traveller service.- Returns:
- the traveller service
-
setTravellerService
Sets traveller service.- Parameters:
travellerService- the traveller service
-
getUnitService
protected de.hybris.platform.product.UnitService getUnitService()Gets unit service.- Returns:
- the unit service
-
setUnitService
public void setUnitService(de.hybris.platform.product.UnitService unitService) Sets unit service.- Parameters:
unitService- the unit service
-
getTravelRouteService
Gets travel route service.- Returns:
- the travel route service
-
setTravelRouteService
Sets travel route service.- Parameters:
travelRouteService- the travel route service
-
getTravelCommercePriceService
Gets travel commerce price service.- Returns:
- the travel commerce price service
-
setTravelCommercePriceService
Sets travel commerce price service.- Parameters:
travelCommercePriceService- the travel commerce price service
-
getOfferGroupToOriginDestinationMapping
Gets offer group to origin destination mapping.- Returns:
- the offer group to origin destination mapping
-
setOfferGroupToOriginDestinationMapping
public void setOfferGroupToOriginDestinationMapping(Map<String, String> offerGroupToOriginDestinationMapping) Sets offer group to origin destination mapping.- Parameters:
offerGroupToOriginDestinationMapping- the offer group to origin destination mapping
-
getBaseSiteService
protected de.hybris.platform.site.BaseSiteService getBaseSiteService()Gets base site service.- Returns:
- the base site service
-
setBaseSiteService
public void setBaseSiteService(de.hybris.platform.site.BaseSiteService baseSiteService) Sets base site service.- Parameters:
baseSiteService- the base site service
-