QueryStockLedgerEventHandler

public class QueryStockLedgerEventHandler

Class responsible for handling “Query Stock Ledger” events. The service will extract the necessary data from the MotechEvent and pass them to the QueryStockLedgerActionService service that will query the CommCare stock transaction API and then send a motech event for every parsed stock transaction.

Constructors

QueryStockLedgerEventHandler

public QueryStockLedgerEventHandler(QueryStockLedgerActionService queryStockLedgerActionService)

Methods

handleEvent

public void handleEvent(MotechEvent event)

Handles the EventSubjects.QUERY_STOCK_LEDGER events. This will result in fetching stock transactions from the CommCareHQ server(based on the event parameters) and then sending motech event for every parsed stock transaction.

Parameters:
  • event – the event to be handled