From 0fa8060856fde1ac887d1fefe3940ac494d236cb Mon Sep 17 00:00:00 2001 From: ivar Date: Sun, 8 Oct 2023 01:22:29 +0200 Subject: . --- .../Internal/Account/CreateAccountRoute.cs | 2 + .../Internal/Account/CreateInitialAccountRoute.cs | 2 + .../Endpoints/Internal/Account/GetAccountRoute.cs | 2 + .../src/Endpoints/Internal/Account/LoginRoute.cs | 2 + .../Internal/Account/UpdateAccountRoute.cs | 2 + .../CreateResetRequestRoute.cs | 2 + .../src/Endpoints/Internal/Root/GetSessionRoute.cs | 2 + .../src/Endpoints/V1/ApiTokens/CreateTokenRoute.cs | 1 + .../src/Endpoints/V1/ApiTokens/DeleteTokenRoute.cs | 2 + .../src/Endpoints/V1/ApiTokens/GetTokensRoute.cs | 2 + .../Endpoints/V1/Customers/CreateCustomerRoute.cs | 2 + .../Endpoints/V1/Projects/CreateProjectRoute.cs | 2 + .../src/Endpoints/V1/Projects/GetProjectsRoute.cs | 1 + code/api/src/IOL.GreatOffice.Api.csproj | 20 +- code/api/src/Jobs/AccessTokenCleanupJob.cs | 2 + .../20210517202115_InitialMigration.Designer.cs | 1 + ...10522165932_RenameNoteToDescription.Designer.cs | 1 + .../20211002113037_V6Migration.Designer.cs | 1 + .../20220225143559_GithubUserMappings.Designer.cs | 1 + .../20220319135910_RenameCreated.Designer.cs | 1 + .../20220319144958_ModifiedAt.Designer.cs | 1 + .../Migrations/20220319203018_UserBase.Designer.cs | 1 + .../Migrations/20220320115601_Update1.Designer.cs | 1 + ...32220_UpdatedForgotPasswordRequests.Designer.cs | 1 + .../20220529190359_ApiAccessTokens.Designer.cs | 1 + .../Migrations/20220530174741_Tenants.Designer.cs | 1 + .../20220530175322_RemoveUnusedNavs.Designer.cs | 1 + ...02214238_NullableOptionalBaseFields.Designer.cs | 1 + .../20220606232346_FleshOutNewModules.Designer.cs | 1 + .../20220616170311_DataProtectionKeys.Designer.cs | 1 + .../20220819203816_RemoveGithubUsers.Designer.cs | 1 + ...030080515_InitialProjectAndCustomer.Designer.cs | 1 + .../20221030081459_DeletedAt.Designer.cs | 1 + .../20221030084716_MinorChanges.Designer.cs | 1 + .../20221030090557_MoreMinorChanges.Designer.cs | 1 + ...21031165813_TodoAndOwnerNavigations.Designer.cs | 1 + .../20221114034213_RemoveTimeTracker.Designer.cs | 1 + ...035223_RenameForgotPasswordRequests.Designer.cs | 1 + .../20221209041908_TenantSlug.Designer.cs | 1 + ...20221209043806_ValidationEmailQueue.Designer.cs | 1 + .../20221214143556_AddUserDeletedBy.Designer.cs | 1 + .../src/Migrations/AppDbContextModelSnapshot.cs | 1 + code/api/src/Models/Database/BaseWithOwner.cs | 54 +++--- code/api/src/Models/Database/MainAppDatabase.cs | 202 +++++++++++---------- code/api/src/Program.cs | 1 + code/api/src/Services/EmailValidationService.cs | 2 + code/api/src/Services/PasswordResetService.cs | 2 + code/api/src/Services/TenantService.cs | 2 + code/api/src/Services/UserService.cs | 2 + .../src/Utilities/BasicAuthenticationHandler.cs | 1 + 50 files changed, 202 insertions(+), 137 deletions(-) (limited to 'code/api') diff --git a/code/api/src/Endpoints/Internal/Account/CreateAccountRoute.cs b/code/api/src/Endpoints/Internal/Account/CreateAccountRoute.cs index 443c4a9..230b4c8 100644 --- a/code/api/src/Endpoints/Internal/Account/CreateAccountRoute.cs +++ b/code/api/src/Endpoints/Internal/Account/CreateAccountRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.Internal.Account; public class CreateAccountRoute : RouteBaseAsync.WithRequest.WithActionResult diff --git a/code/api/src/Endpoints/Internal/Account/CreateInitialAccountRoute.cs b/code/api/src/Endpoints/Internal/Account/CreateInitialAccountRoute.cs index e1d13dd..79449ef 100644 --- a/code/api/src/Endpoints/Internal/Account/CreateInitialAccountRoute.cs +++ b/code/api/src/Endpoints/Internal/Account/CreateInitialAccountRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.Internal.Account; public class CreateInitialAccountRoute : RouteBaseAsync.WithoutRequest.WithActionResult diff --git a/code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs b/code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs index 121b40f..cf653e8 100644 --- a/code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs +++ b/code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.Internal.Account; public class GetAccountRoute : RouteBaseAsync.WithoutRequest.WithActionResult diff --git a/code/api/src/Endpoints/Internal/Account/LoginRoute.cs b/code/api/src/Endpoints/Internal/Account/LoginRoute.cs index 703f324..a6d52c0 100644 --- a/code/api/src/Endpoints/Internal/Account/LoginRoute.cs +++ b/code/api/src/Endpoints/Internal/Account/LoginRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.Internal.Account; public class LoginRoute : RouteBaseAsync.WithRequest.WithActionResult diff --git a/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs b/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs index 1081240..e314124 100644 --- a/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs +++ b/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.Internal.Account; public class UpdateAccountRoute : RouteBaseAsync.WithRequest.WithActionResult diff --git a/code/api/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs b/code/api/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs index c6ed417..781ba6f 100644 --- a/code/api/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs +++ b/code/api/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.Internal.PasswordResetRequests; public class CreateResetRequestRoute : RouteBaseAsync.WithRequest.WithActionResult diff --git a/code/api/src/Endpoints/Internal/Root/GetSessionRoute.cs b/code/api/src/Endpoints/Internal/Root/GetSessionRoute.cs index 82bbb11..048242f 100644 --- a/code/api/src/Endpoints/Internal/Root/GetSessionRoute.cs +++ b/code/api/src/Endpoints/Internal/Root/GetSessionRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.Internal.Root; public class GetSessionRoute : RouteBaseSync.WithoutRequest.WithActionResult diff --git a/code/api/src/Endpoints/V1/ApiTokens/CreateTokenRoute.cs b/code/api/src/Endpoints/V1/ApiTokens/CreateTokenRoute.cs index 163ddb6..6ac356a 100644 --- a/code/api/src/Endpoints/V1/ApiTokens/CreateTokenRoute.cs +++ b/code/api/src/Endpoints/V1/ApiTokens/CreateTokenRoute.cs @@ -1,4 +1,5 @@ using System.Text; +using IOL.GreatOffice.Api.Models.Database; namespace IOL.GreatOffice.Api.Endpoints.V1.ApiTokens; diff --git a/code/api/src/Endpoints/V1/ApiTokens/DeleteTokenRoute.cs b/code/api/src/Endpoints/V1/ApiTokens/DeleteTokenRoute.cs index ee19e40..5a55a2a 100644 --- a/code/api/src/Endpoints/V1/ApiTokens/DeleteTokenRoute.cs +++ b/code/api/src/Endpoints/V1/ApiTokens/DeleteTokenRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.V1.ApiTokens; public class DeleteTokenRoute : RouteBaseSync.WithRequest.WithActionResult diff --git a/code/api/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs b/code/api/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs index ee46b34..19d6f4d 100644 --- a/code/api/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs +++ b/code/api/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.V1.ApiTokens; public class GetTokensRoute : RouteBaseSync.WithoutRequest.WithResult>> diff --git a/code/api/src/Endpoints/V1/Customers/CreateCustomerRoute.cs b/code/api/src/Endpoints/V1/Customers/CreateCustomerRoute.cs index 03ba334..d02a004 100644 --- a/code/api/src/Endpoints/V1/Customers/CreateCustomerRoute.cs +++ b/code/api/src/Endpoints/V1/Customers/CreateCustomerRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.V1.Customers; public class CreateCustomerRoute : RouteBaseAsync.WithRequest.WithActionResult diff --git a/code/api/src/Endpoints/V1/Projects/CreateProjectRoute.cs b/code/api/src/Endpoints/V1/Projects/CreateProjectRoute.cs index bd37faf..bc6247f 100644 --- a/code/api/src/Endpoints/V1/Projects/CreateProjectRoute.cs +++ b/code/api/src/Endpoints/V1/Projects/CreateProjectRoute.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Endpoints.V1.Projects; public class CreateProjectRoute : RouteBaseAsync.WithRequest.WithActionResult diff --git a/code/api/src/Endpoints/V1/Projects/GetProjectsRoute.cs b/code/api/src/Endpoints/V1/Projects/GetProjectsRoute.cs index 8fe70a6..00604bc 100644 --- a/code/api/src/Endpoints/V1/Projects/GetProjectsRoute.cs +++ b/code/api/src/Endpoints/V1/Projects/GetProjectsRoute.cs @@ -1,3 +1,4 @@ +using IOL.GreatOffice.Api.Models.Database; using MR.AspNetCore.Pagination; namespace IOL.GreatOffice.Api.Endpoints.V1.Projects; diff --git a/code/api/src/IOL.GreatOffice.Api.csproj b/code/api/src/IOL.GreatOffice.Api.csproj index 15e5ebf..e1ea073 100644 --- a/code/api/src/IOL.GreatOffice.Api.csproj +++ b/code/api/src/IOL.GreatOffice.Api.csproj @@ -10,21 +10,21 @@ - - + + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + diff --git a/code/api/src/Jobs/AccessTokenCleanupJob.cs b/code/api/src/Jobs/AccessTokenCleanupJob.cs index 20b450c..9e9a78b 100644 --- a/code/api/src/Jobs/AccessTokenCleanupJob.cs +++ b/code/api/src/Jobs/AccessTokenCleanupJob.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Jobs; public class AccessTokenCleanupJob : IJob diff --git a/code/api/src/Migrations/20210517202115_InitialMigration.Designer.cs b/code/api/src/Migrations/20210517202115_InitialMigration.Designer.cs index da3c3ec..e474322 100644 --- a/code/api/src/Migrations/20210517202115_InitialMigration.Designer.cs +++ b/code/api/src/Migrations/20210517202115_InitialMigration.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20210522165932_RenameNoteToDescription.Designer.cs b/code/api/src/Migrations/20210522165932_RenameNoteToDescription.Designer.cs index 28408c7..d6fb701 100644 --- a/code/api/src/Migrations/20210522165932_RenameNoteToDescription.Designer.cs +++ b/code/api/src/Migrations/20210522165932_RenameNoteToDescription.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20211002113037_V6Migration.Designer.cs b/code/api/src/Migrations/20211002113037_V6Migration.Designer.cs index 50f461e..008426f 100644 --- a/code/api/src/Migrations/20211002113037_V6Migration.Designer.cs +++ b/code/api/src/Migrations/20211002113037_V6Migration.Designer.cs @@ -5,6 +5,7 @@ using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220225143559_GithubUserMappings.Designer.cs b/code/api/src/Migrations/20220225143559_GithubUserMappings.Designer.cs index 6c59262..168b330 100644 --- a/code/api/src/Migrations/20220225143559_GithubUserMappings.Designer.cs +++ b/code/api/src/Migrations/20220225143559_GithubUserMappings.Designer.cs @@ -5,6 +5,7 @@ using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220319135910_RenameCreated.Designer.cs b/code/api/src/Migrations/20220319135910_RenameCreated.Designer.cs index 2f96cdc..d4df436 100644 --- a/code/api/src/Migrations/20220319135910_RenameCreated.Designer.cs +++ b/code/api/src/Migrations/20220319135910_RenameCreated.Designer.cs @@ -5,6 +5,7 @@ using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220319144958_ModifiedAt.Designer.cs b/code/api/src/Migrations/20220319144958_ModifiedAt.Designer.cs index 349c4ad..c859201 100644 --- a/code/api/src/Migrations/20220319144958_ModifiedAt.Designer.cs +++ b/code/api/src/Migrations/20220319144958_ModifiedAt.Designer.cs @@ -5,6 +5,7 @@ using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220319203018_UserBase.Designer.cs b/code/api/src/Migrations/20220319203018_UserBase.Designer.cs index c918d3d..96381a3 100644 --- a/code/api/src/Migrations/20220319203018_UserBase.Designer.cs +++ b/code/api/src/Migrations/20220319203018_UserBase.Designer.cs @@ -5,6 +5,7 @@ using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220320115601_Update1.Designer.cs b/code/api/src/Migrations/20220320115601_Update1.Designer.cs index 3b6a63a..3354793 100644 --- a/code/api/src/Migrations/20220320115601_Update1.Designer.cs +++ b/code/api/src/Migrations/20220320115601_Update1.Designer.cs @@ -5,6 +5,7 @@ using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.Designer.cs b/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.Designer.cs index 8dae7c8..4cdefc2 100644 --- a/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.Designer.cs +++ b/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.Designer.cs @@ -5,6 +5,7 @@ using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220529190359_ApiAccessTokens.Designer.cs b/code/api/src/Migrations/20220529190359_ApiAccessTokens.Designer.cs index 3dc01a7..0e7e117 100644 --- a/code/api/src/Migrations/20220529190359_ApiAccessTokens.Designer.cs +++ b/code/api/src/Migrations/20220529190359_ApiAccessTokens.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220530174741_Tenants.Designer.cs b/code/api/src/Migrations/20220530174741_Tenants.Designer.cs index aadbec9..35fb1dc 100644 --- a/code/api/src/Migrations/20220530174741_Tenants.Designer.cs +++ b/code/api/src/Migrations/20220530174741_Tenants.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.Designer.cs b/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.Designer.cs index f87309f..325abca 100644 --- a/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.Designer.cs +++ b/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs b/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs index ddbe9d2..5784c91 100644 --- a/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs +++ b/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220606232346_FleshOutNewModules.Designer.cs b/code/api/src/Migrations/20220606232346_FleshOutNewModules.Designer.cs index 5c4d3a3..6a5d755 100644 --- a/code/api/src/Migrations/20220606232346_FleshOutNewModules.Designer.cs +++ b/code/api/src/Migrations/20220606232346_FleshOutNewModules.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220616170311_DataProtectionKeys.Designer.cs b/code/api/src/Migrations/20220616170311_DataProtectionKeys.Designer.cs index b89e68d..087f40b 100644 --- a/code/api/src/Migrations/20220616170311_DataProtectionKeys.Designer.cs +++ b/code/api/src/Migrations/20220616170311_DataProtectionKeys.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20220819203816_RemoveGithubUsers.Designer.cs b/code/api/src/Migrations/20220819203816_RemoveGithubUsers.Designer.cs index 0ba742c..ed0bd8f 100644 --- a/code/api/src/Migrations/20220819203816_RemoveGithubUsers.Designer.cs +++ b/code/api/src/Migrations/20220819203816_RemoveGithubUsers.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.Designer.cs b/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.Designer.cs index 284ea89..73c31db 100644 --- a/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.Designer.cs +++ b/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20221030081459_DeletedAt.Designer.cs b/code/api/src/Migrations/20221030081459_DeletedAt.Designer.cs index 78f9454..6196026 100644 --- a/code/api/src/Migrations/20221030081459_DeletedAt.Designer.cs +++ b/code/api/src/Migrations/20221030081459_DeletedAt.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20221030084716_MinorChanges.Designer.cs b/code/api/src/Migrations/20221030084716_MinorChanges.Designer.cs index 1527d91..b412de8 100644 --- a/code/api/src/Migrations/20221030084716_MinorChanges.Designer.cs +++ b/code/api/src/Migrations/20221030084716_MinorChanges.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20221030090557_MoreMinorChanges.Designer.cs b/code/api/src/Migrations/20221030090557_MoreMinorChanges.Designer.cs index ff1dfb2..d24112e 100644 --- a/code/api/src/Migrations/20221030090557_MoreMinorChanges.Designer.cs +++ b/code/api/src/Migrations/20221030090557_MoreMinorChanges.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.Designer.cs b/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.Designer.cs index 1909d36..ef4e425 100644 --- a/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.Designer.cs +++ b/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20221114034213_RemoveTimeTracker.Designer.cs b/code/api/src/Migrations/20221114034213_RemoveTimeTracker.Designer.cs index c649575..f1c4571 100644 --- a/code/api/src/Migrations/20221114034213_RemoveTimeTracker.Designer.cs +++ b/code/api/src/Migrations/20221114034213_RemoveTimeTracker.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20221114035223_RenameForgotPasswordRequests.Designer.cs b/code/api/src/Migrations/20221114035223_RenameForgotPasswordRequests.Designer.cs index feb9805..9132bdb 100644 --- a/code/api/src/Migrations/20221114035223_RenameForgotPasswordRequests.Designer.cs +++ b/code/api/src/Migrations/20221114035223_RenameForgotPasswordRequests.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20221209041908_TenantSlug.Designer.cs b/code/api/src/Migrations/20221209041908_TenantSlug.Designer.cs index d23568d..29a616d 100644 --- a/code/api/src/Migrations/20221209041908_TenantSlug.Designer.cs +++ b/code/api/src/Migrations/20221209041908_TenantSlug.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20221209043806_ValidationEmailQueue.Designer.cs b/code/api/src/Migrations/20221209043806_ValidationEmailQueue.Designer.cs index aa2d7f4..f2fff80 100644 --- a/code/api/src/Migrations/20221209043806_ValidationEmailQueue.Designer.cs +++ b/code/api/src/Migrations/20221209043806_ValidationEmailQueue.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/20221214143556_AddUserDeletedBy.Designer.cs b/code/api/src/Migrations/20221214143556_AddUserDeletedBy.Designer.cs index de4debc..4e0fe8f 100644 --- a/code/api/src/Migrations/20221214143556_AddUserDeletedBy.Designer.cs +++ b/code/api/src/Migrations/20221214143556_AddUserDeletedBy.Designer.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; diff --git a/code/api/src/Migrations/AppDbContextModelSnapshot.cs b/code/api/src/Migrations/AppDbContextModelSnapshot.cs index e0a5cfb..106f6d4 100644 --- a/code/api/src/Migrations/AppDbContextModelSnapshot.cs +++ b/code/api/src/Migrations/AppDbContextModelSnapshot.cs @@ -1,6 +1,7 @@ // using System; using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; diff --git a/code/api/src/Models/Database/BaseWithOwner.cs b/code/api/src/Models/Database/BaseWithOwner.cs index 7e9f6c1..ebb331a 100644 --- a/code/api/src/Models/Database/BaseWithOwner.cs +++ b/code/api/src/Models/Database/BaseWithOwner.cs @@ -5,36 +5,36 @@ namespace IOL.GreatOffice.Api.Data.Database; /// public abstract class BaseWithOwner : Base { - protected BaseWithOwner() { } + protected BaseWithOwner() { } - protected BaseWithOwner(Guid createdBy) { - CreatedBy = createdBy; - } + protected BaseWithOwner(Guid createdBy) { + CreatedBy = createdBy; + } - protected BaseWithOwner(LoggedInUserModel loggedInUser) { - CreatedBy = loggedInUser.Id; - } + protected BaseWithOwner(LoggedInUserModel loggedInUser) { + CreatedBy = loggedInUser.Id; + } - public Guid? UserId { get; private set; } - public Guid? TenantId { get; private set; } - public Guid? ModifiedBy { get; private set; } - public Guid? CreatedBy { get; private set; } - public Guid? DeletedBy { get; private set; } - public User OwningUser { get; set; } - public Tenant OwningTenant { get; set; } + public Guid? UserId { get; private set; } + public Guid? TenantId { get; private set; } + public Guid? ModifiedBy { get; private set; } + public Guid? CreatedBy { get; private set; } + public Guid? DeletedBy { get; private set; } + public User OwningUser { get; set; } + public Tenant OwningTenant { get; set; } - public void SetDeleted(Guid userId) { - DeletedBy = userId; - base.SetDeleted(); - } + public void SetDeleted(Guid userId) { + DeletedBy = userId; + base.SetDeleted(); + } - public void SetModified(Guid userId) { - ModifiedBy = userId; - base.SetModified(); - } + public void SetModified(Guid userId) { + ModifiedBy = userId; + base.SetModified(); + } - public void SetOwnerIds(Guid userId = default, Guid tenantId = default) { - if (tenantId != default) TenantId = tenantId; - if (userId != default) UserId = userId; - } -} \ No newline at end of file + public void SetOwnerIds(Guid userId = default, Guid tenantId = default) { + if (tenantId != default) TenantId = tenantId; + if (userId != default) UserId = userId; + } +} diff --git a/code/api/src/Models/Database/MainAppDatabase.cs b/code/api/src/Models/Database/MainAppDatabase.cs index 2b42fe0..cba7269 100644 --- a/code/api/src/Models/Database/MainAppDatabase.cs +++ b/code/api/src/Models/Database/MainAppDatabase.cs @@ -1,107 +1,109 @@ using Microsoft.AspNetCore.DataProtection.EntityFrameworkCore; -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class MainAppDatabase : DbContext, IDataProtectionKeyContext { - public MainAppDatabase(DbContextOptions options) : base(options) { } - public DbSet Users { get; set; } - public DbSet PasswordResetRequests { get; set; } - public DbSet AccessTokens { get; set; } - public DbSet Tenants { get; set; } - public DbSet DataProtectionKeys { get; set; } - public DbSet Projects { get; set; } - public DbSet ProjectLabels { get; set; } - public DbSet Customers { get; set; } - public DbSet CustomersContacts { get; set; } - public DbSet CustomerEvents { get; set; } - public DbSet CustomerGroups { get; set; } - public DbSet TodoLabels { get; set; } - public DbSet TodoProjectAccessControls { get; set; } - public DbSet TodoProjects { get; set; } - public DbSet TodoComments { get; set; } - public DbSet Todos { get; set; } - public DbSet ValidationEmails { get; set; } + public MainAppDatabase(DbContextOptions options) : base(options) { } + public DbSet Users { get; set; } + public DbSet PasswordResetRequests { get; set; } + public DbSet AccessTokens { get; set; } + public DbSet Tenants { get; set; } + public DbSet DataProtectionKeys { get; set; } + public DbSet Projects { get; set; } + public DbSet ProjectLabels { get; set; } + public DbSet Customers { get; set; } + public DbSet CustomersContacts { get; set; } + public DbSet CustomerEvents { get; set; } + public DbSet CustomerGroups { get; set; } + public DbSet TodoLabels { get; set; } + public DbSet TodoProjectAccessControls { get; set; } + public DbSet TodoProjects { get; set; } + public DbSet TodoComments { get; set; } + public DbSet Todos { get; set; } + public DbSet ValidationEmails { get; set; } - protected override void OnModelCreating(ModelBuilder modelBuilder) { - modelBuilder.Entity(e => { - e.HasMany(n => n.Tenants); - e.ToTable("users"); - }); - modelBuilder.Entity(e => { - e.HasOne(c => c.User); - e.ToTable("password_reset_requests"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.User); - e.ToTable("api_access_tokens"); - }); - modelBuilder.Entity(e => { - e.HasMany(n => n.Users); - e.ToTable("tenants"); - }); - modelBuilder.Entity(e => { - e.HasMany(n => n.Members); - e.HasMany(n => n.Customers); - e.ToTable("projects"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.Project); - e.HasOne(n => n.User); - e.ToTable("project_members"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.Project); - e.ToTable("project_labels"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.Owner); - e.HasMany(n => n.Events); - e.HasMany(n => n.Contacts); - e.HasMany(n => n.Groups); - e.HasMany(n => n.Projects); - e.ToTable("customers"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.Customer); - e.ToTable("customer_contacts"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.Customer); - e.ToTable("customer_events"); - }); - modelBuilder.Entity(e => { - e.HasMany(n => n.Customers); - e.ToTable("customer_groups"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.Collection); - e.HasOne(n => n.AssignedTo); - e.HasOne(n => n.ClosedBy); - e.HasMany(n => n.Labels); - e.HasMany(n => n.Comments); - e.ToTable("todos"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.Project); - e.HasMany(n => n.AccessControls); - e.ToTable("todo_collections"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.Todo); - e.ToTable("todo_comments"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.Todo); - e.ToTable("todo_labels"); - }); - modelBuilder.Entity(e => { - e.HasOne(n => n.User); - e.HasOne(n => n.Collection); - e.ToTable("todo_collection_access_controls"); - }); - modelBuilder.Entity(e => { e.ToTable("validation_emails"); }); + protected override void OnModelCreating(ModelBuilder modelBuilder) { + modelBuilder.Entity(e => { + e.HasMany(n => n.Tenants); + e.ToTable("users"); + }); + modelBuilder.Entity(e => { + e.HasOne(c => c.User); + e.ToTable("password_reset_requests"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.User); + e.ToTable("api_access_tokens"); + }); + modelBuilder.Entity(e => { + e.HasMany(n => n.Users); + e.ToTable("tenants"); + }); + modelBuilder.Entity(e => { + e.HasMany(n => n.Members); + e.HasMany(n => n.Customers); + e.ToTable("projects"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.Project); + e.HasOne(n => n.User); + e.ToTable("project_members"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.Project); + e.ToTable("project_labels"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.Owner); + e.HasMany(n => n.Events); + e.HasMany(n => n.Contacts); + e.HasMany(n => n.Groups); + e.HasMany(n => n.Projects); + e.ToTable("customers"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.Customer); + e.ToTable("customer_contacts"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.Customer); + e.ToTable("customer_events"); + }); + modelBuilder.Entity(e => { + e.HasMany(n => n.Customers); + e.ToTable("customer_groups"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.Collection); + e.HasOne(n => n.AssignedTo); + e.HasOne(n => n.ClosedBy); + e.HasMany(n => n.Labels); + e.HasMany(n => n.Comments); + e.ToTable("todos"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.Project); + e.HasMany(n => n.AccessControls); + e.ToTable("todo_collections"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.Todo); + e.ToTable("todo_comments"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.Todo); + e.ToTable("todo_labels"); + }); + modelBuilder.Entity(e => { + e.HasOne(n => n.User); + e.HasOne(n => n.Collection); + e.ToTable("todo_collection_access_controls"); + }); + modelBuilder.Entity(e => { + e.ToTable("validation_emails"); + }); - base.OnModelCreating(modelBuilder); - } -} \ No newline at end of file + base.OnModelCreating(modelBuilder); + } +} diff --git a/code/api/src/Program.cs b/code/api/src/Program.cs index 3da1111..fcb9465 100644 --- a/code/api/src/Program.cs +++ b/code/api/src/Program.cs @@ -34,6 +34,7 @@ global using Quartz; global using IOL.GreatOffice.Api.Resources; using IOL.GreatOffice.Api.Endpoints.V1; using IOL.GreatOffice.Api.Jobs; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Mvc.Versioning; diff --git a/code/api/src/Services/EmailValidationService.cs b/code/api/src/Services/EmailValidationService.cs index c7be20a..e88dfec 100644 --- a/code/api/src/Services/EmailValidationService.cs +++ b/code/api/src/Services/EmailValidationService.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Services; public class EmailValidationService diff --git a/code/api/src/Services/PasswordResetService.cs b/code/api/src/Services/PasswordResetService.cs index 4c00b81..a179e10 100644 --- a/code/api/src/Services/PasswordResetService.cs +++ b/code/api/src/Services/PasswordResetService.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Services; public class PasswordResetService diff --git a/code/api/src/Services/TenantService.cs b/code/api/src/Services/TenantService.cs index 0de6f53..477a865 100644 --- a/code/api/src/Services/TenantService.cs +++ b/code/api/src/Services/TenantService.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Services; public class TenantService diff --git a/code/api/src/Services/UserService.cs b/code/api/src/Services/UserService.cs index 4df8ded..8e183fe 100644 --- a/code/api/src/Services/UserService.cs +++ b/code/api/src/Services/UserService.cs @@ -1,3 +1,5 @@ +using IOL.GreatOffice.Api.Models.Database; + namespace IOL.GreatOffice.Api.Services; public class UserService diff --git a/code/api/src/Utilities/BasicAuthenticationHandler.cs b/code/api/src/Utilities/BasicAuthenticationHandler.cs index b0a2d1a..3b92293 100644 --- a/code/api/src/Utilities/BasicAuthenticationHandler.cs +++ b/code/api/src/Utilities/BasicAuthenticationHandler.cs @@ -1,6 +1,7 @@ using System.Net.Http.Headers; using System.Text; using System.Text.Encodings.Web; +using IOL.GreatOffice.Api.Models.Database; using Microsoft.Extensions.Options; namespace IOL.GreatOffice.Api.Utilities; -- cgit v1.3