Interface SkuInventoryService<I extends SkuInventory>

  • Type Parameters:
    I -
    All Superinterfaces:
    com.broadleafcommerce.data.tracking.core.service.CrudEntityService<I>
    All Known Implementing Classes:
    DefaultSkuInventoryService

    public interface SkuInventoryService<I extends SkuInventory>
    extends com.broadleafcommerce.data.tracking.core.service.CrudEntityService<I>
    Service API for adjusting SkuInventory.
    Author:
    Kelly Tisdell (ktisdell)
    • Method Detail

      • readAllByName

        org.springframework.data.domain.Page<I> readAllByName​(@Nullable
                                                              String nameQuery,
                                                              @Nullable
                                                              cz.jirutka.rsql.parser.ast.Node filters,
                                                              @Nullable
                                                              org.springframework.data.domain.Pageable page,
                                                              @Nullable
                                                              com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Read all Inventory Locations, optionally filtered by name or number.
        Parameters:
        nameQuery - (optional) the name to filter by
        page - the requested page of results from the database
        filters - additional filters to apply in the query, can be null
        context - context information surrounding sandboxing and multitenant state
        Returns:
        all SkuInventory, optionally filtered by name
      • findAllByInventoryLocationContextId

        org.springframework.data.domain.Page<I> findAllByInventoryLocationContextId​(String inventoryLocationId,
                                                                                    @Nullable
                                                                                    cz.jirutka.rsql.parser.ast.Node filters,
                                                                                    @Nullable
                                                                                    org.springframework.data.domain.Pageable page,
                                                                                    @Nullable
                                                                                    com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Read all Sku Inventories for the specified inventory location id matching the given filters. Read all Inventory Locations,
        Parameters:
        inventoryLocationId - the inventory location id
        filters - additional filters to apply in the query, can be null
        page - the requested page of results from the database
        context - context information surrounding sandboxing and multitenant state
        Returns:
        the Sku Inventories for the specified inventory location id
      • readAllByInventoryLocationId

        Stream<I> readAllByInventoryLocationId​(String inventoryLocationId,
                                               @Nullable
                                               cz.jirutka.rsql.parser.ast.Node filters,
                                               @Nullable
                                               com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Read all Sku Inventories for the specified inventory location id matching the given filters.
        Parameters:
        inventoryLocationId - the inventory location id
        filters - additional filters to apply in the query, can be null
        context - context information surrounding sandboxing and multitenant state
        Returns:
        the Sku Inventories for the specified inventory location id
      • createSkuInventoryReservations

        List<InventoryTransaction> createSkuInventoryReservations​(@NonNull
                                                                  SkuInventoryReservationRequest request,
                                                                  @Nullable
                                                                  com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
                                                           throws InventoryUnavailableException
        Creates HARD or a SOFT Inventory Reservations. This results in the creation of 1 or more InventoryTransaction records. A SOFT inventory reservation is a temporary reservation that may be removed or rolled back after a period of time. A SOFT reservation typically results in decrementing quantityAvailable on the SkuInventory record. These are typically created prior to payment processing. A HARD reservation makes the SOFT reservation permanent. These are typically created after payment processing. If a corresponding SOFT reservation does not exist, then the creation of a HARD reservation will attempt to decrement quantityAvailable as well. In this case, the process is similar to creating a SOFT reservation immediately followed by a HARD reservation.
        Parameters:
        request - SkuInventoryReservationRequest to be processed
        contextInfo - Context information around sandbox and multitenant state.
        Returns:
        The InventoryTransactions resulting from processing the request.
        Throws:
        InventoryUnavailableException - if inventory cannot be reserved or otherwise decremented
      • existsByInventoryLocationAndSkuRefFieldValues

        boolean existsByInventoryLocationAndSkuRefFieldValues​(String inventoryLocationId,
                                                              Optional<String> skuContextId,
                                                              Optional<String> externalId,
                                                              Optional<String> skuCode,
                                                              Optional<String> upc,
                                                              Optional<String> ean,
                                                              Optional<String> gtin,
                                                              com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Determines is a SkuInventory record exists in a given location, based on SkuRef fields.
        Parameters:
        inventoryLocationId -
        skuContextId -
        externalId -
        skuCode -
        upc -
        ean -
        gtin -
        context -
        Returns:
      • readAll

        Stream<I> readAll​(@Nullable
                          Optional<cz.jirutka.rsql.parser.ast.Node> filters,
                          @Nullable
                          com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Generally used for batch export, this allows a caller to query, filter, and stream paged results.
        Parameters:
        filters -
        context -
        Returns: