Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ public class DataTransferObject
[JsonProperty("merchant_id")]
public Guid MerchantId { get; set; }

/// <summary>
/// Gets or sets the transaction date time.
/// </summary>
/// <value>
/// The transaction date time.
/// </value>
[JsonProperty("transaction_date_time")]
public DateTime TransactionDateTime { get; set; }

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ public class LogonTransactionRequest : DataTransferObject
/// </value>
[JsonProperty("device_identifier")]
public String DeviceIdentifier { get; set; }

/// <summary>
/// Gets or sets the transaction date time.
/// </summary>
/// <value>
/// The transaction date time.
/// </value>
[JsonProperty("transaction_date_time")]
public DateTime TransactionDateTime { get; set; }


/// <summary>
/// Gets or sets the transaction number.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ public class ReconciliationRequest : DataTransferObject
[JsonProperty("transaction_count")]
public Int32 TransactionCount { get; set; }

/// <summary>
/// Gets or sets the transaction date time.
/// </summary>
/// <value>
/// The transaction date time.
/// </value>
[JsonProperty("transaction_date_time")]
public DateTime TransactionDateTime { get; set; }

/// <summary>
/// Gets or sets the transaction value.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ public class SaleTransactionRequest : DataTransferObject

[JsonProperty("product_id")]
public Guid ProductId { get; set; }

[JsonProperty("transaction_date_time")]
public DateTime TransactionDateTime { get; set; }


[JsonProperty("transaction_number")]
public String TransactionNumber { get; set; }

Expand Down
18 changes: 12 additions & 6 deletions TransactionProcessor/Controllers/TransactionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@

namespace TransactionProcessor.Controllers
{
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using BusinessLogic.Requests;
using Common.Examples;
using DataTransferObjects;
using Factories;
using Humanizer;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
Expand All @@ -21,6 +17,11 @@ namespace TransactionProcessor.Controllers
using Shared.General;
using Swashbuckle.AspNetCore.Annotations;
using Swashbuckle.AspNetCore.Filters;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
///
Expand Down Expand Up @@ -81,8 +82,13 @@ public async Task<IActionResult> PerformTransaction([FromBody] SerialisedMessage
{
TypeNameHandling = TypeNameHandling.Auto
});

dto.MerchantId = merchantId;
dto.EstateId = estateId;
if (dto.TransactionDateTime.Kind == DateTimeKind.Utc)
{
dto.TransactionDateTime = new DateTime(dto.TransactionDateTime.Ticks, DateTimeKind.Unspecified);
}

Result<SerialisedMessage> transactionResult = dto switch {
LogonTransactionRequest ltr => await this.ProcessSpecificMessage(ltr, cancellationToken),
Expand Down Expand Up @@ -124,7 +130,7 @@ private async Task<Result<SerialisedMessage>> ProcessSpecificMessage(LogonTransa
CancellationToken cancellationToken)
{
Guid transactionId = Guid.NewGuid();

TransactionCommands.ProcessLogonTransactionCommand command = new(transactionId,
logonTransactionRequest.EstateId,
logonTransactionRequest.MerchantId,
Expand Down
Loading