Class TxnHistoryQuery

java.lang.Object
com.avoka.tm.query.TxnHistoryQuery

public class TxnHistoryQuery extends Object
Provides a Transaction History Query class.

Examples

Please find the transaction history query examples below.

Tracing Code Query

The query below returns a single transaction history record for the given tracking code.

 import com.avoka.tm.query.*

 Map<String, Object> row = new TxnHistoryQuery()
      .setTrackingCode("L6THD27")
      .firstRow() 

Completed Transactions CSV Export

The query below returns a CSV export of all the transaction history records for the given form code, form version number and completed status between the given date period.

 import com.avoka.tm.query.*
 import org.joda.time.LocalDate

 Date startDate = new LocalDate().minusMonths(1).toDate()
 Date endDate = new LocalDate().minusDays(1).toDate()

 String csvExport = new TxnHistoryQuery()
      .setFormCode("Home Loan")
      .setVersionNumber("2.0")
      .setStartDate(startDate)
      .setFetchLimit(10000)
      .listCsv() 
Since:
17.10.0
  • Constructor Details

  • Method Details

    • setPortalName

      public TxnHistoryQuery setPortalName(String portalName)
      Parameters:
      portalName - the portalName to set
      Returns:
      the transaction history query
    • setClientCode

      public TxnHistoryQuery setClientCode(String clientCode)
      Parameters:
      clientCode - the clientCode to set
      Returns:
      the transaction history query
    • setFormCode

      public TxnHistoryQuery setFormCode(String formCode)
      Parameters:
      formCode - the formCode to set
      Returns:
      the transaction history query
    • setVersionNumber

      public TxnHistoryQuery setVersionNumber(String versionNumber)
      Parameters:
      versionNumber - the versionNumber to set
      Returns:
      the transaction history query
    • setJobName

      public TxnHistoryQuery setJobName(String jobName)
      Parameters:
      jobName - the jobName to set
      Returns:
      the transaction history query
    • setFormStatus

      public TxnHistoryQuery setFormStatus(String formStatus)
      Parameters:
      formStatus - the formStatus to set
      Returns:
      the transaction history query
    • setAbandonFormStatus

      public TxnHistoryQuery setAbandonFormStatus(String abandonFormStatus)
      Parameters:
      abandonFormStatus - the abandonFormStatus to set
      Returns:
      the transaction history query
    • setFormAbandonType

      public TxnHistoryQuery setFormAbandonType(String formAbandonType)
      Parameters:
      formAbandonType - the formAbandonType to set
      Returns:
      the transaction history query
    • setMilestone

      public TxnHistoryQuery setMilestone(String milestone)
      Parameters:
      milestone - the transaction milestone to set
      Returns:
      the transaction history query
      Since:
      17.10.0
    • setTxnRefNumber

      public TxnHistoryQuery setTxnRefNumber(String transRefNumber)
      Parameters:
      transRefNumber - the txn reference number to set
      Returns:
      the transaction history query
      Since:
      18.11.0
    • setTrackingCode

      public TxnHistoryQuery setTrackingCode(String trackingCode)
      Parameters:
      trackingCode - the trackingCode (tracking number) to set
      Returns:
      the transaction history query
    • setStartDate

      public TxnHistoryQuery setStartDate(Date startDate)
      Parameters:
      startDate - the startDate to set (defaults to time completed)
      Returns:
      the transaction history query
    • setEndDate

      public TxnHistoryQuery setEndDate(Date endDate)
      Parameters:
      endDate - the endDate to set (defaults to time completed)
      Returns:
      the transaction history query
    • setTime

      public TxnHistoryQuery setTime(TxnHistoryQuery.Time time)
      Parameters:
      time - the time to set (defaults to time completed)
      Returns:
      the transaction history query
    • setDeviceType

      public TxnHistoryQuery setDeviceType(String deviceType)
      Parameters:
      deviceType - the deviceType to set
      Returns:
      the transaction history query
    • setFetchLimit

      public TxnHistoryQuery setFetchLimit(int fetchLimit)
      Set the query fetch limit to limit the maximum number of records returned. The default query fetch limit is 1,000 records. The maximum fetch limit value is 100,000 records.
      Parameters:
      fetchLimit - the query fetch limit
      Returns:
      the transaction history query
    • addOrderByAsc

      public TxnHistoryQuery addOrderByAsc(String orderProperty)
      Add the sort order by ascending to the query.
      Parameters:
      orderProperty - the property to sort by (required)
      Returns:
      the transaction query
    • addOrderByDesc

      public TxnHistoryQuery addOrderByDesc(String orderProperty)
      Add the sort order by descending to the query.
      Parameters:
      orderProperty - the property to sort by (required)
      Returns:
      the transaction query
    • count

      public int count()
      Execute a select count query and return the total number of records selected by the query.
      Returns:
      the total number of records selected by the query
    • listRows

      public List<Map<String,Object>> listRows()
      Execute the transaction history query and return a list of row map objects.
      Returns:
      execute the transaction history query and return a list of row map objects
    • listJson

      public String listJson()
      Execute the query and return an transaction history rows JSON array list.
      Returns:
      execute the query and return an transaction history rows JSON array list
    • listCsv

      public String listCsv()
      Execute the query and return an transaction history rows in CSV (Comma Separated Value) format list.
      Returns:
      execute the query and return an transaction history rows in CSV (Comma Separated Value) format list
    • firstRow

      public Map<String,Object> firstRow()
      Execute the query and return the first transaction history row for the query.
      Returns:
      execute the query and return the first transaction history row for the query.