diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 202659b..675f76c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup .NET SDK - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - name: Restore NuGet packages @@ -27,7 +27,7 @@ jobs: # Launch and prepare MySQL server sudo systemctl start mysql.service - dotnet run -c Release --no-build --project server/src/Korga.Server -- database create + dotnet run -c Release --no-build --project server/Korga -- database create - name: Test run: dotnet test -c Release --no-build --verbosity normal diff --git a/Dockerfile b/Dockerfile index 876f545..8b9da26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,12 +13,12 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS server WORKDIR /app # Copy csproj and restore as distinct layers -COPY server/src/Korga.Server/Korga.Server.csproj ./Korga.Server/ -RUN dotnet restore Korga.Server +COPY server/Korga/Korga.csproj ./Korga/ +RUN dotnet restore Korga # Copy everything else and build -COPY server/src ./ -RUN dotnet publish -c Release -o /app/out Korga.Server +COPY server ./ +RUN dotnet publish -c Release -o /app/out Korga # Build runtime image FROM mcr.microsoft.com/dotnet/aspnet:8.0 @@ -26,4 +26,4 @@ WORKDIR /app COPY --from=server /app/out . COPY --from=webapp /app/dist wwwroot/ -ENTRYPOINT ["dotnet", "Korga.Server.dll"] +ENTRYPOINT ["dotnet", "Korga.dll"] diff --git a/Korga.sln b/Korga.sln index 7222692..520ecbe 100644 --- a/Korga.sln +++ b/Korga.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.1.32210.238 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Korga.Server", "server\src\Korga.Server\Korga.Server.csproj", "{E1C5CDEB-C3D5-4BE1-B823-5FD650AB1D08}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Korga", "server\Korga\Korga.csproj", "{E1C5CDEB-C3D5-4BE1-B823-5FD650AB1D08}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "server-src", "server-src", "{565B1C55-E3A4-4B7E-9F8E-EF14AA917618}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "server", "server", "{565B1C55-E3A4-4B7E-9F8E-EF14AA917618}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_", "_", "{28945597-DB66-4C1C-A2DB-C5ACB5ED4DD4}" ProjectSection(SolutionItems) = preProject @@ -13,10 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_", "_", "{28945597-DB66-4C README.md = README.md EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "server-tests", "server-tests", "{86DB2784-54F6-43CC-8F86-94E059B7DE59}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Korga.Server.Tests", "server\tests\Korga.Server.Tests\Korga.Server.Tests.csproj", "{2A484A88-F6BD-4B36-92C8-0675ADDD8CDB}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{2ED6D7FB-8B8A-4139-98C3-854E00A38490}" ProjectSection(SolutionItems) = preProject docs\docker-compose.yml = docs\docker-compose.yml @@ -24,7 +20,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{2ED6D7FB-8 docs\frontend.md = docs\frontend.md EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Korga.Core", "server\src\Korga.Core\Korga.Core.csproj", "{D1CEB029-9AFB-4464-BF93-DBA6216B4128}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChurchTools", "server\ChurchTools\ChurchTools.csproj", "{D1CEB029-9AFB-4464-BF93-DBA6216B4128}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Korga.Tests", "server\Korga.Tests\Korga.Tests.csproj", "{EFA087E1-C034-44A2-B1C1-DEDCF996FEB1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -36,22 +34,22 @@ Global {E1C5CDEB-C3D5-4BE1-B823-5FD650AB1D08}.Debug|Any CPU.Build.0 = Debug|Any CPU {E1C5CDEB-C3D5-4BE1-B823-5FD650AB1D08}.Release|Any CPU.ActiveCfg = Release|Any CPU {E1C5CDEB-C3D5-4BE1-B823-5FD650AB1D08}.Release|Any CPU.Build.0 = Release|Any CPU - {2A484A88-F6BD-4B36-92C8-0675ADDD8CDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2A484A88-F6BD-4B36-92C8-0675ADDD8CDB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2A484A88-F6BD-4B36-92C8-0675ADDD8CDB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2A484A88-F6BD-4B36-92C8-0675ADDD8CDB}.Release|Any CPU.Build.0 = Release|Any CPU {D1CEB029-9AFB-4464-BF93-DBA6216B4128}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D1CEB029-9AFB-4464-BF93-DBA6216B4128}.Debug|Any CPU.Build.0 = Debug|Any CPU {D1CEB029-9AFB-4464-BF93-DBA6216B4128}.Release|Any CPU.ActiveCfg = Release|Any CPU {D1CEB029-9AFB-4464-BF93-DBA6216B4128}.Release|Any CPU.Build.0 = Release|Any CPU + {EFA087E1-C034-44A2-B1C1-DEDCF996FEB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EFA087E1-C034-44A2-B1C1-DEDCF996FEB1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EFA087E1-C034-44A2-B1C1-DEDCF996FEB1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EFA087E1-C034-44A2-B1C1-DEDCF996FEB1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {E1C5CDEB-C3D5-4BE1-B823-5FD650AB1D08} = {565B1C55-E3A4-4B7E-9F8E-EF14AA917618} - {2A484A88-F6BD-4B36-92C8-0675ADDD8CDB} = {86DB2784-54F6-43CC-8F86-94E059B7DE59} {D1CEB029-9AFB-4464-BF93-DBA6216B4128} = {565B1C55-E3A4-4B7E-9F8E-EF14AA917618} + {EFA087E1-C034-44A2-B1C1-DEDCF996FEB1} = {565B1C55-E3A4-4B7E-9F8E-EF14AA917618} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {638049AA-35BE-4FFE-8370-373448555D24} diff --git a/README.md b/README.md index aff7d24..02b3b71 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Once configured, Korga automatically synchronizes people and groups from ChurchT There is no Web UI available yet to manage distribution lists so you must stick to the CLI inside the Docker container: ``` -./Korga.Server distribution-list create --group 137 kids +./Korga distribution-list create --group 137 kids ``` This command creates a distribution list _kids@example.org_ which forwards emails to every member of group #137. @@ -32,7 +32,7 @@ Korga has multiple modules that must be enabled via configuration to use them: Configuration can set as enviroment variables or by creating a custom config file. I recommend to use environment variables and will explain them in the following sections. -However, if you prefer a config file, copy the default [appsettings.json](server/src/Korga.Server/appsettings.json), edit it as required, and mount it at `/app/appsettings.json`. +However, if you prefer a config file, copy the default [appsettings.json](server/src/Korga/appsettings.json), edit it as required, and mount it at `/app/appsettings.json`. ### OpenID Connect authentication diff --git a/server/ChurchTools/ChurchTools.csproj b/server/ChurchTools/ChurchTools.csproj new file mode 100644 index 0000000..24e28fb --- /dev/null +++ b/server/ChurchTools/ChurchTools.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + ChurchTools + + + diff --git a/server/src/Korga.Core/ChurchTools/ChurchToolsApi.cs b/server/ChurchTools/ChurchToolsApi.cs similarity index 98% rename from server/src/Korga.Core/ChurchTools/ChurchToolsApi.cs rename to server/ChurchTools/ChurchToolsApi.cs index 4fde5c5..e46183c 100644 --- a/server/src/Korga.Core/ChurchTools/ChurchToolsApi.cs +++ b/server/ChurchTools/ChurchToolsApi.cs @@ -1,4 +1,4 @@ -using Korga.ChurchTools.Api; +using ChurchTools.Model; using System; using System.Collections.Generic; using System.IO; @@ -10,7 +10,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.ChurchTools; +namespace ChurchTools; public class ChurchToolsApi : IChurchToolsApi, IDisposable { @@ -164,7 +164,7 @@ private async ValueTask InternalGetNonPaged(string path, CancellationToken private async ValueTask> InternalGetAllPages(string path, string? query, CancellationToken cancellationToken) { - List items = new(); + List items = []; PaginatedResponse? response; int page = 0; diff --git a/server/src/Korga.Core/ChurchTools/IChurchToolsApi.cs b/server/ChurchTools/IChurchToolsApi.cs similarity index 95% rename from server/src/Korga.Core/ChurchTools/IChurchToolsApi.cs rename to server/ChurchTools/IChurchToolsApi.cs index 87d5fa7..4ef1804 100644 --- a/server/src/Korga.Core/ChurchTools/IChurchToolsApi.cs +++ b/server/ChurchTools/IChurchToolsApi.cs @@ -1,10 +1,10 @@ -using Korga.ChurchTools.Api; +using ChurchTools.Model; using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -namespace Korga.ChurchTools; +namespace ChurchTools; public interface IChurchToolsApi : IDisposable { diff --git a/server/src/Korga.Core/ChurchTools/Api/Event.cs b/server/ChurchTools/Model/Event.cs similarity index 96% rename from server/src/Korga.Core/ChurchTools/Api/Event.cs rename to server/ChurchTools/Model/Event.cs index 816afd9..4ed7582 100644 --- a/server/src/Korga.Core/ChurchTools/Api/Event.cs +++ b/server/ChurchTools/Model/Event.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace Korga.ChurchTools.Api; +namespace ChurchTools.Model; public class Event { diff --git a/server/src/Korga.Core/ChurchTools/Api/GlobalPermissions.cs b/server/ChurchTools/Model/GlobalPermissions.cs similarity index 99% rename from server/src/Korga.Core/ChurchTools/Api/GlobalPermissions.cs rename to server/ChurchTools/Model/GlobalPermissions.cs index 7a19e63..18bad9c 100644 --- a/server/src/Korga.Core/ChurchTools/Api/GlobalPermissions.cs +++ b/server/ChurchTools/Model/GlobalPermissions.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Korga.ChurchTools.Api; +namespace ChurchTools.Model; public class GlobalPermissions { diff --git a/server/ChurchTools/Model/Group.cs b/server/ChurchTools/Model/Group.cs new file mode 100644 index 0000000..b1d0c8b --- /dev/null +++ b/server/ChurchTools/Model/Group.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text.Json; + +namespace ChurchTools.Model; + +public class Group : IIdentifiable +{ + public Group(int id, Guid guid, string name, Dictionary information) + { + Id = id; + Guid = guid; + Name = name; + Information = information; + } + + public int Id { get; set; } + public Guid Guid { get; set; } + public string Name { get; set; } + public Dictionary Information { get; set; } + public int GroupTypeId => Information["groupTypeId"].GetInt32(); + public int GroupStatusId => Information["groupStatusId"].GetInt32(); +} diff --git a/server/ChurchTools/Model/GroupMember.cs b/server/ChurchTools/Model/GroupMember.cs new file mode 100644 index 0000000..0c52d86 --- /dev/null +++ b/server/ChurchTools/Model/GroupMember.cs @@ -0,0 +1,19 @@ +namespace ChurchTools.Model; + +public class GroupMember : IIdentifiable +{ + public GroupMember(int personId, int groupId, int groupTypeRoleId, string groupMemberStatus) + { + PersonId = personId; + GroupId = groupId; + GroupTypeRoleId = groupTypeRoleId; + GroupMemberStatus = groupMemberStatus; + } + + public int PersonId { get; set; } + public int GroupId { get; set; } + public int GroupTypeRoleId { get; set; } + public string GroupMemberStatus { get; set; } + + long IIdentifiable.Id => (long)PersonId << 32 | (long)GroupId; +} diff --git a/server/src/Korga.Core/ChurchTools/GroupMemberStatus.cs b/server/ChurchTools/Model/GroupMemberStatus.cs similarity index 70% rename from server/src/Korga.Core/ChurchTools/GroupMemberStatus.cs rename to server/ChurchTools/Model/GroupMemberStatus.cs index 1ac21eb..938bda0 100644 --- a/server/src/Korga.Core/ChurchTools/GroupMemberStatus.cs +++ b/server/ChurchTools/Model/GroupMemberStatus.cs @@ -1,4 +1,4 @@ -namespace Korga.ChurchTools; +namespace ChurchTools.Model; public enum GroupMemberStatus { diff --git a/server/src/Korga.Core/IIdentifiable.cs b/server/ChurchTools/Model/IIdentifiable.cs similarity index 64% rename from server/src/Korga.Core/IIdentifiable.cs rename to server/ChurchTools/Model/IIdentifiable.cs index f02f9a3..e7194e4 100644 --- a/server/src/Korga.Core/IIdentifiable.cs +++ b/server/ChurchTools/Model/IIdentifiable.cs @@ -1,8 +1,8 @@ using System; -namespace Korga; +namespace ChurchTools.Model; public interface IIdentifiable where TKey : IComparable { - TKey Id { get; } + TKey Id { get; } } diff --git a/server/src/Korga.Core/ChurchTools/Api/Login.cs b/server/ChurchTools/Model/Login.cs similarity index 91% rename from server/src/Korga.Core/ChurchTools/Api/Login.cs rename to server/ChurchTools/Model/Login.cs index 4507f2f..00f2d01 100644 --- a/server/src/Korga.Core/ChurchTools/Api/Login.cs +++ b/server/ChurchTools/Model/Login.cs @@ -1,4 +1,4 @@ -namespace Korga.ChurchTools.Api; +namespace ChurchTools.Model; public class Login { diff --git a/server/ChurchTools/Model/PaginatedResponse.cs b/server/ChurchTools/Model/PaginatedResponse.cs new file mode 100644 index 0000000..cbf4432 --- /dev/null +++ b/server/ChurchTools/Model/PaginatedResponse.cs @@ -0,0 +1,35 @@ +namespace ChurchTools.Model; + +public class PaginatedResponse +{ + public PaginatedResponse(T data, PaginatedResponse.ListInformation meta) + { + Data = data; + Meta = meta; + } + + public T Data { get; set; } + public ListInformation Meta { get; set; } + + public class ListInformation + { + public ListInformation(int count, int all, PaginatedResponse.Pagination pagination) + { + Count = count; + All = all; + Pagination = pagination; + } + + public int Count { get; set; } + public int All { get; set; } + public Pagination Pagination { get; set; } + } + + public class Pagination + { + public int Total { get; set; } + public int Limit { get; set; } + public int Current { get; set; } + public int LastPage { get; set; } + } +} diff --git a/server/ChurchTools/Model/Person.cs b/server/ChurchTools/Model/Person.cs new file mode 100644 index 0000000..00150f7 --- /dev/null +++ b/server/ChurchTools/Model/Person.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; + +namespace ChurchTools.Model; + +public class Person : IIdentifiable +{ + public Person(int id, int statusId, List departmentIds, string firstName, string lastName, string email) + { + Id = id; + StatusId = statusId; + DepartmentIds = departmentIds; + FirstName = firstName; + LastName = lastName; + Email = email; + } + + public int Id { get; set; } + public int StatusId { get; set; } + public List DepartmentIds { get; set; } + public string FirstName { get; set; } + public string LastName { get; set; } + public string Email { get; set; } +} diff --git a/server/src/Korga.Core/ChurchTools/Api/PersonMasterdata.cs b/server/ChurchTools/Model/PersonMasterdata.cs similarity index 51% rename from server/src/Korga.Core/ChurchTools/Api/PersonMasterdata.cs rename to server/ChurchTools/Model/PersonMasterdata.cs index 357d6cd..def791b 100644 --- a/server/src/Korga.Core/ChurchTools/Api/PersonMasterdata.cs +++ b/server/ChurchTools/Model/PersonMasterdata.cs @@ -2,17 +2,17 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Korga.ChurchTools.Api; +namespace ChurchTools.Model; public class PersonMasterdata { public PersonMasterdata() { - Roles = Array.Empty(); - GroupTypes = Array.Empty(); - GroupStatuses = Array.Empty(); - Departments = Array.Empty(); - Statuses = Array.Empty(); + Roles = []; + GroupTypes = []; + GroupStatuses = []; + Departments = []; + Statuses = []; } [JsonConstructor] @@ -26,14 +26,14 @@ public PersonMasterdata(IReadOnlyList roles, IReadOnlyList grou } public IReadOnlyList Roles { get; set; } - public IReadOnlyList GroupTypes { get; set; } + public IReadOnlyList GroupTypes { get; set; } public IReadOnlyList GroupStatuses { get; set; } - public IReadOnlyList Departments { get; set; } - public IReadOnlyList Statuses { get; set; } + public IReadOnlyList Departments { get; set; } + public IReadOnlyList Statuses { get; set; } - public record Role(int Id, int GroupTypeId, string Name, int SortKey) : IIdentifiable; - public record GroupType(int Id, string Name, int SortKey) : IIdentifiable; + public record Role(int Id, int GroupTypeId, string Name, int SortKey) : IIdentifiable; + public record GroupType(int Id, string Name, int SortKey) : IIdentifiable; public record GroupStatus(int Id, string Name, int SortKey) : IIdentifiable; - public record Department(int Id, string Name, int SortKey) : IIdentifiable; - public record Status(int Id, string Name, int SortKey) : IIdentifiable; + public record Department(int Id, string Name, int SortKey) : IIdentifiable; + public record Status(int Id, string Name, int SortKey) : IIdentifiable; } diff --git a/server/ChurchTools/Model/Response.cs b/server/ChurchTools/Model/Response.cs new file mode 100644 index 0000000..ae1645f --- /dev/null +++ b/server/ChurchTools/Model/Response.cs @@ -0,0 +1,11 @@ +namespace ChurchTools.Model; + +public class Response +{ + public Response(T data) + { + Data = data; + } + + public T Data { get; set; } +} diff --git a/server/src/Korga.Core/ChurchTools/Api/Service.cs b/server/ChurchTools/Model/Service.cs similarity index 94% rename from server/src/Korga.Core/ChurchTools/Api/Service.cs rename to server/ChurchTools/Model/Service.cs index 79254c6..8495c0e 100644 --- a/server/src/Korga.Core/ChurchTools/Api/Service.cs +++ b/server/ChurchTools/Model/Service.cs @@ -1,4 +1,4 @@ -namespace Korga.ChurchTools.Api; +namespace ChurchTools.Model; public class Service { diff --git a/server/src/Korga.Core/ChurchTools/Api/ServiceGroup.cs b/server/ChurchTools/Model/ServiceGroup.cs similarity index 87% rename from server/src/Korga.Core/ChurchTools/Api/ServiceGroup.cs rename to server/ChurchTools/Model/ServiceGroup.cs index d08864d..1a119b5 100644 --- a/server/src/Korga.Core/ChurchTools/Api/ServiceGroup.cs +++ b/server/ChurchTools/Model/ServiceGroup.cs @@ -1,4 +1,4 @@ -namespace Korga.ChurchTools.Api; +namespace ChurchTools.Model; public class ServiceGroup { diff --git a/server/tests/Korga.Server.Tests/ChurchToolsApiTests.cs b/server/Korga.Tests/ChurchToolsApiTests.cs similarity index 95% rename from server/tests/Korga.Server.Tests/ChurchToolsApiTests.cs rename to server/Korga.Tests/ChurchToolsApiTests.cs index fc7dcc5..7f4c145 100644 --- a/server/tests/Korga.Server.Tests/ChurchToolsApiTests.cs +++ b/server/Korga.Tests/ChurchToolsApiTests.cs @@ -1,8 +1,8 @@ -using Korga.ChurchTools; +using ChurchTools; using System.Threading.Tasks; using Xunit; -namespace Korga.Server.Tests; +namespace Korga.Tests; public class ChurchToolsApiTests { diff --git a/server/tests/Korga.Server.Tests/ChurchToolsSyncServiceTests.cs b/server/Korga.Tests/ChurchToolsSyncServiceTests.cs similarity index 80% rename from server/tests/Korga.Server.Tests/ChurchToolsSyncServiceTests.cs rename to server/Korga.Tests/ChurchToolsSyncServiceTests.cs index 128a3a8..fd0d474 100644 --- a/server/tests/Korga.Server.Tests/ChurchToolsSyncServiceTests.cs +++ b/server/Korga.Tests/ChurchToolsSyncServiceTests.cs @@ -1,6 +1,6 @@ -using Korga.ChurchTools; -using Korga.ChurchTools.Api; -using Korga.Server.ChurchTools; +using ChurchTools; +using ChurchTools.Model; +using Korga.ChurchTools; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using System; @@ -10,7 +10,10 @@ using System.Threading.Tasks; using Xunit; -namespace Korga.Server.Tests; +using DbGroupRole = Korga.ChurchTools.Entities.GroupRole; +using DbGroupType = Korga.ChurchTools.Entities.GroupType; + +namespace Korga.Tests; public class ChurchToolsSyncServiceTests : DatabaseTestBase { @@ -37,31 +40,31 @@ public async Task TestIntialSync() // Initialize database await databaseContext.Database.MigrateAsync(); - var expectedGroupTypes = new Korga.ChurchTools.Entities.GroupType[] - { + DbGroupType[] expectedGroupTypes = + [ new(1, "Kleingruppe"), new(2, "Dienst"), - }; - var expectedGroupRoles = new Korga.ChurchTools.Entities.GroupRole[] - { + ]; + DbGroupRole[] expectedGroupRoles = + [ new(8, 1, "Teilnehmer") { GroupType = expectedGroupTypes[0] }, new(9, 1, "Leiter") { GroupType = expectedGroupTypes[0] }, new(15, 2, "Mitarbeiter") { GroupType = expectedGroupTypes[1] }, new(16, 2, "Leiter") { GroupType = expectedGroupTypes[1] }, - }; + ]; - churchTools.PersonMasterdata.Roles = new PersonMasterdata.Role[] - { + churchTools.PersonMasterdata.Roles = + [ new(8, 1, "Teilnehmer", 0), new(9, 1, "Leiter", 0), new(15, 2, "Mitarbeiter", 0), new(16, 2, "Leiter", 0) - }; - churchTools.PersonMasterdata.GroupTypes = new PersonMasterdata.GroupType[] - { + ]; + churchTools.PersonMasterdata.GroupTypes = + [ new(1, "Kleingruppe", 0), new(2, "Dienst", 0) - }; + ]; await syncService.Execute(CancellationToken.None); @@ -74,29 +77,29 @@ public async Task TestUpdate() { await InitializeSampleDataset(); - var expectedGroupTypes = new Korga.ChurchTools.Entities.GroupType[] - { + DbGroupType[] expectedGroupTypes = + [ new(1, "Kleingruppe"), new(2, "Dienst"), - }; - var expectedGroupRoles = new Korga.ChurchTools.Entities.GroupRole[] - { + ]; + DbGroupRole[] expectedGroupRoles = + [ new(8, 1, "Teilnehmer*in") { GroupType = expectedGroupTypes[0] }, new(9, 1, "Leiter*in") { GroupType = expectedGroupTypes[0] }, new(15, 2, "Mitarbeiter*in") { GroupType = expectedGroupTypes[1] }, new(16, 2, "Leiter*in") { GroupType = expectedGroupTypes[1] }, - }; + ]; - churchTools.PersonMasterdata.Roles = new PersonMasterdata.Role[] { + churchTools.PersonMasterdata.Roles = [ new(8, 1, "Teilnehmer*in", 0), new(9, 1, "Leiter*in", 0), new(15, 2, "Mitarbeiter*in", 0), new(16, 2, "Leiter*in", 0) - }; - churchTools.PersonMasterdata.GroupTypes = new PersonMasterdata.GroupType[] { + ]; + churchTools.PersonMasterdata.GroupTypes = [ new(1, "Kleingruppe", 0), new(2, "Dienst", 0) - }; + ]; await syncService.Execute(CancellationToken.None); @@ -109,13 +112,13 @@ public async Task TestDelete() { await InitializeSampleDataset(); - churchTools.PersonMasterdata.Roles = new PersonMasterdata.Role[] { + churchTools.PersonMasterdata.Roles = [ new(8, 1, "Teilnehmer", 0), new(9, 1, "Leiter", 0), - }; - churchTools.PersonMasterdata.GroupTypes = new PersonMasterdata.GroupType[] { + ]; + churchTools.PersonMasterdata.GroupTypes = [ new(1, "Kleingruppe", 0), - }; + ]; await syncService.Execute(CancellationToken.None); @@ -137,31 +140,31 @@ public async Task TestUndoDelete() { await InitializePartiallyDeletedDataset(); - var expectedGroupTypes = new Korga.ChurchTools.Entities.GroupType[] - { + DbGroupType[] expectedGroupTypes = + [ new(1, "Kleingruppe"), new(2, "Dienst"), - }; - var expectedGroupRoles = new Korga.ChurchTools.Entities.GroupRole[] - { + ]; + DbGroupRole[] expectedGroupRoles = + [ new(8, 1, "Teilnehmer") { GroupType = expectedGroupTypes[0] }, new(9, 1, "Leiter") { GroupType = expectedGroupTypes[0] }, new(15, 2, "Mitarbeiter") { GroupType = expectedGroupTypes[1] }, new(16, 2, "Leiter") { GroupType = expectedGroupTypes[1] }, - }; + ]; - churchTools.PersonMasterdata.Roles = new PersonMasterdata.Role[] - { + churchTools.PersonMasterdata.Roles = + [ new(8, 1, "Teilnehmer", 0), new(9, 1, "Leiter", 0), new(15, 2, "Mitarbeiter", 0), new(16, 2, "Leiter", 0) - }; - churchTools.PersonMasterdata.GroupTypes = new PersonMasterdata.GroupType[] - { + ]; + churchTools.PersonMasterdata.GroupTypes = + [ new(1, "Kleingruppe", 0), new(2, "Dienst", 0) - }; + ]; await syncService.Execute(CancellationToken.None); @@ -174,13 +177,13 @@ public async Task TestStillDeleted() { await InitializePartiallyDeletedDataset(); - churchTools.PersonMasterdata.Roles = new PersonMasterdata.Role[] { + churchTools.PersonMasterdata.Roles = [ new(8, 1, "Teilnehmer", 0), new(9, 1, "Leiter", 0), - }; - churchTools.PersonMasterdata.GroupTypes = new PersonMasterdata.GroupType[] { + ]; + churchTools.PersonMasterdata.GroupTypes = [ new(1, "Kleingruppe", 0), - }; + ]; await syncService.Execute(CancellationToken.None); @@ -202,18 +205,18 @@ private async ValueTask InitializeSampleDataset() // Initialize database await databaseContext.Database.MigrateAsync(); - databaseContext.GroupTypes.AddRange(new Korga.ChurchTools.Entities.GroupType[] - { + databaseContext.GroupTypes.AddRange( + [ new(1, "Kleingruppe"), new(2, "Dienst"), - }); - databaseContext.GroupRoles.AddRange(new Korga.ChurchTools.Entities.GroupRole[] - { + ]); + databaseContext.GroupRoles.AddRange( + [ new(8, 1, "Teilnehmer"), new(9, 1, "Leiter"), new(15, 2, "Mitarbeiter"), new(16, 2, "Leiter"), - }); + ]); await databaseContext.SaveChangesAsync(); } @@ -222,18 +225,18 @@ private async ValueTask InitializePartiallyDeletedDataset() // Initialize database await databaseContext.Database.MigrateAsync(); - databaseContext.GroupTypes.AddRange(new Korga.ChurchTools.Entities.GroupType[] - { + databaseContext.GroupTypes.AddRange( + [ new(1, "Kleingruppe"), new(2, "Dienst") { DeletionTime = deletionTime }, - }); - databaseContext.GroupRoles.AddRange(new Korga.ChurchTools.Entities.GroupRole[] - { + ]); + databaseContext.GroupRoles.AddRange( + [ new(8, 1, "Teilnehmer"), new(9, 1, "Leiter"), new(15, 2, "Mitarbeiter") { DeletionTime = deletionTime }, new(16, 2, "Leiter") { DeletionTime = deletionTime }, - }); + ]); await databaseContext.SaveChangesAsync(); } @@ -241,9 +244,9 @@ private class FakeChurchToolsApi : IChurchToolsApi { public Login? User { get; set; } public PersonMasterdata PersonMasterdata { get; } = new(); - public List People { get; } = new List(); - public List Groups { get; } = new List(); - public List GroupMembers { get; } = new List(); + public List People { get; } = []; + public List Groups { get; } = []; + public List GroupMembers { get; } = []; public void Dispose() { } diff --git a/server/tests/Korga.Server.Tests/CollectionExtensionsTests.cs b/server/Korga.Tests/CollectionExtensionsTests.cs similarity index 64% rename from server/tests/Korga.Server.Tests/CollectionExtensionsTests.cs rename to server/Korga.Tests/CollectionExtensionsTests.cs index 875e907..125bc99 100644 --- a/server/tests/Korga.Server.Tests/CollectionExtensionsTests.cs +++ b/server/Korga.Tests/CollectionExtensionsTests.cs @@ -1,17 +1,18 @@ -using Korga.Server.Extensions; +using ChurchTools.Model; +using Korga.Extensions; using System.Collections.Generic; using System.Linq; using Xunit; -namespace Korga.Server.Tests; +namespace Korga.Tests; public class CollectionExtensionsTests { [Fact] public void TestClear() { - List source = new(); - List destination = new() { new() { Id = 5 }, new() { Id = 7 } }; + List source = []; + List destination = [new() { Id = 5 }, new() { Id = 7 }]; var expected = new (Source?, Destination?)[] { (null, destination[0]), (null, destination[1]) }; @@ -21,8 +22,8 @@ public void TestClear() [Fact] public void TestInit() { - List source = new() { new() { Id = 3 }, new() { Id = 4 } }; - List destination = new(); + List source = [new() { Id = 3 }, new() { Id = 4 }]; + List destination = []; var expected = new (Source?, Destination?)[] { (source[0], null), (source[1], null) }; @@ -32,8 +33,8 @@ public void TestInit() [Fact] public void TestAppend() { - List source = new() { new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 } }; - List destination = new() { new() { Id = 3 }, new() { Id = 4 } }; + List source = [new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 }]; + List destination = [new() { Id = 3 }, new() { Id = 4 }]; var expected = new (Source?, Destination?)[] { (source[0], destination[0]), (source[1], destination[1]), (source[2], null) }; @@ -44,8 +45,8 @@ public void TestAppend() [Fact] public void TestInsert() { - List source = new() { new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 } }; - List destination = new() { new() { Id = 3 }, new() { Id = 6 } }; + List source = [new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 }]; + List destination = [new() { Id = 3 }, new() { Id = 6 }]; var expected = new (Source?, Destination?)[] { (source[0], destination[0]), (source[1], null), (source[2], destination[1]) }; @@ -56,8 +57,8 @@ public void TestInsert() [Fact] public void TestPrepend() { - List source = new() { new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 } }; - List destination = new() { new() { Id = 4 }, new() { Id = 6 } }; + List source = [new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 }]; + List destination = [new() { Id = 4 }, new() { Id = 6 }]; var expected = new (Source?, Destination?)[] { (source[0], null), (source[1], destination[0]), (source[2], destination[1]) }; @@ -67,8 +68,8 @@ public void TestPrepend() [Fact] public void TestRemoveFirst() { - List source = new() { new() { Id = 4 }, new() { Id = 6 } }; - List destination = new() { new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 } }; + List source = [new() { Id = 4 }, new() { Id = 6 }]; + List destination = [new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 }]; var expected = new (Source?, Destination?)[] { (null, destination[0]), (source[0], destination[1]), (source[1], destination[2]) }; @@ -78,8 +79,8 @@ public void TestRemoveFirst() [Fact] public void TestRemoveMiddle() { - List source = new() { new() { Id = 3 }, new() { Id = 6 } }; - List destination = new() { new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 } }; + List source = [new() { Id = 3 }, new() { Id = 6 }]; + List destination = [new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 }]; var expected = new (Source?, Destination?)[] { (source[0], destination[0]), (null, destination[1]), (source[1], destination[2]) }; @@ -89,8 +90,8 @@ public void TestRemoveMiddle() [Fact] public void TestRemoveLast() { - List source = new() { new() { Id = 3 }, new() { Id = 4 } }; - List destination = new() { new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 } }; + List source = [new() { Id = 3 }, new() { Id = 4 }]; + List destination = [new() { Id = 3 }, new() { Id = 4 }, new() { Id = 6 }]; var expected = new (Source?, Destination?)[] { (source[0], destination[0]), (source[1], destination[1]), (null, destination[2]) }; @@ -100,8 +101,8 @@ public void TestRemoveLast() [Fact] public void TestUpdate() { - List source = new() { new() { Id = 1 }, new() { Id = 3, SortKey = 5 } }; - List destination = new() { new() { Id = 1 }, new() { Id = 3 } }; + List source = [new() { Id = 1 }, new() { Id = 3, SortKey = 5 }]; + List destination = [new() { Id = 1 }, new() { Id = 3 }]; var expected = new (Source?, Destination?)[] { (source[0], destination[0]), (source[1], destination[1]) }; diff --git a/server/tests/Korga.Server.Tests/DatabaseTestBase.cs b/server/Korga.Tests/DatabaseTestBase.cs similarity index 91% rename from server/tests/Korga.Server.Tests/DatabaseTestBase.cs rename to server/Korga.Tests/DatabaseTestBase.cs index d2480c6..6bfa84a 100644 --- a/server/tests/Korga.Server.Tests/DatabaseTestBase.cs +++ b/server/Korga.Tests/DatabaseTestBase.cs @@ -3,7 +3,7 @@ using MySqlConnector; using System; -namespace Korga.Server.Tests; +namespace Korga.Tests; public abstract class DatabaseTestBase : IDisposable { @@ -34,11 +34,7 @@ public DatabaseTestBase() optionsBuilder.UseMySql( connectionString, ServerVersion.AutoDetect(shortConnectionString), - builder => - { - builder.MigrationsAssembly($"{nameof(Korga)}.{nameof(Server)}"); - builder.EnableRetryOnFailure(); - }); + builder => builder.EnableRetryOnFailure()); }); ConfigureServices(serviceCollection); serviceProvider = serviceCollection.BuildServiceProvider(); diff --git a/server/tests/Korga.Server.Tests/Extensions/IConfigurationBuilderExtensions.cs b/server/Korga.Tests/Extensions/IConfigurationBuilderExtensions.cs similarity index 89% rename from server/tests/Korga.Server.Tests/Extensions/IConfigurationBuilderExtensions.cs rename to server/Korga.Tests/Extensions/IConfigurationBuilderExtensions.cs index 4f78f69..ea60765 100644 --- a/server/tests/Korga.Server.Tests/Extensions/IConfigurationBuilderExtensions.cs +++ b/server/Korga.Tests/Extensions/IConfigurationBuilderExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Configuration; -namespace Korga.Server.Tests.Extensions; +namespace Korga.Tests.Extensions; public static class IConfigurationBuilderExtensions { diff --git a/server/tests/Korga.Server.Tests/Http/VueSpaTests.cs b/server/Korga.Tests/Http/VueSpaTests.cs similarity index 96% rename from server/tests/Korga.Server.Tests/Http/VueSpaTests.cs rename to server/Korga.Tests/Http/VueSpaTests.cs index 6aa4b94..4ec62bf 100644 --- a/server/tests/Korga.Server.Tests/Http/VueSpaTests.cs +++ b/server/Korga.Tests/Http/VueSpaTests.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using Xunit; -namespace Korga.Server.Tests.Http; +namespace Korga.Tests.Http; public class VueSpaTests { diff --git a/server/tests/Korga.Server.Tests/JobQueueTests.cs b/server/Korga.Tests/JobQueueTests.cs similarity index 98% rename from server/tests/Korga.Server.Tests/JobQueueTests.cs rename to server/Korga.Tests/JobQueueTests.cs index 8acb4e7..f94dbd0 100644 --- a/server/tests/Korga.Server.Tests/JobQueueTests.cs +++ b/server/Korga.Tests/JobQueueTests.cs @@ -1,4 +1,4 @@ -using Korga.Server.Utilities; +using Korga.Utilities; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using System; @@ -7,7 +7,7 @@ using System.Threading.Tasks; using Xunit; -namespace Korga.Server.Tests; +namespace Korga.Tests; public class JobQueueTests : IDisposable { diff --git a/server/tests/Korga.Server.Tests/Korga.Server.Tests.csproj b/server/Korga.Tests/Korga.Tests.csproj similarity index 83% rename from server/tests/Korga.Server.Tests/Korga.Server.Tests.csproj rename to server/Korga.Tests/Korga.Tests.csproj index 900a859..e56a8df 100644 --- a/server/tests/Korga.Server.Tests/Korga.Server.Tests.csproj +++ b/server/Korga.Tests/Korga.Tests.csproj @@ -8,21 +8,21 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/server/tests/Korga.Server.Tests/Migrations/AddSinglePersonFilter/DatabaseContext.cs b/server/Korga.Tests/Migrations/AddSinglePersonFilter/DatabaseContext.cs similarity index 78% rename from server/tests/Korga.Server.Tests/Migrations/AddSinglePersonFilter/DatabaseContext.cs rename to server/Korga.Tests/Migrations/AddSinglePersonFilter/DatabaseContext.cs index 00fd593..5c4d968 100644 --- a/server/tests/Korga.Server.Tests/Migrations/AddSinglePersonFilter/DatabaseContext.cs +++ b/server/Korga.Tests/Migrations/AddSinglePersonFilter/DatabaseContext.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace Korga.Server.Tests.Migrations.AddSinglePersonFilter; +namespace Korga.Tests.Migrations.AddSinglePersonFilter; public class DatabaseContext : DbContext { diff --git a/server/tests/Korga.Server.Tests/Migrations/AddSinglePersonFilter/Email.cs b/server/Korga.Tests/Migrations/AddSinglePersonFilter/Email.cs similarity index 88% rename from server/tests/Korga.Server.Tests/Migrations/AddSinglePersonFilter/Email.cs rename to server/Korga.Tests/Migrations/AddSinglePersonFilter/Email.cs index 353de1e..c21082a 100644 --- a/server/tests/Korga.Server.Tests/Migrations/AddSinglePersonFilter/Email.cs +++ b/server/Korga.Tests/Migrations/AddSinglePersonFilter/Email.cs @@ -1,6 +1,6 @@ using System; -namespace Korga.Server.Tests.Migrations.AddSinglePersonFilter; +namespace Korga.Tests.Migrations.AddSinglePersonFilter; public class Email { diff --git a/server/tests/Korga.Server.Tests/Migrations/ForwardMode/DatabaseContext.cs b/server/Korga.Tests/Migrations/ForwardMode/DatabaseContext.cs similarity index 82% rename from server/tests/Korga.Server.Tests/Migrations/ForwardMode/DatabaseContext.cs rename to server/Korga.Tests/Migrations/ForwardMode/DatabaseContext.cs index 3d399fa..0f94d8d 100644 --- a/server/tests/Korga.Server.Tests/Migrations/ForwardMode/DatabaseContext.cs +++ b/server/Korga.Tests/Migrations/ForwardMode/DatabaseContext.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace Korga.Server.Tests.Migrations.ForwardMode; +namespace Korga.Tests.Migrations.ForwardMode; public class DatabaseContext : DbContext { diff --git a/server/tests/Korga.Server.Tests/Migrations/ForwardMode/OutboxEmail.cs b/server/Korga.Tests/Migrations/ForwardMode/OutboxEmail.cs similarity index 85% rename from server/tests/Korga.Server.Tests/Migrations/ForwardMode/OutboxEmail.cs rename to server/Korga.Tests/Migrations/ForwardMode/OutboxEmail.cs index 8ed8e1b..6a3a3bb 100644 --- a/server/tests/Korga.Server.Tests/Migrations/ForwardMode/OutboxEmail.cs +++ b/server/Korga.Tests/Migrations/ForwardMode/OutboxEmail.cs @@ -1,6 +1,6 @@ using System; -namespace Korga.Server.Tests.Migrations.ForwardMode; +namespace Korga.Tests.Migrations.ForwardMode; public class OutboxEmail { diff --git a/server/tests/Korga.Server.Tests/Migrations/GroupStatus/DatabaseContext.cs b/server/Korga.Tests/Migrations/GroupStatus/DatabaseContext.cs similarity index 86% rename from server/tests/Korga.Server.Tests/Migrations/GroupStatus/DatabaseContext.cs rename to server/Korga.Tests/Migrations/GroupStatus/DatabaseContext.cs index d8b05c7..dc2f3ea 100644 --- a/server/tests/Korga.Server.Tests/Migrations/GroupStatus/DatabaseContext.cs +++ b/server/Korga.Tests/Migrations/GroupStatus/DatabaseContext.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace Korga.Server.Tests.Migrations.GroupStatus; +namespace Korga.Tests.Migrations.GroupStatus; public class DatabaseContext : DbContext { diff --git a/server/tests/Korga.Server.Tests/Migrations/GroupStatus/Group.cs b/server/Korga.Tests/Migrations/GroupStatus/Group.cs similarity index 87% rename from server/tests/Korga.Server.Tests/Migrations/GroupStatus/Group.cs rename to server/Korga.Tests/Migrations/GroupStatus/Group.cs index 03af2c8..9b4e6bc 100644 --- a/server/tests/Korga.Server.Tests/Migrations/GroupStatus/Group.cs +++ b/server/Korga.Tests/Migrations/GroupStatus/Group.cs @@ -1,6 +1,6 @@ using System; -namespace Korga.Server.Tests.Migrations.GroupStatus; +namespace Korga.Tests.Migrations.GroupStatus; public class Group { diff --git a/server/tests/Korga.Server.Tests/Migrations/GroupStatus/GroupStatus.cs b/server/Korga.Tests/Migrations/GroupStatus/GroupStatus.cs similarity index 77% rename from server/tests/Korga.Server.Tests/Migrations/GroupStatus/GroupStatus.cs rename to server/Korga.Tests/Migrations/GroupStatus/GroupStatus.cs index 94354e2..6120dd1 100644 --- a/server/tests/Korga.Server.Tests/Migrations/GroupStatus/GroupStatus.cs +++ b/server/Korga.Tests/Migrations/GroupStatus/GroupStatus.cs @@ -1,6 +1,6 @@ using System; -namespace Korga.Server.Tests.Migrations.GroupStatus; +namespace Korga.Tests.Migrations.GroupStatus; public class GroupStatus { diff --git a/server/tests/Korga.Server.Tests/Migrations/GroupStatus/GroupType.cs b/server/Korga.Tests/Migrations/GroupStatus/GroupType.cs similarity index 77% rename from server/tests/Korga.Server.Tests/Migrations/GroupStatus/GroupType.cs rename to server/Korga.Tests/Migrations/GroupStatus/GroupType.cs index 38652d5..83add25 100644 --- a/server/tests/Korga.Server.Tests/Migrations/GroupStatus/GroupType.cs +++ b/server/Korga.Tests/Migrations/GroupStatus/GroupType.cs @@ -1,6 +1,6 @@ using System; -namespace Korga.Server.Tests.Migrations.GroupStatus; +namespace Korga.Tests.Migrations.GroupStatus; public class GroupType { diff --git a/server/tests/Korga.Server.Tests/Migrations/GroupStatusMigrationTests.cs b/server/Korga.Tests/Migrations/GroupStatusMigrationTests.cs similarity index 99% rename from server/tests/Korga.Server.Tests/Migrations/GroupStatusMigrationTests.cs rename to server/Korga.Tests/Migrations/GroupStatusMigrationTests.cs index 180f87d..515fb2a 100644 --- a/server/tests/Korga.Server.Tests/Migrations/GroupStatusMigrationTests.cs +++ b/server/Korga.Tests/Migrations/GroupStatusMigrationTests.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using Xunit; -namespace Korga.Server.Tests.Migrations; +namespace Korga.Tests.Migrations; public class GroupStatusMigrationTests : MigrationTestBase { diff --git a/server/tests/Korga.Server.Tests/Migrations/InboxOutbox/DatabaseContext.cs b/server/Korga.Tests/Migrations/InboxOutbox/DatabaseContext.cs similarity index 81% rename from server/tests/Korga.Server.Tests/Migrations/InboxOutbox/DatabaseContext.cs rename to server/Korga.Tests/Migrations/InboxOutbox/DatabaseContext.cs index 806710a..1eaf0dc 100644 --- a/server/tests/Korga.Server.Tests/Migrations/InboxOutbox/DatabaseContext.cs +++ b/server/Korga.Tests/Migrations/InboxOutbox/DatabaseContext.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace Korga.Server.Tests.Migrations.InboxOutbox; +namespace Korga.Tests.Migrations.InboxOutbox; public class DatabaseContext : DbContext { diff --git a/server/tests/Korga.Server.Tests/Migrations/InboxOutbox/InboxEmail.cs b/server/Korga.Tests/Migrations/InboxOutbox/InboxEmail.cs similarity index 92% rename from server/tests/Korga.Server.Tests/Migrations/InboxOutbox/InboxEmail.cs rename to server/Korga.Tests/Migrations/InboxOutbox/InboxEmail.cs index 289d63d..1279dde 100644 --- a/server/tests/Korga.Server.Tests/Migrations/InboxOutbox/InboxEmail.cs +++ b/server/Korga.Tests/Migrations/InboxOutbox/InboxEmail.cs @@ -1,6 +1,6 @@ using System; -namespace Korga.Server.Tests.Migrations.InboxOutbox; +namespace Korga.Tests.Migrations.InboxOutbox; public class InboxEmail { diff --git a/server/tests/Korga.Server.Tests/Migrations/InboxOutboxMigrationTests.cs b/server/Korga.Tests/Migrations/InboxOutboxMigrationTests.cs similarity index 99% rename from server/tests/Korga.Server.Tests/Migrations/InboxOutboxMigrationTests.cs rename to server/Korga.Tests/Migrations/InboxOutboxMigrationTests.cs index 4b55c8a..5e8a3fe 100644 --- a/server/tests/Korga.Server.Tests/Migrations/InboxOutboxMigrationTests.cs +++ b/server/Korga.Tests/Migrations/InboxOutboxMigrationTests.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Xunit; -namespace Korga.Server.Tests.Migrations; +namespace Korga.Tests.Migrations; /// /// These tests focus on breaking database schema changes diff --git a/server/tests/Korga.Server.Tests/Migrations/MigrationTestBase.cs b/server/Korga.Tests/Migrations/MigrationTestBase.cs similarity index 95% rename from server/tests/Korga.Server.Tests/Migrations/MigrationTestBase.cs rename to server/Korga.Tests/Migrations/MigrationTestBase.cs index ec54ef1..6ac528c 100644 --- a/server/tests/Korga.Server.Tests/Migrations/MigrationTestBase.cs +++ b/server/Korga.Tests/Migrations/MigrationTestBase.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -namespace Korga.Server.Tests.Migrations; +namespace Korga.Tests.Migrations; public abstract class MigrationTestBase : DatabaseTestBase where TBefore : DbContext where TAfter : DbContext { diff --git a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/DatabaseContext.cs b/server/Korga.Tests/Migrations/SplitOutboxEmail/DatabaseContext.cs similarity index 87% rename from server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/DatabaseContext.cs rename to server/Korga.Tests/Migrations/SplitOutboxEmail/DatabaseContext.cs index 6c690ba..6a9cc8e 100644 --- a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/DatabaseContext.cs +++ b/server/Korga.Tests/Migrations/SplitOutboxEmail/DatabaseContext.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace Korga.Server.Tests.Migrations.SplitOutboxEmail; +namespace Korga.Tests.Migrations.SplitOutboxEmail; public class DatabaseContext : DbContext { diff --git a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/Group.cs b/server/Korga.Tests/Migrations/SplitOutboxEmail/Group.cs similarity index 77% rename from server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/Group.cs rename to server/Korga.Tests/Migrations/SplitOutboxEmail/Group.cs index ded2a7a..7a0f5bc 100644 --- a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/Group.cs +++ b/server/Korga.Tests/Migrations/SplitOutboxEmail/Group.cs @@ -1,4 +1,4 @@ -namespace Korga.Server.Tests.Migrations.SplitOutboxEmail; +namespace Korga.Tests.Migrations.SplitOutboxEmail; public class Group { diff --git a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/GroupType.cs b/server/Korga.Tests/Migrations/SplitOutboxEmail/GroupType.cs similarity index 65% rename from server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/GroupType.cs rename to server/Korga.Tests/Migrations/SplitOutboxEmail/GroupType.cs index cd0cd43..392814b 100644 --- a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/GroupType.cs +++ b/server/Korga.Tests/Migrations/SplitOutboxEmail/GroupType.cs @@ -1,4 +1,4 @@ -namespace Korga.Server.Tests.Migrations.SplitOutboxEmail; +namespace Korga.Tests.Migrations.SplitOutboxEmail; public class GroupType { diff --git a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/OutboxEmail.cs b/server/Korga.Tests/Migrations/SplitOutboxEmail/OutboxEmail.cs similarity index 77% rename from server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/OutboxEmail.cs rename to server/Korga.Tests/Migrations/SplitOutboxEmail/OutboxEmail.cs index 5c2c1ef..24b14a7 100644 --- a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/OutboxEmail.cs +++ b/server/Korga.Tests/Migrations/SplitOutboxEmail/OutboxEmail.cs @@ -1,4 +1,4 @@ -namespace Korga.Server.Tests.Migrations.SplitOutboxEmail; +namespace Korga.Tests.Migrations.SplitOutboxEmail; public class OutboxEmail { diff --git a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/SentEmail.cs b/server/Korga.Tests/Migrations/SplitOutboxEmail/SentEmail.cs similarity index 84% rename from server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/SentEmail.cs rename to server/Korga.Tests/Migrations/SplitOutboxEmail/SentEmail.cs index be372ae..45c8198 100644 --- a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmail/SentEmail.cs +++ b/server/Korga.Tests/Migrations/SplitOutboxEmail/SentEmail.cs @@ -1,6 +1,6 @@ using System; -namespace Korga.Server.Tests.Migrations.SplitOutboxEmail; +namespace Korga.Tests.Migrations.SplitOutboxEmail; public class SentEmail { diff --git a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmailMigrationTests.cs b/server/Korga.Tests/Migrations/SplitOutboxEmailMigrationTests.cs similarity index 99% rename from server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmailMigrationTests.cs rename to server/Korga.Tests/Migrations/SplitOutboxEmailMigrationTests.cs index 514d64e..d87bf15 100644 --- a/server/tests/Korga.Server.Tests/Migrations/SplitOutboxEmailMigrationTests.cs +++ b/server/Korga.Tests/Migrations/SplitOutboxEmailMigrationTests.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Xunit; -namespace Korga.Server.Tests.Migrations; +namespace Korga.Tests.Migrations; public class SplitOutboxEmailMigrationTests : MigrationTestBase { diff --git a/server/tests/Korga.Server.Tests/TestHost.cs b/server/Korga.Tests/TestHost.cs similarity index 87% rename from server/tests/Korga.Server.Tests/TestHost.cs rename to server/Korga.Tests/TestHost.cs index 56d41d2..7404772 100644 --- a/server/tests/Korga.Server.Tests/TestHost.cs +++ b/server/Korga.Tests/TestHost.cs @@ -1,5 +1,5 @@ -using Korga.Server.Extensions; -using Korga.Server.Tests.Extensions; +using Korga.Extensions; +using Korga.Tests.Extensions; using McMaster.Extensions.CommandLineUtils; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; @@ -11,7 +11,7 @@ using System; using System.Collections.Generic; -namespace Korga.Server.Tests; +namespace Korga.Tests; public static class TestHost { @@ -31,8 +31,8 @@ public static IServiceCollection CreateServiceCollection() public static TestServer CreateTestServer(IEnumerable>? configuration = null) { return new TestServer(new WebHostBuilder() - // Working directory: tests/Korga.Server.Tests/bin/Release/net5.0 - .UseWebRoot("../../../../../src/Korga.Server/wwwroot") + // Working directory: Korga.Tests/bin/Debug/net8.0 + .UseWebRoot("../../../../Korga/wwwroot") .ConfigureAppConfiguration(builder => { builder.AddKorga(); diff --git a/server/src/Korga.Server/ChurchTools/ChurchToolsOptions.cs b/server/Korga/ChurchTools/ChurchToolsOptions.cs similarity index 91% rename from server/src/Korga.Server/ChurchTools/ChurchToolsOptions.cs rename to server/Korga/ChurchTools/ChurchToolsOptions.cs index 2c6c932..1b0ec7e 100644 --- a/server/src/Korga.Server/ChurchTools/ChurchToolsOptions.cs +++ b/server/Korga/ChurchTools/ChurchToolsOptions.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Korga.Server.ChurchTools; +namespace Korga.ChurchTools; public class ChurchToolsOptions { diff --git a/server/src/Korga.Server/ChurchTools/ChurchToolsPermissionsHostedService.cs b/server/Korga/ChurchTools/ChurchToolsPermissionsHostedService.cs similarity index 97% rename from server/src/Korga.Server/ChurchTools/ChurchToolsPermissionsHostedService.cs rename to server/Korga/ChurchTools/ChurchToolsPermissionsHostedService.cs index 058b486..aac0827 100644 --- a/server/src/Korga.Server/ChurchTools/ChurchToolsPermissionsHostedService.cs +++ b/server/Korga/ChurchTools/ChurchToolsPermissionsHostedService.cs @@ -1,5 +1,5 @@ -using Korga.ChurchTools; -using Korga.ChurchTools.Api; +using ChurchTools; +using ChurchTools.Model; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; @@ -8,7 +8,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.ChurchTools +namespace Korga.ChurchTools { public class ChurchToolsPermissionsHostedService : BackgroundService { diff --git a/server/src/Korga.Server/ChurchTools/ChurchToolsSyncHostedService.cs b/server/Korga/ChurchTools/ChurchToolsSyncHostedService.cs similarity index 93% rename from server/src/Korga.Server/ChurchTools/ChurchToolsSyncHostedService.cs rename to server/Korga/ChurchTools/ChurchToolsSyncHostedService.cs index ad6e72f..c1656d6 100644 --- a/server/src/Korga.Server/ChurchTools/ChurchToolsSyncHostedService.cs +++ b/server/Korga/ChurchTools/ChurchToolsSyncHostedService.cs @@ -1,4 +1,4 @@ -using Korga.Server.Utilities; +using Korga.Utilities; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.ChurchTools; +namespace Korga.ChurchTools; public class ChurchToolsSyncHostedService : RepeatedExecutionService { diff --git a/server/src/Korga.Server/ChurchTools/ChurchToolsSyncService.cs b/server/Korga/ChurchTools/ChurchToolsSyncService.cs similarity index 98% rename from server/src/Korga.Server/ChurchTools/ChurchToolsSyncService.cs rename to server/Korga/ChurchTools/ChurchToolsSyncService.cs index c484e3f..91ad807 100644 --- a/server/src/Korga.Server/ChurchTools/ChurchToolsSyncService.cs +++ b/server/Korga/ChurchTools/ChurchToolsSyncService.cs @@ -1,6 +1,6 @@ -using Korga.ChurchTools; -using Korga.ChurchTools.Api; -using Korga.Server.Extensions; +using ChurchTools; +using ChurchTools.Model; +using Korga.Extensions; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using System; @@ -13,7 +13,7 @@ using DbDepartmentMember = Korga.ChurchTools.Entities.DepartmentMember; using DbGroupMember = Korga.ChurchTools.Entities.GroupMember; -namespace Korga.Server.ChurchTools; +namespace Korga.ChurchTools; public class ChurchToolsSyncService { diff --git a/server/src/Korga.Core/ChurchTools/Entities/Department.cs b/server/Korga/ChurchTools/Entities/Department.cs similarity index 92% rename from server/src/Korga.Core/ChurchTools/Entities/Department.cs rename to server/Korga/ChurchTools/Entities/Department.cs index 5c2b09a..e5e8fe7 100644 --- a/server/src/Korga.Core/ChurchTools/Entities/Department.cs +++ b/server/Korga/ChurchTools/Entities/Department.cs @@ -1,4 +1,5 @@ using System; +using ChurchTools.Model; namespace Korga.ChurchTools.Entities; diff --git a/server/src/Korga.Core/ChurchTools/Entities/DepartmentMember.cs b/server/Korga/ChurchTools/Entities/DepartmentMember.cs similarity index 82% rename from server/src/Korga.Core/ChurchTools/Entities/DepartmentMember.cs rename to server/Korga/ChurchTools/Entities/DepartmentMember.cs index 3f6380a..69f3033 100644 --- a/server/src/Korga.Core/ChurchTools/Entities/DepartmentMember.cs +++ b/server/Korga/ChurchTools/Entities/DepartmentMember.cs @@ -1,4 +1,6 @@ -namespace Korga.ChurchTools.Entities; +using ChurchTools.Model; + +namespace Korga.ChurchTools.Entities; public class DepartmentMember : IIdentifiable { diff --git a/server/src/Korga.Core/ChurchTools/Entities/Group.cs b/server/Korga/ChurchTools/Entities/Group.cs similarity index 96% rename from server/src/Korga.Core/ChurchTools/Entities/Group.cs rename to server/Korga/ChurchTools/Entities/Group.cs index a18e6e8..363eb9d 100644 --- a/server/src/Korga.Core/ChurchTools/Entities/Group.cs +++ b/server/Korga/ChurchTools/Entities/Group.cs @@ -1,4 +1,5 @@ using System; +using ChurchTools.Model; namespace Korga.ChurchTools.Entities; diff --git a/server/src/Korga.Core/ChurchTools/Entities/GroupMember.cs b/server/Korga/ChurchTools/Entities/GroupMember.cs similarity index 86% rename from server/src/Korga.Core/ChurchTools/Entities/GroupMember.cs rename to server/Korga/ChurchTools/Entities/GroupMember.cs index e48b863..7830fc1 100644 --- a/server/src/Korga.Core/ChurchTools/Entities/GroupMember.cs +++ b/server/Korga/ChurchTools/Entities/GroupMember.cs @@ -1,4 +1,6 @@ -namespace Korga.ChurchTools.Entities; +using ChurchTools.Model; + +namespace Korga.ChurchTools.Entities; public class GroupMember : IIdentifiable { diff --git a/server/src/Korga.Core/ChurchTools/Entities/GroupRole.cs b/server/Korga/ChurchTools/Entities/GroupRole.cs similarity index 94% rename from server/src/Korga.Core/ChurchTools/Entities/GroupRole.cs rename to server/Korga/ChurchTools/Entities/GroupRole.cs index b751820..09fcd1a 100644 --- a/server/src/Korga.Core/ChurchTools/Entities/GroupRole.cs +++ b/server/Korga/ChurchTools/Entities/GroupRole.cs @@ -1,4 +1,5 @@ using System; +using ChurchTools.Model; namespace Korga.ChurchTools.Entities; diff --git a/server/src/Korga.Core/ChurchTools/Entities/GroupStatus.cs b/server/Korga/ChurchTools/Entities/GroupStatus.cs similarity index 92% rename from server/src/Korga.Core/ChurchTools/Entities/GroupStatus.cs rename to server/Korga/ChurchTools/Entities/GroupStatus.cs index 9cd3be3..facb920 100644 --- a/server/src/Korga.Core/ChurchTools/Entities/GroupStatus.cs +++ b/server/Korga/ChurchTools/Entities/GroupStatus.cs @@ -1,4 +1,5 @@ using System; +using ChurchTools.Model; namespace Korga.ChurchTools.Entities; diff --git a/server/src/Korga.Core/ChurchTools/Entities/GroupType.cs b/server/Korga/ChurchTools/Entities/GroupType.cs similarity index 92% rename from server/src/Korga.Core/ChurchTools/Entities/GroupType.cs rename to server/Korga/ChurchTools/Entities/GroupType.cs index 9c4fb75..bcceccc 100644 --- a/server/src/Korga.Core/ChurchTools/Entities/GroupType.cs +++ b/server/Korga/ChurchTools/Entities/GroupType.cs @@ -1,4 +1,5 @@ using System; +using ChurchTools.Model; namespace Korga.ChurchTools.Entities; diff --git a/server/src/Korga.Core/ChurchTools/Entities/IArchivable.cs b/server/Korga/ChurchTools/Entities/IArchivable.cs similarity index 100% rename from server/src/Korga.Core/ChurchTools/Entities/IArchivable.cs rename to server/Korga/ChurchTools/Entities/IArchivable.cs diff --git a/server/src/Korga.Core/ChurchTools/Entities/Person.cs b/server/Korga/ChurchTools/Entities/Person.cs similarity index 97% rename from server/src/Korga.Core/ChurchTools/Entities/Person.cs rename to server/Korga/ChurchTools/Entities/Person.cs index b9aa3c2..843821f 100644 --- a/server/src/Korga.Core/ChurchTools/Entities/Person.cs +++ b/server/Korga/ChurchTools/Entities/Person.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using ChurchTools.Model; namespace Korga.ChurchTools.Entities; diff --git a/server/src/Korga.Core/ChurchTools/Entities/Status.cs b/server/Korga/ChurchTools/Entities/Status.cs similarity index 92% rename from server/src/Korga.Core/ChurchTools/Entities/Status.cs rename to server/Korga/ChurchTools/Entities/Status.cs index f2dcaa1..c5a7229 100644 --- a/server/src/Korga.Core/ChurchTools/Entities/Status.cs +++ b/server/Korga/ChurchTools/Entities/Status.cs @@ -1,4 +1,5 @@ using System; +using ChurchTools.Model; namespace Korga.ChurchTools.Entities; diff --git a/server/src/Korga.Server/ChurchTools/Hosting/ChurchToolsApiExtensions.cs b/server/Korga/ChurchTools/Hosting/ChurchToolsApiExtensions.cs similarity index 92% rename from server/src/Korga.Server/ChurchTools/Hosting/ChurchToolsApiExtensions.cs rename to server/Korga/ChurchTools/Hosting/ChurchToolsApiExtensions.cs index 18cf18e..a91d28c 100644 --- a/server/src/Korga.Server/ChurchTools/Hosting/ChurchToolsApiExtensions.cs +++ b/server/Korga/ChurchTools/Hosting/ChurchToolsApiExtensions.cs @@ -1,9 +1,9 @@ -using Korga.ChurchTools; +using ChurchTools; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using System.Net.Http; -namespace Korga.Server.ChurchTools.Hosting; +namespace Korga.ChurchTools.Hosting; public static class ChurchToolsApiExtensions { diff --git a/server/src/Korga.Server/ChurchTools/Hosting/ChurchToolsApiFactory.cs b/server/Korga/ChurchTools/Hosting/ChurchToolsApiFactory.cs similarity index 90% rename from server/src/Korga.Server/ChurchTools/Hosting/ChurchToolsApiFactory.cs rename to server/Korga/ChurchTools/Hosting/ChurchToolsApiFactory.cs index 7727bb8..ef4ae1d 100644 --- a/server/src/Korga.Server/ChurchTools/Hosting/ChurchToolsApiFactory.cs +++ b/server/Korga/ChurchTools/Hosting/ChurchToolsApiFactory.cs @@ -1,9 +1,9 @@ -using Korga.ChurchTools; +using ChurchTools; using Microsoft.Extensions.Options; using System.Net.Http; using System.Threading.Tasks; -namespace Korga.Server.ChurchTools.Hosting; +namespace Korga.ChurchTools.Hosting; public class ChurchToolsApiFactory { diff --git a/server/src/Korga.Server/Commands/DatabaseCommand.cs b/server/Korga/Commands/DatabaseCommand.cs similarity index 98% rename from server/src/Korga.Server/Commands/DatabaseCommand.cs rename to server/Korga/Commands/DatabaseCommand.cs index 41afb0c..8e35f61 100644 --- a/server/src/Korga.Server/Commands/DatabaseCommand.cs +++ b/server/Korga/Commands/DatabaseCommand.cs @@ -5,7 +5,7 @@ #pragma warning disable CA1822 // Mark members as static #pragma warning disable IDE0051 // Remove unused private members -namespace Korga.Server.Commands; +namespace Korga.Commands; [Command("database")] [Subcommand(typeof(Migrate), typeof(Create), typeof(Delete))] diff --git a/server/src/Korga.Server/Commands/DistributionListCommand.cs b/server/Korga/Commands/DistributionListCommand.cs similarity index 98% rename from server/src/Korga.Server/Commands/DistributionListCommand.cs rename to server/Korga/Commands/DistributionListCommand.cs index 8005120..878a13b 100644 --- a/server/src/Korga.Server/Commands/DistributionListCommand.cs +++ b/server/Korga/Commands/DistributionListCommand.cs @@ -7,7 +7,7 @@ #pragma warning disable CA1822 // Mark members as static #pragma warning disable IDE0051 // Remove unused private members -namespace Korga.Server.Commands; +namespace Korga.Commands; [Command("distribution-list")] [Subcommand(typeof(Create), typeof(List))] diff --git a/server/src/Korga.Server/Commands/KorgaCommand.cs b/server/Korga/Commands/KorgaCommand.cs similarity index 92% rename from server/src/Korga.Server/Commands/KorgaCommand.cs rename to server/Korga/Commands/KorgaCommand.cs index a77cf7e..0e699da 100644 --- a/server/src/Korga.Server/Commands/KorgaCommand.cs +++ b/server/Korga/Commands/KorgaCommand.cs @@ -2,7 +2,7 @@ #pragma warning disable IDE0051 // Remove unused private members -namespace Korga.Server.Commands; +namespace Korga.Commands; [Command("korga", Description = "Korga server management console")] [Subcommand(typeof(DatabaseCommand), typeof(DistributionListCommand))] diff --git a/server/src/Korga.Server/Configuration/DatabaseOptions.cs b/server/Korga/Configuration/DatabaseOptions.cs similarity index 87% rename from server/src/Korga.Server/Configuration/DatabaseOptions.cs rename to server/Korga/Configuration/DatabaseOptions.cs index cd49c1d..8e139be 100644 --- a/server/src/Korga.Server/Configuration/DatabaseOptions.cs +++ b/server/Korga/Configuration/DatabaseOptions.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Korga.Server.Configuration; +namespace Korga.Configuration; public class DatabaseOptions { diff --git a/server/src/Korga.Server/Configuration/HostingOptions.cs b/server/Korga/Configuration/HostingOptions.cs similarity index 80% rename from server/src/Korga.Server/Configuration/HostingOptions.cs rename to server/Korga/Configuration/HostingOptions.cs index 9c8cac7..f2b9297 100644 --- a/server/src/Korga.Server/Configuration/HostingOptions.cs +++ b/server/Korga/Configuration/HostingOptions.cs @@ -1,4 +1,4 @@ -namespace Korga.Server.Configuration; +namespace Korga.Configuration; public class HostingOptions { diff --git a/server/src/Korga.Server/Configuration/OpenIdConnectOptions.cs b/server/Korga/Configuration/OpenIdConnectOptions.cs similarity index 80% rename from server/src/Korga.Server/Configuration/OpenIdConnectOptions.cs rename to server/Korga/Configuration/OpenIdConnectOptions.cs index 7fa3295..809c8a2 100644 --- a/server/src/Korga.Server/Configuration/OpenIdConnectOptions.cs +++ b/server/Korga/Configuration/OpenIdConnectOptions.cs @@ -1,4 +1,4 @@ -namespace Korga.Server.Configuration; +namespace Korga.Configuration; public class OpenIdConnectOptions { diff --git a/server/src/Korga.Server/Controllers/DistributionListController.cs b/server/Korga/Controllers/DistributionListController.cs similarity index 92% rename from server/src/Korga.Server/Controllers/DistributionListController.cs rename to server/Korga/Controllers/DistributionListController.cs index 0d13fe8..fa76ff1 100644 --- a/server/src/Korga.Server/Controllers/DistributionListController.cs +++ b/server/Korga/Controllers/DistributionListController.cs @@ -1,6 +1,6 @@ using Korga.EmailRelay; using Korga.EmailRelay.Entities; -using Korga.Server.Models.Json; +using Korga.Models.Json; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -9,7 +9,7 @@ using System.Linq; using System.Threading.Tasks; -namespace Korga.Server.Controllers +namespace Korga.Controllers { [ApiController] public class DistributionListController : ControllerBase @@ -28,11 +28,11 @@ public async Task GetDistributionLists() { List distributionLists = await database.DistributionLists.Include(dl => dl.Filters).OrderBy(dl => dl.Alias).ToListAsync(); - List response = new(); + List response = []; foreach (DistributionList distributionList in distributionLists) { - List filters = new(); + List filters = []; foreach (PersonFilter personFilter in distributionList.Filters!) { diff --git a/server/src/Korga.Server/Controllers/ProfileController.cs b/server/Korga/Controllers/ProfileController.cs similarity index 95% rename from server/src/Korga.Server/Controllers/ProfileController.cs rename to server/Korga/Controllers/ProfileController.cs index 23da722..7d95e8b 100644 --- a/server/src/Korga.Server/Controllers/ProfileController.cs +++ b/server/Korga/Controllers/ProfileController.cs @@ -1,4 +1,4 @@ -using Korga.Server.Models.Json; +using Korga.Models.Json; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Authorization; @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Mvc; using System.Security.Claims; -namespace Korga.Server.Controllers; +namespace Korga.Controllers; [ApiController] public class ProfileController : ControllerBase diff --git a/server/src/Korga.Server/Controllers/ServiceController.cs b/server/Korga/Controllers/ServiceController.cs similarity index 96% rename from server/src/Korga.Server/Controllers/ServiceController.cs rename to server/Korga/Controllers/ServiceController.cs index dbad81f..0ca677c 100644 --- a/server/src/Korga.Server/Controllers/ServiceController.cs +++ b/server/Korga/Controllers/ServiceController.cs @@ -1,6 +1,6 @@ -using Korga.ChurchTools; -using Korga.ChurchTools.Api; -using Korga.Server.Models.Json; +using ChurchTools; +using ChurchTools.Model; +using Korga.Models.Json; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -10,7 +10,7 @@ using System.Linq; using System.Threading.Tasks; -namespace Korga.Server.Controllers; +namespace Korga.Controllers; [Authorize] [ApiController] diff --git a/server/src/Korga.Core/DatabaseContext.cs b/server/Korga/DatabaseContext.cs similarity index 100% rename from server/src/Korga.Core/DatabaseContext.cs rename to server/Korga/DatabaseContext.cs index 156e8cb..943b9aa 100644 --- a/server/src/Korga.Core/DatabaseContext.cs +++ b/server/Korga/DatabaseContext.cs @@ -1,7 +1,7 @@ using Korga.ChurchTools.Entities; -using Korga.EmailDelivery.Entities; using Korga.EmailRelay.Entities; using Microsoft.EntityFrameworkCore; +using Korga.EmailDelivery.Entities; namespace Korga; diff --git a/server/src/Korga.Server/EmailDelivery/EmailDeliveryJobController.cs b/server/Korga/EmailDelivery/EmailDeliveryJobController.cs similarity index 98% rename from server/src/Korga.Server/EmailDelivery/EmailDeliveryJobController.cs rename to server/Korga/EmailDelivery/EmailDeliveryJobController.cs index dad3591..1a2da18 100644 --- a/server/src/Korga.Server/EmailDelivery/EmailDeliveryJobController.cs +++ b/server/Korga/EmailDelivery/EmailDeliveryJobController.cs @@ -1,5 +1,5 @@ using Korga.EmailDelivery.Entities; -using Korga.Server.Utilities; +using Korga.Utilities; using MailKit.Net.Smtp; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -11,7 +11,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.EmailDelivery; +namespace Korga.EmailDelivery; public class EmailDeliveryJobController : OneAtATimeJobController, IAsyncDisposable { diff --git a/server/src/Korga.Server/EmailDelivery/EmailDeliveryOptions.cs b/server/Korga/EmailDelivery/EmailDeliveryOptions.cs similarity index 93% rename from server/src/Korga.Server/EmailDelivery/EmailDeliveryOptions.cs rename to server/Korga/EmailDelivery/EmailDeliveryOptions.cs index 9a407b4..48f1ab0 100644 --- a/server/src/Korga.Server/EmailDelivery/EmailDeliveryOptions.cs +++ b/server/Korga/EmailDelivery/EmailDeliveryOptions.cs @@ -1,12 +1,12 @@ using System.ComponentModel.DataAnnotations; -namespace Korga.Server.EmailDelivery; +namespace Korga.EmailDelivery; public class EmailDeliveryOptions { // Validation ensures that required values cannot be null public bool Enable { get; set; } - + [Required] public string SenderName { get; set; } = null!; [Required] public string SenderAddress { get; set; } = null!; [Required] public string SmtpHost { get; set; } = null!; diff --git a/server/src/Korga.Server/EmailDelivery/EmailDeliveryService.cs b/server/Korga/EmailDelivery/EmailDeliveryService.cs similarity index 93% rename from server/src/Korga.Server/EmailDelivery/EmailDeliveryService.cs rename to server/Korga/EmailDelivery/EmailDeliveryService.cs index 049956f..8ce5e75 100644 --- a/server/src/Korga.Server/EmailDelivery/EmailDeliveryService.cs +++ b/server/Korga/EmailDelivery/EmailDeliveryService.cs @@ -1,4 +1,4 @@ -using Korga.Server.Utilities; +using Korga.Utilities; using Microsoft.EntityFrameworkCore; using MimeKit; using System; @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.EmailDelivery; +namespace Korga.EmailDelivery; public class EmailDeliveryService { @@ -35,7 +35,7 @@ public async ValueTask Enqueue(string emailAddress, MimeMessage mimeMessag content = memoryStream.ToArray(); } - database.OutboxEmails.Add(new(emailAddress, content) { InboxEmailId = inboxEmailId}); + database.OutboxEmails.Add(new(emailAddress, content) { InboxEmailId = inboxEmailId }); await database.SaveChangesAsync(cancellationToken); jobQueue.EnsureRunning(); return true; diff --git a/server/src/Korga.Core/EmailDelivery/Entities/OutboxEmail.cs b/server/Korga/EmailDelivery/Entities/OutboxEmail.cs similarity index 98% rename from server/src/Korga.Core/EmailDelivery/Entities/OutboxEmail.cs rename to server/Korga/EmailDelivery/Entities/OutboxEmail.cs index 167c397..2dfe2fc 100644 --- a/server/src/Korga.Core/EmailDelivery/Entities/OutboxEmail.cs +++ b/server/Korga/EmailDelivery/Entities/OutboxEmail.cs @@ -9,7 +9,7 @@ public OutboxEmail(string emailAddress, byte[] content) EmailAddress = emailAddress; Content = content; } - + public long Id { get; set; } public long? InboxEmailId { get; set; } diff --git a/server/src/Korga.Core/EmailDelivery/Entities/SentEmail.cs b/server/Korga/EmailDelivery/Entities/SentEmail.cs similarity index 100% rename from server/src/Korga.Core/EmailDelivery/Entities/SentEmail.cs rename to server/Korga/EmailDelivery/Entities/SentEmail.cs diff --git a/server/src/Korga.Core/EmailRelay/DistributionListFlags.cs b/server/Korga/EmailRelay/DistributionListFlags.cs similarity index 100% rename from server/src/Korga.Core/EmailRelay/DistributionListFlags.cs rename to server/Korga/EmailRelay/DistributionListFlags.cs diff --git a/server/src/Korga.Server/EmailRelay/DistributionListService.cs b/server/Korga/EmailRelay/DistributionListService.cs similarity index 97% rename from server/src/Korga.Server/EmailRelay/DistributionListService.cs rename to server/Korga/EmailRelay/DistributionListService.cs index 1511792..a1dc02f 100644 --- a/server/src/Korga.Server/EmailRelay/DistributionListService.cs +++ b/server/Korga/EmailRelay/DistributionListService.cs @@ -8,7 +8,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.EmailRelay; +namespace Korga.EmailRelay; public class DistributionListService { @@ -34,7 +34,7 @@ public async ValueTask> GetPeople(DistributionList distribut { List personFilters = await database.PersonFilters.Where(f => f.DistributionListId == distributionList.Id).ToListAsync(cancellationToken); - HashSet people = new(); + HashSet people = []; foreach (PersonFilter personFilter in personFilters) { diff --git a/server/src/Korga.Server/EmailRelay/EmailRelayHostedService.cs b/server/Korga/EmailRelay/EmailRelayHostedService.cs similarity index 93% rename from server/src/Korga.Server/EmailRelay/EmailRelayHostedService.cs rename to server/Korga/EmailRelay/EmailRelayHostedService.cs index a8a3c04..b3808b7 100644 --- a/server/src/Korga.Server/EmailRelay/EmailRelayHostedService.cs +++ b/server/Korga/EmailRelay/EmailRelayHostedService.cs @@ -1,4 +1,4 @@ -using Korga.Server.Utilities; +using Korga.Utilities; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.EmailRelay; +namespace Korga.EmailRelay; public class EmailRelayHostedService : RepeatedExecutionService { diff --git a/server/src/Korga.Server/EmailRelay/EmailRelayJobController.cs b/server/Korga/EmailRelay/EmailRelayJobController.cs similarity index 97% rename from server/src/Korga.Server/EmailRelay/EmailRelayJobController.cs rename to server/Korga/EmailRelay/EmailRelayJobController.cs index 9797883..4e06427 100644 --- a/server/src/Korga.Server/EmailRelay/EmailRelayJobController.cs +++ b/server/Korga/EmailRelay/EmailRelayJobController.cs @@ -1,7 +1,6 @@ -using Korga.EmailRelay; +using Korga.EmailDelivery; using Korga.EmailRelay.Entities; -using Korga.Server.EmailDelivery; -using Korga.Server.Utilities; +using Korga.Utilities; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using MimeKit; @@ -10,7 +9,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.EmailRelay; +namespace Korga.EmailRelay; public class EmailRelayJobController : OneAtATimeJobController { diff --git a/server/src/Korga.Server/EmailRelay/EmailRelayOptions.cs b/server/Korga/EmailRelay/EmailRelayOptions.cs similarity index 95% rename from server/src/Korga.Server/EmailRelay/EmailRelayOptions.cs rename to server/Korga/EmailRelay/EmailRelayOptions.cs index 7bc51f9..6653d2d 100644 --- a/server/src/Korga.Server/EmailRelay/EmailRelayOptions.cs +++ b/server/Korga/EmailRelay/EmailRelayOptions.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Korga.Server.EmailRelay; +namespace Korga.EmailRelay; public class EmailRelayOptions { diff --git a/server/src/Korga.Core/EmailRelay/Entities/DistributionList.cs b/server/Korga/EmailRelay/Entities/DistributionList.cs similarity index 100% rename from server/src/Korga.Core/EmailRelay/Entities/DistributionList.cs rename to server/Korga/EmailRelay/Entities/DistributionList.cs diff --git a/server/src/Korga.Core/EmailRelay/Entities/GroupFilter.cs b/server/Korga/EmailRelay/Entities/GroupFilter.cs similarity index 100% rename from server/src/Korga.Core/EmailRelay/Entities/GroupFilter.cs rename to server/Korga/EmailRelay/Entities/GroupFilter.cs diff --git a/server/src/Korga.Core/EmailRelay/Entities/InboxEmail.cs b/server/Korga/EmailRelay/Entities/InboxEmail.cs similarity index 100% rename from server/src/Korga.Core/EmailRelay/Entities/InboxEmail.cs rename to server/Korga/EmailRelay/Entities/InboxEmail.cs diff --git a/server/src/Korga.Core/EmailRelay/Entities/PersonFilter.cs b/server/Korga/EmailRelay/Entities/PersonFilter.cs similarity index 100% rename from server/src/Korga.Core/EmailRelay/Entities/PersonFilter.cs rename to server/Korga/EmailRelay/Entities/PersonFilter.cs diff --git a/server/src/Korga.Core/EmailRelay/Entities/SinglePerson.cs b/server/Korga/EmailRelay/Entities/SinglePerson.cs similarity index 100% rename from server/src/Korga.Core/EmailRelay/Entities/SinglePerson.cs rename to server/Korga/EmailRelay/Entities/SinglePerson.cs diff --git a/server/src/Korga.Core/EmailRelay/Entities/StatusFilter.cs b/server/Korga/EmailRelay/Entities/StatusFilter.cs similarity index 100% rename from server/src/Korga.Core/EmailRelay/Entities/StatusFilter.cs rename to server/Korga/EmailRelay/Entities/StatusFilter.cs diff --git a/server/src/Korga.Server/EmailRelay/ImapReceiverService.cs b/server/Korga/EmailRelay/ImapReceiverService.cs similarity index 98% rename from server/src/Korga.Server/EmailRelay/ImapReceiverService.cs rename to server/Korga/EmailRelay/ImapReceiverService.cs index 4c917f7..7274e0f 100644 --- a/server/src/Korga.Server/EmailRelay/ImapReceiverService.cs +++ b/server/Korga/EmailRelay/ImapReceiverService.cs @@ -1,6 +1,6 @@ using Korga.EmailRelay.Entities; -using Korga.Server.Extensions; -using Korga.Server.Utilities; +using Korga.Extensions; +using Korga.Utilities; using MailKit; using MailKit.Net.Imap; using Microsoft.EntityFrameworkCore; @@ -12,7 +12,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.EmailRelay; +namespace Korga.EmailRelay; public class ImapReceiverService { diff --git a/server/src/Korga.Server/EmailRelay/MimeMessageCreationService.cs b/server/Korga/EmailRelay/MimeMessageCreationService.cs similarity index 98% rename from server/src/Korga.Server/EmailRelay/MimeMessageCreationService.cs rename to server/Korga/EmailRelay/MimeMessageCreationService.cs index fc092cf..9b2eb9f 100644 --- a/server/src/Korga.Server/EmailRelay/MimeMessageCreationService.cs +++ b/server/Korga/EmailRelay/MimeMessageCreationService.cs @@ -1,5 +1,5 @@ -using Korga.EmailRelay.Entities; -using Korga.Server.EmailDelivery; +using Korga.EmailDelivery; +using Korga.EmailRelay.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; using MimeKit; @@ -10,7 +10,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.EmailRelay; +namespace Korga.EmailRelay; public class MimeMessageCreationService { diff --git a/server/src/Korga.Server/Extensions/AsyncExtensions.cs b/server/Korga/Extensions/AsyncExtensions.cs similarity index 96% rename from server/src/Korga.Server/Extensions/AsyncExtensions.cs rename to server/Korga/Extensions/AsyncExtensions.cs index e79e3dd..10a8e68 100644 --- a/server/src/Korga.Server/Extensions/AsyncExtensions.cs +++ b/server/Korga/Extensions/AsyncExtensions.cs @@ -3,7 +3,7 @@ using System.Threading; using System; -namespace Korga.Server.Extensions; +namespace Korga.Extensions; public static class AsyncExtensions { diff --git a/server/src/Korga.Server/Extensions/CollectionExtensions.cs b/server/Korga/Extensions/CollectionExtensions.cs similarity index 90% rename from server/src/Korga.Server/Extensions/CollectionExtensions.cs rename to server/Korga/Extensions/CollectionExtensions.cs index 894412f..eb95770 100644 --- a/server/src/Korga.Server/Extensions/CollectionExtensions.cs +++ b/server/Korga/Extensions/CollectionExtensions.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; +using ChurchTools.Model; -namespace Korga.Server.Extensions; +namespace Korga.Extensions; public static class CollectionExtensions { @@ -79,4 +80,12 @@ public static class CollectionExtensions } } } + + public static void AddRange(this ICollection collection, IEnumerable values) + { + foreach (var item in values) + { + collection.Add(item); + } + } } diff --git a/server/src/Korga.Server/Extensions/HeaderListExtensions.cs b/server/Korga/Extensions/HeaderListExtensions.cs similarity index 97% rename from server/src/Korga.Server/Extensions/HeaderListExtensions.cs rename to server/Korga/Extensions/HeaderListExtensions.cs index 500d61e..05e7634 100644 --- a/server/src/Korga.Server/Extensions/HeaderListExtensions.cs +++ b/server/Korga/Extensions/HeaderListExtensions.cs @@ -1,6 +1,6 @@ using MimeKit; -namespace Korga.Server.Extensions; +namespace Korga.Extensions; public static class HeaderListExtensions { diff --git a/server/src/Korga.Server/Extensions/HostExtensions.cs b/server/Korga/Extensions/HostExtensions.cs similarity index 94% rename from server/src/Korga.Server/Extensions/HostExtensions.cs rename to server/Korga/Extensions/HostExtensions.cs index 2c6ed88..913596f 100644 --- a/server/src/Korga.Server/Extensions/HostExtensions.cs +++ b/server/Korga/Extensions/HostExtensions.cs @@ -1,4 +1,4 @@ -using Korga.Server.Configuration; +using Korga.Configuration; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -7,7 +7,7 @@ using System.Collections.Generic; using System.Linq; -namespace Korga.Server.Extensions; +namespace Korga.Extensions; public static class HostExtensions { diff --git a/server/src/Korga.Server/Extensions/IApplicationBuilderExtensions.cs b/server/Korga/Extensions/IApplicationBuilderExtensions.cs similarity index 95% rename from server/src/Korga.Server/Extensions/IApplicationBuilderExtensions.cs rename to server/Korga/Extensions/IApplicationBuilderExtensions.cs index 35c0ece..4f6564d 100644 --- a/server/src/Korga.Server/Extensions/IApplicationBuilderExtensions.cs +++ b/server/Korga/Extensions/IApplicationBuilderExtensions.cs @@ -1,10 +1,10 @@ -using Korga.Server.Configuration; +using Korga.Configuration; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.HttpOverrides; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -namespace Korga.Server.Extensions; +namespace Korga.Extensions; public static class IApplicationBuilderExtensions { diff --git a/server/src/Korga.Server/Extensions/IServiceCollectionExtensions.cs b/server/Korga/Extensions/IServiceCollectionExtensions.cs similarity index 94% rename from server/src/Korga.Server/Extensions/IServiceCollectionExtensions.cs rename to server/Korga/Extensions/IServiceCollectionExtensions.cs index 6c0d1f1..23f9b99 100644 --- a/server/src/Korga.Server/Extensions/IServiceCollectionExtensions.cs +++ b/server/Korga/Extensions/IServiceCollectionExtensions.cs @@ -1,7 +1,6 @@ -using Korga.Server.ChurchTools; -using Korga.Server.Configuration; -using Korga.Server.EmailDelivery; -using Korga.Server.EmailRelay; +using Korga.ChurchTools; +using Korga.Configuration; +using Korga.EmailRelay; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Hosting; @@ -17,9 +16,10 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using OpenIdConnectOptions = Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectOptions; -using KorgaOpenIdConnectOptions = Korga.Server.Configuration.OpenIdConnectOptions; +using KorgaOpenIdConnectOptions = Korga.Configuration.OpenIdConnectOptions; +using Korga.EmailDelivery; -namespace Korga.Server.Extensions; +namespace Korga.Extensions; public static class IServiceCollectionExtensions { @@ -72,11 +72,7 @@ public static IServiceCollection AddKorgaMySqlDatabase(this IServiceCollection s optionsBuilder.UseMySql( options.Value.ConnectionString, ServerVersion.AutoDetect(options.Value.ConnectionString), - builder => - { - builder.MigrationsAssembly($"{nameof(Korga)}.{nameof(Server)}"); - builder.EnableRetryOnFailure(); - }); + builder => builder.EnableRetryOnFailure()); }); return services; diff --git a/server/src/Korga.Server/Extensions/ISpaBuilderExtensions.cs b/server/Korga/Extensions/ISpaBuilderExtensions.cs similarity index 91% rename from server/src/Korga.Server/Extensions/ISpaBuilderExtensions.cs rename to server/Korga/Extensions/ISpaBuilderExtensions.cs index 5356a51..82b3773 100644 --- a/server/src/Korga.Server/Extensions/ISpaBuilderExtensions.cs +++ b/server/Korga/Extensions/ISpaBuilderExtensions.cs @@ -1,5 +1,5 @@ -using Korga.Server.Configuration; -using Korga.Server.Utilities; +using Korga.Configuration; +using Korga.Utilities; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.SpaServices; @@ -7,7 +7,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Korga.Server.Extensions; +namespace Korga.Extensions; public static class ISpaBuilderExtensions { diff --git a/server/src/Korga.Server/Extensions/StringExtensions.cs b/server/Korga/Extensions/StringExtensions.cs similarity index 83% rename from server/src/Korga.Server/Extensions/StringExtensions.cs rename to server/Korga/Extensions/StringExtensions.cs index e7bdf21..f05d2b2 100644 --- a/server/src/Korga.Server/Extensions/StringExtensions.cs +++ b/server/Korga/Extensions/StringExtensions.cs @@ -1,4 +1,4 @@ -namespace Korga.Server.Extensions; +namespace Korga.Extensions; public static class StringExtensions { diff --git a/server/src/Korga.Server/Korga.Server.csproj b/server/Korga/Korga.csproj similarity index 63% rename from server/src/Korga.Server/Korga.Server.csproj rename to server/Korga/Korga.csproj index 8d58869..29f6811 100644 --- a/server/src/Korga.Server/Korga.Server.csproj +++ b/server/Korga/Korga.csproj @@ -7,22 +7,25 @@ - + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive + - - + + + + - + diff --git a/server/src/Korga.Server/Migrations/20230216232307_InitialCreate.Designer.cs b/server/Korga/Migrations/20230216232307_InitialCreate.Designer.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20230216232307_InitialCreate.Designer.cs rename to server/Korga/Migrations/20230216232307_InitialCreate.Designer.cs index 0787391..e361a5d 100644 --- a/server/src/Korga.Server/Migrations/20230216232307_InitialCreate.Designer.cs +++ b/server/Korga/Migrations/20230216232307_InitialCreate.Designer.cs @@ -8,7 +8,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20230216232307_InitialCreate")] diff --git a/server/src/Korga.Server/Migrations/20230216232307_InitialCreate.cs b/server/Korga/Migrations/20230216232307_InitialCreate.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20230216232307_InitialCreate.cs rename to server/Korga/Migrations/20230216232307_InitialCreate.cs index a2a3c33..744d8b1 100644 --- a/server/src/Korga.Server/Migrations/20230216232307_InitialCreate.cs +++ b/server/Korga/Migrations/20230216232307_InitialCreate.cs @@ -4,7 +4,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { /// public partial class InitialCreate : Migration diff --git a/server/src/Korga.Server/Migrations/20230224191853_AddSinglePersonFilter.Designer.cs b/server/Korga/Migrations/20230224191853_AddSinglePersonFilter.Designer.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20230224191853_AddSinglePersonFilter.Designer.cs rename to server/Korga/Migrations/20230224191853_AddSinglePersonFilter.Designer.cs index 6f0141e..fe24c96 100644 --- a/server/src/Korga.Server/Migrations/20230224191853_AddSinglePersonFilter.Designer.cs +++ b/server/Korga/Migrations/20230224191853_AddSinglePersonFilter.Designer.cs @@ -8,7 +8,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20230224191853_AddSinglePersonFilter")] diff --git a/server/src/Korga.Server/Migrations/20230224191853_AddSinglePersonFilter.cs b/server/Korga/Migrations/20230224191853_AddSinglePersonFilter.cs similarity index 97% rename from server/src/Korga.Server/Migrations/20230224191853_AddSinglePersonFilter.cs rename to server/Korga/Migrations/20230224191853_AddSinglePersonFilter.cs index 0d7e27b..50d2f04 100644 --- a/server/src/Korga.Server/Migrations/20230224191853_AddSinglePersonFilter.cs +++ b/server/Korga/Migrations/20230224191853_AddSinglePersonFilter.cs @@ -2,7 +2,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { /// public partial class AddSinglePersonFilter : Migration diff --git a/server/src/Korga.Server/Migrations/20230427101434_InboxOutbox.Designer.cs b/server/Korga/Migrations/20230427101434_InboxOutbox.Designer.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20230427101434_InboxOutbox.Designer.cs rename to server/Korga/Migrations/20230427101434_InboxOutbox.Designer.cs index f33940c..9fde9b4 100644 --- a/server/src/Korga.Server/Migrations/20230427101434_InboxOutbox.Designer.cs +++ b/server/Korga/Migrations/20230427101434_InboxOutbox.Designer.cs @@ -8,7 +8,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20230427101434_InboxOutbox")] diff --git a/server/src/Korga.Server/Migrations/20230427101434_InboxOutbox.cs b/server/Korga/Migrations/20230427101434_InboxOutbox.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20230427101434_InboxOutbox.cs rename to server/Korga/Migrations/20230427101434_InboxOutbox.cs index ddce442..d0b26e2 100644 --- a/server/src/Korga.Server/Migrations/20230427101434_InboxOutbox.cs +++ b/server/Korga/Migrations/20230427101434_InboxOutbox.cs @@ -4,7 +4,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { /// public partial class InboxOutbox : Migration diff --git a/server/src/Korga.Server/Migrations/20230506101019_ForwardMode.Designer.cs b/server/Korga/Migrations/20230506101019_ForwardMode.Designer.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20230506101019_ForwardMode.Designer.cs rename to server/Korga/Migrations/20230506101019_ForwardMode.Designer.cs index 1473ad4..bccee85 100644 --- a/server/src/Korga.Server/Migrations/20230506101019_ForwardMode.Designer.cs +++ b/server/Korga/Migrations/20230506101019_ForwardMode.Designer.cs @@ -8,7 +8,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20230506101019_ForwardMode")] diff --git a/server/src/Korga.Server/Migrations/20230506101019_ForwardMode.cs b/server/Korga/Migrations/20230506101019_ForwardMode.cs similarity index 98% rename from server/src/Korga.Server/Migrations/20230506101019_ForwardMode.cs rename to server/Korga/Migrations/20230506101019_ForwardMode.cs index 289f033..9957f00 100644 --- a/server/src/Korga.Server/Migrations/20230506101019_ForwardMode.cs +++ b/server/Korga/Migrations/20230506101019_ForwardMode.cs @@ -2,7 +2,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { /// public partial class ForwardMode : Migration diff --git a/server/src/Korga.Server/Migrations/20230718214221_SplitOutboxEmail.Designer.cs b/server/Korga/Migrations/20230718214221_SplitOutboxEmail.Designer.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20230718214221_SplitOutboxEmail.Designer.cs rename to server/Korga/Migrations/20230718214221_SplitOutboxEmail.Designer.cs index 319d76c..4a28cff 100644 --- a/server/src/Korga.Server/Migrations/20230718214221_SplitOutboxEmail.Designer.cs +++ b/server/Korga/Migrations/20230718214221_SplitOutboxEmail.Designer.cs @@ -8,7 +8,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20230718214221_SplitOutboxEmail")] diff --git a/server/src/Korga.Server/Migrations/20230718214221_SplitOutboxEmail.cs b/server/Korga/Migrations/20230718214221_SplitOutboxEmail.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20230718214221_SplitOutboxEmail.cs rename to server/Korga/Migrations/20230718214221_SplitOutboxEmail.cs index d10b91c..abcc882 100644 --- a/server/src/Korga.Server/Migrations/20230718214221_SplitOutboxEmail.cs +++ b/server/Korga/Migrations/20230718214221_SplitOutboxEmail.cs @@ -3,7 +3,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { /// public partial class SplitOutboxEmail : Migration diff --git a/server/src/Korga.Server/Migrations/20230823082608_GroupStatus.Designer.cs b/server/Korga/Migrations/20230823082608_GroupStatus.Designer.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20230823082608_GroupStatus.Designer.cs rename to server/Korga/Migrations/20230823082608_GroupStatus.Designer.cs index 399e8ce..d45a960 100644 --- a/server/src/Korga.Server/Migrations/20230823082608_GroupStatus.Designer.cs +++ b/server/Korga/Migrations/20230823082608_GroupStatus.Designer.cs @@ -8,7 +8,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20230823082608_GroupStatus")] diff --git a/server/src/Korga.Server/Migrations/20230823082608_GroupStatus.cs b/server/Korga/Migrations/20230823082608_GroupStatus.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20230823082608_GroupStatus.cs rename to server/Korga/Migrations/20230823082608_GroupStatus.cs index 67b2c62..7f56d61 100644 --- a/server/src/Korga.Server/Migrations/20230823082608_GroupStatus.cs +++ b/server/Korga/Migrations/20230823082608_GroupStatus.cs @@ -3,7 +3,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { /// public partial class GroupStatus : Migration diff --git a/server/src/Korga.Server/Migrations/20231201142030_RemovePasswordReset.Designer.cs b/server/Korga/Migrations/20231201142030_RemovePasswordReset.Designer.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20231201142030_RemovePasswordReset.Designer.cs rename to server/Korga/Migrations/20231201142030_RemovePasswordReset.Designer.cs index 762952d..a6c6043 100644 --- a/server/src/Korga.Server/Migrations/20231201142030_RemovePasswordReset.Designer.cs +++ b/server/Korga/Migrations/20231201142030_RemovePasswordReset.Designer.cs @@ -8,7 +8,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20231201142030_RemovePasswordReset")] diff --git a/server/src/Korga.Server/Migrations/20231201142030_RemovePasswordReset.cs b/server/Korga/Migrations/20231201142030_RemovePasswordReset.cs similarity index 97% rename from server/src/Korga.Server/Migrations/20231201142030_RemovePasswordReset.cs rename to server/Korga/Migrations/20231201142030_RemovePasswordReset.cs index 8105394..d424e34 100644 --- a/server/src/Korga.Server/Migrations/20231201142030_RemovePasswordReset.cs +++ b/server/Korga/Migrations/20231201142030_RemovePasswordReset.cs @@ -3,7 +3,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { /// public partial class RemovePasswordReset : Migration diff --git a/server/src/Korga.Server/Migrations/20231212132844_RemoveEventRegistration.Designer.cs b/server/Korga/Migrations/20231212132844_RemoveEventRegistration.Designer.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20231212132844_RemoveEventRegistration.Designer.cs rename to server/Korga/Migrations/20231212132844_RemoveEventRegistration.Designer.cs index 6b588c9..3fd767d 100644 --- a/server/src/Korga.Server/Migrations/20231212132844_RemoveEventRegistration.Designer.cs +++ b/server/Korga/Migrations/20231212132844_RemoveEventRegistration.Designer.cs @@ -8,7 +8,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20231212132844_RemoveEventRegistration")] diff --git a/server/src/Korga.Server/Migrations/20231212132844_RemoveEventRegistration.cs b/server/Korga/Migrations/20231212132844_RemoveEventRegistration.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20231212132844_RemoveEventRegistration.cs rename to server/Korga/Migrations/20231212132844_RemoveEventRegistration.cs index 6bebfa1..a4660ce 100644 --- a/server/src/Korga.Server/Migrations/20231212132844_RemoveEventRegistration.cs +++ b/server/Korga/Migrations/20231212132844_RemoveEventRegistration.cs @@ -3,7 +3,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { /// public partial class RemoveEventRegistration : Migration diff --git a/server/src/Korga.Server/Migrations/20240115151648_GroupMemberStatus.Designer.cs b/server/Korga/Migrations/20240115151648_GroupMemberStatus.Designer.cs similarity index 99% rename from server/src/Korga.Server/Migrations/20240115151648_GroupMemberStatus.Designer.cs rename to server/Korga/Migrations/20240115151648_GroupMemberStatus.Designer.cs index 663558c..0619901 100644 --- a/server/src/Korga.Server/Migrations/20240115151648_GroupMemberStatus.Designer.cs +++ b/server/Korga/Migrations/20240115151648_GroupMemberStatus.Designer.cs @@ -8,7 +8,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20240115151648_GroupMemberStatus")] diff --git a/server/src/Korga.Server/Migrations/20240115151648_GroupMemberStatus.cs b/server/Korga/Migrations/20240115151648_GroupMemberStatus.cs similarity index 95% rename from server/src/Korga.Server/Migrations/20240115151648_GroupMemberStatus.cs rename to server/Korga/Migrations/20240115151648_GroupMemberStatus.cs index 39878fa..3bf1960 100644 --- a/server/src/Korga.Server/Migrations/20240115151648_GroupMemberStatus.cs +++ b/server/Korga/Migrations/20240115151648_GroupMemberStatus.cs @@ -2,7 +2,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { /// public partial class GroupMemberStatus : Migration diff --git a/server/src/Korga.Server/Migrations/DatabaseContextModelSnapshot.cs b/server/Korga/Migrations/DatabaseContextModelSnapshot.cs similarity index 99% rename from server/src/Korga.Server/Migrations/DatabaseContextModelSnapshot.cs rename to server/Korga/Migrations/DatabaseContextModelSnapshot.cs index 42bc589..a83cc4a 100644 --- a/server/src/Korga.Server/Migrations/DatabaseContextModelSnapshot.cs +++ b/server/Korga/Migrations/DatabaseContextModelSnapshot.cs @@ -7,7 +7,7 @@ #nullable disable -namespace Korga.Server.Migrations +namespace Korga.Migrations { [DbContext(typeof(DatabaseContext))] partial class DatabaseContextModelSnapshot : ModelSnapshot diff --git a/server/src/Korga.Server/Models/Json/DistributionListResponse.cs b/server/Korga/Models/Json/DistributionListResponse.cs similarity index 95% rename from server/src/Korga.Server/Models/Json/DistributionListResponse.cs rename to server/Korga/Models/Json/DistributionListResponse.cs index 5acc27f..81235f9 100644 --- a/server/src/Korga.Server/Models/Json/DistributionListResponse.cs +++ b/server/Korga/Models/Json/DistributionListResponse.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Korga.Server.Models.Json; +namespace Korga.Models.Json; public class DistributionListResponse { diff --git a/server/src/Korga.Server/Models/Json/PasswordResetInfo.cs b/server/Korga/Models/Json/PasswordResetInfo.cs similarity index 91% rename from server/src/Korga.Server/Models/Json/PasswordResetInfo.cs rename to server/Korga/Models/Json/PasswordResetInfo.cs index 5eae730..d6d01f4 100644 --- a/server/src/Korga.Server/Models/Json/PasswordResetInfo.cs +++ b/server/Korga/Models/Json/PasswordResetInfo.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Korga.Server.Models.Json; +namespace Korga.Models.Json; public class PasswordResetInfo { diff --git a/server/src/Korga.Server/Models/Json/PasswordResetRequest.cs b/server/Korga/Models/Json/PasswordResetRequest.cs similarity index 90% rename from server/src/Korga.Server/Models/Json/PasswordResetRequest.cs rename to server/Korga/Models/Json/PasswordResetRequest.cs index 8f3f14f..6439d70 100644 --- a/server/src/Korga.Server/Models/Json/PasswordResetRequest.cs +++ b/server/Korga/Models/Json/PasswordResetRequest.cs @@ -1,7 +1,7 @@ using System; using System.Text.Json.Serialization; -namespace Korga.Server.Models.Json; +namespace Korga.Models.Json; public class PasswordResetRequest { diff --git a/server/src/Korga.Server/Models/Json/ProfileResponse.cs b/server/Korga/Models/Json/ProfileResponse.cs similarity index 85% rename from server/src/Korga.Server/Models/Json/ProfileResponse.cs rename to server/Korga/Models/Json/ProfileResponse.cs index 2ca9387..c49fb3c 100644 --- a/server/src/Korga.Server/Models/Json/ProfileResponse.cs +++ b/server/Korga/Models/Json/ProfileResponse.cs @@ -1,4 +1,4 @@ -namespace Korga.Server.Models.Json; +namespace Korga.Models.Json; public class ProfileResponse { diff --git a/server/src/Korga.Server/Models/Json/ServiceHistoryResponse.cs b/server/Korga/Models/Json/ServiceHistoryResponse.cs similarity index 76% rename from server/src/Korga.Server/Models/Json/ServiceHistoryResponse.cs rename to server/Korga/Models/Json/ServiceHistoryResponse.cs index 78096d8..9b829c6 100644 --- a/server/src/Korga.Server/Models/Json/ServiceHistoryResponse.cs +++ b/server/Korga/Models/Json/ServiceHistoryResponse.cs @@ -1,9 +1,9 @@ -using Korga.ChurchTools; +using ChurchTools.Model; using System; using System.Collections.Generic; using System.Text.Json.Serialization; -namespace Korga.Server.Models.Json; +namespace Korga.Models.Json; public class ServiceHistoryResponse { @@ -14,5 +14,5 @@ public class ServiceHistoryResponse [JsonConverter(typeof(JsonStringEnumConverter))] public required GroupMemberStatus GroupMemberStatus { get; init; } - public List ServiceDates { get; } = new(); + public List ServiceDates { get; } = []; } diff --git a/server/src/Korga.Server/Models/Json/ServiceResponse.cs b/server/Korga/Models/Json/ServiceResponse.cs similarity index 81% rename from server/src/Korga.Server/Models/Json/ServiceResponse.cs rename to server/Korga/Models/Json/ServiceResponse.cs index b904be6..f49ebdb 100644 --- a/server/src/Korga.Server/Models/Json/ServiceResponse.cs +++ b/server/Korga/Models/Json/ServiceResponse.cs @@ -1,4 +1,4 @@ -namespace Korga.Server.Models.Json; +namespace Korga.Models.Json; public class ServiceResponse { diff --git a/server/src/Korga.Server/Program.cs b/server/Korga/Program.cs similarity index 96% rename from server/src/Korga.Server/Program.cs rename to server/Korga/Program.cs index fa940c6..2d325ad 100644 --- a/server/src/Korga.Server/Program.cs +++ b/server/Korga/Program.cs @@ -1,6 +1,6 @@ -using Korga.Server.Commands; -using Korga.Server.Extensions; -using Korga.Server.Utilities; +using Korga.Commands; +using Korga.Extensions; +using Korga.Utilities; using McMaster.Extensions.CommandLineUtils; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; @@ -10,7 +10,7 @@ using System.Diagnostics; using System.Threading.Tasks; -namespace Korga.Server; +namespace Korga; public class Program { diff --git a/server/src/Korga.Server/Properties/launchSettings.json b/server/Korga/Properties/launchSettings.json similarity index 97% rename from server/src/Korga.Server/Properties/launchSettings.json rename to server/Korga/Properties/launchSettings.json index b08fb38..beaddac 100644 --- a/server/src/Korga.Server/Properties/launchSettings.json +++ b/server/Korga/Properties/launchSettings.json @@ -17,7 +17,7 @@ "ASPNETCORE_ENVIRONMENT": "Development" } }, - "Korga.Server": { + "Korga": { "commandName": "Project", "launchBrowser": false, "launchUrl": "", diff --git a/server/src/Korga.Server/Startup.cs b/server/Korga/Startup.cs similarity index 93% rename from server/src/Korga.Server/Startup.cs rename to server/Korga/Startup.cs index 57adb0a..644c6f1 100644 --- a/server/src/Korga.Server/Startup.cs +++ b/server/Korga/Startup.cs @@ -1,16 +1,16 @@ -using Korga.Server.ChurchTools; -using Korga.Server.ChurchTools.Hosting; -using Korga.Server.EmailDelivery; -using Korga.Server.EmailRelay; -using Korga.Server.Extensions; -using Korga.Server.Utilities; +using Korga.ChurchTools; +using Korga.ChurchTools.Hosting; +using Korga.EmailRelay; +using Korga.Extensions; +using Korga.Utilities; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Korga.EmailDelivery; -namespace Korga.Server; +namespace Korga; public class Startup { diff --git a/server/src/Korga.Server/Utilities/IJobController.cs b/server/Korga/Utilities/IJobController.cs similarity index 92% rename from server/src/Korga.Server/Utilities/IJobController.cs rename to server/Korga/Utilities/IJobController.cs index 1d205ac..337b686 100644 --- a/server/src/Korga.Server/Utilities/IJobController.cs +++ b/server/Korga/Utilities/IJobController.cs @@ -1,7 +1,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.Utilities; +namespace Korga.Utilities; public interface IJobController { diff --git a/server/src/Korga.Server/Utilities/JobQueue.cs b/server/Korga/Utilities/JobQueue.cs similarity index 97% rename from server/src/Korga.Server/Utilities/JobQueue.cs rename to server/Korga/Utilities/JobQueue.cs index 57cbc10..81c44b4 100644 --- a/server/src/Korga.Server/Utilities/JobQueue.cs +++ b/server/Korga/Utilities/JobQueue.cs @@ -1,4 +1,4 @@ -using Korga.Server.Extensions; +using Korga.Extensions; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; @@ -7,7 +7,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.Utilities; +namespace Korga.Utilities; public class JobQueue : BackgroundService where TController : IJobController { diff --git a/server/src/Korga.Server/Utilities/NativeMethods.cs b/server/Korga/Utilities/NativeMethods.cs similarity index 92% rename from server/src/Korga.Server/Utilities/NativeMethods.cs rename to server/Korga/Utilities/NativeMethods.cs index e2507ae..21e6445 100644 --- a/server/src/Korga.Server/Utilities/NativeMethods.cs +++ b/server/Korga/Utilities/NativeMethods.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -namespace Korga.Server.Utilities; +namespace Korga.Utilities; public static class NativeMethods { diff --git a/server/src/Korga.Server/Utilities/OneAtATimeJobController.cs b/server/Korga/Utilities/OneAtATimeJobController.cs similarity index 94% rename from server/src/Korga.Server/Utilities/OneAtATimeJobController.cs rename to server/Korga/Utilities/OneAtATimeJobController.cs index 9666f13..63e2fa6 100644 --- a/server/src/Korga.Server/Utilities/OneAtATimeJobController.cs +++ b/server/Korga/Utilities/OneAtATimeJobController.cs @@ -1,7 +1,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.Utilities; +namespace Korga.Utilities; public abstract class OneAtATimeJobController : IJobController { diff --git a/server/src/Korga.Server/Utilities/RepeatedExecutionService.cs b/server/Korga/Utilities/RepeatedExecutionService.cs similarity index 97% rename from server/src/Korga.Server/Utilities/RepeatedExecutionService.cs rename to server/Korga/Utilities/RepeatedExecutionService.cs index 2c97fec..1ff7732 100644 --- a/server/src/Korga.Server/Utilities/RepeatedExecutionService.cs +++ b/server/Korga/Utilities/RepeatedExecutionService.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Korga.Server.Utilities; +namespace Korga.Utilities; public abstract class RepeatedExecutionService : BackgroundService { diff --git a/server/src/Korga.Server/Utilities/TransientFailureException.cs b/server/Korga/Utilities/TransientFailureException.cs similarity index 89% rename from server/src/Korga.Server/Utilities/TransientFailureException.cs rename to server/Korga/Utilities/TransientFailureException.cs index 3baa0c6..415e78a 100644 --- a/server/src/Korga.Server/Utilities/TransientFailureException.cs +++ b/server/Korga/Utilities/TransientFailureException.cs @@ -1,6 +1,6 @@ using System; -namespace Korga.Server.Utilities; +namespace Korga.Utilities; public class TransientFailureException : ApplicationException { diff --git a/server/src/Korga.Server/Utilities/VueSpaFileProvider.cs b/server/Korga/Utilities/VueSpaFileProvider.cs similarity index 98% rename from server/src/Korga.Server/Utilities/VueSpaFileProvider.cs rename to server/Korga/Utilities/VueSpaFileProvider.cs index 6f87254..3592337 100644 --- a/server/src/Korga.Server/Utilities/VueSpaFileProvider.cs +++ b/server/Korga/Utilities/VueSpaFileProvider.cs @@ -1,4 +1,4 @@ -using Korga.Server.Configuration; +using Korga.Configuration; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -7,7 +7,7 @@ using System.IO; using System.Text; -namespace Korga.Server.Utilities; +namespace Korga.Utilities; public class VueSpaFileProvider : IFileProvider { diff --git a/server/src/Korga.Server/appsettings.Development.json b/server/Korga/appsettings.Development.json similarity index 100% rename from server/src/Korga.Server/appsettings.Development.json rename to server/Korga/appsettings.Development.json diff --git a/server/src/Korga.Server/appsettings.json b/server/Korga/appsettings.json similarity index 100% rename from server/src/Korga.Server/appsettings.json rename to server/Korga/appsettings.json diff --git a/server/src/Korga.Server/wwwroot/index.html b/server/Korga/wwwroot/index.html similarity index 100% rename from server/src/Korga.Server/wwwroot/index.html rename to server/Korga/wwwroot/index.html diff --git a/server/src/Korga.Core/ChurchTools/Api/Group.cs b/server/src/Korga.Core/ChurchTools/Api/Group.cs deleted file mode 100644 index a5d3aed..0000000 --- a/server/src/Korga.Core/ChurchTools/Api/Group.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text.Json; - -namespace Korga.ChurchTools.Api; - -public class Group : IIdentifiable -{ - public Group(int id, Guid guid, string name, Dictionary information) - { - Id = id; - Guid = guid; - Name = name; - Information = information; - } - - public int Id { get; set; } - public Guid Guid { get; set; } - public string Name { get; set; } - public Dictionary Information { get; set; } - public int GroupTypeId => Information["groupTypeId"].GetInt32(); - public int GroupStatusId => Information["groupStatusId"].GetInt32(); -} diff --git a/server/src/Korga.Core/ChurchTools/Api/GroupMember.cs b/server/src/Korga.Core/ChurchTools/Api/GroupMember.cs deleted file mode 100644 index d4dfe07..0000000 --- a/server/src/Korga.Core/ChurchTools/Api/GroupMember.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Korga.ChurchTools.Api; - -public class GroupMember : IIdentifiable -{ - public GroupMember(int personId, int groupId, int groupTypeRoleId, string groupMemberStatus) - { - PersonId = personId; - GroupId = groupId; - GroupTypeRoleId = groupTypeRoleId; - GroupMemberStatus = groupMemberStatus; - } - - public int PersonId { get; set; } - public int GroupId { get; set; } - public int GroupTypeRoleId { get; set; } - public string GroupMemberStatus { get; set; } - - long IIdentifiable.Id => (((long)PersonId) << 32) | (long)GroupId; -} diff --git a/server/src/Korga.Core/ChurchTools/Api/PaginatedResponse.cs b/server/src/Korga.Core/ChurchTools/Api/PaginatedResponse.cs deleted file mode 100644 index fe54e20..0000000 --- a/server/src/Korga.Core/ChurchTools/Api/PaginatedResponse.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace Korga.ChurchTools.Api; - -public class PaginatedResponse -{ - public PaginatedResponse(T data, PaginatedResponse.ListInformation meta) - { - Data = data; - Meta = meta; - } - - public T Data { get; set; } - public ListInformation Meta { get; set; } - - public class ListInformation - { - public ListInformation(int count, int all, PaginatedResponse.Pagination pagination) - { - Count = count; - All = all; - Pagination = pagination; - } - - public int Count { get; set; } - public int All { get; set; } - public Pagination Pagination { get; set; } - } - - public class Pagination - { - public int Total { get; set; } - public int Limit { get; set; } - public int Current { get; set; } - public int LastPage { get; set; } - } -} diff --git a/server/src/Korga.Core/ChurchTools/Api/Person.cs b/server/src/Korga.Core/ChurchTools/Api/Person.cs deleted file mode 100644 index 729ab6a..0000000 --- a/server/src/Korga.Core/ChurchTools/Api/Person.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; - -namespace Korga.ChurchTools.Api; - -public class Person : IIdentifiable -{ - public Person(int id, int statusId, List departmentIds, string firstName, string lastName, string email) - { - Id = id; - StatusId = statusId; - DepartmentIds = departmentIds; - FirstName = firstName; - LastName = lastName; - Email = email; - } - - public int Id { get; set; } - public int StatusId { get; set; } - public List DepartmentIds { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - public string Email { get; set; } -} diff --git a/server/src/Korga.Core/ChurchTools/Api/Response.cs b/server/src/Korga.Core/ChurchTools/Api/Response.cs deleted file mode 100644 index ad335cf..0000000 --- a/server/src/Korga.Core/ChurchTools/Api/Response.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Korga.ChurchTools.Api; - -public class Response -{ - public Response(T data) - { - Data = data; - } - - public T Data { get; set; } -} diff --git a/server/src/Korga.Core/Extensions/CollectionExtensions.cs b/server/src/Korga.Core/Extensions/CollectionExtensions.cs deleted file mode 100644 index b1f8d63..0000000 --- a/server/src/Korga.Core/Extensions/CollectionExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; - -namespace Korga.Extensions; - -public static class CollectionExtensions -{ - public static void AddRange(this ICollection collection, IEnumerable values) - { - foreach (var item in values) - { - collection.Add(item); - } - } -} diff --git a/server/src/Korga.Core/Korga.Core.csproj b/server/src/Korga.Core/Korga.Core.csproj deleted file mode 100644 index fa4540e..0000000 --- a/server/src/Korga.Core/Korga.Core.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net8.0 - enable - Korga - - - - - - - diff --git a/webapp/README.md b/webapp/README.md deleted file mode 100644 index d055c27..0000000 --- a/webapp/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Korga Vue.js frontend - -## Project setup -``` -npm install -``` - -### Compiles and hot-reloads for development -``` -npm run serve -``` - -### Compiles and minifies for production -``` -npm run build -``` - -### Lints and fixes files -``` -npm run lint -``` - -### Customize configuration -See [Configuration Reference](https://cli.vuejs.org/config/).