diff --git a/EstateReportingAPI.BusinessLogic/ReportingManager.cs b/EstateReportingAPI.BusinessLogic/ReportingManager.cs index e97d4f1..c758ef9 100644 --- a/EstateReportingAPI.BusinessLogic/ReportingManager.cs +++ b/EstateReportingAPI.BusinessLogic/ReportingManager.cs @@ -705,6 +705,7 @@ from s in sJoin.DefaultIfEmpty() Value = t.TransactionAmount, FeeValue = msf != null ? msf.FeeValue : 0m, SettlementId = s != null ? s.SettlementId : Guid.Empty, + TransactionNumber = Int32.Parse(t.TransactionNumber) }; } @@ -737,7 +738,8 @@ private static TransactionDetailReportResponse MapToTransactionDetailResponse(Li Status = q.Status, Value = q.Value, TotalFees = q.FeeValue, - SettlementReference = q.SettlementId.ToString() + SettlementReference = q.SettlementId.ToString(), + TransactionNumber = q.TransactionNumber }).ToList(), Summary = new TransactionDetailSummary { TransactionCount = queryResults.Count(), TotalValue = queryResults.Sum(q => q.Value), TotalFees = queryResults.Sum(q => q.FeeValue) } }; @@ -1466,7 +1468,8 @@ private sealed class TransactionDetailQueryResult { public decimal Value { get; init; } public decimal FeeValue { get; init; } public Guid SettlementId { get; init; } - } + public Int32 TransactionNumber { get; init; } + } private sealed class OperatorTransactionData { public Guid MerchantId { get; init; } diff --git a/EstateReportingAPI.DataTrasferObjects/TransactionDetail.cs b/EstateReportingAPI.DataTrasferObjects/TransactionDetail.cs index f1b039c..089ad76 100644 --- a/EstateReportingAPI.DataTrasferObjects/TransactionDetail.cs +++ b/EstateReportingAPI.DataTrasferObjects/TransactionDetail.cs @@ -37,4 +37,6 @@ public class TransactionDetail public Decimal TotalFees { get; set; } [JsonProperty("settlement_reference")] public String SettlementReference { get; set; } + [JsonProperty("transaction_number")] + public Int32 TransactionNumber { get; set; } } \ No newline at end of file diff --git a/EstateReportingAPI.IntegrationTests/TransactionsEndpointTests.cs b/EstateReportingAPI.IntegrationTests/TransactionsEndpointTests.cs index cda2840..f21a14b 100644 --- a/EstateReportingAPI.IntegrationTests/TransactionsEndpointTests.cs +++ b/EstateReportingAPI.IntegrationTests/TransactionsEndpointTests.cs @@ -393,6 +393,7 @@ public async Task TransactionsEndpoint_TransactionDetailReport_NoFilters_Transac foreach (Transaction transaction in transactions) { var foundTxn = transactionDetailReportResponse.Transactions.SingleOrDefault(t => t.Id == transaction.TransactionId); foundTxn.ShouldNotBeNull(transaction.TransactionId.ToString()); + foundTxn.TransactionNumber.ShouldNotBe(0); } } diff --git a/EstateReportingAPI.Models/TransactionDetail.cs b/EstateReportingAPI.Models/TransactionDetail.cs index 0157b74..ed8328f 100644 --- a/EstateReportingAPI.Models/TransactionDetail.cs +++ b/EstateReportingAPI.Models/TransactionDetail.cs @@ -17,4 +17,5 @@ public class TransactionDetail { public Decimal Value { get; set; } public Decimal TotalFees { get; set; } public String SettlementReference { get; set; } + public Int32 TransactionNumber { get; set; } } \ No newline at end of file diff --git a/EstateReportingAPI/Handlers/TransactionHandler.cs b/EstateReportingAPI/Handlers/TransactionHandler.cs index 2cf693c..7037c6c 100644 --- a/EstateReportingAPI/Handlers/TransactionHandler.cs +++ b/EstateReportingAPI/Handlers/TransactionHandler.cs @@ -103,7 +103,8 @@ TransactionDetailReportResponse SuccessFactory (Models.TransactionDetailReportRe OperatorId = t.OperatorId, MerchantReportingId = t.MerchantReportingId, ProductId = t.ProductId, - ProductReportingId = t.ProductReportingId + ProductReportingId = t.ProductReportingId, + TransactionNumber = t.TransactionNumber }) .ToList()