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 @@ -162,7 +162,6 @@ public async Task TransactionDomainEventHandler_Handle_TransactionHasBeenComplet
var merchant = new MerchantResponse
{
SettlementSchedule = SettlementSchedule.Weekly,
NextSettlementDueDate = DateTime.Now.AddDays(7)
};
this.EstateClient.Setup(e => e.GetMerchant(It.IsAny<String>(), It.IsAny<Guid>(), It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
.ReturnsAsync(merchant);
Expand Down Expand Up @@ -213,7 +212,6 @@ public async Task TransactionDomainEventHandler_Handle_TransactionHasBeenComplet
var merchant = new MerchantResponse
{
SettlementSchedule = SettlementSchedule.Monthly,
NextSettlementDueDate = DateTime.Now.AddMonths(1)
};
this.EstateClient.Setup(e => e.GetMerchant(It.IsAny<String>(), It.IsAny<Guid>(), It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
.ReturnsAsync(merchant);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EstateManagement.Client" Version="1.0.15-build74" />
<PackageReference Include="MessagingService.Client" Version="1.0.10.2" />
<PackageReference Include="SecurityService.Client" Version="1.0.6.2" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="1.0.18" />
<PackageReference Include="Shared.EventStore" Version="1.0.18" />
<PackageReference Include="EstateManagement.Client" Version="1.0.17-build86" />
<PackageReference Include="MessagingService.Client" Version="1.0.14-build56" />
<PackageReference Include="SecurityService.Client" Version="1.0.8" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="1.1.0" />
<PackageReference Include="Shared.EventStore" Version="1.1.0" />
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="System.IO.Abstractions" Version="13.2.9" />
<PackageReference Include="VoucherManagement.Client" Version="1.0.4.1" />
<PackageReference Include="VoucherManagement.Client" Version="1.0.8-build38" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClientProxyBase" Version="1.0.14" />
<PackageReference Include="ClientProxyBase" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
385 changes: 156 additions & 229 deletions TransactionProcessor.IntegrationTests/Common/DockerHelper.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Scenario: Get Pending Settlement
| Reference | Amount | DateTime | MerchantName | EstateName |
| Deposit1 | 210.00 | Today | Test Merchant 1 | Test Estate 1 |
| Deposit1 | 110.00 | Today | Test Merchant 2 | Test Estate 1 |
| Deposit1 | 110.00 | Today | Test Merchant 3 | Test Estate 1 |
| Deposit1 | 120.00 | Today | Test Merchant 3 | Test Estate 1 |

When I perform the following transactions
| DateTime | TransactionNumber | TransactionType | MerchantName | DeviceIdentifier | EstateName | OperatorName | TransactionAmount | CustomerAccountNumber | CustomerEmailAddress | ContractDescription | ProductName | RecipientEmail | RecipientMobile |
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions TransactionProcessor.IntegrationTests/Shared/SharedSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ await Retry.For(async () =>
estate = await this.TestingContext.DockerHelper.EstateClient
.GetEstate(this.TestingContext.AccessToken, estateDetails.EstateId, CancellationToken.None).ConfigureAwait(false);
estate.ShouldNotBeNull();
}, retryFor: TimeSpan.FromSeconds(90)).ConfigureAwait(false);
}, retryFor: TimeSpan.FromSeconds(180)).ConfigureAwait(false);

estate.EstateName.ShouldBe(estateDetails.EstateName);
}
Expand Down Expand Up @@ -802,7 +802,6 @@ public async Task GivenIMakeTheFollowingManualMerchantDeposits(Table table)
MakeMerchantDepositRequest makeMerchantDepositRequest = new MakeMerchantDepositRequest
{
DepositDateTime = SpecflowTableHelper.GetDateForDateString(SpecflowTableHelper.GetStringRowValue(tableRow, "DateTime"), DateTime.Now),
Source = MerchantDepositSource.Manual,
Reference = SpecflowTableHelper.GetStringRowValue(tableRow, "Reference"),
Amount = SpecflowTableHelper.GetDecimalValue(tableRow, "Amount")
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClientProxyBase" Version="1.0.14" />
<PackageReference Include="ClientProxyBase" Version="1.1.0" />
<PackageReference Include="Ductus.FluentDocker" Version="2.10.7" />
<PackageReference Include="EstateManagement.Client" Version="1.0.15-build74" />
<PackageReference Include="EstateReporting.Database" Version="1.0.13.1" />
<PackageReference Include="EstateManagement.Client" Version="1.0.17-build86" />
<PackageReference Include="EstateReporting.Database" Version="1.0.19-build87" />
<PackageReference Include="EventStore.Client.Grpc.PersistentSubscriptions" Version="21.2.0" />
<PackageReference Include="EventStore.Client.Grpc.ProjectionManagement" Version="21.2.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.40.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.12" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="SecurityService.Client" Version="1.0.6.2" />
<PackageReference Include="Shared.IntegrationTesting" Version="1.0.14" />
<PackageReference Include="SecurityService.Client" Version="1.0.8" />
<PackageReference Include="Shared.IntegrationTesting" Version="1.1.0" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="SpecFlow" Version="3.5.14" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.5.14" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var fromStreams = fromStreams || require('../../node_modules/esprojection-testing-framework').scope.fromStreams;
var emit = emit || require('../../node_modules/esprojection-testing-framework').scope.emit;
//var fromStreams = fromStreams || require('../../node_modules/esprojection-testing-framework').scope.fromStreams;
//var emit = emit || require('../../node_modules/esprojection-testing-framework').scope.emit;

fromStreams("$ce-EstateAggregate", "$et-CallbackReceivedEvent")
.when({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var fromAll = fromAll || require("../../node_modules/esprojection-testing-framework").scope.fromAll;
var linkTo = linkTo || require("../../node_modules/esprojection-testing-framework").scope.linkTo;
//var fromAll = fromAll || require("../../node_modules/esprojection-testing-framework").scope.fromAll;
//var linkTo = linkTo || require("../../node_modules/esprojection-testing-framework").scope.linkTo;

isEstateEvent = (e) => { return (e.data && e.data.estateId); }
isAnEstateCreatedEvent = (e) => { return compareEventTypeSafely(e.eventType, 'EstateCreatedEvent') };
Expand Down Expand Up @@ -36,7 +36,6 @@ fromAll()

if (isAnEstateCreatedEvent(e)) {
s.estates[e.data.estateId] = {
filteredName: e.data.estateName.replace(/-/gi, ""),
name: e.data.estateName.replace(/-/gi, "").replace(/ /g, "")
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var fromAll = fromAll || require("../../node_modules/esprojection-testing-framework").scope.fromAll;
var linkTo = linkTo || require("../../node_modules/esprojection-testing-framework").scope.linkTo;
//var fromAll = fromAll || require("../../node_modules/esprojection-testing-framework").scope.fromAll;
//var linkTo = linkTo || require("../../node_modules/esprojection-testing-framework").scope.linkTo;

isEstateEvent = (e) => { return (e.data && e.data.estateId); }
isAnEstateCreatedEvent = (e) => { return compareEventTypeSafely(e.eventType, 'EstateCreatedEvent') };
Expand Down Expand Up @@ -65,4 +65,4 @@ fromAll()
}
}
}
);
);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var fromAll = fromAll || require("../../node_modules/esprojection-testing-framework").scope.fromAll;
var linkTo = linkTo || require("../../node_modules/esprojection-testing-framework").scope.linkTo;
//var fromAll = fromAll || require("../../node_modules/esprojection-testing-framework").scope.fromAll;
//var linkTo = linkTo || require("../../node_modules/esprojection-testing-framework").scope.linkTo;

