Class DefaultInventoryTransactionService<T extends InventoryTransaction>
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<T>
-
- com.broadleafcommerce.inventory.service.DefaultInventoryTransactionService<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<T>
,InventoryTransactionService<T>
public class DefaultInventoryTransactionService<T extends InventoryTransaction> extends com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<T> implements InventoryTransactionService<T>
Service to save / retrieveInventoryTransaction
records.- Author:
- Kelly Tisdell (ktisdell)
-
-
Constructor Summary
Constructors Constructor Description DefaultInventoryTransactionService(InventoryTransactionRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected InventoryTransactionRepository<com.broadleafcommerce.data.tracking.core.Trackable>
getRepository()
Inventory Repository (or DAO).org.springframework.data.domain.Page<T>
readByBatchId(String batchId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Reads a paginated list ofInventoryTransaction
records based on batchId.org.springframework.data.domain.Page<T>
readByDateCreatedBeforeAndTransactionTypeIn(Instant maxCreatedDate, Set<String> transactionTypes, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Reads a page of inventory transactions created before a certain date and of certain transaction types.List<T>
readByReferenceNumberAndTransactionTypes(String referenceNumber, Set<String> transactionTypes, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Returns a list ofInventoryTransaction
records for 1 or more transaction type with the same referenceNumber.List<T>
readByReferenceNumbersAndTransactionTypes(List<String> referenceNumbers, Set<String> transactionTypes, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Returns a list ofInventoryTransaction
records for 1 or more transaction type with for the given reference numbers.org.springframework.data.domain.Page<T>
readBySkuInventoryId(String skuInventoryId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
ReadsInventoryTransaction
records bySkuInventory#getContextId()
.org.springframework.data.domain.Page<T>
readBySkuInventoryIdAndTransactionType(String skuInventoryId, String transactionType, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
List<T>
readByTransactionTypeAndReferenceNumber(String transactionType, String referenceNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
ReadsInventoryTransaction
records byInventoryTransactionType
and a referenceNumber.List<T>
readByTransactionTypeAndReferenceNumberAndDateProcessedIsNull(String transactionType, String referenceNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
ReadsInventoryTransaction
records byInventoryTransactionType
and a referenceNumber where the processed date is null.List<T>
readReservationTransactionsBySkuInventoryIdAndReferenceNumber(String skuInventoryId, String referenceNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Returns a list ofInventoryTransaction
records that have 1 or more transaction types for the sameSkuInventory.getId()
and reference number.-
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
-
-
-
-
Constructor Detail
-
DefaultInventoryTransactionService
public DefaultInventoryTransactionService(InventoryTransactionRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.CrudEntityHelper helper)
- Parameters:
repository
-helper
-
-
-
Method Detail
-
readBySkuInventoryId
public org.springframework.data.domain.Page<T> readBySkuInventoryId(String skuInventoryId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:InventoryTransactionService
ReadsInventoryTransaction
records bySkuInventory#getContextId()
.- Specified by:
readBySkuInventoryId
in interfaceInventoryTransactionService<T extends InventoryTransaction>
- Returns:
-
readBySkuInventoryIdAndTransactionType
public org.springframework.data.domain.Page<T> readBySkuInventoryIdAndTransactionType(String skuInventoryId, String transactionType, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:InventoryTransactionService
- Specified by:
readBySkuInventoryIdAndTransactionType
in interfaceInventoryTransactionService<T extends InventoryTransaction>
- Returns:
- See Also:
DefaultInventoryTransactionType
-
readByTransactionTypeAndReferenceNumber
public List<T> readByTransactionTypeAndReferenceNumber(@NonNull String transactionType, @NonNull String referenceNumber, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:InventoryTransactionService
ReadsInventoryTransaction
records byInventoryTransactionType
and a referenceNumber. The referenceNumber could be anything, but typically a unique identifier across a tenant (e.g. Fulfillment Group Item ID, Purchase Order Item ID, etc.)- Specified by:
readByTransactionTypeAndReferenceNumber
in interfaceInventoryTransactionService<T extends InventoryTransaction>
- Returns:
-
readByTransactionTypeAndReferenceNumberAndDateProcessedIsNull
public List<T> readByTransactionTypeAndReferenceNumberAndDateProcessedIsNull(@NonNull String transactionType, @NonNull String referenceNumber, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:InventoryTransactionService
ReadsInventoryTransaction
records byInventoryTransactionType
and a referenceNumber where the processed date is null. The referenceNumber could be anything, but typically a sales order number, a PO number, or another document number. This allows you to search for records that have not been processed yet.- Specified by:
readByTransactionTypeAndReferenceNumberAndDateProcessedIsNull
in interfaceInventoryTransactionService<T extends InventoryTransaction>
- Returns:
-
readReservationTransactionsBySkuInventoryIdAndReferenceNumber
public List<T> readReservationTransactionsBySkuInventoryIdAndReferenceNumber(String skuInventoryId, String referenceNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:InventoryTransactionService
Returns a list ofInventoryTransaction
records that have 1 or more transaction types for the sameSkuInventory.getId()
and reference number.- Specified by:
readReservationTransactionsBySkuInventoryIdAndReferenceNumber
in interfaceInventoryTransactionService<T extends InventoryTransaction>
- Returns:
-
readByReferenceNumberAndTransactionTypes
public List<T> readByReferenceNumberAndTransactionTypes(@NonNull String referenceNumber, @NonNull Set<String> transactionTypes, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:InventoryTransactionService
Returns a list ofInventoryTransaction
records for 1 or more transaction type with the same referenceNumber.- Specified by:
readByReferenceNumberAndTransactionTypes
in interfaceInventoryTransactionService<T extends InventoryTransaction>
- Returns:
-
readByReferenceNumbersAndTransactionTypes
public List<T> readByReferenceNumbersAndTransactionTypes(@NonNull List<String> referenceNumbers, @NonNull Set<String> transactionTypes, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:InventoryTransactionService
Returns a list ofInventoryTransaction
records for 1 or more transaction type with for the given reference numbers.- Specified by:
readByReferenceNumbersAndTransactionTypes
in interfaceInventoryTransactionService<T extends InventoryTransaction>
- Parameters:
referenceNumbers
- the reference numbers to search fortransactionTypes
- the transaction types to search forcontextInfo
- context information around sandbox and multitenant state- Returns:
- a list of
InventoryTransaction
records that have 1 or more transaction types for the given reference numbers
-
readByBatchId
public org.springframework.data.domain.Page<T> readByBatchId(@NonNull String batchId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:InventoryTransactionService
Reads a paginated list ofInventoryTransaction
records based on batchId.- Specified by:
readByBatchId
in interfaceInventoryTransactionService<T extends InventoryTransaction>
- Returns:
-
readByDateCreatedBeforeAndTransactionTypeIn
public org.springframework.data.domain.Page<T> readByDateCreatedBeforeAndTransactionTypeIn(Instant maxCreatedDate, Set<String> transactionTypes, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:InventoryTransactionService
Reads a page of inventory transactions created before a certain date and of certain transaction types.- Specified by:
readByDateCreatedBeforeAndTransactionTypeIn
in interfaceInventoryTransactionService<T extends InventoryTransaction>
-
getRepository
@NonNull protected InventoryTransactionRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
Inventory Repository (or DAO).- Overrides:
getRepository
in classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<T extends InventoryTransaction>
-
-