Class DefaultStaticPackageService

java.lang.Object
de.hybris.platform.staticpackageservices.services.impl.DefaultStaticPackageService
All Implemented Interfaces:
StaticPackageService

public class DefaultStaticPackageService extends Object implements StaticPackageService
The class implementation of StaticPackageService
  • Field Details

  • Constructor Details

    • DefaultStaticPackageService

      public DefaultStaticPackageService()
  • Method Details

    • createDealBundleTemplates

      public void createDealBundleTemplates(List<StaticPackageModel> staticPackages) throws StaticPackageException
      Creates a deal bundle template for each static package. This method uses the transaction in order to rollback the creation of a dealBundleTemplate if something goes wrong.
      Specified by:
      createDealBundleTemplates in interface StaticPackageService
      Parameters:
      staticPackages - the list of staticPackages
      Throws:
      StaticPackageException
    • createDealBundleTemplate

      protected void createDealBundleTemplate(StaticPackageModel staticPackage) throws StaticPackageException
      Creates a deal bundle template from a static package.
      Parameters:
      staticPackage - the static package
      Throws:
      StaticPackageException
    • setDealBasicInformation

      protected void setDealBasicInformation(DealBundleTemplateModel dealBundleTemplate)
      Sets deal basic information.
      Parameters:
      dealBundleTemplate - the deal bundle template
    • createDealProductBundleTemplate

      protected void createDealProductBundleTemplate(DealBundleTemplateModel parentTemplate, List<ProductModel> products, String staticPackageId) throws StaticPackageException
      Creates a deal product bundle template from the list of products of a static package.
      Parameters:
      parentTemplate - the parent template
      products - the products
      staticPackageId - the static package id
      Throws:
      StaticPackageException
    • createDealTransportBundleTemplate

      protected void createDealTransportBundleTemplate(StaticPackageModel staticPackage, DealBundleTemplateModel parentTemplate) throws StaticPackageException
      Creates the child bundle template of type transport from a static package.
      Parameters:
      staticPackage - the flight package model
      parentTemplate - the parent template
      Throws:
      StaticPackageException - the static package exception
    • createDealRouteBundleTemplate

      protected void createDealRouteBundleTemplate(TransportBundleTemplateModel parentTemplate, int originDestinationRefNumber, TransportFacilityModel origin, TransportFacilityModel destination, CabinClassModel cabinClass, BundleType bundleType, String flightPackageId, BundleTemplateModel bundleTemplate, String staticPackageId) throws StaticPackageException
      Creates a deal route bundle template.
      Parameters:
      parentTemplate - the parent template
      originDestinationRefNumber - the origin destination re number
      origin - the origin airport
      destination - the destination airport
      cabinClass - the cabin class
      bundleType - the bundle type
      flightPackageId - the flight package id
      bundleTemplate - the bundle template
      staticPackageId - the static package id
      Throws:
      StaticPackageException - the static package exception
    • createChildTemplatesForRouteBundle

      protected void createChildTemplatesForRouteBundle(RouteBundleTemplateModel parentBundleTemplate, BundleTemplateModel bundleTemplate, String flightPackageId, int originDestinationRefNumber, String staticPackageId) throws StaticPackageException
      Creates child templates for a route bundle by cloning the ones contained in the bundle template previously retrieved.
      Parameters:
      parentBundleTemplate - the parent bundle template
      bundleTemplate - the bundle template
      flightPackageId - the flight package id
      originDestinationRefNumber - the origin destination ref number
      staticPackageId - the static package id
      Throws:
      StaticPackageException - the static package exception
    • cloneChildBundleTemplate

      protected void cloneChildBundleTemplate(BundleTemplateModel childBundleTemplate, RouteBundleTemplateModel parentBundleTemplate, String flightPackageId, int originDestinationRefNumber, String staticPackageId) throws StaticPackageException
      Clones a child bundle template. This method clones the child bundle together with its bundle selection criteria and change product price bundle rules.
      Parameters:
      childBundleTemplate - the child bundle template
      parentBundleTemplate - the parent bundle template
      flightPackageId - the flight package id
      originDestinationRefNumber - the origin destination ref number
      staticPackageId - the static package id
      Throws:
      StaticPackageException - the static package exception
    • getIdForClonedChildBundleTemplate

      protected String getIdForClonedChildBundleTemplate(String flightPackageId, int originDestinationRefNumber, String childBundleTemplateId, String staticPackageId)
      Gets the id for cloned child bundle template.
      Parameters:
      flightPackageId - the flight package id
      originDestinationRefNumber - the origin destination ref number
      childBundleTemplateId - the child bundle template id
      staticPackageId - the static package id
      Returns:
      the id for cloned child bundle template
    • getRouteChangeProductPriceBundleRuleId

      protected String getRouteChangeProductPriceBundleRuleId(String flightPackageId, int originDestinationRefNumber, String originalId, String staticPackageId)
      Gets route change product price bundle rule id.
      Parameters:
      flightPackageId - the flight package id
      originDestinationRefNumber - the origin destination ref number
      originalId - the original id
      staticPackageId - the static package id
      Returns:
      the route change product price bundle rule id
    • getRouteBundleTemplateId

      protected String getRouteBundleTemplateId(String flightPackageId, int originDestinationRefNumber, String staticPackageId)
      Gets the route bundle template id.
      Parameters:
      flightPackageId - the flight package id
      originDestinationRefNumber - the origin destination ref number
      staticPackageId - the static package id
      Returns:
      the route bundle template id
    • getBundleSelectionCriteriaId

      protected String getBundleSelectionCriteriaId(String staticPackageId, int originDestinationRefNumber, String bundleSelectionCriteriaId)
      Gets the bundle selection criteria id.
      Parameters:
      staticPackageId - as the static package id
      originDestinationRefNumber - as the origin destination ref number
      bundleSelectionCriteriaId - as the bundle selection criteria id
      Returns:
      the bundle selection criteria id.
    • createDealAccommodationBundleTemplate

      protected void createDealAccommodationBundleTemplate(RoomPackageModel roomPackage, DealBundleTemplateModel dealParentBundleTemplate, long percentageDiscount, String staticPackageId) throws StaticPackageException
      Creates the child accommodation bundle template from a static package.
      Parameters:
      roomPackage - the room package
      dealParentBundleTemplate - the deal parent bundle template
      percentageDiscount - the percentage discount
      staticPackageId - the static package id
      Throws:
      StaticPackageException - the static package exception
    • createChangeProductPriceBundleRuleForRoomRateProducts

      protected void createChangeProductPriceBundleRuleForRoomRateProducts(List<ProductModel> roomRateProducts, String accommodationBundleId, long percentageDiscount, BundleTemplateModel parentTemplate, String staticPackageId)
      Creates a change product price bundle rule for each room rate product. The price of the rule is calculated accordingly to the percentage of the discount to apply on the product.
      Parameters:
      roomRateProducts - the room rate products
      accommodationBundleId - the accommodation bundle id
      percentageDiscount - the percentage discount
      parentTemplate - the parent template
      staticPackageId - the static package id
    • createChangeProductPriceBundleRule

      protected void createChangeProductPriceBundleRule(String accommodationBundleId, CurrencyModel currency, int index, long percentageDiscount, BundleTemplateModel parentTemplate, de.hybris.platform.jalo.order.price.PriceInformation priceInfo, ProductModel product, String staticPackageId)
      Creates a change product price bundle rule.
      Parameters:
      accommodationBundleId - the accommodation bundle id
      currency - the currency
      index - the index
      percentageDiscount - the percentage discount
      parentTemplate - the parent template
      priceInfo - the price info
      product - the product
      staticPackageId - the static package id
    • createChangeProductPriceBundleRuleId

      protected String createChangeProductPriceBundleRuleId(String bundleId, String isocode, int i, String staticPackageId)
      Generates the id for a change product price bundle rule related to a product.
      Parameters:
      bundleId - the route bundle id
      isocode - the isocode
      i - the index
      staticPackageId - the static package id
      Returns:
      the string
    • setBasicInformationForProductBundleTemplate

      protected void setBasicInformationForProductBundleTemplate(BundleTemplateModel productBundleTemplate, String staticPackageId)
      Sets basic information for a product bundle template.
      Parameters:
      productBundleTemplate - the product bundle template
      staticPackageId - the static package id
    • 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
    • getTravelBundleTemplateStatusService

      protected TravelBundleTemplateStatusService getTravelBundleTemplateStatusService()
      Gets travel bundle template status service.
      Returns:
      the travel bundle template status service
    • setTravelBundleTemplateStatusService

      public void setTravelBundleTemplateStatusService(TravelBundleTemplateStatusService travelBundleTemplateStatusService)
      Sets travel bundle template status service.
      Parameters:
      travelBundleTemplateStatusService - the travel bundle template status service
    • getStaticPackageBundleTemplateService

      protected StaticPackageBundleTemplateService getStaticPackageBundleTemplateService()
      Gets static package bundle template service.
      Returns:
      the static package bundle template service
    • setStaticPackageBundleTemplateService

      public void setStaticPackageBundleTemplateService(StaticPackageBundleTemplateService staticPackageBundleTemplateService)
      Sets static package bundle template service.
      Parameters:
      staticPackageBundleTemplateService - the static package bundle template service
    • getCommonI18NService

      protected de.hybris.platform.servicelayer.i18n.CommonI18NService getCommonI18NService()
      Gets common i 18 n service.
      Returns:
      the common i 18 n service
    • setCommonI18NService

      public void setCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService)
      Sets common i 18 n service.
      Parameters:
      commonI18NService - the common i 18 n service
    • getTravelCommercePriceService

      protected TravelCommercePriceService getTravelCommercePriceService()
      Gets travel commerce price service.
      Returns:
      the travel commerce price service
    • setTravelCommercePriceService

      public void setTravelCommercePriceService(TravelCommercePriceService travelCommercePriceService)
      Sets travel commerce price service.
      Parameters:
      travelCommercePriceService - the travel commerce price service
    • getTravelRouteService

      protected TravelRouteService getTravelRouteService()
      Gets travel route service.
      Returns:
      the travel route service
    • setTravelRouteService

      public void setTravelRouteService(TravelRouteService travelRouteService)
      Sets travel route service.
      Parameters:
      travelRouteService - the travel route service