-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify backend project structure and namespaces (#61)
- Loading branch information
1 parent
f9caa72
commit 90ea3b4
Showing
147 changed files
with
438 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 _[email protected]_ 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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<RootNamespace>ChurchTools</RootNamespace> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...Korga.Core/ChurchTools/IChurchToolsApi.cs → server/ChurchTools/IChurchToolsApi.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...r/src/Korga.Core/ChurchTools/Api/Event.cs → server/ChurchTools/Model/Event.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Core/ChurchTools/Api/GlobalPermissions.cs → ...er/ChurchTools/Model/GlobalPermissions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
|
||
namespace ChurchTools.Model; | ||
|
||
public class Group : IIdentifiable<int> | ||
{ | ||
public Group(int id, Guid guid, string name, Dictionary<string, JsonElement> 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<string, JsonElement> Information { get; set; } | ||
public int GroupTypeId => Information["groupTypeId"].GetInt32(); | ||
public int GroupStatusId => Information["groupStatusId"].GetInt32(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace ChurchTools.Model; | ||
|
||
public class GroupMember : IIdentifiable<long> | ||
{ | ||
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<long>.Id => (long)PersonId << 32 | (long)GroupId; | ||
} |
2 changes: 1 addition & 1 deletion
2
...rga.Core/ChurchTools/GroupMemberStatus.cs → ...er/ChurchTools/Model/GroupMemberStatus.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Korga.ChurchTools; | ||
namespace ChurchTools.Model; | ||
|
||
public enum GroupMemberStatus | ||
{ | ||
|
4 changes: 2 additions & 2 deletions
4
server/src/Korga.Core/IIdentifiable.cs → server/ChurchTools/Model/IIdentifiable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
using System; | ||
|
||
namespace Korga; | ||
namespace ChurchTools.Model; | ||
|
||
public interface IIdentifiable<TKey> where TKey : IComparable<TKey> | ||
{ | ||
TKey Id { get; } | ||
TKey Id { get; } | ||
} |
2 changes: 1 addition & 1 deletion
2
...r/src/Korga.Core/ChurchTools/Api/Login.cs → server/ChurchTools/Model/Login.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Korga.ChurchTools.Api; | ||
namespace ChurchTools.Model; | ||
|
||
public class Login | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace ChurchTools.Model; | ||
|
||
public class PaginatedResponse<T> | ||
{ | ||
public PaginatedResponse(T data, PaginatedResponse<T>.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<T>.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; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace ChurchTools.Model; | ||
|
||
public class Person : IIdentifiable<int> | ||
{ | ||
public Person(int id, int statusId, List<int> 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<int> DepartmentIds { get; set; } | ||
public string FirstName { get; set; } | ||
public string LastName { get; set; } | ||
public string Email { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace ChurchTools.Model; | ||
|
||
public class Response<T> | ||
{ | ||
public Response(T data) | ||
{ | ||
Data = data; | ||
} | ||
|
||
public T Data { get; set; } | ||
} |
2 changes: 1 addition & 1 deletion
2
...src/Korga.Core/ChurchTools/Api/Service.cs → server/ChurchTools/Model/Service.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Korga.ChurchTools.Api; | ||
namespace ChurchTools.Model; | ||
|
||
public class Service | ||
{ | ||
|
2 changes: 1 addition & 1 deletion
2
...orga.Core/ChurchTools/Api/ServiceGroup.cs → server/ChurchTools/Model/ServiceGroup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Korga.ChurchTools.Api; | ||
namespace ChurchTools.Model; | ||
|
||
public class ServiceGroup | ||
{ | ||
|
4 changes: 2 additions & 2 deletions
4
...Korga.Server.Tests/ChurchToolsApiTests.cs → server/Korga.Tests/ChurchToolsApiTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.