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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionProcessor.BusinessLogic.OperatorInterfaces
{
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

/// <summary>
Expand All @@ -11,6 +12,14 @@ public class OperatorResponse
{
#region Properties

/// <summary>
/// Gets or sets the additional transaction response metadata.
/// </summary>
/// <value>
/// The additional transaction response metadata.
/// </value>
public Dictionary<String, String> AdditionalTransactionResponseMetadata { get; set; }

/// <summary>
/// Gets or sets the authorisation code.
/// </summary>
Expand All @@ -19,6 +28,14 @@ public class OperatorResponse
/// </value>
public String AuthorisationCode { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this instance is successful.
/// </summary>
/// <value>
/// <c>true</c> if this instance is successful; otherwise, <c>false</c>.
/// </value>
public Boolean IsSuccessful { get; set; }

/// <summary>
/// Gets or sets the response code.
/// </summary>
Expand All @@ -36,12 +53,12 @@ public class OperatorResponse
public String ResponseMessage { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this instance is successful.
/// Gets or sets the transaction identifier.
/// </summary>
/// <value>
/// <c>true</c> if this instance is successful; otherwise, <c>false</c>.
/// The transaction identifier.
/// </value>
public Boolean IsSuccessful { get; set; }
public String TransactionId { get; set; }

#endregion
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
namespace TransactionProcessor.BusinessLogic.Services
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Models;
using OperatorInterfaces;
using TransactionAggregate;

/// <summary>
///
/// </summary>
public interface ITransactionAggregateManager
{
#region Methods

/// <summary>
/// Authorises the transaction.
/// </summary>
/// <param name="estateId">The estate identifier.</param>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="operatorResponse">The operator response.</param>
/// <param name="transactionResponseCode">The transaction response code.</param>
/// <param name="responseMessage">The response message.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
Task AuthoriseTransaction(Guid estateId,
Guid transactionId,
OperatorResponse operatorResponse,
TransactionResponseCode transactionResponseCode,
String responseMessage,
CancellationToken cancellationToken);

/// <summary>
/// Authorises the transaction locally.
/// </summary>
/// <param name="estateId">The estate identifier.</param>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="authorisationCode">The authorisation code.</param>
/// <param name="validationResult">The validation result.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
Task AuthoriseTransactionLocally(Guid estateId,
Guid transactionId,
String authorisationCode,
(String responseMessage, TransactionResponseCode responseCode) validationResult,
CancellationToken cancellationToken);

/// <summary>
/// Completes the transaction.
/// </summary>
/// <param name="estateId">The estate identifier.</param>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
Task CompleteTransaction(Guid estateId,
Guid transactionId,
CancellationToken cancellationToken);

/// <summary>
/// Declines the transaction.
/// </summary>
/// <param name="estateId">The estate identifier.</param>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="operatorResponse">The operator response.</param>
/// <param name="transactionResponseCode">The transaction response code.</param>
/// <param name="responseMessage">The response message.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
Task DeclineTransaction(Guid estateId,
Guid transactionId,
OperatorResponse operatorResponse,
TransactionResponseCode transactionResponseCode,
String responseMessage,
CancellationToken cancellationToken);

/// <summary>
/// Declines the transaction locally.
/// </summary>
/// <param name="estateId">The estate identifier.</param>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="validationResult">The validation result.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
Task DeclineTransactionLocally(Guid estateId,
Guid transactionId,
(String responseMessage, TransactionResponseCode responseCode) validationResult,
CancellationToken cancellationToken);

/// <summary>
/// Gets the aggregate.
/// </summary>
/// <param name="estateId">The estate identifier.</param>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
Task<TransactionAggregate> GetAggregate(Guid estateId,
Guid transactionId,
CancellationToken cancellationToken);

/// <summary>
/// Records the additional request data.
/// </summary>
/// <param name="estateId">The estate identifier.</param>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="additionalTransactionRequestMetadata">The additional transaction request metadata.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
Task RecordAdditionalRequestData(Guid estateId,
Guid transactionId,
Dictionary<String, String> additionalTransactionRequestMetadata,
CancellationToken cancellationToken);

/// <summary>
/// Records the additional response data.
/// </summary>
/// <param name="estateId">The estate identifier.</param>
/// <param name="transactionId">The transaction identifier.</param>
/// <param name="additionalTransactionResponseMetadata">The additional transaction response metadata.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
Task RecordAdditionalResponseData(Guid estateId,
Guid transactionId,
Dictionary<String, String> additionalTransactionResponseMetadata,
CancellationToken cancellationToken);

/// <summary>
/// Starts the transaction.
/// </summary>
/// <param name="transactionId">The transaction identifier.</param>
/// <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="estateId">The estate identifier.</param>
/// <param name="merchantId">The merchant identifier.</param>
/// <param name="deviceIdentifier">The device identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
Task StartTransaction(Guid transactionId,
DateTime transactionDateTime,
String transactionNumber,
TransactionType transactionType,
Guid estateId,
Guid merchantId,
String deviceIdentifier,
CancellationToken cancellationToken);

#endregion
}
}
Loading