Skip to content

Commit 2354ea2

Browse files
Merge pull request #598 from TransactionProcessing/task/#590_remove_operatoridentifier_looukp_for_operatorid
Remove lookups based on operator name and use operator id
2 parents fc920f8 + b5996c1 commit 2354ea2

File tree

64 files changed

+398
-358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+398
-358
lines changed

TransactionProcessor.BusinessLogic.Tests/DomainEventHandlers/TransactionDomainEventHandlerTests.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ public TransactionDomainEventHandlerTests()
7676
}
7777

7878
[Theory]
79-
[InlineData(SettlementSchedule.Immediate)]
80-
[InlineData(SettlementSchedule.Weekly)]
81-
[InlineData(SettlementSchedule.Monthly)]
82-
public async Task TransactionDomainEventHandler_Handle_TransactionHasBeenCompletedEvent_SuccessfulSale_EventIsHandled(SettlementSchedule settlementSchedule)
79+
[InlineData(EstateManagement.DataTransferObjects.Responses.Merchant.SettlementSchedule.Immediate)]
80+
[InlineData(EstateManagement.DataTransferObjects.Responses.Merchant.SettlementSchedule.Weekly)]
81+
[InlineData(EstateManagement.DataTransferObjects.Responses.Merchant.SettlementSchedule.Monthly)]
82+
public async Task TransactionDomainEventHandler_Handle_TransactionHasBeenCompletedEvent_SuccessfulSale_EventIsHandled(EstateManagement.DataTransferObjects.Responses.Merchant.SettlementSchedule settlementSchedule)
8383
{
8484
this.FloatAggregateRepository.Setup(f => f.GetLatestVersion(It.IsAny<Guid>(), It.IsAny<CancellationToken>())).ReturnsAsync(TestData.GetFloatAggregateWithCostValues);
8585

@@ -94,7 +94,7 @@ public async Task TransactionDomainEventHandler_Handle_TransactionHasBeenComplet
9494
});
9595

9696
this.EstateClient.Setup(e => e.GetMerchant(It.IsAny<String>(), It.IsAny<Guid>(), It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
97-
.ReturnsAsync(new MerchantResponse
97+
.ReturnsAsync(new EstateManagement.DataTransferObjects.Responses.Merchant.MerchantResponse
9898
{
9999
SettlementSchedule = settlementSchedule,
100100
});
@@ -111,16 +111,16 @@ public async Task TransactionDomainEventHandler_Handle_TransactionHasBeenComplet
111111

112112
CalculatedFee merchantFee = transactionAggregate.GetFees().SingleOrDefault(f => f.FeeId == TestData.TransactionFeeId);
113113
merchantFee.ShouldNotBeNull();
114-
if (settlementSchedule == SettlementSchedule.Immediate){
114+
if (settlementSchedule == EstateManagement.DataTransferObjects.Responses.Merchant.SettlementSchedule.Immediate){
115115
merchantFee.IsSettled.ShouldBeTrue();
116116
}
117117
else{
118118
merchantFee.IsSettled.ShouldBeFalse();
119119
}
120120

121121
var expectedSettlementDate = settlementSchedule switch{
122-
SettlementSchedule.Monthly => transactionAggregate.TransactionDateTime.Date.AddMonths(1),
123-
SettlementSchedule.Weekly => transactionAggregate.TransactionDateTime.Date.AddDays(7),
122+
EstateManagement.DataTransferObjects.Responses.Merchant.SettlementSchedule.Monthly => transactionAggregate.TransactionDateTime.Date.AddMonths(1),
123+
EstateManagement.DataTransferObjects.Responses.Merchant.SettlementSchedule.Weekly => transactionAggregate.TransactionDateTime.Date.AddDays(7),
124124
_ => transactionAggregate.TransactionDateTime.Date
125125
};
126126
merchantFee.SettlementDueDate.ShouldBe(expectedSettlementDate);
@@ -145,9 +145,9 @@ public async Task TransactionDomainEventHandler_Handle_TransactionHasBeenComplet
145145
});
146146

147147
this.EstateClient.Setup(e => e.GetMerchant(It.IsAny<String>(), It.IsAny<Guid>(), It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
148-
.ReturnsAsync(new MerchantResponse
148+
.ReturnsAsync(new EstateManagement.DataTransferObjects.Responses.Merchant.MerchantResponse
149149
{
150-
SettlementSchedule = SettlementSchedule.NotSet,
150+
SettlementSchedule = EstateManagement.DataTransferObjects.Responses.Merchant.SettlementSchedule.NotSet,
151151
});
152152
this.EstateClient.Setup(e => e.GetTransactionFeesForProduct(It.IsAny<String>(),
153153
It.IsAny<Guid>(),
@@ -211,6 +211,7 @@ public async Task TransactionDomainEventHandler_Handle_CustomerEmailReceiptReque
211211
{
212212
this.TransactionAggregateRepository.Setup(t => t.GetLatestVersion(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
213213
.ReturnsAsync(TestData.GetCompletedAuthorisedSaleTransactionAggregate);
214+
this.EstateClient.Setup(e => e.GetEstate(It.IsAny<String>(), It.IsAny<Guid>(), It.IsAny<CancellationToken>())).ReturnsAsync(TestData.GetEstateResponseWithOperator1);
214215

215216
this.SecurityServiceClient.Setup(s => s.GetToken(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<CancellationToken>())).ReturnsAsync(TestData.TokenResponse);
216217

TransactionProcessor.BusinessLogic.Tests/Mediator/DummyTransactionDomainService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public async Task<ProcessSaleTransactionResponse> ProcessSaleTransaction(Guid tr
2525
DateTime transactionDateTime,
2626
String transactionNumber,
2727
String deviceIdentifier,
28-
String operatorId,
28+
Guid operatorId,
2929
String customerEmailAddress,
3030
Dictionary<String, String> additionalTransactionMetadata,
3131
Guid contractId,

TransactionProcessor.BusinessLogic.Tests/Mediator/DummyVoucherDomainService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
public class DummyVoucherDomainService : IVoucherDomainService
1010
{
1111
public async Task<IssueVoucherResponse> IssueVoucher(Guid voucherId,
12-
String operatorId,
12+
Guid operatorId,
1313
Guid estateId,
1414
Guid transactionId,
1515
DateTime issuedDateTime,

0 commit comments

Comments
 (0)