Skip to content

Commit

Permalink
Merge from Develop (#304)
Browse files Browse the repository at this point in the history
* v2.1.3 (#295)

* FasTnT EPCIS 2.0.1 (#175)

* Bump Microsoft.Extensions.DependencyInjection from 3.1.1 to 3.1.2

Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.1...v3.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump Microsoft.Extensions.Logging.Abstractions from 3.1.1 to 3.1.2

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.1...v3.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump Microsoft.Extensions.Logging from 3.1.1 to 3.1.2

Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.1...v3.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump Npgsql from 4.1.3 to 4.1.3.1

Bumps [Npgsql](https://github.com/npgsql/npgsql) from 4.1.3 to 4.1.3.1.
- [Release notes](https://github.com/npgsql/npgsql/releases)
- [Commits](npgsql/npgsql@v4.1.3...v4.1.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Add command lines parameters (#159)

* Add command lines parameters

* Add unit tests

* Bump MediatR from 8.0.0 to 8.0.1 (#160)

Bumps [MediatR](https://github.com/jbogard/mediatr) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/jbogard/mediatr/releases)
- [Commits](jbogard/MediatR@v8.0.0...v8.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Implement parameters (#161)

* Implement parameters

- EQATTR
- HASATTR
- "**_"-like parameters
- "**_INNER_"-like parameters

* Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.2 to 3.1.3 (#162)

Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.2...v3.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Logging.Abstractions from 3.1.2 to 3.1.3 (#163)

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.2...v3.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.DependencyInjection from 3.1.2 to 3.1.3 (#167)

Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.2...v3.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Logging from 3.1.2 to 3.1.3 (#164)

Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.2...v3.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Add XML/SOAP parsing tests (#168)

* Add unit tests

* Add XML parsing unit tests

* Update WhenParsingXmlGetSubscriptionIDsRequest.cs

* Add XML parsing unit tests

* Add SOAP parsing unit tests

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Use .NET Core 3.1 LTS (#169)

* Update solution to use .NET Core 3.1

Use the latest LTS 3.1 framework

* Update dotnetcore.yml

Use .NET Core 3.1 in Github workflow

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Fix/http status code (#170)

* Return 200 instead of 204

As specified in compliance document

* Fix tests

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Update README.md

Update .NET Core version requirement

* Cleanup code (#171)

* Cleanup Host code

* Cleanup and update NuGet

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Fix XML formatting (#172)

Add missing condition on ErrorDeclaration field existance

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Fix azure deployment (#173)

Use IIS Integration instead of Kestrel

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Bump version to 2.0.1 & cleanup code (#174)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Complete merge from develop

* Merge Develop into Master (#280)

* Update dotnetcore.yml (#247)

* Update dotnetcore.yml

Run integration tests + coverage

* Update dotnetcore.yml

* Cleanup SimpleEventQuery.cs (#255)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Bump Microsoft.AspNetCore.TestHost from 3.1.7 to 3.1.8 (#261)

Bumps [Microsoft.AspNetCore.TestHost](https://github.com/aspnet/AspNetCore) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/aspnet/AspNetCore/releases)
- [Commits](dotnet/aspnetcore@v3.1.7...v3.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Logging.Abstractions from 3.1.7 to 3.1.8 (#260)

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.7...v3.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.7 to 3.1.8 (#256)

Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.7...v3.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.DependencyInjection from 3.1.7 to 3.1.8 (#257)

Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.7...v3.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Logging from 3.1.7 to 3.1.8 (#259)

Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.7...v3.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Small changes & improvements (#262)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Bump Npgsql from 4.1.4 to 4.1.5 (#263)

Bumps [Npgsql](https://github.com/npgsql/npgsql) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/npgsql/npgsql/releases)
- [Commits](npgsql/npgsql@v4.1.4...v4.1.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Moq from 4.14.5 to 4.14.6 (#264)

Bumps [Moq](https://github.com/moq/moq4) from 4.14.5 to 4.14.6.
- [Release notes](https://github.com/moq/moq4/releases)
- [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md)
- [Commits](devlooped/moq@v4.14.5...v4.14.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump MediatR from 8.1.0 to 8.2.0 (#265)

Bumps [MediatR](https://github.com/jbogard/MediatR) from 8.1.0 to 8.2.0.
- [Release notes](https://github.com/jbogard/MediatR/releases)
- [Commits](jbogard/MediatR@v8.1.0...v8.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.8 to 3.1.9 (#273)

Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.8...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump MediatR from 8.2.0 to 9.0.0 (#267)

Bumps [MediatR](https://github.com/jbogard/MediatR) from 8.2.0 to 9.0.0.
- [Release notes](https://github.com/jbogard/MediatR/releases)
- [Commits](https://github.com/jbogard/MediatR/commits/v9.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.AspNetCore.TestHost from 3.1.8 to 3.1.9 (#268)

Bumps [Microsoft.AspNetCore.TestHost](https://github.com/aspnet/AspNetCore) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/aspnet/AspNetCore/releases)
- [Commits](dotnet/aspnetcore@v3.1.8...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Improve bulk performances by tuning parametrs (#275)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Bump Microsoft.Extensions.Logging.Abstractions from 3.1.8 to 3.1.9 (#271)

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.8...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.DependencyInjection from 3.1.8 to 3.1.9 (#272)

Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.8...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Moq from 4.14.6 to 4.14.7 (#274)

Bumps [Moq](https://github.com/moq/moq4) from 4.14.6 to 4.14.7.
- [Release notes](https://github.com/moq/moq4/releases)
- [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md)
- [Commits](devlooped/moq@v4.14.6...v4.14.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump MediatR.Extensions.Microsoft.DependencyInjection (#266)

Bumps [MediatR.Extensions.Microsoft.DependencyInjection](https://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection) from 8.1.0 to 9.0.0.
- [Release notes](https://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection/releases)
- [Commits](jbogard/MediatR.Extensions.Microsoft.DependencyInjection@v8.1.0...v9.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Logging from 3.1.8 to 3.1.9 (#269)

Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.8...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Hosting from 3.1.7 to 3.1.9 (#270)

Bumps [Microsoft.Extensions.Hosting](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.9.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.7...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Add CancellationToken to XML formatter (#276)

* Use CancellationToken in events/masterdata formatting to avoid having hanging long queries (WIP)

* Check for cancelled query when formatting XML response

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Fix naming

* Update SimpleEventQuery.cs

* Remove UserSecrets

* Update BasicAuthenticationHandler.cs

* Handle request cancellation during event retrieving (#277)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Fix Subscription SQL store (#278)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Use C# 8 using statement (#279)

+ cleanup unused namespaces

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump version

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Bump Moq from 4.14.7 to 4.15.1 (#296)

Bumps [Moq](https://github.com/moq/moq4) from 4.14.7 to 4.15.1.
- [Release notes](https://github.com/moq/moq4/releases)
- [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moq/moq4/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Npgsql from 4.1.5 to 5.0.0 (#297)

Bumps [Npgsql](https://github.com/npgsql/npgsql) from 4.1.5 to 5.0.0.
- [Release notes](https://github.com/npgsql/npgsql/releases)
- [Commits](npgsql/npgsql@v4.1.5...v5.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Dapper from 2.0.35 to 2.0.78 (#299)

Bumps [Dapper](https://github.com/StackExchange/Dapper) from 2.0.35 to 2.0.78.
- [Release notes](https://github.com/StackExchange/Dapper/releases)
- [Commits](https://github.com/StackExchange/Dapper/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Dapper.SqlBuilder from 2.0.35 to 2.0.78 (#300)

Bumps [Dapper.SqlBuilder](https://github.com/StackExchange/Dapper) from 2.0.35 to 2.0.78.
- [Release notes](https://github.com/StackExchange/Dapper/releases)
- [Commits](https://github.com/StackExchange/Dapper/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Use .NET Core 5 (#298)

* FasTnT EPCIS 2.0.1 (#175)

* Bump Microsoft.Extensions.DependencyInjection from 3.1.1 to 3.1.2

Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.1...v3.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump Microsoft.Extensions.Logging.Abstractions from 3.1.1 to 3.1.2

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.1...v3.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump Microsoft.Extensions.Logging from 3.1.1 to 3.1.2

Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.1...v3.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump Npgsql from 4.1.3 to 4.1.3.1

Bumps [Npgsql](https://github.com/npgsql/npgsql) from 4.1.3 to 4.1.3.1.
- [Release notes](https://github.com/npgsql/npgsql/releases)
- [Commits](npgsql/npgsql@v4.1.3...v4.1.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Add command lines parameters (#159)

* Add command lines parameters

* Add unit tests

* Bump MediatR from 8.0.0 to 8.0.1 (#160)

Bumps [MediatR](https://github.com/jbogard/mediatr) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/jbogard/mediatr/releases)
- [Commits](jbogard/MediatR@v8.0.0...v8.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Implement parameters (#161)

* Implement parameters

- EQATTR
- HASATTR
- "**_"-like parameters
- "**_INNER_"-like parameters

* Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.2 to 3.1.3 (#162)

Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.2...v3.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Logging.Abstractions from 3.1.2 to 3.1.3 (#163)

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.2...v3.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.DependencyInjection from 3.1.2 to 3.1.3 (#167)

Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.2...v3.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Logging from 3.1.2 to 3.1.3 (#164)

Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.2...v3.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Add XML/SOAP parsing tests (#168)

* Add unit tests

* Add XML parsing unit tests

* Update WhenParsingXmlGetSubscriptionIDsRequest.cs

* Add XML parsing unit tests

* Add SOAP parsing unit tests

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Use .NET Core 3.1 LTS (#169)

* Update solution to use .NET Core 3.1

Use the latest LTS 3.1 framework

* Update dotnetcore.yml

Use .NET Core 3.1 in Github workflow

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Fix/http status code (#170)

* Return 200 instead of 204

As specified in compliance document

* Fix tests

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Update README.md

Update .NET Core version requirement

* Cleanup code (#171)

* Cleanup Host code

* Cleanup and update NuGet

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Fix XML formatting (#172)

Add missing condition on ErrorDeclaration field existance

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Fix azure deployment (#173)

Use IIS Integration instead of Kestrel

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Bump version to 2.0.1 & cleanup code (#174)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Complete merge from develop

* Merge Develop into Master (#280)

* Update dotnetcore.yml (#247)

* Update dotnetcore.yml

Run integration tests + coverage

* Update dotnetcore.yml

* Cleanup SimpleEventQuery.cs (#255)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Bump Microsoft.AspNetCore.TestHost from 3.1.7 to 3.1.8 (#261)

Bumps [Microsoft.AspNetCore.TestHost](https://github.com/aspnet/AspNetCore) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/aspnet/AspNetCore/releases)
- [Commits](dotnet/aspnetcore@v3.1.7...v3.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Logging.Abstractions from 3.1.7 to 3.1.8 (#260)

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.7...v3.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.7 to 3.1.8 (#256)

Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.7...v3.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.DependencyInjection from 3.1.7 to 3.1.8 (#257)

Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.7...v3.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Logging from 3.1.7 to 3.1.8 (#259)

Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.7...v3.1.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Small changes & improvements (#262)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Bump Npgsql from 4.1.4 to 4.1.5 (#263)

Bumps [Npgsql](https://github.com/npgsql/npgsql) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/npgsql/npgsql/releases)
- [Commits](npgsql/npgsql@v4.1.4...v4.1.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Moq from 4.14.5 to 4.14.6 (#264)

Bumps [Moq](https://github.com/moq/moq4) from 4.14.5 to 4.14.6.
- [Release notes](https://github.com/moq/moq4/releases)
- [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md)
- [Commits](devlooped/moq@v4.14.5...v4.14.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump MediatR from 8.1.0 to 8.2.0 (#265)

Bumps [MediatR](https://github.com/jbogard/MediatR) from 8.1.0 to 8.2.0.
- [Release notes](https://github.com/jbogard/MediatR/releases)
- [Commits](jbogard/MediatR@v8.1.0...v8.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.8 to 3.1.9 (#273)

Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.8...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump MediatR from 8.2.0 to 9.0.0 (#267)

Bumps [MediatR](https://github.com/jbogard/MediatR) from 8.2.0 to 9.0.0.
- [Release notes](https://github.com/jbogard/MediatR/releases)
- [Commits](https://github.com/jbogard/MediatR/commits/v9.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.AspNetCore.TestHost from 3.1.8 to 3.1.9 (#268)

Bumps [Microsoft.AspNetCore.TestHost](https://github.com/aspnet/AspNetCore) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/aspnet/AspNetCore/releases)
- [Commits](dotnet/aspnetcore@v3.1.8...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Improve bulk performances by tuning parametrs (#275)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Bump Microsoft.Extensions.Logging.Abstractions from 3.1.8 to 3.1.9 (#271)

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.8...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.DependencyInjection from 3.1.8 to 3.1.9 (#272)

Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.8...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Moq from 4.14.6 to 4.14.7 (#274)

Bumps [Moq](https://github.com/moq/moq4) from 4.14.6 to 4.14.7.
- [Release notes](https://github.com/moq/moq4/releases)
- [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md)
- [Commits](devlooped/moq@v4.14.6...v4.14.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump MediatR.Extensions.Microsoft.DependencyInjection (#266)

Bumps [MediatR.Extensions.Microsoft.DependencyInjection](https://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection) from 8.1.0 to 9.0.0.
- [Release notes](https://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection/releases)
- [Commits](jbogard/MediatR.Extensions.Microsoft.DependencyInjection@v8.1.0...v9.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Logging from 3.1.8 to 3.1.9 (#269)

Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.8...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump Microsoft.Extensions.Hosting from 3.1.7 to 3.1.9 (#270)

Bumps [Microsoft.Extensions.Hosting](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.9.
- [Release notes](https://github.com/aspnet/Extensions/releases)
- [Commits](dotnet/extensions@v3.1.7...v3.1.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Add CancellationToken to XML formatter (#276)

* Use CancellationToken in events/masterdata formatting to avoid having hanging long queries (WIP)

* Check for cancelled query when formatting XML response

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Fix naming

* Update SimpleEventQuery.cs

* Remove UserSecrets

* Update BasicAuthenticationHandler.cs

* Handle request cancellation during event retrieving (#277)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Fix Subscription SQL store (#278)

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Use C# 8 using statement (#279)

+ cleanup unused namespaces

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump version

* Use .NET5 and C# 9

* Code cleanup + remove warnings

Cleanup useless "using" statements
Use C# 9 substring format
Apply suggestions from Rozlyn warnings/messages

* Update NuGet packages

Use v5.0.0 for .NET5

* Update Build workflow

Use .NET5

* Update dotnetcore.yml

* Update workflow + remove invalid tests

* Update dotnetcore.yml

* Update fastnt.template.json

Set default .NET 5

* Update NuGet

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>

* Use Directory.build.props to manage version (#301)

* Update README.md

* Bump Microsoft.NET.Test.Sdk (#303)

Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.9.0-preview-20201020-06 to 16.9.0-preview-20201123-03.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](microsoft/vstest@v16.9.0-preview-20201020-06...v16.9.0-preview-20201123-03)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Bump dbup-postgresql from 4.4.0 to 4.5.0 (#302)

Bumps dbup-postgresql from 4.4.0 to 4.5.0.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Update README.md

* Bump version to 2.1.4

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>
  • Loading branch information
3 people authored Nov 26, 2020
1 parent 2091728 commit e0e28bc
Show file tree
Hide file tree
Showing 65 changed files with 439 additions and 447 deletions.
2 changes: 1 addition & 1 deletion .azure/templates/fastnt.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
"[resourceId('Microsoft.Web/sites', parameters('apiName'))]"
],
"properties": {
"netFrameworkVersion": "v4.0",
"netFrameworkVersion": "v5.0",
"use32BitWorkerProcess": true,
"managedPipelineMode": "Integrated",
"virtualApplications": [
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Setup .NET5
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: 3.1.100
dotnet-version: 5.0.100
- name: Build with dotnet
run: dotnet build -c Release /nodeReuse:false

Expand Down
7 changes: 7 additions & 0 deletions Directory.build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<Version>2.1.4</Version>
<AssemblyVersion>2.1.4</AssemblyVersion>
<Product>FasTnT EPCIS</Product>
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Last Commit (develop)](https://img.shields.io/github/last-commit/FasTnT/Epcis/develop.svg?logo=github)
[![Last Commit (develop)](https://img.shields.io/github/last-commit/FasTnT/Epcis/develop.svg?logo=github)](https://github.com/FasTnT/epcis/commits/develop)
![Build Status](https://github.com/FasTnT/epcis/workflows/.NET%20Core/badge.svg)
[![Maintainability](https://api.codeclimate.com/v1/badges/40672e48b92da57852d7/maintainability)](https://codeclimate.com/github/FasTnT/epcis/maintainability)
[![codecov](https://codecov.io/gh/FasTnT/epcis/branch/develop/graph/badge.svg)](https://codecov.io/gh/FasTnT/epcis)
Expand All @@ -8,13 +8,13 @@

# FasTnT EPCIS

FasTnT EPCIS is a lightweight GS1 EPCIS 1.2 repository written in C# using .NET Core 3.1 and backed with PostGreSQL database.
FasTnT EPCIS is a lightweight GS1 EPCIS 1.2 repository written in C# using .NET 5 and backed with PostGreSQL database.

## Setup

Prerequisites:
- PostGreSQL 9.5 or higher
- .NET Core 3.1 SDK
- .NET 5 SDK

Steps:
1. Download the source code, and create a new user/database in PostGreSQL for FasTnT ;
Expand Down
6 changes: 3 additions & 3 deletions src/FasTnT.Data.PostgreSql/Capture/EpcisRequestStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ public async Task Capture(EpcisRequest request, RequestContext context, Cancella
transaction.Commit();
}

private async Task<int> StoreHeader(EpcisRequest request, User user, IDbTransaction transaction, CancellationToken cancellationToken)
private static async Task<int> StoreHeader(EpcisRequest request, User user, IDbTransaction transaction, CancellationToken cancellationToken)
{
var requestDto = RequestDto.Create(request, user.Id);

return await transaction.InsertAsync(requestDto, cancellationToken);
}

private async Task StoreStandardBusinessHeader(StandardBusinessHeader header, int requestId, IDbTransaction transaction, CancellationToken cancellationToken)
private static async Task StoreStandardBusinessHeader(StandardBusinessHeader header, int requestId, IDbTransaction transaction, CancellationToken cancellationToken)
{
if (header == default) return;

Expand Down Expand Up @@ -79,7 +79,7 @@ private static async Task StoreEpcisEvents(List<EpcisEvent> events, int requestI
await eventDtoManager.PersistAsync(transaction, cancellationToken);
}

private async Task StoreMasterData(List<EpcisMasterData> epcisMasterDatas, IDbTransaction tx, CancellationToken cancellationToken)
private static async Task StoreMasterData(List<EpcisMasterData> epcisMasterDatas, IDbTransaction tx, CancellationToken cancellationToken)
{
if (epcisMasterDatas.Count == 0) return;

Expand Down
2 changes: 1 addition & 1 deletion src/FasTnT.Data.PostgreSql/Capture/SubscriptionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task Store(Subscription subscription, CancellationToken cancellatio
var parameterValues = new List<ParameterValueDto>();

using var transaction = _connection.BeginTransaction();
var subscriptionId = await transaction.InsertAsync(SubscriptionDto.Create(subscription));
var subscriptionId = await transaction.InsertAsync(SubscriptionDto.Create(subscription), cancellationToken);

for(short id=0; id<subscription.Parameters.Count; id++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ internal IEnumerable<EpcisEvent> FormatEvents()
return Events.Select(evt =>
{
var epcisEvent = evt.ToEpcisEvent();
epcisEvent.Epcs = Epcs.Where(x => x.Matches(evt)).Select(x => x.ToEpc()).ToList();
epcisEvent.CustomFields = CreateHierarchy(CustomFields.Where(x => x.Matches(evt)));
epcisEvent.BusinessTransactions = Transactions.Where(x => x.Matches(evt)).Select(x => x.ToBusinessTransaction()).ToList();
epcisEvent.SourceDestinationList = SourceDests.Where(x => x.Matches(evt)).Select(x => x.ToSourceDestination()).ToList();
epcisEvent.CorrectiveEventIds = CorrectiveIds.Where(x => x.Matches(evt)).Select(x => x.ToCorrectiveId()).ToList();
epcisEvent.Epcs.AddRange(Epcs.Where(x => x.Matches(evt)).Select(x => x.ToEpc()));
epcisEvent.CustomFields.AddRange(CreateHierarchy(CustomFields.Where(x => x.Matches(evt))));
epcisEvent.BusinessTransactions.AddRange(Transactions.Where(x => x.Matches(evt)).Select(x => x.ToBusinessTransaction()));
epcisEvent.SourceDestinationList.AddRange(SourceDests.Where(x => x.Matches(evt)).Select(x => x.ToSourceDestination()));
epcisEvent.CorrectiveEventIds.AddRange(CorrectiveIds.Where(x => x.Matches(evt)).Select(x => x.ToCorrectiveId()));

return epcisEvent;
});
Expand Down
12 changes: 6 additions & 6 deletions src/FasTnT.Data.PostgreSql/FasTnT.Data.PostgreSql.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>9</LangVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="Migrations\Initial\M008_SubscriptionTrigger.sql" />
Expand Down Expand Up @@ -36,12 +36,12 @@
<EmbeddedResource Include="Migrations\Initial\M008_SubscriptionTrigger.sql" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.35" />
<PackageReference Include="Dapper.SqlBuilder" Version="2.0.35" />
<PackageReference Include="dbup-postgresql" Version="4.4.0" />
<PackageReference Include="Dapper" Version="2.0.78" />
<PackageReference Include="Dapper.SqlBuilder" Version="2.0.78" />
<PackageReference Include="dbup-postgresql" Version="4.5.0" />
<PackageReference Include="Faithlife.Utility.Dapper" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
<PackageReference Include="Npgsql" Version="4.1.5" />
<PackageReference Include="Npgsql" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FasTnT.Domain\FasTnT.Domain.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/FasTnT.Data.PostgreSql/Query/QueryParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public string Add<T>(T value)
: throw new Exception("Impossible to create SQL parameter.");
}

private object GetSqlValue<T>(T value)
private static object GetSqlValue<T>(T value)
{
return value switch
{
Expand Down
6 changes: 3 additions & 3 deletions src/FasTnT.Domain/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace FasTnT.Domain
{
public static class Constants
{
public static string VendorVersion = "2.1.3";
public static string StandardVersion = "1.2";
public static string VendorVersion => Assembly.GetName().Version.ToString(3);
public static string StandardVersion => "1.2";

public static Assembly Assembly = typeof(Constants).Assembly;
public static readonly Assembly Assembly = typeof(Constants).Assembly;
}
}
4 changes: 2 additions & 2 deletions src/FasTnT.Domain/FasTnT.Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>8</LangVersion>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>9</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using FasTnT.Commands.Responses;
using FasTnT.Domain;
using FasTnT.Domain.Data;
using FasTnT.Model.Enums;
using FasTnT.Model.Events;
using FasTnT.Model.Exceptions;
using MediatR;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace FasTnT.Commands.Requests
{
public class CaptureEpcisDocumentHandler : IRequestHandler<CaptureEpcisDocumentRequest, IEpcisResponse>
{
private readonly RequestContext _context;
private readonly IEpcisRequestStore _documentStore;

public CaptureEpcisDocumentHandler(RequestContext context, IEpcisRequestStore documentStore)
{
_context = context;
_documentStore = documentStore;
}

public async Task<IEpcisResponse> Handle(CaptureEpcisDocumentRequest request, CancellationToken cancellationToken)
{
request.Request.EventList.ForEach(Validate);

await _documentStore.Capture(request.Request, _context, cancellationToken);

return EmptyResponse.Value;
}

internal static void Validate(EpcisEvent evt)
{
if (IsAddOrDeleteAggregation(evt) && !evt.Epcs.Any(x => x.Type == EpcType.ParentId)) // TCR-7 parentID is Populated for ADD or DELETE Actions in Aggregation Events
{
throw new EpcisException(ExceptionType.ValidationException, "TCR-7: parentID must be populated for ADD or DELETE aggregation event.");
}
}

private static bool IsAddOrDeleteAggregation(EpcisEvent evt) => evt.Type == EventType.Aggregation && new[] { EventAction.Add, EventAction.Delete }.Contains(evt.Action);
}
}
Original file line number Diff line number Diff line change
@@ -1,56 +1,10 @@
using FasTnT.Commands.Responses;
using FasTnT.Domain;
using FasTnT.Domain.Commands;
using FasTnT.Domain.Data;
using FasTnT.Domain.Commands;
using FasTnT.Model;
using FasTnT.Model.Enums;
using FasTnT.Model.Events;
using FasTnT.Model.Exceptions;
using MediatR;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace FasTnT.Commands.Requests
{
public class CaptureEpcisDocumentRequest : ICaptureRequest
{
public EpcisRequest Request { get; set; }

public class CaptureEpcisDocumentHandler : IRequestHandler<CaptureEpcisDocumentRequest, IEpcisResponse>
{
private readonly RequestContext _context;
private readonly IEpcisRequestStore _documentStore;

public CaptureEpcisDocumentHandler(RequestContext context, IEpcisRequestStore documentStore)
{
_context = context;
_documentStore = documentStore;
}

public async Task<IEpcisResponse> Handle(CaptureEpcisDocumentRequest request, CancellationToken cancellationToken)
{
request.Request.EventList.ForEach(Validate);

await _documentStore.Capture(request.Request, _context, cancellationToken);

return EmptyResponse.Value;
}

internal static void Validate(EpcisEvent evt)
{
foreach(var epc in evt.Epcs)
{
UriValidator.Validate(epc.Id);
}

if (IsAddOrDeleteAggregation(evt) && !evt.Epcs.Any(x => x.Type == EpcType.ParentId)) // TCR-7 parentID is Populated for ADD or DELETE Actions in Aggregation Events
{
throw new EpcisException(ExceptionType.ValidationException, "TCR-7: parentID must be populated for ADD or DELETE aggregation event.");
}
}

private static bool IsAddOrDeleteAggregation(EpcisEvent evt) => evt.Type == EventType.Aggregation && new[] { EventAction.Add, EventAction.Delete }.Contains(evt.Action);
}
public EpcisRequest Request { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using FasTnT.Commands.Responses;
using FasTnT.Domain.Queries;
using MediatR;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace FasTnT.Commands.Requests
{
public class GetQueryNamesHandler : IRequestHandler<GetQueryNamesRequest, IEpcisResponse>
{
private readonly IEnumerable<IEpcisQuery> _queries;

public GetQueryNamesHandler(IEnumerable<IEpcisQuery> queries)
{
_queries = queries;
}

public async Task<IEpcisResponse> Handle(GetQueryNamesRequest request, CancellationToken cancellationToken)
{
return await Task.FromResult(new GetQueryNamesResponse
{
QueryNames = _queries.Select(q => q.Name).ToArray()
});
}
}
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
using FasTnT.Commands.Responses;
using FasTnT.Domain.Commands;
using FasTnT.Domain.Queries;
using MediatR;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using FasTnT.Domain.Commands;

namespace FasTnT.Commands.Requests
{
public class GetQueryNamesRequest : IQueryRequest
{
public class GetQueryNamesHandler : IRequestHandler<GetQueryNamesRequest, IEpcisResponse>
{
private readonly IEnumerable<IEpcisQuery> _queries;

public GetQueryNamesHandler(IEnumerable<IEpcisQuery> queries)
{
_queries = queries;
}

public async Task<IEpcisResponse> Handle(GetQueryNamesRequest request, CancellationToken cancellationToken)
{
return await Task.FromResult(new GetQueryNamesResponse
{
QueryNames = _queries.Select(q => q.Name).ToArray()
});
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using FasTnT.Commands.Responses;
using FasTnT.Domain;
using MediatR;
using System.Threading;
using System.Threading.Tasks;

namespace FasTnT.Commands.Requests
{
public class GetStandardVersionHandler : IRequestHandler<GetStandardVersionRequest, IEpcisResponse>
{
public async Task<IEpcisResponse> Handle(GetStandardVersionRequest request, CancellationToken cancellationToken)
{
var result = new GetStandardVersionResponse { Version = Constants.StandardVersion };

return await Task.FromResult(result);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
using FasTnT.Commands.Responses;
using FasTnT.Domain;
using FasTnT.Domain.Commands;
using MediatR;
using System.Threading;
using System.Threading.Tasks;
using FasTnT.Domain.Commands;

namespace FasTnT.Commands.Requests
{
public class GetStandardVersionRequest : IQueryRequest
{
public class GetStandardVersionHandler : IRequestHandler<GetStandardVersionRequest, IEpcisResponse>
{
public async Task<IEpcisResponse> Handle(GetStandardVersionRequest request, CancellationToken cancellationToken)
{
var result = new GetStandardVersionResponse { Version = Constants.StandardVersion };

return await Task.FromResult(result);
}
}
}
}
Loading

0 comments on commit e0e28bc

Please sign in to comment.