Interface TravelCommerceStockService

All Superinterfaces:
de.hybris.platform.commerceservices.stock.CommerceStockService
All Known Subinterfaces:
ShoppingTravelCommerceStockService
All Known Implementing Classes:
DefaultShoppingTravelCommerceStockService, DefaultTravelCommerceStockService

public interface TravelCommerceStockService extends de.hybris.platform.commerceservices.stock.CommerceStockService
Service that collects functionality for stock levels related with transport offering (warehouse). The service offers:
  • getStockLevel get stock level for a particular product on a particular transport offering
  • reserve stock for a particular order
  • release stock on a particular order
  • releaseForAmendment stock for an existing order
  • Method Details

    • getStockLevel

      Long getStockLevel(ProductModel product, Collection<TransportOfferingModel> transportOfferings)
      Gets stock level.
      Parameters:
      product - the product for which the stock level is checked
      transportOfferings - the collection of transport offering model for the given product.
      Returns:
      Long stock level
    • reserve

      void reserve(AbstractOrderModel currentOrder) throws de.hybris.platform.stock.exception.InsufficientStockLevelException
      Reserves products in the specified warehouse for a given Order. This method is wrapped in a transaction and so will only commit once the transaction completes without errors.
      Parameters:
      currentOrder - the current order
      Throws:
      de.hybris.platform.stock.exception.InsufficientStockLevelException - the insufficient stock level exception
    • release

      void release(AbstractOrderModel currentOrder)
      Release products in the specified warehouse for a given Order.
      Parameters:
      currentOrder - the current order
      Throws:
      IllegalArgumentException
      de.hybris.platform.servicelayer.exceptions.SystemException
    • adjustStockReservationForAmmendment

      void adjustStockReservationForAmmendment(AbstractOrderModel newOrder, AbstractOrderModel originalOrder) throws de.hybris.platform.stock.exception.InsufficientStockLevelException
      Method compares the newOrder with the originalOrder and reserves stock accordingly.
      Parameters:
      newOrder - the new order
      originalOrder - the original order
      Throws:
      de.hybris.platform.stock.exception.InsufficientStockLevelException - the insufficient stock level exception
    • getStockForDate

      Integer getStockForDate(ProductModel product, Date date, Collection<WarehouseModel> warehouses)
      This method returns the product availability for a given date
      Parameters:
      product - the product
      date - the date
      warehouses - the warehouses
      Returns:
      the availability
    • getStockLevelQuantity

      Long getStockLevelQuantity(ProductModel product, Collection<WarehouseModel> warehouses)
      This method calculates availability for a given product
      Parameters:
      product - the product
      warehouses - the warehouses
      Returns:
      a long value representing the stock level
    • reservePerDateProduct

      void reservePerDateProduct(ProductModel product, Date date, int quantity, Collection<WarehouseModel> warehouses) throws de.hybris.platform.stock.exception.InsufficientStockLevelException
      This method performs reservation for an accommodation for a given date
      Parameters:
      product - the product
      date - the date
      quantity - the quantity
      warehouses - the warehouses
      Throws:
      de.hybris.platform.stock.exception.InsufficientStockLevelException - the insufficient stock level exception
    • releasePerDateProduct

      void releasePerDateProduct(ProductModel product, Date date, int quantity, Collection<WarehouseModel> warehouses)
      This method performs stock releasing for an accommodation for a given date
      Parameters:
      product - the product
      date - the date
      quantity - the quantity
      warehouses - the warehouses