/// <summary> /// Get ledger transactions /// </summary> /// <param name="request"></param> /// <returns></returns> public GetLedgerTransactionsResponse GetLedgerTransactions(GetLedgerTransactionsRequest request) { _log.Info($"Entry {GetType().FullName}.{MethodBase.GetCurrentMethod().Name}"); try { var response = _queryFacade.GetLedgerTransactions(request.OrganizationId, request.CargoId, request.Skip, request.Take); if (response == null) { return(new GetLedgerTransactionsResponse(null, ServiceStatus.ServiceError, "Unable to lookup Organization Balance")); } return (new GetLedgerTransactionsResponse(Mapper.Map <ICollection <LedgerTransactionDTO> >(response), ServiceStatus.Success, string.Empty)); } catch (Exception ex) { _log.Error(request, ex); return(new GetLedgerTransactionsResponse(null, ServiceStatus.ServiceError, ex.Message)); } finally { _log.Info($"Exit {GetType().FullName}.{MethodBase.GetCurrentMethod().Name}"); } }
/// <summary> /// Get ledger transactions for an organization and cargo type /// </summary> /// <param name="request"></param> /// <returns></returns> public GetLedgerTransactionsResponse GetLedgerTransactions(GetLedgerTransactionsRequest request) { try { Guard.IsNotNull(request); var response = _transactionService .GetLedgerTransactions(Mapper .Map <TransactionService.Contracts.Models.Service.Transaction.GetLedgerTransactionsRequest>( request)); if (response.ServiceStatus != TransactionService.Contracts.Models.Service.ServiceStatus.Success) { return(new GetLedgerTransactionsResponse(null, ServiceStatus.ServiceError, response.ErrorMessage)); } return(Mapper.Map <GetLedgerTransactionsResponse>(response)); } catch (Exception ex) { _log.Error(ex.Message); return(new GetLedgerTransactionsResponse(null, ServiceStatus.ServiceError, ex.Message)); } }