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 @@ -36,7 +36,8 @@ public List<CalculatedFee> CalculateFees(List<TransactionFeeToCalculate> feeList
FeeType = transactionFeeToCalculate.FeeType,
FeeCalculationType = transactionFeeToCalculate.CalculationType,
FeeId = transactionFeeToCalculate.FeeId,
FeeValue = transactionFeeToCalculate.Value
FeeValue = transactionFeeToCalculate.Value,
FeeCalculatedDateTime = DateTime.Now
});
}

Expand All @@ -49,8 +50,9 @@ public List<CalculatedFee> CalculateFees(List<TransactionFeeToCalculate> feeList
FeeType = transactionFeeToCalculate.FeeType,
FeeCalculationType = transactionFeeToCalculate.CalculationType,
FeeId = transactionFeeToCalculate.FeeId,
FeeValue = transactionFeeToCalculate.Value
});
FeeValue = transactionFeeToCalculate.Value,
FeeCalculatedDateTime = DateTime.Now
});
}
}

Expand Down
8 changes: 8 additions & 0 deletions TransactionProcessor.Models/CalculatedFee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public class CalculatedFee
/// </value>
public CalculationType FeeCalculationType { get; set; }

/// <summary>
/// Gets or sets the fee calculated date time.
/// </summary>
/// <value>
/// The fee calculated date time.
/// </value>
public DateTime FeeCalculatedDateTime { get; set; }

/// <summary>
/// Gets or sets the fee identifier.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions TransactionProcessor.Testing/TestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,8 @@ public static TokenResponse TokenResponse()
public static String TransactionFeeDescription = "Commission for Merchant";

public static Decimal TransactionFeeValue = 0.5m;

public static DateTime TransactionFeeCalculateDateTime = new DateTime(2021, 3, 18);
public static Decimal CalculatedFeeValue = 0.5m;

public static Int32 ReconciliationTransactionCount = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ public record MerchantFeeAddedToTransactionEvent : DomainEventRecord.DomainEvent
/// <param name="feeCalculationType">Type of the fee calculation.</param>
/// <param name="feeId">The fee identifier.</param>
/// <param name="feeValue">The fee value.</param>
/// <param name="feeCalculatedDateTime"></param>
public MerchantFeeAddedToTransactionEvent(Guid aggregateId,
Guid estateId,
Guid merchantId,
Decimal calculatedValue,
Int32 feeCalculationType,
Guid feeId,
Decimal feeValue) : base(aggregateId, Guid.NewGuid())
Decimal feeValue,
DateTime feeCalculatedDateTime) : base(aggregateId, Guid.NewGuid())
{
this.TransactionId = aggregateId;
this.EstateId = estateId;
Expand All @@ -36,6 +38,7 @@ public MerchantFeeAddedToTransactionEvent(Guid aggregateId,
this.FeeCalculationType = feeCalculationType;
this.FeeId = feeId;
this.FeeValue = feeValue;
this.FeeCalculatedDateTime = feeCalculatedDateTime;
}

#endregion
Expand All @@ -50,6 +53,14 @@ public MerchantFeeAddedToTransactionEvent(Guid aggregateId,
/// </value>
public Decimal CalculatedValue { get; init; }

/// <summary>
/// Gets or sets the fee calculated date time.
/// </summary>
/// <value>
/// The fee calculated date time.
/// </value>
public DateTime FeeCalculatedDateTime { get; init; }

/// <summary>
/// Gets the estate identifier.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ public record ServiceProviderFeeAddedToTransactionEvent : DomainEventRecord.Doma
/// <param name="feeCalculationType">Type of the fee calculation.</param>
/// <param name="feeId">The fee identifier.</param>
/// <param name="feeValue">The fee value.</param>
/// <param name="feeCalculatedDateTime">The fee calculated date time.</param>
public ServiceProviderFeeAddedToTransactionEvent(Guid aggregateId,
Guid estateId,
Guid merchantId,
Decimal calculatedValue,
Int32 feeCalculationType,
Guid feeId,
Decimal feeValue) : base(aggregateId, Guid.NewGuid())
Decimal feeValue,
DateTime feeCalculatedDateTime) : base(aggregateId, Guid.NewGuid())
{
this.TransactionId = aggregateId;
this.EstateId = estateId;
Expand All @@ -38,6 +40,7 @@ public ServiceProviderFeeAddedToTransactionEvent(Guid aggregateId,
this.FeeCalculationType = feeCalculationType;
this.FeeId = feeId;
this.FeeValue = feeValue;
this.FeeCalculatedDateTime = feeCalculatedDateTime;
}

#endregion
Expand Down Expand Up @@ -84,6 +87,14 @@ public ServiceProviderFeeAddedToTransactionEvent(Guid aggregateId,
/// </value>
public Decimal FeeValue { get; init; }

/// <summary>
/// Gets or sets the fee calculated date time.
/// </summary>
/// <value>
/// The fee calculated date time.
/// </value>
public DateTime FeeCalculatedDateTime { get; init; }

/// <summary>
/// Gets the merchant identifier.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ public void MerchantFeeAddedToTransactionEvent_CanBeCreated_IsCreated()
TestData.CalculatedFeeValue,
(Int32)CalculationType.Fixed,
TestData.TransactionFeeId,
TestData.TransactionFeeValue);
TestData.TransactionFeeValue,
TestData.TransactionFeeCalculateDateTime);

merchantFeeAddedToTransactionEvent.ShouldNotBeNull();
merchantFeeAddedToTransactionEvent.AggregateId.ShouldBe(TestData.TransactionId);
Expand All @@ -264,6 +265,7 @@ public void MerchantFeeAddedToTransactionEvent_CanBeCreated_IsCreated()
merchantFeeAddedToTransactionEvent.FeeCalculationType.ShouldBe((Int32)CalculationType.Fixed);
merchantFeeAddedToTransactionEvent.FeeId.ShouldBe(TestData.TransactionFeeId);
merchantFeeAddedToTransactionEvent.FeeValue.ShouldBe(TestData.TransactionFeeValue);
merchantFeeAddedToTransactionEvent.FeeCalculatedDateTime.ShouldBe(TestData.TransactionFeeCalculateDateTime);

}

