getUserTransactionLogs method

Future<TransactionLogList> getUserTransactionLogs (UniqueId userId)

Returns TransactionLogList of authenticated m4e user.

Throws AuthException if no m4e user is authenticated

Throws CacheException if no TransactionLog is returned from cache on no-internet connectivity

Throws ServerException if request fails. This could be as a result of a Request timeout, Socket Exception or General server error

Implementation

// TODO: Pass-in token from application when issueing a request
Future<TransactionLogList> getUserTransactionLogs(UniqueId userId) async {
  if ((await _connectionChecker.hasConnection) ?? false) {
    try {
      final _transactionLogs =
          await _transactionApi.getUserTransactionLogs(userId);

      return _transactionLogs;
    } catch (e) {
      rethrow;
    }
  }

  throw ExceptionMessages.kNoInternetConnectionException;
}