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 @@ -14,14 +14,14 @@ public class CommandTests
[Fact]
public void ProcessLogonTransactionCommand_CanBeCreated_IsCreated()
{
ProcessLogonTransactionCommand processLogonTransactionCommand = ProcessLogonTransactionCommand.Create(TestData.TransactionId, TestData.EstateId, TestData.MerchantId, TestData.IMEINumber,TestData.TransactionType, TestData.TransactionDateTime,
ProcessLogonTransactionCommand processLogonTransactionCommand = ProcessLogonTransactionCommand.Create(TestData.TransactionId, TestData.EstateId, TestData.MerchantId, TestData.DeviceIdentifier,TestData.TransactionType, TestData.TransactionDateTime,
TestData.TransactionNumber);

processLogonTransactionCommand.ShouldNotBeNull();
processLogonTransactionCommand.CommandId.ShouldNotBe(Guid.Empty);
processLogonTransactionCommand.EstateId.ShouldBe(TestData.EstateId);
processLogonTransactionCommand.MerchantId.ShouldBe(TestData.MerchantId);
processLogonTransactionCommand.IMEINumber.ShouldBe(TestData.IMEINumber);
processLogonTransactionCommand.DeviceIdentifier.ShouldBe(TestData.DeviceIdentifier);
processLogonTransactionCommand.TransactionType.ShouldBe(TestData.TransactionType);
processLogonTransactionCommand.TransactionDateTime.ShouldBe(TestData.TransactionDateTime);
processLogonTransactionCommand.TransactionNumber.ShouldBe(TestData.TransactionNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task TransactionDomainService_ProcessLogonTransaction_TransactionIs
TestData.MerchantId,
TestData.TransactionDateTime,
TestData.TransactionNumber,
TestData.IMEINumber,
TestData.DeviceIdentifier,
CancellationToken.None);

response.ShouldNotBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private async Task HandleCommand(ProcessLogonTransactionCommand command,
CancellationToken cancellationToken)
{
ProcessLogonTransactionResponse logonResponse = await this.TransactionDomainService.ProcessLogonTransaction(command.TransactionId, command.EstateId,
command.MerchantId, command.TransactionDateTime, command.TransactionNumber, command.IMEINumber, cancellationToken);
command.MerchantId, command.TransactionDateTime, command.TransactionNumber, command.DeviceIdentifier, cancellationToken);

command.Response = logonResponse;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@ public class ProcessLogonTransactionCommand : Command<ProcessLogonTransactionRes
/// <summary>
/// Initializes a new instance of the <see cref="ProcessLogonTransactionCommand" /> class.
/// </summary>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="estateId">The estate identifier.</param>
/// <param name="merchantId">The merchant identifier.</param>
/// <param name="imeiNumber">The imei number.</param>
/// <param name="deviceIdentifier">The device identifier.</param>
/// <param name="transactionType">Type of the transaction.</param>
/// <param name="transactionDateTime">The transaction date time.</param>
/// <param name="transactionNumber">The transaction number.</param>
/// <param name="commandId">The command identifier.</param>
private ProcessLogonTransactionCommand(Guid transactionId,
Guid estateId,
Guid merchantId,
String imeiNumber,
String deviceIdentifier,
String transactionType,
DateTime transactionDateTime,
String transactionNumber,
Guid commandId) : base(commandId)
{
this.TransactionId = transactionId;
this.EstateId = estateId;
this.IMEINumber = imeiNumber;
this.DeviceIdentifier = deviceIdentifier;
this.MerchantId = merchantId;
this.TransactionDateTime = transactionDateTime;
this.TransactionNumber = transactionNumber;
Expand All @@ -55,12 +56,12 @@ private ProcessLogonTransactionCommand(Guid transactionId,
public Guid EstateId { get; }

/// <summary>
/// Gets the imei number.
/// Gets the device identifier.
/// </summary>
/// <value>
/// The imei number.
/// The device identifier.
/// </value>
public String IMEINumber { get; }
public String DeviceIdentifier { get; }

/// <summary>
/// Gets the merchant identifier.
Expand Down Expand Up @@ -101,22 +102,23 @@ private ProcessLogonTransactionCommand(Guid transactionId,
/// <summary>
/// Creates the specified estate identifier.
/// </summary>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="estateId">The estate identifier.</param>
/// <param name="merchantId">The merchant identifier.</param>
/// <param name="imeiNumber">The imei number.</param>
/// <param name="deviceIdentifier">The device identifier.</param>
/// <param name="transactionType">Type of the transaction.</param>
/// <param name="transactionDateTime">The transaction date time.</param>
/// <param name="transactionNumber">The transaction number.</param>
/// <returns></returns>
public static ProcessLogonTransactionCommand Create(Guid transactionId,
Guid estateId,
Guid merchantId,
String imeiNumber,
String deviceIdentifier,
String transactionType,
DateTime transactionDateTime,
String transactionNumber)
{
return new ProcessLogonTransactionCommand(transactionId, estateId, merchantId, imeiNumber, transactionType, transactionDateTime, transactionNumber, Guid.NewGuid());
return new ProcessLogonTransactionCommand(transactionId, estateId, merchantId, deviceIdentifier, transactionType, transactionDateTime, transactionNumber, Guid.NewGuid());
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ public interface ITransactionDomainService
/// <summary>
/// Processes the logon transaction.
/// </summary>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="estateId">The estate identifier.</param>
/// <param name="merchantId">The merchant identifier.</param>
/// <param name="transactionDateTime">The transaction date time.</param>
/// <param name="transactionNumber">The transaction number.</param>
/// <param name="deviceIdentifier">The device identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
Task<ProcessLogonTransactionResponse> ProcessLogonTransaction(Guid transactionId, Guid estateId, Guid merchantId, DateTime transactionDateTime,
String transactionNumber, String imeiNumber, CancellationToken cancellationToken);
String transactionNumber, String deviceIdentifier, CancellationToken cancellationToken);

#endregion
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ public TransactionDomainService(IAggregateRepositoryManager aggregateRepositoryM
/// <summary>
/// Processes the logon transaction.
/// </summary>
/// <param name="transactionId"></param>
/// <param name="estateId"></param>
/// <param name="merchantId"></param>
/// <param name="transactionDateTime"></param>
/// <param name="transactionNumber"></param>
/// <param name="imeiNumber"></param>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="estateId">The estate identifier.</param>
/// <param name="merchantId">The merchant identifier.</param>
/// <param name="transactionDateTime">The transaction date time.</param>
/// <param name="transactionNumber">The transaction number.</param>
/// <param name="deviceIdentifier">The device identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
public async Task<ProcessLogonTransactionResponse> ProcessLogonTransaction(Guid transactionId, Guid estateId, Guid merchantId, DateTime transactionDateTime,
String transactionNumber, String imeiNumber, CancellationToken cancellationToken)
String transactionNumber, String deviceIdentifier, CancellationToken cancellationToken)
{
IAggregateRepository<TransactionAggregate> transactionAggregateRepository = this.AggregateRepositoryManager.GetAggregateRepository<TransactionAggregate>(estateId);

TransactionAggregate transactionAggregate = await transactionAggregateRepository.GetLatestVersion(transactionId, cancellationToken);
transactionAggregate.StartTransaction(transactionDateTime, transactionNumber, "Logon", estateId, merchantId, imeiNumber);
transactionAggregate.StartTransaction(transactionDateTime, transactionNumber, "Logon", estateId, merchantId, deviceIdentifier);
await transactionAggregateRepository.SaveChanges(transactionAggregate, cancellationToken);

transactionAggregate = await transactionAggregateRepository.GetLatestVersion(transactionId, cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public class LogonTransactionRequest : DataTransferObject
#region Properties

/// <summary>
/// Gets or sets the imei number.
/// Gets or sets the device identifier.
/// </summary>
/// <value>
/// The imei number.
/// The device identifier.
/// </value>
public String IMEINumber { get; set; }
public String DeviceIdentifier { get; set; }

/// <summary>
/// Gets or sets the transaction date time.
Expand Down
4 changes: 2 additions & 2 deletions TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ public async Task WhenIPerformTheFollowingTransactions(Table table)
}
}

private async Task<SerialisedMessage> PerformLogonTransaction(Guid estateId, Guid merchantId, DateTime transactionDateTime, String transactionType, String transactionNumber, String imeiNumber, CancellationToken cancellationToken)
private async Task<SerialisedMessage> PerformLogonTransaction(Guid estateId, Guid merchantId, DateTime transactionDateTime, String transactionType, String transactionNumber, String deviceIdentifier, CancellationToken cancellationToken)
{
LogonTransactionRequest logonTransactionRequest = new LogonTransactionRequest
{
MerchantId = merchantId,
EstateId = estateId,
TransactionDateTime = transactionDateTime,
TransactionNumber = transactionNumber,
IMEINumber = imeiNumber,
DeviceIdentifier = deviceIdentifier,
TransactionType = transactionType
};

Expand Down
10 changes: 5 additions & 5 deletions TransactionProcessor.Testing/TestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public class TestData
public static Guid TransactionId = Guid.Parse("AE89B2F6-307B-46F4-A8E7-CEF27097D766");

public static ProcessLogonTransactionCommand ProcessLogonTransactionCommand = ProcessLogonTransactionCommand.Create( TestData.TransactionId, TestData.EstateId, TestData.MerchantId,
TestData.IMEINumber, TestData.TransactionType,
TestData.DeviceIdentifier, TestData.TransactionType,
TestData.TransactionDateTime,
TestData.TransactionNumber);

public static String IMEINumber = "1234567890";
public static String DeviceIdentifier = "1234567890";

public static String TransactionType = "Logon";

Expand All @@ -51,7 +51,7 @@ public static TransactionAggregate GetStartedTransactionAggregate()
TransactionAggregate transactionAggregate = TransactionAggregate.Create(TestData.TransactionId);

transactionAggregate.StartTransaction(TestData.TransactionDateTime,TestData.TransactionNumber, TestData.TransactionType, TestData.EstateId, TestData.MerchantId,
TestData.IMEINumber);
TestData.DeviceIdentifier);

return transactionAggregate;
}
Expand All @@ -61,7 +61,7 @@ public static TransactionAggregate GetLocallyAuthorisedTransactionAggregate()
TransactionAggregate transactionAggregate = TransactionAggregate.Create(TestData.TransactionId);

transactionAggregate.StartTransaction(TestData.TransactionDateTime, TestData.TransactionNumber, TestData.TransactionType, TestData.EstateId, TestData.MerchantId,
TestData.IMEINumber);
TestData.DeviceIdentifier);

transactionAggregate.AuthoriseTransactionLocally(TestData.AuthorisationCode, TestData.ResponseCode, TestData.ResponseMessage);

Expand All @@ -73,7 +73,7 @@ public static TransactionAggregate GetCompletedTransactionAggregate()
TransactionAggregate transactionAggregate = TransactionAggregate.Create(TestData.TransactionId);

transactionAggregate.StartTransaction(TestData.TransactionDateTime, TestData.TransactionNumber, TestData.TransactionType, TestData.EstateId, TestData.MerchantId,
TestData.IMEINumber);
TestData.DeviceIdentifier);

transactionAggregate.AuthoriseTransactionLocally(TestData.AuthorisationCode, TestData.ResponseCode, TestData.ResponseMessage);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ public TransactionHasStartedEvent()
/// <param name="transactionDateTime">The transaction date time.</param>
/// <param name="transactionNumber">The transaction number.</param>
/// <param name="transactionType">Type of the transaction.</param>
/// <param name="imeiNumber">The imei number.</param>
/// <param name="deviceIdentifier">The device identifier.</param>
public TransactionHasStartedEvent(Guid aggregateId,
Guid eventId,
Guid estateId,
Guid merchantId,
DateTime transactionDateTime,
String transactionNumber,
String transactionType,
String imeiNumber) : base(aggregateId, eventId)
String deviceIdentifier) : base(aggregateId, eventId)
{
this.TransactionId = aggregateId;
this.EstateId = estateId;
this.MerchantId = merchantId;
this.TransactionDateTime = transactionDateTime;
this.TransactionNumber = transactionNumber;
this.TransactionType = transactionType;
this.ImeiNumber = imeiNumber;
this.DeviceIdentifier = deviceIdentifier;
}

#endregion
Expand All @@ -65,13 +65,13 @@ public TransactionHasStartedEvent(Guid aggregateId,
public Guid EstateId { get; private set; }

/// <summary>
/// Gets the imei number.
/// Gets the device identifier.
/// </summary>
/// <value>
/// The imei number.
/// The device identifier.
/// </value>
[JsonProperty]
public String ImeiNumber { get; private set; }
public String DeviceIdentifier { get; private set; }

/// <summary>
/// Gets the merchant identifier.
Expand Down Expand Up @@ -131,17 +131,17 @@ public TransactionHasStartedEvent(Guid aggregateId,
/// <param name="transactionDateTime">The transaction date time.</param>
/// <param name="transactionNumber">The transaction number.</param>
/// <param name="transactionType">Type of the transaction.</param>
/// <param name="imeiNumber">The imei number.</param>
/// <param name="deviceIdentifier">The device identifier.</param>
/// <returns></returns>
public static TransactionHasStartedEvent Create(Guid aggregateId,
Guid estateId,
Guid merchantId,
DateTime transactionDateTime,
String transactionNumber,
String transactionType,
String imeiNumber)
String deviceIdentifier)
{
return new TransactionHasStartedEvent(aggregateId, Guid.NewGuid(), estateId, merchantId, transactionDateTime, transactionNumber, transactionType, imeiNumber);
return new TransactionHasStartedEvent(aggregateId, Guid.NewGuid(), estateId, merchantId, transactionDateTime, transactionNumber, transactionType, deviceIdentifier);
}

#endregion
Expand Down
Loading