Skip to content

Commit 9cb17b3

Browse files
Merge pull request #15 from StuartFerguson/task/#8_logontransactionspecflow
Task/#8 logontransactionspecflow
2 parents 1bfb949 + 5ff92e0 commit 9cb17b3

27 files changed

Lines changed: 1293 additions & 25 deletions

.github/workflows/createrelease.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
run: |
4242
docker build . --file TransactionProcessor/Dockerfile --tag transactionprocessor:latest --tag stuartferguson/transactionprocessor:latest --tag stuartferguson/transactionprocessor:${{ steps.get_version.outputs.VERSION }}
4343
44+
- name: Run Integration Tests
45+
run: dotnet test "TransactionProcessor.IntegrationTests\TransactionProcessor.IntegrationTests.csproj"
46+
4447
- name: Publish Images to Docker Hub
4548
run: |
4649
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}

.github/workflows/nightlybuild.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ jobs:
4949

5050
- name: Build Docker Image
5151
run: docker build . --file TransactionProcessor/Dockerfile --tag transactionprocessor:latest
52+
53+
- name: Run Integration Tests
54+
run: dotnet test "TransactionProcessor.IntegrationTests\TransactionProcessor.IntegrationTests.csproj"

.github/workflows/pullrequest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ jobs:
3737
- name: Build Docker Image
3838
run: docker build . --file TransactionProcessor/Dockerfile --tag transactionprocessor:latest
3939

40+
- name: Run Integration Tests
41+
run: dotnet test "TransactionProcessor.IntegrationTests\TransactionProcessor.IntegrationTests.csproj" --filter Category=PRTest

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
# TransactionProcessor
1+
# TransactionProcessor
2+
3+
## Build Status
4+
5+
[![Last Nightly Build Status Badge](https://github.com/StuartFerguson/TransactionProcessor/workflows/Nightly%20Build/badge.svg)](https://github.com/StuartFerguson/TransactionProcessor/workflows/Nightly%20Build/badge.svg)
6+
[![Last Release Build Status Badge](https://github.com/StuartFerguson/TransactionProcessor/workflows/Release/badge.svg)](https://github.com/StuartFerguson/TransactionProcessor/workflows/Release/badge.svg)
7+
8+
## Nuget Versions
9+
10+
11+
12+
## Code Coverage Results
13+
14+
[![Coverage Status](https://coveralls.io/repos/github/StuartFerguson/TransactionProcessor/badge.svg)](https://coveralls.io/github/StuartFerguson/TransactionProcessor)
15+
16+
## Code Quality Results
17+
18+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5bcb33c3c68e473193a872f0d3375f61)](https://www.codacy.com/manual/stuart_ferguson1/TransactionProcessor?utm_source=github.com&utm_medium=referral&utm_content=StuartFerguson/TransactionProcessor&utm_campaign=Badge_Grade)

TransactionProcessor.BusinessLogic/Services/TransactionDomainService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ public async Task<ProcessLogonTransactionResponse> ProcessLogonTransaction(Guid
5454
return new ProcessLogonTransactionResponse
5555
{
5656
ResponseMessage = transactionAggregate.ResponseMessage,
57-
ResponseCode = transactionAggregate.ResponseCode
57+
ResponseCode = transactionAggregate.ResponseCode,
58+
EstateId = estateId,
59+
MerchantId = merchantId
5860
};
5961
}
6062

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
namespace TransactionProcessor.DataTransferObjects
2+
{
3+
using System;
4+
5+
/// <summary>
6+
///
7+
/// </summary>
8+
public abstract class DataTransferObject
9+
{
10+
#region Properties
11+
12+
// This only here as a shell base class...
13+
/// <summary>
14+
/// Gets or sets the estate identifier.
15+
/// </summary>
16+
/// <value>
17+
/// The estate identifier.
18+
/// </value>
19+
public Guid EstateId { get; set; }
20+
21+
/// <summary>
22+
/// Gets or sets the merchant identifier.
23+
/// </summary>
24+
/// <value>
25+
/// The merchant identifier.
26+
/// </value>
27+
public Guid MerchantId { get; set; }
28+
29+
#endregion
30+
}
31+
32+
public class MetadataContants
33+
{
34+
public const String KeyNameEstateId = "EstateId";
35+
public const String KeyNameMerchantId = "MerchantId";
36+
}
37+
}

TransactionProcessor.DataTransferObjects/LogonTransactionRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
///
88
/// </summary>
99
[ExcludeFromCodeCoverage]
10-
public class LogonTransactionRequest
10+
public class LogonTransactionRequest : DataTransferObject
1111
{
1212
#region Properties
1313

TransactionProcessor.DataTransferObjects/LogonTransactionResponse.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ public class LogonTransactionResponse
1111
{
1212
#region Properties
1313

14+
public Guid EstateId { get; set; }
15+
public Guid MerchantId { get; set; }
16+
1417
/// <summary>
1518
/// Gets or sets the response code.
1619
/// </summary>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
namespace TransactionProcessor.DataTransferObjects
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using Newtonsoft.Json;
6+
7+
/// <summary>
8+
///
9+
/// </summary>
10+
public class SerialisedMessage
11+
{
12+
#region Constructors
13+
14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="SerialisedMessage"/> class.
16+
/// </summary>
17+
public SerialisedMessage()
18+
{
19+
this.Metadata = new Dictionary<String, String>();
20+
}
21+
22+
#endregion
23+
24+
#region Properties
25+
26+
/// <summary>
27+
/// Gets or sets the metadata.
28+
/// </summary>
29+
/// <value>
30+
/// The metadata.
31+
/// </value>
32+
[JsonProperty("metadata")]
33+
public Dictionary<String, String> Metadata { get; set; }
34+
35+
/// <summary>
36+
/// Gets or sets the serialised data.
37+
/// </summary>
38+
/// <value>
39+
/// The serialised data.
40+
/// </value>
41+
[JsonProperty("serialised_data")]
42+
public String SerialisedData { get; set; }
43+
44+
#endregion
45+
}
46+
}

TransactionProcessor.DataTransferObjects/TransactionProcessor.DataTransferObjects.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44
<TargetFramework>netstandard2.1</TargetFramework>
55
</PropertyGroup>
66

7+
<ItemGroup>
8+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
9+
</ItemGroup>
10+
711
</Project>

0 commit comments

Comments
 (0)