Class CreateBulkTransactionServiceImpl

java.lang.Object
com.skava.inventory.service.impl.CommonDependencies
com.skava.inventory.service.impl.transaction.CreateBulkTransactionServiceImpl
All Implemented Interfaces:
com.skava.core.EcommService<CreateBulkTransactionRequest,BulkTransactionResponse>, CustomEcommService<CreateBulkTransactionRequest,BulkTransactionResponse>, CreateBulkTransactionService

@Service public class CreateBulkTransactionServiceImpl extends CommonDependencies implements CreateBulkTransactionService
This class implements the CreateBulkTransactionService interface to handle create bulk transaction for multiple bin items. Creates a bulk transaction for multiple bin items. Each bin can have a set of bin items. A bin item is a SKU associated with a particular bin. A transaction helps to manage the quantity of a bin item.

The transaction types are as follows:
  • Type 1 - The ADD transaction enables the user to add the inventory of a bin item.
  • Type 2 - The REMOVE transaction enables the user to remove the inventory of a bin item.
  • Type 3 - The TRANSFER transaction enables the user to transfer the bin items from one bin to another. In the transfer inventory transaction, there is no intermediate state (in-transit). Once a transfer transaction is initiated, the inventory from the source bin would be reduced for the corresponding bin item and increased in the destination bin. The entire process is locked until completion. If there are any exceptions, then the entire process would be reversed and there would be no change in the bin status. However, if the destination bin does not have the relevant bin item, then a new transaction would be initiated to create the bin item first.
  • Type 4 - The RECONCILE transaction enables the user to reconcile the system inventory against the actual physical inventory through periodic stock checks. As a result of the reconciliation, the system inventory would be updated to be in sync with the actual available physical inventory. This transaction always happens at the bin item level.

The response of this request is given through the BulkTransaction model.

Note: A user with the privilege to create a transaction can create a bulk transaction for one or more bin items.
Since:
Aug 31, 2018
Author:
Infosys Equinox
  • Constructor Details

    • CreateBulkTransactionServiceImpl

      public CreateBulkTransactionServiceImpl()
  • Method Details

    • process

      @Audit @Retryable(maxAttempts=10, backoff=@Backoff(delay=3L,maxDelay=10L,multiplier=4.0,random=true)) @Transactional(isolation=SERIALIZABLE) @HystrixCommand(commandKey="inventory-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) @SendEvent(eventType="inventoryservice/transactionbulk/create", identifier="response_bulkTransaction.binItems.binName") public BulkTransactionResponse process(@AuditField(field="CreateBulkTransactionRequest") CreateBulkTransactionRequest request)
      This method is used to create bulk Transaction based on given request. The given request will be audit for reference. Initially it will check collection and bin item is available. if any one of the transaction is to be failed, then the request will be revoked based on the flag 'allOrNone' as true
      Specified by:
      process in interface com.skava.core.EcommService<CreateBulkTransactionRequest,BulkTransactionResponse>
      Parameters:
      request - It contains the attributes required for the creation of Transaction.
      Returns:
      It returns the BulkTransactionResponse.
    • getValidator

      public List<com.skava.core.validation.ValidatorComponent> getValidator(CreateBulkTransactionRequest request)
      Specified by:
      getValidator in interface com.skava.core.EcommService<CreateBulkTransactionRequest,BulkTransactionResponse>