getUserTransactionLogs method
Returns TransactionLogList
of authenticated m4e user.
Throws M4eAuthException if no m4e user is authenticated
Throws M4eCacheException if no TransactionLog
is returned from cache on no-internet connectivity
Throws M4eServerException 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<M4eTransactionLogList> getUserTransactionLogs(UniqueId userId) async {
if ((await _connectionChecker.hasConnection) ?? false) {
try {
final _transactionLogs =
await _transactionApi.getUserTransactionLogs(userId);
return _transactionLogs;
} catch (e) {
rethrow;
}
}
throw M4eExceptionMessages.kNoInternetConnectionException;
}