Class ShippingCalculationHelper

java.lang.Object
com.skava.shipping.helper.ShippingCalculationHelper

@Service public class ShippingCalculationHelper extends Object
The Class ShippingCollectionPropertiesHelper
  • Constructor Details

    • ShippingCalculationHelper

      public ShippingCalculationHelper()
      instantiates new instance for this class.
  • Method Details

    • plugInLoader

      public ShippingResponse plugInLoader(ShippingRequest shippingRequest)
      Plug in loader. This class used to load collection properties. If the partner plugin property is not available in that collection properties, Load default calculation partner from default properties. If collection partner plugin property is available means get and use it.
      Parameters:
      shippingRequest - the shipping request
      Returns:
      the shipping response
    • allowedCountryCheck

      public void allowedCountryCheck(long collectionId, String countryNameToBeChecked)
      this method check whether the given country allowed to be or not returns error if not allowed
      Parameters:
      collectionId - to retrive collection properties to get countries list to check with the given country name
      countryNameToBeChecked - country name to be checked
    • getAddress

      public ShippingAddress getAddress(Shipping dtoModel, Items itemdtoModel, ShippingRequest request)
      Gets the address.
      Parameters:
      dtoModel - the dto model
      itemdtoModel - the itemdto model
      request - the shipping request
      Returns:
      the address
    • getType

      public DeliveryType getType(Shipping dtoModel, Items itemdtoModel, String locale)
      Gets the type.
      Parameters:
      dtoModel - the dto model
      itemdtoModel - the itemdto model
      locale - the locale
      Returns:
      the type
    • getCollectionProperty

      public String getCollectionProperty(long collectionId, String propertyName, String locale)
      Find the collection property value
      Parameters:
      collectionId - the collection identifier
      propertyName - the property name
      locale - the locale string
      Returns:
      the value of the collection property
    • getValidatorsFromCollectionProperty

      public List<com.skava.core.validation.ValidatorComponent> getValidatorsFromCollectionProperty(long collectionId, String validatorPropName, String defaultValidator, String locale)
      This method is used to load the list of validators from the given collection property
      Parameters:
      collectionId - The collection identifier
      validatorPropName - The collection property name to take the validator
      defaultValidator - The default validator that should be loaded if the the validator property is null
      locale - Locale for processing the response message