Expand All @@ -276,7 +278,8 @@ public void ServiceProviderFeeAddedToTransactionEvent_CanBeCreated_IsCreated()
TestData.CalculatedFeeValue,
(Int32)CalculationType.Fixed,
TestData.TransactionFeeId,
TestData.TransactionFeeValue);
TestData.TransactionFeeValue,
TestData.TransactionFeeCalculateDateTime);

serviceProviderFeeAddedToTransactionEvent.ShouldNotBeNull();
serviceProviderFeeAddedToTransactionEvent.AggregateId.ShouldBe(TestData.TransactionId);
Expand All @@ -288,6 +291,7 @@ public void ServiceProviderFeeAddedToTransactionEvent_CanBeCreated_IsCreated()
serviceProviderFeeAddedToTransactionEvent.FeeCalculationType.ShouldBe((Int32)CalculationType.Fixed);
serviceProviderFeeAddedToTransactionEvent.FeeId.ShouldBe(TestData.TransactionFeeId);
serviceProviderFeeAddedToTransactionEvent.FeeValue.ShouldBe(TestData.TransactionFeeValue);
serviceProviderFeeAddedToTransactionEvent.FeeCalculatedDateTime.ShouldBe(TestData.TransactionFeeCalculateDateTime);

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ public void AddFee(CalculatedFee calculatedFee)
calculatedFee.CalculatedValue,
(Int32)calculatedFee.FeeCalculationType,
calculatedFee.FeeId,
calculatedFee.FeeValue);
calculatedFee.FeeValue,
calculatedFee.FeeCalculatedDateTime);
}
else if (calculatedFee.FeeType == FeeType.ServiceProvider)
{
Expand All @@ -310,7 +311,8 @@ public void AddFee(CalculatedFee calculatedFee)
calculatedFee.CalculatedValue,
(Int32)calculatedFee.FeeCalculationType,
calculatedFee.FeeId,
calculatedFee.FeeValue);
calculatedFee.FeeValue,
calculatedFee.FeeCalculatedDateTime);
}
else
{
Expand Down