Interface InventoryAvailabilityIndexService

All Known Implementing Classes:
DefaultInventoryAvailabilityIndexService

public interface InventoryAvailabilityIndexService
Service for building the inventory availability index for products.
Since:
Catalog Browse Service 2.2.0, Release Train 2.3.0
Author:
Susana Cruz (susanacruz)
  • Method Details

    • buildProductAvailabilityIndex

      ProductAvailabilityIndex buildProductAvailabilityIndex(@NonNull String productId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Constructs a ProductAvailabilityIndex for a given product by gathering relevant variants and their associated inventory availability details. The index is intended to optimize payload size and improve performance, especially when dealing with products having multiple variants.
      Parameters:
      productId - the unique identifier of the product for which the availability index is built
      contextInfo - additional context information (such as sandbox or multitenant details) relevant to the operation
      Returns:
      a ProductAvailabilityIndex containing the related variants and their inventory availability details
    • getLiteVariantsWithAvailability

      Map<String,VariantAvailabilityInfo> getLiteVariantsWithAvailability(@NonNull String productId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Fetches the LiteVariants for a given productId and then fetches their inventory availability using a grouping of their SKUs. The result is hydrated onto each corresponding LiteVariant.
      Parameters:
      productId - the productId to find variants for
      contextInfo - context information around sandbox and multitenant state
      Returns:
      the LiteVariants with their inventory availability