diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml
index 115cbf86..723f23df 100644
--- a/.github/workflows/all.yml
+++ b/.github/workflows/all.yml
@@ -17,9 +17,11 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.x
+
- name: C-Gen - Restore dependencies
run: dotnet restore
working-directory: src/Services/c-gen
+
- name: C-Gen - Build
run: dotnet build --no-restore
working-directory: src/Services/c-gen
@@ -44,10 +46,57 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: src/Services/TestResults/coverage.info
-
+
+ - name: E-Sender - Restore dependencies
+ run: dotnet restore
+ working-directory: src/Services/e-sender
+
+ - name: E-Sender - Build
+ run: dotnet build --no-restore
+ working-directory: src/Services/e-sender
+
+ - name: E-Sender - Unit Tests(Tests.O2NextGen.ESender.Api)
+ run: dotnet test Tests.O2NextGen.ESender.Api.csproj --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutput==../../../TestResults/ /p:CoverletOutputFormat=lcov
+ working-directory: src/Services/e-sender/Tests/Tests.O2NextGen.ESender.Api/
+
+ - name: E-Sender - Unit Tests (Tests.O2NextGen.ESender.Data)
+ run: dotnet test Tests.O2NextGen.ESender.Data.csproj --no-build --verbosity normal /p:MergeWith=src/Services/TestResults/coverage.info /p:CollectCoverage=true /p:CoverletOutput=../../../TestResults/ /p:CoverletOutputFormat=lcov
+ working-directory: src/Services/e-sender/Tests/Tests.O2NextGen.ESender.Data/
+
+ - name: E-Sender - Unit Tests (Tests.O2NextGen.ESender.Impl)
+ run: dotnet test Tests.O2NextGen.ESender.Impl.csproj --no-build --verbosity normal /p:MergeWith=src/Services/TestResults/coverage.info /p:CollectCoverage=true /p:CoverletOutput=../../../TestResults/ /p:CoverletOutputFormat=lcov
+ working-directory: src/Services/e-sender/Tests/Tests.O2NextGen.ESender.Impl/
+
+ - name: E-Sender - Unit Tests (Tests.O2NextGen.ESender.Business)
+ run: dotnet test Tests.O2NextGen.ESender.Business.csproj --no-build --verbosity normal /p:MergeWith=src/Services/TestResults/coverage.info /p:CollectCoverage=true /p:CoverletOutput=../../../TestResults/ /p:CoverletOutputFormat=lcov
+ working-directory: src/Services/e-sender/Tests/Tests.O2NextGen.ESender.Business/
+
+ # - name: E-Sender - Integration Tests(IntegrationTests.O2NextGen.ESender.Api)
+ # run: dotnet test IntegrationTests.O2NextGen.ESender.Api.csproj --no-build --verbosity normal /p:MergeWith=src/Services/TestResults/coverage.info /p:CollectCoverage=true /p:CoverletOutput=../../../TestResults/ /p:CoverletOutputFormat=lcov
+ # working-directory: src/Services/e-sender/Tests/IntegrationTests.O2NextGen.ESender.Api/
+
+ # - name: E-Sender - Integration Tests(IntegrationTests.O2NextGen.ESender.Data)
+ # run: dotnet test IntegrationTests.O2NextGen.ESender.Data.csproj --no-build --verbosity normal /p:MergeWith=src/Services/TestResults/coverage.info /p:CollectCoverage=true /p:CoverletOutput=../../../TestResults/ /p:CoverletOutputFormat=lcov
+ # working-directory: src/Services/e-sender/Tests/IntegrationTests.O2NextGen.ESender.Data/
+
+ # - name: E-Sender - Integration Tests(IntegrationTests.O2NextGen.ESender.Impl)
+ # run: dotnet test IntegrationTests.O2NextGen.ESender.Impl.csproj --no-build --verbosity normal /p:MergeWith=src/Services/TestResults/coverage.info /p:CollectCoverage=true /p:CoverletOutput=../../../TestResults/ /p:CoverletOutputFormat=lcov
+ # working-directory: src/Services/e-sender/Tests/IntegrationTests.O2NextGen.ESender.Impl/
+
+ # - name: E-Sender - Integration Tests(IntegrationTests.O2NextGen.ESender.Business)
+ # run: dotnet test IntegrationTests.O2NextGen.ESender.Business.csproj --no-build --verbosity normal /p:MergeWith=src/Services/TestResults/coverage.info /p:CollectCoverage=true /p:CoverletOutput=../../../TestResults/ /p:CoverletOutputFormat=lcov
+ # working-directory: src/Services/e-sender/Tests/IntegrationTests.O2NextGen.ESender.Business/
+
+ - name: Publish coverage report to coveralls.io
+ uses: coverallsapp/github-action@master
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ path-to-lcov: src/Services/TestResults/coverage.info
+
- name: Auth - Restore dependencies
run: dotnet restore
working-directory: src/Services/auth
+
- name: Auth - Build
run: dotnet build --no-restore
working-directory: src/Services/auth
diff --git a/.github/workflows/e-sender.yml b/.github/workflows/e-sender.yml
new file mode 100644
index 00000000..628fe567
--- /dev/null
+++ b/.github/workflows/e-sender.yml
@@ -0,0 +1,32 @@
+name: e-sender
+
+on:
+ push:
+ branches:
+ - master
+ - dev
+ pull_request:
+ branches:
+ - master
+ - dev
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: 2.2.x
+ - name: Restore dependencies
+ run: dotnet restore
+ working-directory: src/Services/e-sender
+ - name: Build
+ run: dotnet build --no-restore
+ working-directory: src/Services/e-sender
+ - name: Test
+ run: dotnet test --no-build --verbosity normal
+ working-directory: src/Services/e-sender
diff --git a/README.md b/README.md
index f87d97b2..ceae01ab 100644
--- a/README.md
+++ b/README.md
@@ -218,4 +218,5 @@ build number - Build Number
3 - release
sample: 1.1.3.3 like (1.1-r.3)
revision - git revision
- ```
\ No newline at end of file
+ ```
+ ```
diff --git a/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/Mappers/BaseMappingTests.cs b/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/Mappers/BaseMappingTests.cs
new file mode 100644
index 00000000..12abd3b9
--- /dev/null
+++ b/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/Mappers/BaseMappingTests.cs
@@ -0,0 +1,18 @@
+using NUnit.Framework;
+
+namespace O2NG.Sdk.UnitTester.NetCore.Mappers
+{
+ public class BaseMappingTests
+ {
+ [SetUp]
+ public void Setup()
+ {
+ }
+
+ [Test]
+ public void Test1()
+ {
+ Assert.Pass();
+ }
+ }
+}
diff --git a/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/O2NG.Sdk.IntegrationTester.NetCore/O2NG.Sdk.IntegrationTester.NetCore.csproj b/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/O2NG.Sdk.IntegrationTester.NetCore/O2NG.Sdk.IntegrationTester.NetCore.csproj
new file mode 100644
index 00000000..09b7577b
--- /dev/null
+++ b/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/O2NG.Sdk.IntegrationTester.NetCore/O2NG.Sdk.IntegrationTester.NetCore.csproj
@@ -0,0 +1,15 @@
+
+
+
+ netcoreapp2.1
+
+ false
+
+
+
+
+
+
+
+
+
diff --git a/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/O2NG.Sdk.IntegrationTester.NetCore/UnitTest1.cs b/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/O2NG.Sdk.IntegrationTester.NetCore/UnitTest1.cs
new file mode 100644
index 00000000..5343ce7a
--- /dev/null
+++ b/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/O2NG.Sdk.IntegrationTester.NetCore/UnitTest1.cs
@@ -0,0 +1,13 @@
+using Xunit;
+
+namespace O2NG.Sdk.IntegrationTester.NetCore
+{
+ public class Tests
+ {
+ [Fact]
+ public void Test1()
+ {
+
+ }
+ }
+}
diff --git a/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/O2NG.Sdk.UnitTester.NetCore.csproj b/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/O2NG.Sdk.UnitTester.NetCore.csproj
new file mode 100644
index 00000000..e430a463
--- /dev/null
+++ b/src/SDKs/O2NG.Tester.Sdk/O2NG.Sdk.UnitTester.NetCore/O2NG.Sdk.UnitTester.NetCore.csproj
@@ -0,0 +1,52 @@
+
+
+
+ netcoreapp2.1
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/SDKs/O2NG.Tester.Sdk/O2NG.Tester.Sdk.sln b/src/SDKs/O2NG.Tester.Sdk/O2NG.Tester.Sdk.sln
new file mode 100644
index 00000000..2a51a216
--- /dev/null
+++ b/src/SDKs/O2NG.Tester.Sdk/O2NG.Tester.Sdk.sln
@@ -0,0 +1,41 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 25.0.1700.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WPF", "WPF", "{0BD21E13-AC0B-4567-823C-CE1B4D286489}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XAMARIN", "XAMARIN", "{EF06ACB4-9E8C-47B5-B709-DBE7A4BED4E4}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".NetCore", ".NetCore", "{B94CA396-F1CA-4326-B5E3-7C4FFA843076}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NG.Sdk.UnitTester.NetCore", "O2NG.Sdk.UnitTester.NetCore\O2NG.Sdk.UnitTester.NetCore.csproj", "{A93A8701-CF00-446D-9B51-8C762B896BB6}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NG.Sdk.IntegrationTester.NetCore", "O2NG.Sdk.UnitTester.NetCore\O2NG.Sdk.IntegrationTester.NetCore\O2NG.Sdk.IntegrationTester.NetCore.csproj", "{953F39E9-9D11-4C7F-AF76-9EEC2FA12644}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A93A8701-CF00-446D-9B51-8C762B896BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A93A8701-CF00-446D-9B51-8C762B896BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A93A8701-CF00-446D-9B51-8C762B896BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A93A8701-CF00-446D-9B51-8C762B896BB6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {953F39E9-9D11-4C7F-AF76-9EEC2FA12644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {953F39E9-9D11-4C7F-AF76-9EEC2FA12644}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {953F39E9-9D11-4C7F-AF76-9EEC2FA12644}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {953F39E9-9D11-4C7F-AF76-9EEC2FA12644}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {4670C972-682D-4FA8-9097-095CB3E02EBB}
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {A93A8701-CF00-446D-9B51-8C762B896BB6} = {B94CA396-F1CA-4326-B5E3-7C4FFA843076}
+ {953F39E9-9D11-4C7F-AF76-9EEC2FA12644} = {B94CA396-F1CA-4326-B5E3-7C4FFA843076}
+ EndGlobalSection
+EndGlobal
diff --git a/src/Services/e-sender/O2NextGen.ESender.Api.sln b/src/Services/e-sender/O2NextGen.ESender.Api.sln
index 86a4e5ff..538d0175 100644
--- a/src/Services/e-sender/O2NextGen.ESender.Api.sln
+++ b/src/Services/e-sender/O2NextGen.ESender.Api.sln
@@ -11,6 +11,24 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.ESender.Impl", "O
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "O2NextGen.ESender.Data", "O2NextGen.ESender.Data\O2NextGen.ESender.Data.csproj", "{307B36BA-BFB2-4294-93DB-6C2F3455C06A}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{4D4C70FE-9CB3-4D78-837F-120EBAAD651B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.O2NextGen.ESender.Api", "Tests\IntegrationTests.O2NextGen.ESender.Api\IntegrationTests.O2NextGen.ESender.Api.csproj", "{0CA484B4-E79A-43E1-ABAC-30C661DD637D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.O2NextGen.ESender.Api", "Tests\Tests.O2NextGen.ESender.Api\Tests.O2NextGen.ESender.Api.csproj", "{0AD9CB1F-539F-4D06-9E19-C724C0350488}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.O2NextGen.ESender.Business", "Tests\Tests.O2NextGen.ESender.Business\Tests.O2NextGen.ESender.Business.csproj", "{313FF018-98BB-4229-A2E6-525F1ACA13D9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.O2NextGen.ESender.Business", "Tests\IntegrationTests.O2NextGen.ESender.Business\IntegrationTests.O2NextGen.ESender.Business.csproj", "{C6455931-5324-40B0-B101-0B68A119C1C3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.O2NextGen.ESender.Data", "Tests\IntegrationTests.O2NextGen.ESender.Data\IntegrationTests.O2NextGen.ESender.Data.csproj", "{FC4C87E2-DD4B-46E0-92EB-62482631A16C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.O2NextGen.ESender.Data", "Tests\Tests.O2NextGen.ESender.Data\Tests.O2NextGen.ESender.Data.csproj", "{EA85C970-EF8B-4860-B6F2-0C6FDCAD5BCD}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.O2NextGen.ESender.Impl", "Tests\Tests.O2NextGen.ESender.Impl\Tests.O2NextGen.ESender.Impl.csproj", "{0A589BE0-F0F3-4E52-BAC3-87F12D31E8CA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.O2NextGen.ESender.Impl", "Tests\IntegrationTests.O2NextGen.ESender.Impl\IntegrationTests.O2NextGen.ESender.Impl.csproj", "{534D8645-6FA7-4F66-A90F-4C99FD5DED4D}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -33,6 +51,38 @@ Global
{307B36BA-BFB2-4294-93DB-6C2F3455C06A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{307B36BA-BFB2-4294-93DB-6C2F3455C06A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{307B36BA-BFB2-4294-93DB-6C2F3455C06A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0CA484B4-E79A-43E1-ABAC-30C661DD637D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0CA484B4-E79A-43E1-ABAC-30C661DD637D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0CA484B4-E79A-43E1-ABAC-30C661DD637D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0CA484B4-E79A-43E1-ABAC-30C661DD637D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0AD9CB1F-539F-4D06-9E19-C724C0350488}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0AD9CB1F-539F-4D06-9E19-C724C0350488}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0AD9CB1F-539F-4D06-9E19-C724C0350488}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0AD9CB1F-539F-4D06-9E19-C724C0350488}.Release|Any CPU.Build.0 = Release|Any CPU
+ {313FF018-98BB-4229-A2E6-525F1ACA13D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {313FF018-98BB-4229-A2E6-525F1ACA13D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {313FF018-98BB-4229-A2E6-525F1ACA13D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {313FF018-98BB-4229-A2E6-525F1ACA13D9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C6455931-5324-40B0-B101-0B68A119C1C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C6455931-5324-40B0-B101-0B68A119C1C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C6455931-5324-40B0-B101-0B68A119C1C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C6455931-5324-40B0-B101-0B68A119C1C3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FC4C87E2-DD4B-46E0-92EB-62482631A16C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FC4C87E2-DD4B-46E0-92EB-62482631A16C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FC4C87E2-DD4B-46E0-92EB-62482631A16C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FC4C87E2-DD4B-46E0-92EB-62482631A16C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EA85C970-EF8B-4860-B6F2-0C6FDCAD5BCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EA85C970-EF8B-4860-B6F2-0C6FDCAD5BCD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EA85C970-EF8B-4860-B6F2-0C6FDCAD5BCD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EA85C970-EF8B-4860-B6F2-0C6FDCAD5BCD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0A589BE0-F0F3-4E52-BAC3-87F12D31E8CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0A589BE0-F0F3-4E52-BAC3-87F12D31E8CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0A589BE0-F0F3-4E52-BAC3-87F12D31E8CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0A589BE0-F0F3-4E52-BAC3-87F12D31E8CA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {534D8645-6FA7-4F66-A90F-4C99FD5DED4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {534D8645-6FA7-4F66-A90F-4C99FD5DED4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {534D8645-6FA7-4F66-A90F-4C99FD5DED4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {534D8645-6FA7-4F66-A90F-4C99FD5DED4D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -40,4 +90,14 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B0B1A6AC-DCC6-4AAB-B22C-8767ECCB3CF2}
EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {0CA484B4-E79A-43E1-ABAC-30C661DD637D} = {4D4C70FE-9CB3-4D78-837F-120EBAAD651B}
+ {0AD9CB1F-539F-4D06-9E19-C724C0350488} = {4D4C70FE-9CB3-4D78-837F-120EBAAD651B}
+ {313FF018-98BB-4229-A2E6-525F1ACA13D9} = {4D4C70FE-9CB3-4D78-837F-120EBAAD651B}
+ {C6455931-5324-40B0-B101-0B68A119C1C3} = {4D4C70FE-9CB3-4D78-837F-120EBAAD651B}
+ {FC4C87E2-DD4B-46E0-92EB-62482631A16C} = {4D4C70FE-9CB3-4D78-837F-120EBAAD651B}
+ {EA85C970-EF8B-4860-B6F2-0C6FDCAD5BCD} = {4D4C70FE-9CB3-4D78-837F-120EBAAD651B}
+ {0A589BE0-F0F3-4E52-BAC3-87F12D31E8CA} = {4D4C70FE-9CB3-4D78-837F-120EBAAD651B}
+ {534D8645-6FA7-4F66-A90F-4C99FD5DED4D} = {4D4C70FE-9CB3-4D78-837F-120EBAAD651B}
+ EndGlobalSection
EndGlobal
diff --git a/src/Services/e-sender/O2NextGen.ESender.Api/Controllers/BoardController.cs b/src/Services/e-sender/O2NextGen.ESender.Api/Controllers/BoardController.cs
index c7ac334a..07f2cb37 100644
--- a/src/Services/e-sender/O2NextGen.ESender.Api/Controllers/BoardController.cs
+++ b/src/Services/e-sender/O2NextGen.ESender.Api/Controllers/BoardController.cs
@@ -43,7 +43,7 @@ public async Task Detail(long id)
[HttpPost]
[Route("id")]
[ValidateAntiForgeryToken]
- public async Task Edit(long id, MailRequestViewModel model)
+ public async Task Edit(long id, EmailRequestViewModel model)
{
var certificate = await _emailSenderService.GetByIdAsync(id, CancellationToken.None);
if (certificate == null)
@@ -65,7 +65,7 @@ public IActionResult Create()
[HttpPost]
[Route("")]
- public async Task CreateReally(MailRequestViewModel model)
+ public async Task CreateReally(EmailRequestViewModel model)
{
var emailRequest = await _emailSenderService.AddAsync(model.ToModel(), CancellationToken.None);
await _emailSender.Send(model.To, model.Subject, model.Body);
diff --git a/src/Services/e-sender/O2NextGen.ESender.Api/Controllers/EmailSenderController.cs b/src/Services/e-sender/O2NextGen.ESender.Api/Controllers/EmailSenderController.cs
index fb7109b1..af4be29f 100644
--- a/src/Services/e-sender/O2NextGen.ESender.Api/Controllers/EmailSenderController.cs
+++ b/src/Services/e-sender/O2NextGen.ESender.Api/Controllers/EmailSenderController.cs
@@ -50,7 +50,7 @@ public async Task GetByIdAsync(long id, CancellationToken ct)
[HttpPut]
[Route("id")]
- public async Task UpdateAsync(long id, [FromBody]MailRequestViewModel model, CancellationToken ct)
+ public async Task UpdateAsync(long id, [FromBody]EmailRequestViewModel model, CancellationToken ct)
{
var certificate = await _emailSenderService.UpdateAsync(model.ToModel(), ct);
return Ok(certificate.ToViewModel());
@@ -59,7 +59,7 @@ public async Task UpdateAsync(long id, [FromBody]MailRequestViewM
[HttpPost]
[HttpPut]
[Route("")]
- public async Task AddAsync([FromBody]MailRequestViewModel model, CancellationToken ct)
+ public async Task AddAsync([FromBody]EmailRequestViewModel model, CancellationToken ct)
{
var emailRequest = await _emailSenderService.AddAsync(model.ToModel(), ct);
await _emailSender.Send(model.To, model.Subject, model.Body);
diff --git a/src/Services/e-sender/O2NextGen.ESender.Api/Extensions/KeyGenerator.cs b/src/Services/e-sender/O2NextGen.ESender.Api/Extensions/KeyGenerator.cs
new file mode 100644
index 00000000..865b3241
--- /dev/null
+++ b/src/Services/e-sender/O2NextGen.ESender.Api/Extensions/KeyGenerator.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+
+namespace O2NextGen.ESender.Api.Extensions
+{
+ public static class KeyGenerator
+ {
+ // private const string ValidChars = "abcdefghjkmnprstwxz2345789"; // Letters and numbers that are not easily mixed with others when reading
+ private const string ValidChars = "ABCDEFHJKLMNPRSTUWXYZ012345789";
+ private static readonly Dictionary ValidCharLookup = new Dictionary();
+ private static readonly Random Rnd = new Random();
+
+ static KeyGenerator()
+ {
+ // Set up a quick lookup dictionary for all valid characters
+ foreach (var c in ValidChars.ToUpperInvariant())
+ ValidCharLookup.Add(c, true);
+ }
+
+ public static string Generate(int length)
+ {
+ var ret = new char[length];
+ for (var i = 0; i < length; i++)
+ {
+ int c;
+ lock (Rnd)
+ {
+ c = Rnd.Next(0, ValidChars.Length);
+ }
+
+ ret[i] = ValidChars[c];
+ }
+
+ return new string(ret);
+ }
+
+ public static bool Validate(int maxLength, string key)
+ {
+ if (key.Length > maxLength)
+ return false;
+
+ foreach (var c in key.ToUpperInvariant())
+ if (!ValidCharLookup.ContainsKey(c))
+ return false;
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Services/e-sender/O2NextGen.ESender.Api/Extensions/UnixDateExtensions.cs b/src/Services/e-sender/O2NextGen.ESender.Api/Extensions/UnixDateExtensions.cs
new file mode 100644
index 00000000..d88f3a27
--- /dev/null
+++ b/src/Services/e-sender/O2NextGen.ESender.Api/Extensions/UnixDateExtensions.cs
@@ -0,0 +1,20 @@
+using System;
+
+namespace O2NextGen.ESender.Api.Extensions
+{
+ public static class UnixDateExtensions
+ {
+ private static readonly DateTime UnixEpoch =
+ new DateTime(1970, 1, 1, 0, 0, 0, 0).ToLocalTime();
+
+ public static DateTime ConvertToDateTime(this long seconds, bool isSeconds = true)
+ {
+ return isSeconds ? UnixEpoch.AddSeconds(seconds) : UnixEpoch.AddMinutes(seconds);
+ }
+
+ public static long ConvertToUnixTime(this DateTime datetime, bool isSeconds = true)
+ {
+ return isSeconds ? (long)(datetime - UnixEpoch).TotalSeconds : (long)(datetime - UnixEpoch).TotalMinutes;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Services/e-sender/O2NextGen.ESender.Api/Mappings/BaseMappings.cs b/src/Services/e-sender/O2NextGen.ESender.Api/Mappings/BaseMappings.cs
new file mode 100644
index 00000000..83a77898
--- /dev/null
+++ b/src/Services/e-sender/O2NextGen.ESender.Api/Mappings/BaseMappings.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using O2NextGen.ESender.Api.Extensions;
+using O2NextGen.ESender.Api.Models;
+using O2NextGen.ESender.Business.Models;
+
+namespace O2NextGen.ESender.Api.Mappings
+{
+ public class BaseMappings
+ where TViewModel : class, IViewModel
+ where TModel : class, IBaseModel
+ {
+ public TViewModel ToViewModel(TModel model)
+ {
+ if (model == null)
+ return null;
+
+ var returnViewModel = Activator.CreateInstance();
+
+ returnViewModel.Id = model.Id;
+ returnViewModel.ExternalId = model.ExternalId;
+ returnViewModel.AddedDate = model.AddedDate;
+ returnViewModel.ModifiedDate = model.ModifiedDate;
+ returnViewModel.DeletedDate = model.DeletedDate;
+ returnViewModel.IsDeleted = model.IsDeleted;
+
+ return returnViewModel;
+ }
+
+ public TModel ToServiceModel(TViewModel viewModel)
+ {
+ //Todo: return not null
+ if (viewModel == null)
+ return null;
+
+ var model = Activator.CreateInstance();
+
+ model.Id = viewModel.Id;
+ model.ExternalId = viewModel.ExternalId;
+ model.AddedDate = viewModel.AddedDate ?? default(long);
+ model.ModifiedDate = viewModel.ModifiedDate ?? default(long);
+ model.DeletedDate = viewModel.DeletedDate ?? DateTime.Now.ConvertToUnixTime();
+ model.IsDeleted = viewModel.IsDeleted ?? default(bool);
+
+ return model;
+ }
+
+ public IReadOnlyCollection ToViewModel(IReadOnlyCollection models)
+ {
+ if (models.Count == 0)
+ {
+ return Array.Empty();
+ }
+
+ var subscription = new TViewModel[models.Count];
+ var i = 0;
+ foreach (var model in models)
+ {
+ subscription[i] = ToViewModel(model);
+ ++i;
+ }
+
+ return new ReadOnlyCollection(subscription);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Services/e-sender/O2NextGen.ESender.Api/Mappings/EmailRequestMappings.cs b/src/Services/e-sender/O2NextGen.ESender.Api/Mappings/EmailRequestMappings.cs
index e2b0e6b8..c7871f8e 100644
--- a/src/Services/e-sender/O2NextGen.ESender.Api/Mappings/EmailRequestMappings.cs
+++ b/src/Services/e-sender/O2NextGen.ESender.Api/Mappings/EmailRequestMappings.cs
@@ -8,15 +8,23 @@ namespace O2NextGen.ESender.Api.Mappings
{
public static class EmailRequestMappings
{
- public static MailRequestViewModel ToViewModel(this EmailRequest model)
+ private static readonly
+ BaseMappings BaseMappings;
+
+ static EmailRequestMappings()
+ {
+ BaseMappings =
+ new BaseMappings();
+ }
+
+ public static EmailRequestViewModel ToViewModel(this EmailRequestModel model)
{
if (model == null)
return null;
- var viewModel = new MailRequestViewModel();
+ var viewModel = BaseMappings.ToViewModel(model);
//Bindings
- viewModel.Id = model.Id;
viewModel.From = model.From;
viewModel.To = model.To;
viewModel.Subject = model.Subject;
@@ -25,32 +33,31 @@ public static MailRequestViewModel ToViewModel(this EmailRequest model)
return viewModel;
}
- public static EmailRequest ToModel(this MailRequestViewModel requestViewModel)
+ public static EmailRequestModel ToModel(this EmailRequestViewModel viewModel)
{
- if (requestViewModel == null)
+ if (viewModel == null)
return null;
- var model = new EmailRequest();
+ var model = BaseMappings.ToServiceModel(viewModel);
//Bindings
- model.Id = requestViewModel.Id;
- model.From = requestViewModel.From;
- model.To = requestViewModel.To;
- model.Subject = requestViewModel.Subject;
- model.Body = requestViewModel.Body;
+ model.From = viewModel.From;
+ model.To = viewModel.To;
+ model.Subject = viewModel.Subject;
+ model.Body = viewModel.Body;
return model;
}
- public static IReadOnlyCollection ToViewModel(
- this IReadOnlyCollection models)
+ public static IReadOnlyCollection ToViewModel(
+ this IReadOnlyCollection models)
{
if (models.Count == 0)
{
- return Array.Empty();
+ return Array.Empty();
}
- var subscription = new MailRequestViewModel[models.Count];
+ var subscription = new EmailRequestViewModel[models.Count];
var i = 0;
foreach (var model in models)
{
@@ -58,7 +65,23 @@ public static IReadOnlyCollection ToViewModel(
++i;
}
- return new ReadOnlyCollection(subscription);
+ return new ReadOnlyCollection(subscription);
+ }
+
+ public static IReadOnlyCollection ToModel(
+ this IReadOnlyCollection models)
+ {
+ if (models.Count == 0) return Array.Empty();
+
+ var subscription = new EmailRequestModel[models.Count];
+ var i = 0;
+ foreach (var model in models)
+ {
+ subscription[i] = ToModel(model);
+ ++i;
+ }
+
+ return new ReadOnlyCollection(subscription);
}
}
}
\ No newline at end of file
diff --git a/src/Services/e-sender/O2NextGen.ESender.Api/Models/EmailRequestViewModel.cs b/src/Services/e-sender/O2NextGen.ESender.Api/Models/EmailRequestViewModel.cs
new file mode 100644
index 00000000..79cb5e9e
--- /dev/null
+++ b/src/Services/e-sender/O2NextGen.ESender.Api/Models/EmailRequestViewModel.cs
@@ -0,0 +1,27 @@
+using System;
+namespace O2NextGen.ESender.Api.Models
+{
+ public interface IViewModel
+ {
+ long Id { get; set; }
+ string ExternalId { get; set; }
+ long? ModifiedDate { get; set; }
+ long? AddedDate { get; set; }
+ long? DeletedDate { get; set; }
+ bool? IsDeleted { get; set; }
+ }
+ public class EmailRequestViewModel: IViewModel
+ {
+ public long Id { get; set; }
+ public string ExternalId { get; set; }
+ public long? ModifiedDate { get; set; }
+ public long? AddedDate { get; set; }
+ public long? DeletedDate { get; set; }
+ public bool? IsDeleted { get; set; }
+ public string From { get; set; }
+ public string To { get; set; }
+ public string Body { get; set; }
+ public string Subject { get; set; }
+ }
+}
+
diff --git a/src/Services/e-sender/O2NextGen.ESender.Api/Models/MailRequestViewModel.cs b/src/Services/e-sender/O2NextGen.ESender.Api/Models/MailRequestViewModel.cs
deleted file mode 100644
index 23b38665..00000000
--- a/src/Services/e-sender/O2NextGen.ESender.Api/Models/MailRequestViewModel.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-namespace O2NextGen.ESender.Api.Models
-{
- public class MailRequestViewModel
- {
- public long Id { get; set; }
- public string From { get; set; }
- public string To { get; set; }
- public string Body { get; set; }
- public string Subject { get; set; }
- }
-}
-
diff --git a/src/Services/e-sender/O2NextGen.ESender.Api/Views/Board/Create.cshtml b/src/Services/e-sender/O2NextGen.ESender.Api/Views/Board/Create.cshtml
index ae9c83ec..01a33fac 100644
--- a/src/Services/e-sender/O2NextGen.ESender.Api/Views/Board/Create.cshtml
+++ b/src/Services/e-sender/O2NextGen.ESender.Api/Views/Board/Create.cshtml
@@ -1,4 +1,4 @@
-@model MailRequestViewModel
+@model EmailRequestViewModel