diff options
Diffstat (limited to 'code/api/src')
101 files changed, 159 insertions, 180 deletions
diff --git a/code/api/src/Endpoints/Internal/Account/CreateAccountRoute.cs b/code/api/src/Endpoints/Internal/Account/CreateAccountRoute.cs index 230b4c8..443c4a9 100644 --- a/code/api/src/Endpoints/Internal/Account/CreateAccountRoute.cs +++ b/code/api/src/Endpoints/Internal/Account/CreateAccountRoute.cs @@ -1,5 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; - namespace IOL.GreatOffice.Api.Endpoints.Internal.Account; public class CreateAccountRoute : RouteBaseAsync.WithRequest<CreateAccountRoute.Payload>.WithActionResult diff --git a/code/api/src/Endpoints/Internal/Account/CreateInitialAccountRoute.cs b/code/api/src/Endpoints/Internal/Account/CreateInitialAccountRoute.cs index 79449ef..e1d13dd 100644 --- a/code/api/src/Endpoints/Internal/Account/CreateInitialAccountRoute.cs +++ b/code/api/src/Endpoints/Internal/Account/CreateInitialAccountRoute.cs @@ -1,5 +1,3 @@ -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 cf653e8..121b40f 100644 --- a/code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs +++ b/code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs @@ -1,5 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; - namespace IOL.GreatOffice.Api.Endpoints.Internal.Account; public class GetAccountRoute : RouteBaseAsync.WithoutRequest.WithActionResult<LoggedInUserModel> diff --git a/code/api/src/Endpoints/Internal/Account/LoginRoute.cs b/code/api/src/Endpoints/Internal/Account/LoginRoute.cs index a6d52c0..703f324 100644 --- a/code/api/src/Endpoints/Internal/Account/LoginRoute.cs +++ b/code/api/src/Endpoints/Internal/Account/LoginRoute.cs @@ -1,5 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; - namespace IOL.GreatOffice.Api.Endpoints.Internal.Account; public class LoginRoute : RouteBaseAsync.WithRequest<LoginRoute.Payload>.WithActionResult diff --git a/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs b/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs index e314124..1081240 100644 --- a/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs +++ b/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs @@ -1,5 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; - namespace IOL.GreatOffice.Api.Endpoints.Internal.Account; public class UpdateAccountRoute : RouteBaseAsync.WithRequest<UpdateAccountRoute.Payload>.WithActionResult diff --git a/code/api/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs b/code/api/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs index 781ba6f..c6ed417 100644 --- a/code/api/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs +++ b/code/api/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs @@ -1,5 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; - namespace IOL.GreatOffice.Api.Endpoints.Internal.PasswordResetRequests; public class CreateResetRequestRoute : RouteBaseAsync.WithRequest<CreateResetRequestRoute.Payload>.WithActionResult diff --git a/code/api/src/Endpoints/Internal/Root/GetSessionRoute.cs b/code/api/src/Endpoints/Internal/Root/GetSessionRoute.cs index 048242f..82bbb11 100644 --- a/code/api/src/Endpoints/Internal/Root/GetSessionRoute.cs +++ b/code/api/src/Endpoints/Internal/Root/GetSessionRoute.cs @@ -1,5 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; - namespace IOL.GreatOffice.Api.Endpoints.Internal.Root; public class GetSessionRoute : RouteBaseSync.WithoutRequest.WithActionResult<GetSessionRoute.SessionResponse> diff --git a/code/api/src/Endpoints/Internal/Root/ReadConfigurationRoute.cs b/code/api/src/Endpoints/Internal/Root/ReadConfigurationRoute.cs index 7270fd8..a02dbb8 100644 --- a/code/api/src/Endpoints/Internal/Root/ReadConfigurationRoute.cs +++ b/code/api/src/Endpoints/Internal/Root/ReadConfigurationRoute.cs @@ -4,14 +4,16 @@ public class ReadConfigurationRoute : RouteBaseSync.WithoutRequest.WithActionRes { private readonly VaultService _vaultService; - public ReadConfigurationRoute(VaultService vaultService) { + public ReadConfigurationRoute(VaultService vaultService) + { _vaultService = vaultService; } [AllowAnonymous] [HttpGet("~/_/configuration")] - public override ActionResult Handle() { + public override ActionResult Handle() + { var config = _vaultService.GetCurrentAppConfiguration(); - return Content(JsonSerializer.Serialize(config.GetPublicVersion()), "application/json"); + return Content(JsonSerializer.Serialize(config.GetPublicObject()), "application/json"); } }
\ No newline at end of file diff --git a/code/api/src/Endpoints/V1/ApiTokens/CreateTokenRoute.cs b/code/api/src/Endpoints/V1/ApiTokens/CreateTokenRoute.cs index 6ac356a..163ddb6 100644 --- a/code/api/src/Endpoints/V1/ApiTokens/CreateTokenRoute.cs +++ b/code/api/src/Endpoints/V1/ApiTokens/CreateTokenRoute.cs @@ -1,5 +1,4 @@ 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 5a55a2a..ee19e40 100644 --- a/code/api/src/Endpoints/V1/ApiTokens/DeleteTokenRoute.cs +++ b/code/api/src/Endpoints/V1/ApiTokens/DeleteTokenRoute.cs @@ -1,5 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; - namespace IOL.GreatOffice.Api.Endpoints.V1.ApiTokens; public class DeleteTokenRoute : RouteBaseSync.WithRequest<Guid>.WithActionResult diff --git a/code/api/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs b/code/api/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs index 19d6f4d..ee46b34 100644 --- a/code/api/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs +++ b/code/api/src/Endpoints/V1/ApiTokens/GetTokensRoute.cs @@ -1,5 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; - namespace IOL.GreatOffice.Api.Endpoints.V1.ApiTokens; public class GetTokensRoute : RouteBaseSync.WithoutRequest.WithResult<ActionResult<List<GetTokensRoute.ResponseModel>>> diff --git a/code/api/src/Endpoints/V1/Customers/CreateCustomerRoute.cs b/code/api/src/Endpoints/V1/Customers/CreateCustomerRoute.cs index d02a004..03ba334 100644 --- a/code/api/src/Endpoints/V1/Customers/CreateCustomerRoute.cs +++ b/code/api/src/Endpoints/V1/Customers/CreateCustomerRoute.cs @@ -1,5 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; - namespace IOL.GreatOffice.Api.Endpoints.V1.Customers; public class CreateCustomerRoute : RouteBaseAsync.WithRequest<CreateCustomerPayload>.WithActionResult diff --git a/code/api/src/Endpoints/V1/Projects/CreateProjectRoute.cs b/code/api/src/Endpoints/V1/Projects/CreateProjectRoute.cs index bc6247f..bd37faf 100644 --- a/code/api/src/Endpoints/V1/Projects/CreateProjectRoute.cs +++ b/code/api/src/Endpoints/V1/Projects/CreateProjectRoute.cs @@ -1,5 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; - namespace IOL.GreatOffice.Api.Endpoints.V1.Projects; public class CreateProjectRoute : RouteBaseAsync.WithRequest<CreateProjectPayload>.WithActionResult diff --git a/code/api/src/Endpoints/V1/Projects/GetProjectsRoute.cs b/code/api/src/Endpoints/V1/Projects/GetProjectsRoute.cs index 00604bc..8fe70a6 100644 --- a/code/api/src/Endpoints/V1/Projects/GetProjectsRoute.cs +++ b/code/api/src/Endpoints/V1/Projects/GetProjectsRoute.cs @@ -1,4 +1,3 @@ -using IOL.GreatOffice.Api.Models.Database; using MR.AspNetCore.Pagination; namespace IOL.GreatOffice.Api.Endpoints.V1.Projects; diff --git a/code/api/src/Jobs/AccessTokenCleanupJob.cs b/code/api/src/Jobs/AccessTokenCleanupJob.cs index 9e9a78b..20b450c 100644 --- a/code/api/src/Jobs/AccessTokenCleanupJob.cs +++ b/code/api/src/Jobs/AccessTokenCleanupJob.cs @@ -1,5 +1,3 @@ -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 e474322..793d8ca 100644 --- a/code/api/src/Migrations/20210517202115_InitialMigration.Designer.cs +++ b/code/api/src/Migrations/20210517202115_InitialMigration.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20210517202115_InitialMigration.cs b/code/api/src/Migrations/20210517202115_InitialMigration.cs index 8bfaf61..1cb123c 100644 --- a/code/api/src/Migrations/20210517202115_InitialMigration.cs +++ b/code/api/src/Migrations/20210517202115_InitialMigration.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace IOL.GreatOffice.Api.Migrations { @@ -119,8 +118,8 @@ namespace IOL.GreatOffice.Api.Migrations migrationBuilder.InsertData( table: "users", - columns: new[] { "id", "created", "password", "username" }, - values: new object[] { new Guid("784938f0-cc0e-46ec-afa6-fc60b47b28db"), new DateTime(2021, 5, 17, 20, 21, 14, 827, DateTimeKind.Utc).AddTicks(4868), "AAAAAAEAACcQAAAAEJdtrX3pEeIbcgY+BDAr56gvfbc420ag1TllA0cK6Q6Gw3+gGDIQtYIZnisW3dmqaQ==", "admin@ivarlovlie.no" }); + columns: ["id", "created", "password", "username"], + values: [new Guid("784938f0-cc0e-46ec-afa6-fc60b47b28db"), new DateTime(2021, 5, 17, 20, 21, 14, 827, DateTimeKind.Utc).AddTicks(4868), "AAAAAAEAACcQAAAAEJdtrX3pEeIbcgY+BDAr56gvfbc420ag1TllA0cK6Q6Gw3+gGDIQtYIZnisW3dmqaQ==", "admin@ivarlovlie.no"]); migrationBuilder.CreateIndex( name: "ix_forgot_password_requests_user_id", diff --git a/code/api/src/Migrations/20210522165932_RenameNoteToDescription.Designer.cs b/code/api/src/Migrations/20210522165932_RenameNoteToDescription.Designer.cs index d6fb701..d5915bc 100644 --- a/code/api/src/Migrations/20210522165932_RenameNoteToDescription.Designer.cs +++ b/code/api/src/Migrations/20210522165932_RenameNoteToDescription.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20210522165932_RenameNoteToDescription.cs b/code/api/src/Migrations/20210522165932_RenameNoteToDescription.cs index e5bae54..db5132a 100644 --- a/code/api/src/Migrations/20210522165932_RenameNoteToDescription.cs +++ b/code/api/src/Migrations/20210522165932_RenameNoteToDescription.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace IOL.GreatOffice.Api.Migrations { @@ -27,8 +26,8 @@ namespace IOL.GreatOffice.Api.Migrations migrationBuilder.InsertData( table: "users", - columns: new[] { "id", "created", "password", "username" }, - values: new object[] { new Guid("784938f0-cc0e-46ec-afa6-fc60b47b28db"), new DateTime(2021, 5, 17, 20, 21, 14, 827, DateTimeKind.Utc).AddTicks(4868), "AAAAAAEAACcQAAAAEJdtrX3pEeIbcgY+BDAr56gvfbc420ag1TllA0cK6Q6Gw3+gGDIQtYIZnisW3dmqaQ==", "admin@ivarlovlie.no" }); + columns: ["id", "created", "password", "username"], + values: [new Guid("784938f0-cc0e-46ec-afa6-fc60b47b28db"), new DateTime(2021, 5, 17, 20, 21, 14, 827, DateTimeKind.Utc).AddTicks(4868), "AAAAAAEAACcQAAAAEJdtrX3pEeIbcgY+BDAr56gvfbc420ag1TllA0cK6Q6Gw3+gGDIQtYIZnisW3dmqaQ==", "admin@ivarlovlie.no"]); } } } diff --git a/code/api/src/Migrations/20211002113037_V6Migration.Designer.cs b/code/api/src/Migrations/20211002113037_V6Migration.Designer.cs index 008426f..410bf75 100644 --- a/code/api/src/Migrations/20211002113037_V6Migration.Designer.cs +++ b/code/api/src/Migrations/20211002113037_V6Migration.Designer.cs @@ -4,7 +4,7 @@ #nullable disable using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20211002113037_V6Migration.cs b/code/api/src/Migrations/20211002113037_V6Migration.cs index c7ac971..fc2af16 100644 --- a/code/api/src/Migrations/20211002113037_V6Migration.cs +++ b/code/api/src/Migrations/20211002113037_V6Migration.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220225143559_GithubUserMappings.Designer.cs b/code/api/src/Migrations/20220225143559_GithubUserMappings.Designer.cs index 168b330..9b6019d 100644 --- a/code/api/src/Migrations/20220225143559_GithubUserMappings.Designer.cs +++ b/code/api/src/Migrations/20220225143559_GithubUserMappings.Designer.cs @@ -4,7 +4,7 @@ #nullable disable using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220225143559_GithubUserMappings.cs b/code/api/src/Migrations/20220225143559_GithubUserMappings.cs index fc30c7a..158b9c4 100644 --- a/code/api/src/Migrations/20220225143559_GithubUserMappings.cs +++ b/code/api/src/Migrations/20220225143559_GithubUserMappings.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220319135910_RenameCreated.Designer.cs b/code/api/src/Migrations/20220319135910_RenameCreated.Designer.cs index d4df436..139ceb8 100644 --- a/code/api/src/Migrations/20220319135910_RenameCreated.Designer.cs +++ b/code/api/src/Migrations/20220319135910_RenameCreated.Designer.cs @@ -4,7 +4,7 @@ #nullable disable using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220319144958_ModifiedAt.Designer.cs b/code/api/src/Migrations/20220319144958_ModifiedAt.Designer.cs index c859201..9a22955 100644 --- a/code/api/src/Migrations/20220319144958_ModifiedAt.Designer.cs +++ b/code/api/src/Migrations/20220319144958_ModifiedAt.Designer.cs @@ -4,7 +4,7 @@ #nullable disable using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220319144958_ModifiedAt.cs b/code/api/src/Migrations/20220319144958_ModifiedAt.cs index 028473d..ccdb7d5 100644 --- a/code/api/src/Migrations/20220319144958_ModifiedAt.cs +++ b/code/api/src/Migrations/20220319144958_ModifiedAt.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220319203018_UserBase.Designer.cs b/code/api/src/Migrations/20220319203018_UserBase.Designer.cs index 96381a3..dfc42ee 100644 --- a/code/api/src/Migrations/20220319203018_UserBase.Designer.cs +++ b/code/api/src/Migrations/20220319203018_UserBase.Designer.cs @@ -4,7 +4,7 @@ #nullable disable using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220319203018_UserBase.cs b/code/api/src/Migrations/20220319203018_UserBase.cs index 14d3f4b..e21b9cc 100644 --- a/code/api/src/Migrations/20220319203018_UserBase.cs +++ b/code/api/src/Migrations/20220319203018_UserBase.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220320115601_Update1.Designer.cs b/code/api/src/Migrations/20220320115601_Update1.Designer.cs index 3354793..4e0e0f6 100644 --- a/code/api/src/Migrations/20220320115601_Update1.Designer.cs +++ b/code/api/src/Migrations/20220320115601_Update1.Designer.cs @@ -4,7 +4,7 @@ #nullable disable using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220320115601_Update1.cs b/code/api/src/Migrations/20220320115601_Update1.cs index 8b06fb7..678bb5d 100644 --- a/code/api/src/Migrations/20220320115601_Update1.cs +++ b/code/api/src/Migrations/20220320115601_Update1.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.Designer.cs b/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.Designer.cs index 4cdefc2..ac7f319 100644 --- a/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.Designer.cs +++ b/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.Designer.cs @@ -4,7 +4,7 @@ #nullable disable using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.cs b/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.cs index df7a195..0d82c8f 100644 --- a/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.cs +++ b/code/api/src/Migrations/20220320132220_UpdatedForgotPasswordRequests.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220529190359_ApiAccessTokens.Designer.cs b/code/api/src/Migrations/20220529190359_ApiAccessTokens.Designer.cs index 0e7e117..9dfb56e 100644 --- a/code/api/src/Migrations/20220529190359_ApiAccessTokens.Designer.cs +++ b/code/api/src/Migrations/20220529190359_ApiAccessTokens.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220529190359_ApiAccessTokens.cs b/code/api/src/Migrations/20220529190359_ApiAccessTokens.cs index dc44bee..b97f66d 100644 --- a/code/api/src/Migrations/20220529190359_ApiAccessTokens.cs +++ b/code/api/src/Migrations/20220529190359_ApiAccessTokens.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220530174741_Tenants.Designer.cs b/code/api/src/Migrations/20220530174741_Tenants.Designer.cs index 35fb1dc..b64c1c2 100644 --- a/code/api/src/Migrations/20220530174741_Tenants.Designer.cs +++ b/code/api/src/Migrations/20220530174741_Tenants.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220530174741_Tenants.cs b/code/api/src/Migrations/20220530174741_Tenants.cs index ea02ddd..9c23b2d 100644 --- a/code/api/src/Migrations/20220530174741_Tenants.cs +++ b/code/api/src/Migrations/20220530174741_Tenants.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.Designer.cs b/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.Designer.cs index 325abca..4a0cd19 100644 --- a/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.Designer.cs +++ b/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.cs b/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.cs index 36b3cf1..e28b498 100644 --- a/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.cs +++ b/code/api/src/Migrations/20220530175322_RemoveUnusedNavs.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs b/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs index 5784c91..b699bdd 100644 --- a/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs +++ b/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.cs b/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.cs index eebab5c..56d5864 100644 --- a/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.cs +++ b/code/api/src/Migrations/20220602214238_NullableOptionalBaseFields.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220606232346_FleshOutNewModules.Designer.cs b/code/api/src/Migrations/20220606232346_FleshOutNewModules.Designer.cs index 6a5d755..44063fa 100644 --- a/code/api/src/Migrations/20220606232346_FleshOutNewModules.Designer.cs +++ b/code/api/src/Migrations/20220606232346_FleshOutNewModules.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220606232346_FleshOutNewModules.cs b/code/api/src/Migrations/20220606232346_FleshOutNewModules.cs index 49a36b8..b0ab318 100644 --- a/code/api/src/Migrations/20220606232346_FleshOutNewModules.cs +++ b/code/api/src/Migrations/20220606232346_FleshOutNewModules.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20220616170311_DataProtectionKeys.Designer.cs b/code/api/src/Migrations/20220616170311_DataProtectionKeys.Designer.cs index 087f40b..765d7ed 100644 --- a/code/api/src/Migrations/20220616170311_DataProtectionKeys.Designer.cs +++ b/code/api/src/Migrations/20220616170311_DataProtectionKeys.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220819203816_RemoveGithubUsers.Designer.cs b/code/api/src/Migrations/20220819203816_RemoveGithubUsers.Designer.cs index ed0bd8f..9705ad4 100644 --- a/code/api/src/Migrations/20220819203816_RemoveGithubUsers.Designer.cs +++ b/code/api/src/Migrations/20220819203816_RemoveGithubUsers.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data; +using IOL.GreatOffice.Api.Models; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20220819203816_RemoveGithubUsers.cs b/code/api/src/Migrations/20220819203816_RemoveGithubUsers.cs index d301f67..7913b2e 100644 --- a/code/api/src/Migrations/20220819203816_RemoveGithubUsers.cs +++ b/code/api/src/Migrations/20220819203816_RemoveGithubUsers.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.Designer.cs b/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.Designer.cs index 73c31db..8851720 100644 --- a/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.Designer.cs +++ b/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.cs b/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.cs index 8a856cb..d17484e 100644 --- a/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.cs +++ b/code/api/src/Migrations/20221030080515_InitialProjectAndCustomer.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20221030081459_DeletedAt.Designer.cs b/code/api/src/Migrations/20221030081459_DeletedAt.Designer.cs index 6196026..a842ec7 100644 --- a/code/api/src/Migrations/20221030081459_DeletedAt.Designer.cs +++ b/code/api/src/Migrations/20221030081459_DeletedAt.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20221030081459_DeletedAt.cs b/code/api/src/Migrations/20221030081459_DeletedAt.cs index 8132a6b..84f1e30 100644 --- a/code/api/src/Migrations/20221030081459_DeletedAt.cs +++ b/code/api/src/Migrations/20221030081459_DeletedAt.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20221030084716_MinorChanges.Designer.cs b/code/api/src/Migrations/20221030084716_MinorChanges.Designer.cs index b412de8..56ac6d7 100644 --- a/code/api/src/Migrations/20221030084716_MinorChanges.Designer.cs +++ b/code/api/src/Migrations/20221030084716_MinorChanges.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20221030090557_MoreMinorChanges.Designer.cs b/code/api/src/Migrations/20221030090557_MoreMinorChanges.Designer.cs index d24112e..223d32e 100644 --- a/code/api/src/Migrations/20221030090557_MoreMinorChanges.Designer.cs +++ b/code/api/src/Migrations/20221030090557_MoreMinorChanges.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20221030090557_MoreMinorChanges.cs b/code/api/src/Migrations/20221030090557_MoreMinorChanges.cs index 5ebd664..de54228 100644 --- a/code/api/src/Migrations/20221030090557_MoreMinorChanges.cs +++ b/code/api/src/Migrations/20221030090557_MoreMinorChanges.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.Designer.cs b/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.Designer.cs index ef4e425..e6640d4 100644 --- a/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.Designer.cs +++ b/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.cs b/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.cs index 334913e..6d99460 100644 --- a/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.cs +++ b/code/api/src/Migrations/20221031165813_TodoAndOwnerNavigations.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20221114034213_RemoveTimeTracker.Designer.cs b/code/api/src/Migrations/20221114034213_RemoveTimeTracker.Designer.cs index f1c4571..c38b1e2 100644 --- a/code/api/src/Migrations/20221114034213_RemoveTimeTracker.Designer.cs +++ b/code/api/src/Migrations/20221114034213_RemoveTimeTracker.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20221114034213_RemoveTimeTracker.cs b/code/api/src/Migrations/20221114034213_RemoveTimeTracker.cs index 70b2539..7bc609e 100644 --- a/code/api/src/Migrations/20221114034213_RemoveTimeTracker.cs +++ b/code/api/src/Migrations/20221114034213_RemoveTimeTracker.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20221114035223_RenameForgotPasswordRequests.Designer.cs b/code/api/src/Migrations/20221114035223_RenameForgotPasswordRequests.Designer.cs index 9132bdb..b013570 100644 --- a/code/api/src/Migrations/20221114035223_RenameForgotPasswordRequests.Designer.cs +++ b/code/api/src/Migrations/20221114035223_RenameForgotPasswordRequests.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20221209041908_TenantSlug.Designer.cs b/code/api/src/Migrations/20221209041908_TenantSlug.Designer.cs index 29a616d..8a55c4f 100644 --- a/code/api/src/Migrations/20221209041908_TenantSlug.Designer.cs +++ b/code/api/src/Migrations/20221209041908_TenantSlug.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20221209043806_ValidationEmailQueue.Designer.cs b/code/api/src/Migrations/20221209043806_ValidationEmailQueue.Designer.cs index f2fff80..8b57dac 100644 --- a/code/api/src/Migrations/20221209043806_ValidationEmailQueue.Designer.cs +++ b/code/api/src/Migrations/20221209043806_ValidationEmailQueue.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20221209043806_ValidationEmailQueue.cs b/code/api/src/Migrations/20221209043806_ValidationEmailQueue.cs index 3599a37..7246fd7 100644 --- a/code/api/src/Migrations/20221209043806_ValidationEmailQueue.cs +++ b/code/api/src/Migrations/20221209043806_ValidationEmailQueue.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/20221214143556_AddUserDeletedBy.Designer.cs b/code/api/src/Migrations/20221214143556_AddUserDeletedBy.Designer.cs index 4e0fe8f..8a2657a 100644 --- a/code/api/src/Migrations/20221214143556_AddUserDeletedBy.Designer.cs +++ b/code/api/src/Migrations/20221214143556_AddUserDeletedBy.Designer.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Migrations/20221214143556_AddUserDeletedBy.cs b/code/api/src/Migrations/20221214143556_AddUserDeletedBy.cs index e929b88..14cfbf2 100644 --- a/code/api/src/Migrations/20221214143556_AddUserDeletedBy.cs +++ b/code/api/src/Migrations/20221214143556_AddUserDeletedBy.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/code/api/src/Migrations/AppDbContextModelSnapshot.cs b/code/api/src/Migrations/AppDbContextModelSnapshot.cs index 106f6d4..525d8f4 100644 --- a/code/api/src/Migrations/AppDbContextModelSnapshot.cs +++ b/code/api/src/Migrations/AppDbContextModelSnapshot.cs @@ -1,6 +1,6 @@ // <auto-generated /> using System; -using IOL.GreatOffice.Api.Data.Database; +using IOL.GreatOffice.Api.Models.Database; using IOL.GreatOffice.Api.Models.Database; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/code/api/src/Models/Database/Api/ApiAccessToken.cs b/code/api/src/Models/Database/Api/ApiAccessToken.cs index 9359fc4..cd7cd50 100644 --- a/code/api/src/Models/Database/Api/ApiAccessToken.cs +++ b/code/api/src/Models/Database/Api/ApiAccessToken.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class ApiAccessToken : Base { diff --git a/code/api/src/Models/Database/Base.cs b/code/api/src/Models/Database/Base.cs index 0b16b12..ec7fad4 100644 --- a/code/api/src/Models/Database/Base.cs +++ b/code/api/src/Models/Database/Base.cs @@ -1,8 +1,9 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public abstract class Base { - protected Base() { + protected Base() + { Id = Guid.NewGuid(); CreatedAt = AppDateTime.UtcNow; } @@ -15,7 +16,8 @@ public abstract class Base public void SetModified() => ModifiedAt = AppDateTime.UtcNow; - public void SetDeleted() { + public void SetDeleted() + { Deleted = true; DeletedAt = AppDateTime.UtcNow; } diff --git a/code/api/src/Models/Database/BaseWithOwner.cs b/code/api/src/Models/Database/BaseWithOwner.cs index ebb331a..3c29c76 100644 --- a/code/api/src/Models/Database/BaseWithOwner.cs +++ b/code/api/src/Models/Database/BaseWithOwner.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; /// <summary> /// Base class for all entities with ownership. @@ -7,11 +7,13 @@ public abstract class BaseWithOwner : Base { protected BaseWithOwner() { } - protected BaseWithOwner(Guid createdBy) { + protected BaseWithOwner(Guid createdBy) + { CreatedBy = createdBy; } - protected BaseWithOwner(LoggedInUserModel loggedInUser) { + protected BaseWithOwner(LoggedInUserModel loggedInUser) + { CreatedBy = loggedInUser.Id; } @@ -23,17 +25,20 @@ public abstract class BaseWithOwner : Base public User OwningUser { get; set; } public Tenant OwningTenant { get; set; } - public void SetDeleted(Guid userId) { + public void SetDeleted(Guid userId) + { DeletedBy = userId; base.SetDeleted(); } - public void SetModified(Guid userId) { + public void SetModified(Guid userId) + { ModifiedBy = userId; base.SetModified(); } - public void SetOwnerIds(Guid userId = default, Guid tenantId = default) { + 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/Customer/Customer.cs b/code/api/src/Models/Database/Customer/Customer.cs index 8e153c6..c54934b 100644 --- a/code/api/src/Models/Database/Customer/Customer.cs +++ b/code/api/src/Models/Database/Customer/Customer.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class Customer : BaseWithOwner { diff --git a/code/api/src/Models/Database/Customer/CustomerContact.cs b/code/api/src/Models/Database/Customer/CustomerContact.cs index f5a951d..4447412 100644 --- a/code/api/src/Models/Database/Customer/CustomerContact.cs +++ b/code/api/src/Models/Database/Customer/CustomerContact.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class CustomerContact : BaseWithOwner { diff --git a/code/api/src/Models/Database/Customer/CustomerEvent.cs b/code/api/src/Models/Database/Customer/CustomerEvent.cs index a87da4c..f12fab1 100644 --- a/code/api/src/Models/Database/Customer/CustomerEvent.cs +++ b/code/api/src/Models/Database/Customer/CustomerEvent.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class CustomerEvent : BaseWithOwner { diff --git a/code/api/src/Models/Database/Customer/CustomerGroup.cs b/code/api/src/Models/Database/Customer/CustomerGroup.cs index 9438f3c..5ae8e29 100644 --- a/code/api/src/Models/Database/Customer/CustomerGroup.cs +++ b/code/api/src/Models/Database/Customer/CustomerGroup.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class CustomerGroup : BaseWithOwner { diff --git a/code/api/src/Models/Database/Customer/CustomerGroupMembership.cs b/code/api/src/Models/Database/Customer/CustomerGroupMembership.cs index ec0d4af..03b715e 100644 --- a/code/api/src/Models/Database/Customer/CustomerGroupMembership.cs +++ b/code/api/src/Models/Database/Customer/CustomerGroupMembership.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class CustomerGroupMembership : Base { diff --git a/code/api/src/Models/Database/Internal/PasswordResetRequest.cs b/code/api/src/Models/Database/Internal/PasswordResetRequest.cs index ee73fd2..1ccb614 100644 --- a/code/api/src/Models/Database/Internal/PasswordResetRequest.cs +++ b/code/api/src/Models/Database/Internal/PasswordResetRequest.cs @@ -1,10 +1,11 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class PasswordResetRequest { public PasswordResetRequest() { } - public PasswordResetRequest(User user) { + public PasswordResetRequest(User user) + { CreatedAt = AppDateTime.UtcNow; Id = Guid.NewGuid(); User = user; diff --git a/code/api/src/Models/Database/Internal/Tenant.cs b/code/api/src/Models/Database/Internal/Tenant.cs index 471164d..15e0be0 100644 --- a/code/api/src/Models/Database/Internal/Tenant.cs +++ b/code/api/src/Models/Database/Internal/Tenant.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class Tenant : BaseWithOwner { diff --git a/code/api/src/Models/Database/Internal/User.cs b/code/api/src/Models/Database/Internal/User.cs index f4d08ff..fa8adaa 100644 --- a/code/api/src/Models/Database/Internal/User.cs +++ b/code/api/src/Models/Database/Internal/User.cs @@ -1,10 +1,11 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class User : Base { public User() { } - public User(string username) { + public User(string username) + { Username = username; } @@ -17,25 +18,30 @@ public class User : Base public ICollection<Tenant> Tenants { get; set; } public Guid? DeletedBy { get; set; } - public string DisplayName(bool isForGreeting = false) { + public string DisplayName(bool isForGreeting = false) + { if (!isForGreeting && FirstName.HasValue() && LastName.HasValue()) return FirstName + " " + LastName; return FirstName.HasValue() ? FirstName : Username ?? Email; } - public void HashAndSetPassword(string password) { + public void HashAndSetPassword(string password) + { Password = PasswordHelper.HashPassword(password); } - public bool VerifyPassword(string password) { + public bool VerifyPassword(string password) + { return PasswordHelper.Verify(password, Password); } - public void SetDeleted(Guid userId) { + public void SetDeleted(Guid userId) + { base.SetDeleted(); DeletedBy = userId; } - public IEnumerable<Claim> DefaultClaims() { + public IEnumerable<Claim> DefaultClaims() + { return new Claim[] { new(AppClaims.USER_ID, Id.ToString()), new(AppClaims.NAME, Username), diff --git a/code/api/src/Models/Database/Project/Project.cs b/code/api/src/Models/Database/Project/Project.cs index de9e2cb..8c59f08 100644 --- a/code/api/src/Models/Database/Project/Project.cs +++ b/code/api/src/Models/Database/Project/Project.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class Project : BaseWithOwner { diff --git a/code/api/src/Models/Database/Project/ProjectLabel.cs b/code/api/src/Models/Database/Project/ProjectLabel.cs index 0e1dc5d..8113199 100644 --- a/code/api/src/Models/Database/Project/ProjectLabel.cs +++ b/code/api/src/Models/Database/Project/ProjectLabel.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class ProjectLabel : BaseWithOwner { diff --git a/code/api/src/Models/Database/Project/ProjectMember.cs b/code/api/src/Models/Database/Project/ProjectMember.cs index a5e0682..caf52c2 100644 --- a/code/api/src/Models/Database/Project/ProjectMember.cs +++ b/code/api/src/Models/Database/Project/ProjectMember.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class ProjectMember : Base { diff --git a/code/api/src/Models/Database/Queues/ValidationEmail.cs b/code/api/src/Models/Database/Queues/ValidationEmail.cs index 0457768..39f71eb 100644 --- a/code/api/src/Models/Database/Queues/ValidationEmail.cs +++ b/code/api/src/Models/Database/Queues/ValidationEmail.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class ValidationEmail { diff --git a/code/api/src/Models/Database/Todo/Todo.cs b/code/api/src/Models/Database/Todo/Todo.cs index 2d7f109..da96cae 100644 --- a/code/api/src/Models/Database/Todo/Todo.cs +++ b/code/api/src/Models/Database/Todo/Todo.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class Todo : BaseWithOwner { diff --git a/code/api/src/Models/Database/Todo/TodoCollection.cs b/code/api/src/Models/Database/Todo/TodoCollection.cs index 470e5e7..551e488 100644 --- a/code/api/src/Models/Database/Todo/TodoCollection.cs +++ b/code/api/src/Models/Database/Todo/TodoCollection.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class TodoCollection : BaseWithOwner { diff --git a/code/api/src/Models/Database/Todo/TodoCollectionAccessControl.cs b/code/api/src/Models/Database/Todo/TodoCollectionAccessControl.cs index 1676c06..a2e8ccd 100644 --- a/code/api/src/Models/Database/Todo/TodoCollectionAccessControl.cs +++ b/code/api/src/Models/Database/Todo/TodoCollectionAccessControl.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class TodoCollectionAccessControl : Base { diff --git a/code/api/src/Models/Database/Todo/TodoComment.cs b/code/api/src/Models/Database/Todo/TodoComment.cs index 32ac3a3..54ab9cb 100644 --- a/code/api/src/Models/Database/Todo/TodoComment.cs +++ b/code/api/src/Models/Database/Todo/TodoComment.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class TodoComment : BaseWithOwner { diff --git a/code/api/src/Models/Database/Todo/TodoLabel.cs b/code/api/src/Models/Database/Todo/TodoLabel.cs index 7753ade..edfaeb5 100644 --- a/code/api/src/Models/Database/Todo/TodoLabel.cs +++ b/code/api/src/Models/Database/Todo/TodoLabel.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Database; +namespace IOL.GreatOffice.Api.Models.Database; public class TodoLabel : BaseWithOwner { diff --git a/code/api/src/Models/Enums/FulfillPasswordResetRequestResult.cs b/code/api/src/Models/Enums/FulfillPasswordResetRequestResult.cs index 2a84c48..60ba43d 100644 --- a/code/api/src/Models/Enums/FulfillPasswordResetRequestResult.cs +++ b/code/api/src/Models/Enums/FulfillPasswordResetRequestResult.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Enums; +namespace IOL.GreatOffice.Api.Models.Enums; public enum FulfillPasswordResetRequestResult { diff --git a/code/api/src/Models/Enums/PasswordResetRequestStatus.cs b/code/api/src/Models/Enums/PasswordResetRequestStatus.cs deleted file mode 100644 index 5629e6f..0000000 --- a/code/api/src/Models/Enums/PasswordResetRequestStatus.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace IOL.GreatOffice.Api.Data.Enums; - -public enum PasswordResetRequestStatus -{ - -}
\ No newline at end of file diff --git a/code/api/src/Models/Enums/ProjectRole.cs b/code/api/src/Models/Enums/ProjectRole.cs index c4a3f29..1fb2b72 100644 --- a/code/api/src/Models/Enums/ProjectRole.cs +++ b/code/api/src/Models/Enums/ProjectRole.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Enums; +namespace IOL.GreatOffice.Api.Models.Enums; public enum ProjectRole { diff --git a/code/api/src/Models/Enums/TodoClosingStatement.cs b/code/api/src/Models/Enums/TodoClosingStatement.cs index d838031..5a19757 100644 --- a/code/api/src/Models/Enums/TodoClosingStatement.cs +++ b/code/api/src/Models/Enums/TodoClosingStatement.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Enums; +namespace IOL.GreatOffice.Api.Models.Enums; public enum TodoClosingStatement { diff --git a/code/api/src/Models/Enums/TodoVisibility.cs b/code/api/src/Models/Enums/TodoVisibility.cs index 2c8fa83..bb45d70 100644 --- a/code/api/src/Models/Enums/TodoVisibility.cs +++ b/code/api/src/Models/Enums/TodoVisibility.cs @@ -1,5 +1,5 @@ -namespace IOL.GreatOffice.Api.Data.Enums; +namespace IOL.GreatOffice.Api.Models.Enums; public enum TodoVisibility { diff --git a/code/api/src/Models/Misc/ApiSpecDocument.cs b/code/api/src/Models/Misc/ApiSpecDocument.cs index 1c7d936..a515baf 100644 --- a/code/api/src/Models/Misc/ApiSpecDocument.cs +++ b/code/api/src/Models/Misc/ApiSpecDocument.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Models; +namespace IOL.GreatOffice.Api.Models.Models; public class ApiSpecDocument { diff --git a/code/api/src/Models/Misc/AppConfiguration.cs b/code/api/src/Models/Misc/AppConfiguration.cs index 31e5726..9ed6fe4 100644 --- a/code/api/src/Models/Misc/AppConfiguration.cs +++ b/code/api/src/Models/Misc/AppConfiguration.cs @@ -1,6 +1,6 @@ using System.Security.Cryptography.X509Certificates; -namespace IOL.GreatOffice.Api.Data.Models; +namespace IOL.GreatOffice.Api.Models.Models; public class AppConfiguration { @@ -96,8 +96,10 @@ public class AppConfiguration public X509Certificate2 CERT1() => new(Convert.FromBase64String(APP_CERT)); - public object GetPublicVersion() { - return new { + public object GetPublicObject() + { + return new + { DB_HOST, DB_PORT, DB_USER, diff --git a/code/api/src/Models/Misc/AppPath.cs b/code/api/src/Models/Misc/AppPath.cs index e47e48c..5a8c206 100644 --- a/code/api/src/Models/Misc/AppPath.cs +++ b/code/api/src/Models/Misc/AppPath.cs @@ -1,20 +1,24 @@ -namespace IOL.GreatOffice.Api.Data.Models; +namespace IOL.GreatOffice.Api.Models.Models; public sealed record AppPath { public string HostPath { get; init; } public string WebPath { get; init; } - public string GetHostPathForFilename(string filename, string fallback = "") { - if (filename.IsNullOrWhiteSpace()) { + public string GetHostPathForFilename(string filename, string fallback = "") + { + if (filename.IsNullOrWhiteSpace()) + { return fallback; } return Path.Combine(HostPath, filename); } - public string GetWebPathForFilename(string filename, string fallback = "") { - if (filename.IsNullOrWhiteSpace()) { + public string GetWebPathForFilename(string filename, string fallback = "") + { + if (filename.IsNullOrWhiteSpace()) + { return fallback; } diff --git a/code/api/src/Models/Misc/KnownProblemModel.cs b/code/api/src/Models/Misc/KnownProblemModel.cs index 9acc85c..5a9927f 100644 --- a/code/api/src/Models/Misc/KnownProblemModel.cs +++ b/code/api/src/Models/Misc/KnownProblemModel.cs @@ -1,8 +1,9 @@ -namespace IOL.GreatOffice.Api.Data.Models; +namespace IOL.GreatOffice.Api.Models.Models; public class KnownProblemModel { - public KnownProblemModel(string title = default, string subtitle = default, Dictionary<string, string[]> errors = default) { + public KnownProblemModel(string title = default, string subtitle = default, Dictionary<string, string[]> errors = default) + { Title = title; Subtitle = subtitle; Errors = errors ?? new(); @@ -13,12 +14,16 @@ public class KnownProblemModel public Dictionary<string, string[]> Errors { get; set; } public string TraceId { get; set; } - public void AddError(string field, string errorText) { - if (!Errors.ContainsKey(field)) { - Errors.Add(field, new[] {errorText}); - } else { + public void AddError(string field, string errorText) + { + if (!Errors.ContainsKey(field)) + { + Errors.Add(field, [errorText]); + } + else + { var currentErrors = Errors[field]; - var newErrors = currentErrors.Concat(new[] {errorText}); + var newErrors = currentErrors.Concat(new[] { errorText }); Errors.Remove(field); Errors.Add(field, newErrors.ToArray()); } diff --git a/code/api/src/Models/Misc/LoggedInUserModel.cs b/code/api/src/Models/Misc/LoggedInUserModel.cs index 541d4a5..ce2b163 100644 --- a/code/api/src/Models/Misc/LoggedInUserModel.cs +++ b/code/api/src/Models/Misc/LoggedInUserModel.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Models; +namespace IOL.GreatOffice.Api.Models.Models; public class LoggedInUserModel { diff --git a/code/api/src/Models/Misc/RequestTimeZoneInfo.cs b/code/api/src/Models/Misc/RequestTimeZoneInfo.cs index 4c5aa13..4d9d8c1 100644 --- a/code/api/src/Models/Misc/RequestTimeZoneInfo.cs +++ b/code/api/src/Models/Misc/RequestTimeZoneInfo.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Models; +namespace IOL.GreatOffice.Api.Models.Models; public class RequestTimeZoneInfo { diff --git a/code/api/src/Models/Static/AppClaims.cs b/code/api/src/Models/Static/AppClaims.cs index 6569700..55db72b 100644 --- a/code/api/src/Models/Static/AppClaims.cs +++ b/code/api/src/Models/Static/AppClaims.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Static; +namespace IOL.GreatOffice.Api.Models.Static; public static class AppClaims { diff --git a/code/api/src/Models/Static/AppConstants.cs b/code/api/src/Models/Static/AppConstants.cs index d0a888b..edd5bf0 100644 --- a/code/api/src/Models/Static/AppConstants.cs +++ b/code/api/src/Models/Static/AppConstants.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Static; +namespace IOL.GreatOffice.Api.Models.Static; public static class AppConstants { diff --git a/code/api/src/Models/Static/AppCookies.cs b/code/api/src/Models/Static/AppCookies.cs index e307b83..21d8cf0 100644 --- a/code/api/src/Models/Static/AppCookies.cs +++ b/code/api/src/Models/Static/AppCookies.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Static; +namespace IOL.GreatOffice.Api.Models.Static; public static class AppCookies { diff --git a/code/api/src/Models/Static/AppDateTime.cs b/code/api/src/Models/Static/AppDateTime.cs index 880d2a8..69371c8 100644 --- a/code/api/src/Models/Static/AppDateTime.cs +++ b/code/api/src/Models/Static/AppDateTime.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Static; +namespace IOL.GreatOffice.Api.Models.Static; public static class AppDateTime { @@ -6,11 +6,13 @@ public static class AppDateTime public static DateTime UtcNow => dateTime ?? DateTime.UtcNow; - public static void Set(DateTime setDateTime) { + public static void Set(DateTime setDateTime) + { dateTime = setDateTime; } - public static void Reset() { + public static void Reset() + { dateTime = null; } } diff --git a/code/api/src/Models/Static/AppEnvironmentVariables.cs b/code/api/src/Models/Static/AppEnvironmentVariables.cs index 0c1938d..c35739e 100644 --- a/code/api/src/Models/Static/AppEnvironmentVariables.cs +++ b/code/api/src/Models/Static/AppEnvironmentVariables.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Static; +namespace IOL.GreatOffice.Api.Models.Static; public static class AppEnvironmentVariables { @@ -18,7 +18,7 @@ public static class AppEnvironmentVariables public const string VAULT_CACHE_TTL = "VAULT_CACHE_TTL"; /// <summary> - /// The vault key name for the main configuration json object, described by <see cref="AppConfiguration"/> + /// The vault key name for the main configuration json object, described by <see cref="AppConfiguration"/> /// </summary> public const string MAIN_CONFIG_SHEET = "MAIN_CONFIG_SHEET"; diff --git a/code/api/src/Models/Static/AppHeaders.cs b/code/api/src/Models/Static/AppHeaders.cs index d534aba..a4d9ae2 100644 --- a/code/api/src/Models/Static/AppHeaders.cs +++ b/code/api/src/Models/Static/AppHeaders.cs @@ -1,4 +1,4 @@ -namespace IOL.GreatOffice.Api.Data.Static; +namespace IOL.GreatOffice.Api.Models.Static; public static class AppHeaders { diff --git a/code/api/src/Models/Static/AppPaths.cs b/code/api/src/Models/Static/AppPaths.cs index a24f5af..38d712b 100644 --- a/code/api/src/Models/Static/AppPaths.cs +++ b/code/api/src/Models/Static/AppPaths.cs @@ -1,17 +1,20 @@ -namespace IOL.GreatOffice.Api.Data.Static; +namespace IOL.GreatOffice.Api.Models.Static; public static class AppPaths { - public static AppPath AppData => new() { - HostPath = Path.Combine(Directory.GetCurrentDirectory(), "AppData") + public static AppPath AppData => new() + { + HostPath = Path.Combine(Directory.GetCurrentDirectory(), "AppData") }; - public static AppPath DataProtectionKeys => new() { - HostPath = Path.Combine(Directory.GetCurrentDirectory(), "AppData", "dp-keys") + public static AppPath DataProtectionKeys => new() + { + HostPath = Path.Combine(Directory.GetCurrentDirectory(), "AppData", "dp-keys") }; - public static AppPath Frontend => new() { - HostPath = Path.Combine(Directory.GetCurrentDirectory(), "Frontend") + public static AppPath Frontend => new() + { + HostPath = Path.Combine(Directory.GetCurrentDirectory(), "Frontend") }; } |
