From b3d8e14e0d5c4fee5fdcf4fd094e08e1a73085a5 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Tue, 5 Oct 2021 18:10:27 +0100 Subject: [PATCH 1/2] Send file date time as transaction datetime --- FIleProcessor.Models/FileDetails.cs | 68 ++++++++++--------- .../RequestHandlers/FileRequestHandler.cs | 5 +- FileProcessor.FileAggregate/FileAggregate.cs | 1 + 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/FIleProcessor.Models/FileDetails.cs b/FIleProcessor.Models/FileDetails.cs index e638cf4..8751e9f 100644 --- a/FIleProcessor.Models/FileDetails.cs +++ b/FIleProcessor.Models/FileDetails.cs @@ -1,54 +1,54 @@ -using System; - -namespace FIleProcessor.Models +namespace FIleProcessor.Models { + using System; using System.Collections.Generic; - using System.Diagnostics.CodeAnalysis; /// /// /// public class FileDetails { + #region Properties + /// - /// Gets or sets the file identifier. + /// Gets or sets the estate identifier. /// /// - /// The file identifier. + /// The estate identifier. /// - public Guid FileId { get; set; } + public Guid EstateId { get; set; } /// - /// Gets or sets a value indicating whether [processing completed]. + /// Gets or sets the file identifier. /// /// - /// true if [processing completed]; otherwise, false. + /// The file identifier. /// - public Boolean ProcessingCompleted { get; set; } + public Guid FileId { get; set; } /// - /// Gets or sets the estate identifier. + /// Gets or sets the file import log identifier. /// /// - /// The estate identifier. + /// The file import log identifier. /// - public Guid EstateId { get; set; } + public Guid FileImportLogId { get; set; } /// - /// Gets or sets the user identifier. + /// Gets or sets the file lines. /// /// - /// The user identifier. + /// The file lines. /// - public Guid UserId { get; set; } + public List FileLines { get; set; } /// - /// Gets or sets the merchant identifier. + /// Gets or sets the file location. /// /// - /// The merchant identifier. + /// The file location. /// - public Guid MerchantId { get; set; } + public String FileLocation { get; set; } /// /// Gets or sets the file profile identifier. @@ -58,36 +58,40 @@ public class FileDetails /// public Guid FileProfileId { get; set; } + public DateTime FileReceivedDateTime { get; set; } + /// - /// Gets or sets the file import log identifier. + /// Gets or sets the merchant identifier. /// /// - /// The file import log identifier. + /// The merchant identifier. /// - public Guid FileImportLogId { get; set; } + public Guid MerchantId { get; set; } /// - /// Gets or sets the file location. + /// Gets or sets a value indicating whether [processing completed]. /// /// - /// The file location. + /// true if [processing completed]; otherwise, false. /// - public String FileLocation { get; set; } + public Boolean ProcessingCompleted { get; set; } /// - /// Gets or sets the file lines. + /// Gets or sets the processing summary. /// /// - /// The file lines. + /// The processing summary. /// - public List FileLines { get; set; } + public ProcessingSummary ProcessingSummary { get; set; } /// - /// Gets or sets the processing summary. + /// Gets or sets the user identifier. /// /// - /// The processing summary. + /// The user identifier. /// - public ProcessingSummary ProcessingSummary { get; set; } + public Guid UserId { get; set; } + + #endregion } -} +} \ No newline at end of file diff --git a/FileProcessor.BusinessLogic/RequestHandlers/FileRequestHandler.cs b/FileProcessor.BusinessLogic/RequestHandlers/FileRequestHandler.cs index a41444d..7a4910e 100644 --- a/FileProcessor.BusinessLogic/RequestHandlers/FileRequestHandler.cs +++ b/FileProcessor.BusinessLogic/RequestHandlers/FileRequestHandler.cs @@ -430,13 +430,14 @@ public async Task Handle(ProcessTransactionForFileLineRequest request, { throw new NotFoundException($"No variable value product found on the merchant contract for operator Id {fileProfile.OperatorName} and Merchant Id {merchant.MerchantId}"); } - + // Build a transaction request message SaleTransactionRequest saleTransactionRequest = new SaleTransactionRequest { + EstateId = fileDetails.EstateId, MerchantId = fileDetails.MerchantId, - TransactionDateTime = DateTime.Now, + TransactionDateTime = fileDetails.FileReceivedDateTime, TransactionNumber = FileRequestHandler.TransactionNumber.ToString(), TransactionType = "Sale", ContractId = contract.ContractId, diff --git a/FileProcessor.FileAggregate/FileAggregate.cs b/FileProcessor.FileAggregate/FileAggregate.cs index eab43e9..ec17d2d 100644 --- a/FileProcessor.FileAggregate/FileAggregate.cs +++ b/FileProcessor.FileAggregate/FileAggregate.cs @@ -147,6 +147,7 @@ public FileDetails GetFile() { return new FileDetails { + ReceivedDateTime = this.FileReceivedDateTime, ProcessingCompleted = this.IsCompleted, FileLines = this.FileLines, EstateId = this.EstateId, From 3c3b3d8ecbbef25d81aa902dfc780bedd02ac54d Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Tue, 5 Oct 2021 18:24:16 +0100 Subject: [PATCH 2/2] ... --- FileProcessor.FileAggregate/FileAggregate.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FileProcessor.FileAggregate/FileAggregate.cs b/FileProcessor.FileAggregate/FileAggregate.cs index ec17d2d..2417944 100644 --- a/FileProcessor.FileAggregate/FileAggregate.cs +++ b/FileProcessor.FileAggregate/FileAggregate.cs @@ -147,7 +147,7 @@ public FileDetails GetFile() { return new FileDetails { - ReceivedDateTime = this.FileReceivedDateTime, + FileReceivedDateTime = this.FileReceivedDateTime, ProcessingCompleted = this.IsCompleted, FileLines = this.FileLines, EstateId = this.EstateId,