isValidEvent = function (e) {

Expand Down Expand Up @@ -29,7 +29,9 @@ fromAll()
if (isValidEvent(e)) {
var merchantId = getMerchantId(e);
if (merchantId !== null) {
s.merchantId = merchantId;
var streamName = "MerchantArchive-" + merchantId.replace(/-/gi, "");
s.streamName = streamName;
linkTo(streamName, e);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var fromCategory = fromCategory || require('../../node_modules/esprojection-testing-framework').scope.fromCategory;
var partitionBy = partitionBy !== null ? partitionBy : require('../../node_modules/esprojection-testing-framework').scope.partitionBy;
var emit = emit || require('../../node_modules/esprojection-testing-framework').scope.emit;
//var fromCategory = fromCategory || require('../../node_modules/esprojection-testing-framework').scope.fromCategory;
//var partitionBy = partitionBy !== null ? partitionBy : require('../../node_modules/esprojection-testing-framework').scope.partitionBy;
//var emit = emit || require('../../node_modules/esprojection-testing-framework').scope.emit;

fromCategory('MerchantArchive')
.foreachStream()
Expand All @@ -18,11 +18,10 @@ fromCategory('MerchantArchive')
totalAuthorisedSales: 0,
totalDeclinedSales: 0,
totalFees: 0,
emittedEvents:1
emittedEvents: 1
}
},
$any: function (s, e)
{
$any: function (s, e) {
if (e === null || e.data === null || e.data.IsJson === false)
return;

Expand All @@ -43,11 +42,6 @@ var eventbus = {
return;
}

if (e.eventType === 'AutomaticDepositMadeEvent') {
depositMadeEventHandler(s, e);
return;
}

if (e.eventType === 'TransactionHasStartedEvent') {
transactionHasStartedEventHandler(s, e);
return;
Expand Down Expand Up @@ -135,7 +129,7 @@ var merchantCreatedEventHandler = function (s, e) {
var emitBalanceChangedEvent = function (aggregateId, eventId, s, changeAmount, dateTime, reference) {

if (s.initialised === true) {

// Emit an opening balance event
var openingBalanceEvent = {
$type: getEventTypeName(),
Expand Down Expand Up @@ -184,7 +178,6 @@ var depositMadeEventHandler = function (s, e) {
incrementBalanceFromDeposit(s, e.data.amount, e.data.depositDateTime);

// emit an balance changed event here
console.log(e);
s = emitBalanceChangedEvent(e.data.merchantId, e.eventId, s, e.data.amount, e.data.depositDateTime, "Merchant Deposit");
};

Expand Down Expand Up @@ -248,7 +241,7 @@ var merchantFeeAddedToTransactionEventHandler = function (s, e) {

// increment the balance now
incrementBalanceFromMerchantFee(s, e.data.calculatedValue, e.data.feeCalculatedDateTime);

// emit an balance changed event here
s = emitBalanceChangedEvent(e.data.transactionId, e.eventId, s, e.data.calculatedValue, e.data.feeCalculatedDateTime, "Transaction Fee Processed");
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var fromCategory = fromCategory || require('../../node_modules/esprojection-testing-framework').scope.fromCategory;
//var fromCategory = fromCategory || require('../../node_modules/esprojection-testing-framework').scope.fromCategory;
//var partitionBy = partitionBy !== null ? partitionBy : require('../../node_modules/event-store-projection-testing').scope.partitionBy;
var emit = emit || require('../../node_modules/esprojection-testing-framework').scope.emit;
var linkTo = linkTo || require("../../node_modules/esprojection-testing-framework").scope.linkTo;
//var emit = emit || require('../../node_modules/esprojection-testing-framework').scope.emit;
//var linkTo = linkTo || require("../../node_modules/esprojection-testing-framework").scope.linkTo;

fromCategory('TransactionAggregate')
.foreachStream()
Expand Down Expand Up @@ -46,7 +46,7 @@ function merchantFeeAddedToTransactionEventHandler(s, e) {
feeCalculationType: e.data.feeCalculationType,
eventId: e.eventId
}
emit(getStreamName(s), "MerchantFeeAddedToTransactionEnrichedEvent", newEvent, null);
emit(getStreamName(s), "MerchantFeeAddedToTransactionEnrichedEvent", newEvent, {});
}

function serviceProviderFeeAddedToTransactionEventHandler(s, e) {
Expand All @@ -61,7 +61,7 @@ function serviceProviderFeeAddedToTransactionEventHandler(s, e) {
feeCalculationType: e.data.feeCalculationType,
eventId: e.eventId
}
emit(getStreamName(s), "ServiceProviderFeeAddedToTransactionEnrichedEvent", newEvent, null);
emit(getStreamName(s), "ServiceProviderFeeAddedToTransactionEnrichedEvent", newEvent, {});
}

function getStreamName(s) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var fromAll = fromAll || require("../../node_modules/esprojection-testing-framework").scope.fromAll;
var linkTo = linkTo || require("../../node_modules/esprojection-testing-framework").scope.linkTo;
//var fromAll = fromAll || require("../../node_modules/esprojection-testing-framework").scope.fromAll;
//var linkTo = linkTo || require("../../node_modules/esprojection-testing-framework").scope.linkTo;

isEstateEvent = (e) => { return (e.data && e.data.estateId); }
isAnEstateCreatedEvent = (e) => { return compareEventTypeSafely(e.eventType, 'EstateCreatedEvent') };
Expand All @@ -11,6 +11,7 @@ getSupportedEventTypes = function () {

eventTypes.push('CustomerEmailReceiptRequestedEvent');
eventTypes.push('TransactionHasBeenCompletedEvent');
eventTypes.push('MerchantFeeAddedToTransactionEvent');

return eventTypes;
}
Expand Down Expand Up @@ -59,4 +60,4 @@ fromAll()
}
}
}
);
);
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Shared.DomainDrivenDesign" Version="1.0.18" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="1.1.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Shared.EventStore" Version="1.0.18" />
<PackageReference Include="Shared.EventStore" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Shared.DomainDrivenDesign" Version="1.0.18" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Shared.EventStore" Version="1.0.18" />
<PackageReference Include="Shared.EventStore" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Shared.DomainDrivenDesign" Version="1.0.18" />
<PackageReference Include="Shared.DomainDrivenDesign" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Shared.EventStore" Version="1.0.18" />
<PackageReference Include="Shared.EventStore" Version="1.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion TransactionProcessor/TransactionProcessor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.7.4" />
<PackageReference Include="Shared.EventStore" Version="1.0.18" />
<PackageReference Include="Shared.EventStore" Version="1.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.1.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.2" />
Expand Down
2 changes: 1 addition & 1 deletion TransactionProcessor/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"AppSettings": {
"SubscriptionFilter": "Transaction Processor",
"InternalSubscriptionServiceFilter": "Transaction Processor",
"ClientId": "serviceClient",
"ClientSecret": "d192cbc46d834d0da90e8a9d50ded543",
"EventHandlerConfiguration": {
Expand Down