From 43bcf449fdc2833fe0ef4c0451c367a7bbcfaacf Mon Sep 17 00:00:00 2001 From: Jonathan Bourdon Date: Wed, 29 Apr 2026 20:58:36 -0400 Subject: [PATCH] wip --- .../src/Socialize.Api/Common/Domain/Entity.cs | 2 +- .../src/Socialize.Api/Data/AppDbContext.cs | 21 ++--- .../src/Socialize.Api/DependencyInjection.cs | 5 +- backend/src/Socialize.Api/GlobalUsings.cs | 12 --- .../BlobStorage/Contracts/CommonFileNames.cs | 2 +- .../BlobStorage/Contracts/ContainerNames.cs | 2 +- .../BlobStorage/Contracts/ContentTypes.cs | 2 +- .../BlobStorage/Contracts/IBlobStorage.cs | 2 +- .../Contracts/SubDirectoryNames.cs | 2 +- .../BlobStorage/Services/AzureBlobStorage.cs | 4 +- .../Configuration/WebsiteOptions.cs | 2 +- .../Infrastructure/DependencyInjection.cs | 16 ++-- .../Development/DevelopmentSeedExtensions.cs | 18 +++- .../Development/DevelopmentSeedOptions.cs | 2 +- .../Emailer/Configuration/EmailerOptions.cs | 2 +- .../Emailer/Contracts/IEmailSender.cs | 2 +- .../Emailer/Services/LoggerEmailSender.cs | 4 +- .../Emailer/Services/PostmarkEmailSender.cs | 6 +- .../Emailer/Services/ResendEmailSender.cs | 6 +- .../Stripe/Configuration/StripeOptions.cs | 2 +- .../Security/AccessScopeService.cs | 4 +- .../Security/ClaimsPrincipalExtensions.cs | 2 +- .../Security/GenerateJwtToken.cs | 2 +- .../Infrastructure/Security/KnownClaims.cs | 2 +- .../Security/MissingClaimException.cs | 2 +- .../Security/PasswordGenerator.cs | 2 +- .../Security/RefreshTokenGenerator.cs | 2 +- .../YouTube/YouTubeUrlHelper.cs | 2 +- .../20260423061407_Initial.Designer.cs | 2 +- .../Migrations/AppDbContextModelSnapshot.cs | 2 +- .../Approvals/Data/ApprovalDecision.cs | 2 +- .../Data/ApprovalModelConfiguration.cs | 4 +- .../Modules/Approvals/Data/ApprovalRequest.cs | 2 +- .../Modules/Approvals/DependencyInjection.cs | 4 +- .../Handlers/CreateApprovalRequest.cs | 15 ++-- .../Approvals/Handlers/GetApprovals.cs | 9 +- .../Handlers/SubmitApprovalDecision.cs | 11 ++- .../Modules/Assets/Data/Asset.cs | 2 +- .../Assets/Data/AssetModelConfiguration.cs | 4 +- .../Modules/Assets/Data/AssetRevision.cs | 2 +- .../Modules/Assets/DependencyInjection.cs | 4 +- .../Assets/Handlers/CreateAssetRevision.cs | 11 ++- .../Assets/Handlers/CreateGoogleDriveAsset.cs | 11 ++- .../Modules/Assets/Handlers/GetAssets.cs | 10 ++- .../Modules/Clients/Data/Client.cs | 2 +- .../Clients/Data/ClientModelConfiguration.cs | 4 +- .../Modules/Clients/DependencyInjection.cs | 4 +- .../Clients/Handlers/ChangeClientPortrait.cs | 11 ++- .../Modules/Clients/Handlers/CreateClient.cs | 9 +- .../Modules/Clients/Handlers/GetClients.cs | 9 +- .../Modules/Clients/Handlers/UpdateClient.cs | 9 +- .../Modules/Comments/Data/Comment.cs | 2 +- .../Data/CommentModelConfiguration.cs | 4 +- .../Modules/Comments/DependencyInjection.cs | 4 +- .../Comments/Handlers/CreateComment.cs | 11 ++- .../Modules/Comments/Handlers/GetComments.cs | 9 +- .../Comments/Handlers/ResolveComment.cs | 11 ++- .../Modules/ContentItems/Data/ContentItem.cs | 2 +- .../Data/ContentItemModelConfiguration.cs | 4 +- .../ContentItems/Data/ContentItemRevision.cs | 2 +- .../ContentItems/DependencyInjection.cs | 4 +- .../Handlers/CreateContentItem.cs | 11 ++- .../Handlers/CreateContentItemRevision.cs | 10 ++- .../ContentItems/Handlers/GetContentItem.cs | 9 +- .../Handlers/GetContentItemRevisions.cs | 9 +- .../ContentItems/Handlers/GetContentItems.cs | 9 +- .../Handlers/UpdateContentItemStatus.cs | 11 ++- .../Identity/Configuration/JwtOptions.cs | 2 +- .../Modules/Identity/Contracts/IUserLookup.cs | 2 +- .../Modules/Identity/Contracts/KnownRoles.cs | 2 +- .../Identity/Contracts/UserReference.cs | 2 +- .../Modules/Identity/Data/IdentityService.cs | 6 +- .../Modules/Identity/Data/Role.cs | 2 +- .../Modules/Identity/Data/User.cs | 2 +- .../Modules/Identity/Data/UserManager.cs | 2 +- .../Modules/Identity/DependencyInjection.cs | 12 +-- .../Identity/Handlers/ChangeAddress.cs | 7 +- .../Modules/Identity/Handlers/ChangeAlias.cs | 7 +- .../Identity/Handlers/ChangeBirthDate.cs | 7 +- .../Modules/Identity/Handlers/ChangeEmail.cs | 7 +- .../Identity/Handlers/ChangeFullname.cs | 7 +- .../Modules/Identity/Handlers/ChangePhone.cs | 7 +- .../Identity/Handlers/ChangePortrait.cs | 9 +- .../Identity/Handlers/ForgotPassword.cs | 35 ++++---- .../Identity/Handlers/GetCurrentUser.cs | 9 +- .../Handlers/GetCurrentUserProfilePicture.cs | 9 +- .../Modules/Identity/Handlers/Login.cs | 11 +-- .../Identity/Handlers/LoginWithFacebook.cs | 15 ++-- .../Identity/Handlers/LoginWithGoogle.cs | 15 ++-- .../Modules/Identity/Handlers/RefreshToken.cs | 12 +-- .../Modules/Identity/Handlers/Register.cs | 7 +- .../Identity/Handlers/ResendVerification.cs | 7 +- .../Identity/Handlers/ResetPassword.cs | 5 +- .../Modules/Identity/Handlers/SetPassword.cs | 7 +- .../Modules/Identity/Handlers/VerifyEmail.cs | 7 +- .../Identity/IdentityResultExtensions.cs | 4 +- .../Modules/Identity/Models/Result.cs | 2 +- .../Modules/Identity/Models/RoleModel.cs | 2 +- .../Modules/Identity/Models/UserDto.cs | 2 +- .../Modules/Identity/Models/UserModel.cs | 2 +- .../Identity/Services/AccessTokenFactory.cs | 10 +-- .../Services/EmailVerificationService.cs | 8 +- .../Modules/Identity/Services/UserLookup.cs | 6 +- .../Contracts/INotificationEventWriter.cs | 2 +- .../Notifications/Data/NotificationEvent.cs | 2 +- .../Data/NotificationModelConfiguration.cs | 4 +- .../Notifications/DependencyInjection.cs | 8 +- .../Handlers/GetNotifications.cs | 10 ++- .../Handlers/MarkNotificationAsRead.cs | 9 +- .../Services/NotificationEventWriter.cs | 7 +- .../Modules/Projects/Data/Project.cs | 2 +- .../Data/ProjectModelConfiguration.cs | 4 +- .../Modules/Projects/DependencyInjection.cs | 4 +- .../Projects/Handlers/CreateProject.cs | 9 +- .../Modules/Projects/Handlers/GetProjects.cs | 9 +- .../Modules/Workspaces/Data/Workspace.cs | 2 +- .../Workspaces/Data/WorkspaceInvite.cs | 2 +- .../Data/WorkspaceModelConfiguration.cs | 4 +- .../Modules/Workspaces/DependencyInjection.cs | 6 +- .../Workspaces/Handlers/CreateWorkspace.cs | 9 +- .../Handlers/CreateWorkspaceInvite.cs | 11 ++- .../Handlers/GetWorkspaceInvites.cs | 9 +- .../Handlers/GetWorkspaceMembers.cs | 14 +-- .../Workspaces/Handlers/GetWorkspaces.cs | 9 +- backend/src/Socialize.Api/Program.cs | 90 +++++++------------ .../src/Socialize.Api/Socialize.Api.csproj | 47 +++++----- 126 files changed, 524 insertions(+), 394 deletions(-) diff --git a/backend/src/Socialize.Api/Common/Domain/Entity.cs b/backend/src/Socialize.Api/Common/Domain/Entity.cs index b3a0015..3d4b8a7 100644 --- a/backend/src/Socialize.Api/Common/Domain/Entity.cs +++ b/backend/src/Socialize.Api/Common/Domain/Entity.cs @@ -1,4 +1,4 @@ -namespace Socialize.Common.Domain; +namespace Socialize.Api.Common.Domain; public abstract class Entity { diff --git a/backend/src/Socialize.Api/Data/AppDbContext.cs b/backend/src/Socialize.Api/Data/AppDbContext.cs index e4fc389..107efd2 100644 --- a/backend/src/Socialize.Api/Data/AppDbContext.cs +++ b/backend/src/Socialize.Api/Data/AppDbContext.cs @@ -1,15 +1,16 @@ +using Microsoft.EntityFrameworkCore; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Socialize.Modules.Approvals.Data; -using Socialize.Modules.Assets.Data; -using Socialize.Modules.Clients.Data; -using Socialize.Modules.Comments.Data; -using Socialize.Modules.ContentItems.Data; -using Socialize.Modules.Identity.Data; -using Socialize.Modules.Notifications.Data; -using Socialize.Modules.Projects.Data; -using Socialize.Modules.Workspaces.Data; +using Socialize.Api.Modules.Approvals.Data; +using Socialize.Api.Modules.Assets.Data; +using Socialize.Api.Modules.Clients.Data; +using Socialize.Api.Modules.Comments.Data; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Notifications.Data; +using Socialize.Api.Modules.Projects.Data; +using Socialize.Api.Modules.Workspaces.Data; -namespace Socialize.Data; +namespace Socialize.Api.Data; public class AppDbContext( DbContextOptions options) diff --git a/backend/src/Socialize.Api/DependencyInjection.cs b/backend/src/Socialize.Api/DependencyInjection.cs index 893bde2..64e723b 100644 --- a/backend/src/Socialize.Api/DependencyInjection.cs +++ b/backend/src/Socialize.Api/DependencyInjection.cs @@ -1,6 +1,7 @@ using System.Text; -using Socialize.Data; -using Socialize.Infrastructure.Security; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Microsoft.EntityFrameworkCore; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Facebook; using Microsoft.AspNetCore.Authentication.Google; diff --git a/backend/src/Socialize.Api/GlobalUsings.cs b/backend/src/Socialize.Api/GlobalUsings.cs index 7dce9da..f11b3ca 100644 --- a/backend/src/Socialize.Api/GlobalUsings.cs +++ b/backend/src/Socialize.Api/GlobalUsings.cs @@ -1,14 +1,2 @@ global using FluentValidation; -global using FastEndpoints; global using JetBrains.Annotations; -global using Microsoft.EntityFrameworkCore; -global using Socialize.Data; -global using Socialize.Modules.Approvals.Data; -global using Socialize.Modules.Assets.Data; -global using Socialize.Modules.Clients.Data; -global using Socialize.Modules.Comments.Data; -global using Socialize.Modules.ContentItems.Data; -global using Socialize.Modules.Identity.Data; -global using Socialize.Modules.Notifications.Data; -global using Socialize.Modules.Projects.Data; -global using Socialize.Modules.Workspaces.Data; diff --git a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/CommonFileNames.cs b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/CommonFileNames.cs index 8dc63ce..3c84acf 100644 --- a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/CommonFileNames.cs +++ b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/CommonFileNames.cs @@ -1,4 +1,4 @@ -namespace Socialize.Infrastructure.BlobStorage.Contracts; +namespace Socialize.Api.Infrastructure.BlobStorage.Contracts; public static class CommonFileNames { diff --git a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/ContainerNames.cs b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/ContainerNames.cs index 96f56ac..b864997 100644 --- a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/ContainerNames.cs +++ b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/ContainerNames.cs @@ -1,4 +1,4 @@ -namespace Socialize.Infrastructure.BlobStorage.Contracts; +namespace Socialize.Api.Infrastructure.BlobStorage.Contracts; internal static class ContainerNames { diff --git a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/ContentTypes.cs b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/ContentTypes.cs index 569d4c1..d08e9ae 100644 --- a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/ContentTypes.cs +++ b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/ContentTypes.cs @@ -1,6 +1,6 @@ using System.Text; -namespace Socialize.Infrastructure.BlobStorage.Contracts; +namespace Socialize.Api.Infrastructure.BlobStorage.Contracts; public static class ContentTypes { diff --git a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/IBlobStorage.cs b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/IBlobStorage.cs index ad5fd5c..d6bb83d 100644 --- a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/IBlobStorage.cs +++ b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/IBlobStorage.cs @@ -1,4 +1,4 @@ -namespace Socialize.Infrastructure.BlobStorage.Contracts; +namespace Socialize.Api.Infrastructure.BlobStorage.Contracts; public interface IBlobStorage { diff --git a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/SubDirectoryNames.cs b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/SubDirectoryNames.cs index e61f412..b1a999b 100644 --- a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/SubDirectoryNames.cs +++ b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Contracts/SubDirectoryNames.cs @@ -1,4 +1,4 @@ -namespace Socialize.Infrastructure.BlobStorage.Contracts; +namespace Socialize.Api.Infrastructure.BlobStorage.Contracts; public static class SubDirectoryNames { diff --git a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Services/AzureBlobStorage.cs b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Services/AzureBlobStorage.cs index ad09d41..61dc279 100644 --- a/backend/src/Socialize.Api/Infrastructure/BlobStorage/Services/AzureBlobStorage.cs +++ b/backend/src/Socialize.Api/Infrastructure/BlobStorage/Services/AzureBlobStorage.cs @@ -1,9 +1,9 @@ using Azure; using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; -using Socialize.Infrastructure.BlobStorage.Contracts; +using Socialize.Api.Infrastructure.BlobStorage.Contracts; -namespace Socialize.Infrastructure.BlobStorage.Services; +namespace Socialize.Api.Infrastructure.BlobStorage.Services; public class AzureBlobStorage : IBlobStorage { diff --git a/backend/src/Socialize.Api/Infrastructure/Configuration/WebsiteOptions.cs b/backend/src/Socialize.Api/Infrastructure/Configuration/WebsiteOptions.cs index 3e80314..b04c425 100644 --- a/backend/src/Socialize.Api/Infrastructure/Configuration/WebsiteOptions.cs +++ b/backend/src/Socialize.Api/Infrastructure/Configuration/WebsiteOptions.cs @@ -1,4 +1,4 @@ -namespace Socialize.Infrastructure.Configuration; +namespace Socialize.Api.Infrastructure.Configuration; public class WebsiteOptions { diff --git a/backend/src/Socialize.Api/Infrastructure/DependencyInjection.cs b/backend/src/Socialize.Api/Infrastructure/DependencyInjection.cs index 6b2212e..e4b7109 100644 --- a/backend/src/Socialize.Api/Infrastructure/DependencyInjection.cs +++ b/backend/src/Socialize.Api/Infrastructure/DependencyInjection.cs @@ -1,12 +1,12 @@ -using Socialize.Infrastructure.BlobStorage.Contracts; -using Socialize.Infrastructure.BlobStorage.Services; -using Socialize.Infrastructure.Configuration; -using Socialize.Infrastructure.Emailer.Configuration; -using Socialize.Infrastructure.Emailer.Contracts; -using Socialize.Infrastructure.Emailer.Services; -using Socialize.Infrastructure.Payments.Stripe.Configuration; +using Socialize.Api.Infrastructure.BlobStorage.Contracts; +using Socialize.Api.Infrastructure.BlobStorage.Services; +using Socialize.Api.Infrastructure.Configuration; +using Socialize.Api.Infrastructure.Emailer.Configuration; +using Socialize.Api.Infrastructure.Emailer.Contracts; +using Socialize.Api.Infrastructure.Emailer.Services; +using Socialize.Api.Infrastructure.Payments.Stripe.Configuration; -namespace Socialize.Infrastructure; +namespace Socialize.Api.Infrastructure; public static class DependencyInjection { diff --git a/backend/src/Socialize.Api/Infrastructure/Development/DevelopmentSeedExtensions.cs b/backend/src/Socialize.Api/Infrastructure/Development/DevelopmentSeedExtensions.cs index 9f89d14..ca5ac82 100644 --- a/backend/src/Socialize.Api/Infrastructure/Development/DevelopmentSeedExtensions.cs +++ b/backend/src/Socialize.Api/Infrastructure/Development/DevelopmentSeedExtensions.cs @@ -1,11 +1,21 @@ +using Microsoft.EntityFrameworkCore; using System.Security.Claims; -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Contracts; -using Socialize.Modules.Identity.Data; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Contracts; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Assets.Data; +using Socialize.Api.Modules.Approvals.Data; +using Socialize.Api.Modules.Comments.Data; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Clients.Data; +using Socialize.Api.Modules.Notifications.Data; +using Socialize.Api.Modules.Projects.Data; +using Socialize.Api.Modules.Workspaces.Data; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Options; -namespace Socialize.Infrastructure.Development; +namespace Socialize.Api.Infrastructure.Development; public static class DevelopmentSeedExtensions { diff --git a/backend/src/Socialize.Api/Infrastructure/Development/DevelopmentSeedOptions.cs b/backend/src/Socialize.Api/Infrastructure/Development/DevelopmentSeedOptions.cs index 5a0b8a7..98da4e8 100644 --- a/backend/src/Socialize.Api/Infrastructure/Development/DevelopmentSeedOptions.cs +++ b/backend/src/Socialize.Api/Infrastructure/Development/DevelopmentSeedOptions.cs @@ -1,4 +1,4 @@ -namespace Socialize.Infrastructure.Development; +namespace Socialize.Api.Infrastructure.Development; public record DevelopmentSeedOptions { diff --git a/backend/src/Socialize.Api/Infrastructure/Emailer/Configuration/EmailerOptions.cs b/backend/src/Socialize.Api/Infrastructure/Emailer/Configuration/EmailerOptions.cs index 2cef6b7..2d10367 100644 --- a/backend/src/Socialize.Api/Infrastructure/Emailer/Configuration/EmailerOptions.cs +++ b/backend/src/Socialize.Api/Infrastructure/Emailer/Configuration/EmailerOptions.cs @@ -1,4 +1,4 @@ -namespace Socialize.Infrastructure.Emailer.Configuration; +namespace Socialize.Api.Infrastructure.Emailer.Configuration; public class EmailerOptions { diff --git a/backend/src/Socialize.Api/Infrastructure/Emailer/Contracts/IEmailSender.cs b/backend/src/Socialize.Api/Infrastructure/Emailer/Contracts/IEmailSender.cs index ee1a065..f33d873 100644 --- a/backend/src/Socialize.Api/Infrastructure/Emailer/Contracts/IEmailSender.cs +++ b/backend/src/Socialize.Api/Infrastructure/Emailer/Contracts/IEmailSender.cs @@ -1,4 +1,4 @@ -namespace Socialize.Infrastructure.Emailer.Contracts; +namespace Socialize.Api.Infrastructure.Emailer.Contracts; public interface IEmailSender { diff --git a/backend/src/Socialize.Api/Infrastructure/Emailer/Services/LoggerEmailSender.cs b/backend/src/Socialize.Api/Infrastructure/Emailer/Services/LoggerEmailSender.cs index c99138f..cca2efc 100644 --- a/backend/src/Socialize.Api/Infrastructure/Emailer/Services/LoggerEmailSender.cs +++ b/backend/src/Socialize.Api/Infrastructure/Emailer/Services/LoggerEmailSender.cs @@ -1,6 +1,6 @@ -using Socialize.Infrastructure.Emailer.Contracts; +using Socialize.Api.Infrastructure.Emailer.Contracts; -namespace Socialize.Infrastructure.Emailer.Services; +namespace Socialize.Api.Infrastructure.Emailer.Services; public class LoggerEmailSender(ILogger logger) : IEmailSender diff --git a/backend/src/Socialize.Api/Infrastructure/Emailer/Services/PostmarkEmailSender.cs b/backend/src/Socialize.Api/Infrastructure/Emailer/Services/PostmarkEmailSender.cs index 0c03a8d..5d0b2b9 100644 --- a/backend/src/Socialize.Api/Infrastructure/Emailer/Services/PostmarkEmailSender.cs +++ b/backend/src/Socialize.Api/Infrastructure/Emailer/Services/PostmarkEmailSender.cs @@ -1,9 +1,9 @@ -using Socialize.Infrastructure.Emailer.Configuration; -using Socialize.Infrastructure.Emailer.Contracts; +using Socialize.Api.Infrastructure.Emailer.Configuration; +using Socialize.Api.Infrastructure.Emailer.Contracts; using Microsoft.Extensions.Options; using PostmarkDotNet; -namespace Socialize.Infrastructure.Emailer.Services; +namespace Socialize.Api.Infrastructure.Emailer.Services; public class PostmarkEmailSender : IEmailSender { diff --git a/backend/src/Socialize.Api/Infrastructure/Emailer/Services/ResendEmailSender.cs b/backend/src/Socialize.Api/Infrastructure/Emailer/Services/ResendEmailSender.cs index 7fa7360..3935c42 100644 --- a/backend/src/Socialize.Api/Infrastructure/Emailer/Services/ResendEmailSender.cs +++ b/backend/src/Socialize.Api/Infrastructure/Emailer/Services/ResendEmailSender.cs @@ -1,11 +1,11 @@ using System.Net.Http.Headers; using System.Text; using System.Text.Json; -using Socialize.Infrastructure.Emailer.Configuration; -using Socialize.Infrastructure.Emailer.Contracts; +using Socialize.Api.Infrastructure.Emailer.Configuration; +using Socialize.Api.Infrastructure.Emailer.Contracts; using Microsoft.Extensions.Options; -namespace Socialize.Infrastructure.Emailer.Services; +namespace Socialize.Api.Infrastructure.Emailer.Services; public class ResendEmailSender : IEmailSender { diff --git a/backend/src/Socialize.Api/Infrastructure/Payments/Stripe/Configuration/StripeOptions.cs b/backend/src/Socialize.Api/Infrastructure/Payments/Stripe/Configuration/StripeOptions.cs index be35dd6..c156d47 100644 --- a/backend/src/Socialize.Api/Infrastructure/Payments/Stripe/Configuration/StripeOptions.cs +++ b/backend/src/Socialize.Api/Infrastructure/Payments/Stripe/Configuration/StripeOptions.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace Socialize.Infrastructure.Payments.Stripe.Configuration; +namespace Socialize.Api.Infrastructure.Payments.Stripe.Configuration; public class StripeOptions { diff --git a/backend/src/Socialize.Api/Infrastructure/Security/AccessScopeService.cs b/backend/src/Socialize.Api/Infrastructure/Security/AccessScopeService.cs index 11771a4..67e4f91 100644 --- a/backend/src/Socialize.Api/Infrastructure/Security/AccessScopeService.cs +++ b/backend/src/Socialize.Api/Infrastructure/Security/AccessScopeService.cs @@ -1,7 +1,7 @@ using System.Security.Claims; -using Socialize.Modules.Identity.Contracts; +using Socialize.Api.Modules.Identity.Contracts; -namespace Socialize.Infrastructure.Security; +namespace Socialize.Api.Infrastructure.Security; public sealed class AccessScopeService { diff --git a/backend/src/Socialize.Api/Infrastructure/Security/ClaimsPrincipalExtensions.cs b/backend/src/Socialize.Api/Infrastructure/Security/ClaimsPrincipalExtensions.cs index b47a62e..a03ddde 100644 --- a/backend/src/Socialize.Api/Infrastructure/Security/ClaimsPrincipalExtensions.cs +++ b/backend/src/Socialize.Api/Infrastructure/Security/ClaimsPrincipalExtensions.cs @@ -1,6 +1,6 @@ using System.Security.Claims; -namespace Socialize.Infrastructure.Security; +namespace Socialize.Api.Infrastructure.Security; public static class ClaimsPrincipalExtensions { diff --git a/backend/src/Socialize.Api/Infrastructure/Security/GenerateJwtToken.cs b/backend/src/Socialize.Api/Infrastructure/Security/GenerateJwtToken.cs index 09fcc3a..51019e6 100644 --- a/backend/src/Socialize.Api/Infrastructure/Security/GenerateJwtToken.cs +++ b/backend/src/Socialize.Api/Infrastructure/Security/GenerateJwtToken.cs @@ -3,7 +3,7 @@ using System.Security.Claims; using System.Text; using Microsoft.IdentityModel.Tokens; -namespace Socialize.Infrastructure.Security; +namespace Socialize.Api.Infrastructure.Security; public static class JwtTokenHelper { diff --git a/backend/src/Socialize.Api/Infrastructure/Security/KnownClaims.cs b/backend/src/Socialize.Api/Infrastructure/Security/KnownClaims.cs index 18c91f7..f84e27a 100644 --- a/backend/src/Socialize.Api/Infrastructure/Security/KnownClaims.cs +++ b/backend/src/Socialize.Api/Infrastructure/Security/KnownClaims.cs @@ -1,4 +1,4 @@ -namespace Socialize.Infrastructure.Security; +namespace Socialize.Api.Infrastructure.Security; public static class KnownClaims { diff --git a/backend/src/Socialize.Api/Infrastructure/Security/MissingClaimException.cs b/backend/src/Socialize.Api/Infrastructure/Security/MissingClaimException.cs index ed4f285..1d0e8f0 100644 --- a/backend/src/Socialize.Api/Infrastructure/Security/MissingClaimException.cs +++ b/backend/src/Socialize.Api/Infrastructure/Security/MissingClaimException.cs @@ -1,4 +1,4 @@ -namespace Socialize.Infrastructure.Security; +namespace Socialize.Api.Infrastructure.Security; public class MissingClaimException( string claimName) diff --git a/backend/src/Socialize.Api/Infrastructure/Security/PasswordGenerator.cs b/backend/src/Socialize.Api/Infrastructure/Security/PasswordGenerator.cs index b6ffe09..224475a 100644 --- a/backend/src/Socialize.Api/Infrastructure/Security/PasswordGenerator.cs +++ b/backend/src/Socialize.Api/Infrastructure/Security/PasswordGenerator.cs @@ -1,7 +1,7 @@ using System.Security.Cryptography; using System.Text; -namespace Socialize.Infrastructure.Security; +namespace Socialize.Api.Infrastructure.Security; // If we need to add special characters we can alternate between 2 pools. public static class PasswordGenerator diff --git a/backend/src/Socialize.Api/Infrastructure/Security/RefreshTokenGenerator.cs b/backend/src/Socialize.Api/Infrastructure/Security/RefreshTokenGenerator.cs index 15911d1..b200c8b 100644 --- a/backend/src/Socialize.Api/Infrastructure/Security/RefreshTokenGenerator.cs +++ b/backend/src/Socialize.Api/Infrastructure/Security/RefreshTokenGenerator.cs @@ -1,6 +1,6 @@ using System.Security.Cryptography; -namespace Socialize.Infrastructure.Security; +namespace Socialize.Api.Infrastructure.Security; public static class RefreshTokenGenerator { diff --git a/backend/src/Socialize.Api/Infrastructure/YouTube/YouTubeUrlHelper.cs b/backend/src/Socialize.Api/Infrastructure/YouTube/YouTubeUrlHelper.cs index e25e162..0fca286 100644 --- a/backend/src/Socialize.Api/Infrastructure/YouTube/YouTubeUrlHelper.cs +++ b/backend/src/Socialize.Api/Infrastructure/YouTube/YouTubeUrlHelper.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace Socialize.Infrastructure.YouTube; +namespace Socialize.Api.Infrastructure.YouTube; public static class YouTubeUrlHelper { diff --git a/backend/src/Socialize.Api/Migrations/20260423061407_Initial.Designer.cs b/backend/src/Socialize.Api/Migrations/20260423061407_Initial.Designer.cs index 85478fa..d4809c6 100644 --- a/backend/src/Socialize.Api/Migrations/20260423061407_Initial.Designer.cs +++ b/backend/src/Socialize.Api/Migrations/20260423061407_Initial.Designer.cs @@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Socialize.Data; +using Socialize.Api.Data; #nullable disable diff --git a/backend/src/Socialize.Api/Migrations/AppDbContextModelSnapshot.cs b/backend/src/Socialize.Api/Migrations/AppDbContextModelSnapshot.cs index 9686d9b..ab8299e 100644 --- a/backend/src/Socialize.Api/Migrations/AppDbContextModelSnapshot.cs +++ b/backend/src/Socialize.Api/Migrations/AppDbContextModelSnapshot.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Socialize.Data; +using Socialize.Api.Data; #nullable disable diff --git a/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalDecision.cs b/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalDecision.cs index 51fa8ff..bab072b 100644 --- a/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalDecision.cs +++ b/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalDecision.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Approvals.Data; +namespace Socialize.Api.Modules.Approvals.Data; public class ApprovalDecision { diff --git a/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalModelConfiguration.cs b/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalModelConfiguration.cs index 9120d1a..1668471 100644 --- a/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalModelConfiguration.cs +++ b/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalModelConfiguration.cs @@ -1,4 +1,6 @@ -namespace Socialize.Modules.Approvals.Data; +using Microsoft.EntityFrameworkCore; + +namespace Socialize.Api.Modules.Approvals.Data; public static class ApprovalModelConfiguration { diff --git a/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalRequest.cs b/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalRequest.cs index ffee615..de2a76a 100644 --- a/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalRequest.cs +++ b/backend/src/Socialize.Api/Modules/Approvals/Data/ApprovalRequest.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Approvals.Data; +namespace Socialize.Api.Modules.Approvals.Data; public class ApprovalRequest { diff --git a/backend/src/Socialize.Api/Modules/Approvals/DependencyInjection.cs b/backend/src/Socialize.Api/Modules/Approvals/DependencyInjection.cs index 8639729..31768fc 100644 --- a/backend/src/Socialize.Api/Modules/Approvals/DependencyInjection.cs +++ b/backend/src/Socialize.Api/Modules/Approvals/DependencyInjection.cs @@ -1,6 +1,6 @@ -using Socialize.Modules.Approvals.Data; +using Socialize.Api.Modules.Approvals.Data; -namespace Socialize.Modules.Approvals; +namespace Socialize.Api.Modules.Approvals; public static class DependencyInjection { diff --git a/backend/src/Socialize.Api/Modules/Approvals/Handlers/CreateApprovalRequest.cs b/backend/src/Socialize.Api/Modules/Approvals/Handlers/CreateApprovalRequest.cs index ee27f83..a2c9199 100644 --- a/backend/src/Socialize.Api/Modules/Approvals/Handlers/CreateApprovalRequest.cs +++ b/backend/src/Socialize.Api/Modules/Approvals/Handlers/CreateApprovalRequest.cs @@ -1,8 +1,12 @@ +using FastEndpoints; +using Microsoft.EntityFrameworkCore; using System.Security.Cryptography; -using Socialize.Infrastructure.Security; -using Socialize.Modules.Notifications.Contracts; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Approvals.Data; +using Socialize.Api.Modules.Notifications.Contracts; -namespace Socialize.Modules.Approvals.Handlers; +namespace Socialize.Api.Modules.Approvals.Handlers; public record CreateApprovalRequestRequest( Guid WorkspaceId, @@ -39,7 +43,8 @@ public class CreateApprovalRequestHandler( public override async Task HandleAsync(CreateApprovalRequestRequest request, CancellationToken ct) { - ContentItem? contentItem = await dbContext.ContentItems + var contentItem = await dbContext + .ContentItems .SingleOrDefaultAsync( candidate => candidate.Id == request.ContentItemId && candidate.WorkspaceId == request.WorkspaceId, ct); @@ -57,7 +62,7 @@ public class CreateApprovalRequestHandler( return; } - ApprovalRequest approval = new() + var approval = new ApprovalRequest() { Id = Guid.NewGuid(), WorkspaceId = request.WorkspaceId, diff --git a/backend/src/Socialize.Api/Modules/Approvals/Handlers/GetApprovals.cs b/backend/src/Socialize.Api/Modules/Approvals/Handlers/GetApprovals.cs index 62361a8..753a5a5 100644 --- a/backend/src/Socialize.Api/Modules/Approvals/Handlers/GetApprovals.cs +++ b/backend/src/Socialize.Api/Modules/Approvals/Handlers/GetApprovals.cs @@ -1,6 +1,11 @@ -using Socialize.Infrastructure.Security; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Modules.Approvals.Data; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Infrastructure.Security; -namespace Socialize.Modules.Approvals.Handlers; +namespace Socialize.Api.Modules.Approvals.Handlers; public record GetApprovalsRequest(Guid ContentItemId); diff --git a/backend/src/Socialize.Api/Modules/Approvals/Handlers/SubmitApprovalDecision.cs b/backend/src/Socialize.Api/Modules/Approvals/Handlers/SubmitApprovalDecision.cs index fb482c8..608e813 100644 --- a/backend/src/Socialize.Api/Modules/Approvals/Handlers/SubmitApprovalDecision.cs +++ b/backend/src/Socialize.Api/Modules/Approvals/Handlers/SubmitApprovalDecision.cs @@ -1,7 +1,12 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Notifications.Contracts; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Approvals.Data; +using Socialize.Api.Modules.Notifications.Contracts; -namespace Socialize.Modules.Approvals.Handlers; +namespace Socialize.Api.Modules.Approvals.Handlers; public record SubmitApprovalDecisionRequest( string Decision, diff --git a/backend/src/Socialize.Api/Modules/Assets/Data/Asset.cs b/backend/src/Socialize.Api/Modules/Assets/Data/Asset.cs index 5c4dc9f..bd61036 100644 --- a/backend/src/Socialize.Api/Modules/Assets/Data/Asset.cs +++ b/backend/src/Socialize.Api/Modules/Assets/Data/Asset.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Assets.Data; +namespace Socialize.Api.Modules.Assets.Data; public class Asset { diff --git a/backend/src/Socialize.Api/Modules/Assets/Data/AssetModelConfiguration.cs b/backend/src/Socialize.Api/Modules/Assets/Data/AssetModelConfiguration.cs index 9be2638..0489588 100644 --- a/backend/src/Socialize.Api/Modules/Assets/Data/AssetModelConfiguration.cs +++ b/backend/src/Socialize.Api/Modules/Assets/Data/AssetModelConfiguration.cs @@ -1,4 +1,6 @@ -namespace Socialize.Modules.Assets.Data; +using Microsoft.EntityFrameworkCore; + +namespace Socialize.Api.Modules.Assets.Data; public static class AssetModelConfiguration { diff --git a/backend/src/Socialize.Api/Modules/Assets/Data/AssetRevision.cs b/backend/src/Socialize.Api/Modules/Assets/Data/AssetRevision.cs index 1f9a7c6..e07a419 100644 --- a/backend/src/Socialize.Api/Modules/Assets/Data/AssetRevision.cs +++ b/backend/src/Socialize.Api/Modules/Assets/Data/AssetRevision.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Assets.Data; +namespace Socialize.Api.Modules.Assets.Data; public class AssetRevision { diff --git a/backend/src/Socialize.Api/Modules/Assets/DependencyInjection.cs b/backend/src/Socialize.Api/Modules/Assets/DependencyInjection.cs index d2c3392..94798b9 100644 --- a/backend/src/Socialize.Api/Modules/Assets/DependencyInjection.cs +++ b/backend/src/Socialize.Api/Modules/Assets/DependencyInjection.cs @@ -1,6 +1,6 @@ -using Socialize.Modules.Assets.Data; +using Socialize.Api.Modules.Assets.Data; -namespace Socialize.Modules.Assets; +namespace Socialize.Api.Modules.Assets; public static class DependencyInjection { diff --git a/backend/src/Socialize.Api/Modules/Assets/Handlers/CreateAssetRevision.cs b/backend/src/Socialize.Api/Modules/Assets/Handlers/CreateAssetRevision.cs index 555f788..60d164a 100644 --- a/backend/src/Socialize.Api/Modules/Assets/Handlers/CreateAssetRevision.cs +++ b/backend/src/Socialize.Api/Modules/Assets/Handlers/CreateAssetRevision.cs @@ -1,7 +1,12 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Notifications.Contracts; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Assets.Data; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Notifications.Contracts; -namespace Socialize.Modules.Assets.Handlers; +namespace Socialize.Api.Modules.Assets.Handlers; public record CreateAssetRevisionRequest( string SourceReference, diff --git a/backend/src/Socialize.Api/Modules/Assets/Handlers/CreateGoogleDriveAsset.cs b/backend/src/Socialize.Api/Modules/Assets/Handlers/CreateGoogleDriveAsset.cs index 7748eda..6d1741f 100644 --- a/backend/src/Socialize.Api/Modules/Assets/Handlers/CreateGoogleDriveAsset.cs +++ b/backend/src/Socialize.Api/Modules/Assets/Handlers/CreateGoogleDriveAsset.cs @@ -1,7 +1,12 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Notifications.Contracts; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Assets.Data; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Notifications.Contracts; -namespace Socialize.Modules.Assets.Handlers; +namespace Socialize.Api.Modules.Assets.Handlers; public record CreateGoogleDriveAssetRequest( Guid WorkspaceId, diff --git a/backend/src/Socialize.Api/Modules/Assets/Handlers/GetAssets.cs b/backend/src/Socialize.Api/Modules/Assets/Handlers/GetAssets.cs index 41a7724..578bd86 100644 --- a/backend/src/Socialize.Api/Modules/Assets/Handlers/GetAssets.cs +++ b/backend/src/Socialize.Api/Modules/Assets/Handlers/GetAssets.cs @@ -1,5 +1,9 @@ -using Socialize.Infrastructure.Security; -namespace Socialize.Modules.Assets.Handlers; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; + +namespace Socialize.Api.Modules.Assets.Handlers; public record GetAssetsRequest(Guid ContentItemId); @@ -40,7 +44,7 @@ public class GetAssetsHandler( public override async Task HandleAsync(GetAssetsRequest request, CancellationToken ct) { - ContentItem? item = await dbContext.ContentItems + var item = await dbContext.ContentItems .SingleOrDefaultAsync(candidate => candidate.Id == request.ContentItemId, ct); if (item is null) { diff --git a/backend/src/Socialize.Api/Modules/Clients/Data/Client.cs b/backend/src/Socialize.Api/Modules/Clients/Data/Client.cs index 8209cc0..dd13ab2 100644 --- a/backend/src/Socialize.Api/Modules/Clients/Data/Client.cs +++ b/backend/src/Socialize.Api/Modules/Clients/Data/Client.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Clients.Data; +namespace Socialize.Api.Modules.Clients.Data; public class Client { diff --git a/backend/src/Socialize.Api/Modules/Clients/Data/ClientModelConfiguration.cs b/backend/src/Socialize.Api/Modules/Clients/Data/ClientModelConfiguration.cs index a1082e5..73b0535 100644 --- a/backend/src/Socialize.Api/Modules/Clients/Data/ClientModelConfiguration.cs +++ b/backend/src/Socialize.Api/Modules/Clients/Data/ClientModelConfiguration.cs @@ -1,4 +1,6 @@ -namespace Socialize.Modules.Clients.Data; +using Microsoft.EntityFrameworkCore; + +namespace Socialize.Api.Modules.Clients.Data; public static class ClientModelConfiguration { diff --git a/backend/src/Socialize.Api/Modules/Clients/DependencyInjection.cs b/backend/src/Socialize.Api/Modules/Clients/DependencyInjection.cs index 892d36b..62e0d43 100644 --- a/backend/src/Socialize.Api/Modules/Clients/DependencyInjection.cs +++ b/backend/src/Socialize.Api/Modules/Clients/DependencyInjection.cs @@ -1,6 +1,6 @@ -using Socialize.Modules.Clients.Data; +using Socialize.Api.Modules.Clients.Data; -namespace Socialize.Modules.Clients; +namespace Socialize.Api.Modules.Clients; public static class DependencyInjection { diff --git a/backend/src/Socialize.Api/Modules/Clients/Handlers/ChangeClientPortrait.cs b/backend/src/Socialize.Api/Modules/Clients/Handlers/ChangeClientPortrait.cs index d35f39d..2b91fe4 100644 --- a/backend/src/Socialize.Api/Modules/Clients/Handlers/ChangeClientPortrait.cs +++ b/backend/src/Socialize.Api/Modules/Clients/Handlers/ChangeClientPortrait.cs @@ -1,8 +1,11 @@ -using Socialize.Infrastructure.BlobStorage.Contracts; -using Socialize.Infrastructure.Security; -using Socialize.Modules.Clients.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.BlobStorage.Contracts; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Clients.Data; -namespace Socialize.Modules.Clients.Handlers; +namespace Socialize.Api.Modules.Clients.Handlers; public record ChangeClientPortraitRequest( IFormFile File); diff --git a/backend/src/Socialize.Api/Modules/Clients/Handlers/CreateClient.cs b/backend/src/Socialize.Api/Modules/Clients/Handlers/CreateClient.cs index 3b2b4e2..61d0112 100644 --- a/backend/src/Socialize.Api/Modules/Clients/Handlers/CreateClient.cs +++ b/backend/src/Socialize.Api/Modules/Clients/Handlers/CreateClient.cs @@ -1,5 +1,10 @@ -using Socialize.Infrastructure.Security; -namespace Socialize.Modules.Clients.Handlers; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Modules.Clients.Data; +using Socialize.Api.Infrastructure.Security; + +namespace Socialize.Api.Modules.Clients.Handlers; public record CreateClientRequest( Guid WorkspaceId, diff --git a/backend/src/Socialize.Api/Modules/Clients/Handlers/GetClients.cs b/backend/src/Socialize.Api/Modules/Clients/Handlers/GetClients.cs index 231b8d2..579584d 100644 --- a/backend/src/Socialize.Api/Modules/Clients/Handlers/GetClients.cs +++ b/backend/src/Socialize.Api/Modules/Clients/Handlers/GetClients.cs @@ -1,7 +1,10 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Clients.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Clients.Data; -namespace Socialize.Modules.Clients.Handlers; +namespace Socialize.Api.Modules.Clients.Handlers; public record GetClientsRequest(Guid? WorkspaceId); diff --git a/backend/src/Socialize.Api/Modules/Clients/Handlers/UpdateClient.cs b/backend/src/Socialize.Api/Modules/Clients/Handlers/UpdateClient.cs index e11672a..f67e364 100644 --- a/backend/src/Socialize.Api/Modules/Clients/Handlers/UpdateClient.cs +++ b/backend/src/Socialize.Api/Modules/Clients/Handlers/UpdateClient.cs @@ -1,7 +1,10 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Clients.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Clients.Data; -namespace Socialize.Modules.Clients.Handlers; +namespace Socialize.Api.Modules.Clients.Handlers; public record UpdateClientRequest( string Name, diff --git a/backend/src/Socialize.Api/Modules/Comments/Data/Comment.cs b/backend/src/Socialize.Api/Modules/Comments/Data/Comment.cs index a392f5d..14d3e7f 100644 --- a/backend/src/Socialize.Api/Modules/Comments/Data/Comment.cs +++ b/backend/src/Socialize.Api/Modules/Comments/Data/Comment.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Comments.Data; +namespace Socialize.Api.Modules.Comments.Data; public class Comment { diff --git a/backend/src/Socialize.Api/Modules/Comments/Data/CommentModelConfiguration.cs b/backend/src/Socialize.Api/Modules/Comments/Data/CommentModelConfiguration.cs index 4970daa..973e6ae 100644 --- a/backend/src/Socialize.Api/Modules/Comments/Data/CommentModelConfiguration.cs +++ b/backend/src/Socialize.Api/Modules/Comments/Data/CommentModelConfiguration.cs @@ -1,4 +1,6 @@ -namespace Socialize.Modules.Comments.Data; +using Microsoft.EntityFrameworkCore; + +namespace Socialize.Api.Modules.Comments.Data; public static class CommentModelConfiguration { diff --git a/backend/src/Socialize.Api/Modules/Comments/DependencyInjection.cs b/backend/src/Socialize.Api/Modules/Comments/DependencyInjection.cs index 5f9148e..4cdd3e1 100644 --- a/backend/src/Socialize.Api/Modules/Comments/DependencyInjection.cs +++ b/backend/src/Socialize.Api/Modules/Comments/DependencyInjection.cs @@ -1,6 +1,6 @@ -using Socialize.Modules.Comments.Data; +using Socialize.Api.Modules.Comments.Data; -namespace Socialize.Modules.Comments; +namespace Socialize.Api.Modules.Comments; public static class DependencyInjection { diff --git a/backend/src/Socialize.Api/Modules/Comments/Handlers/CreateComment.cs b/backend/src/Socialize.Api/Modules/Comments/Handlers/CreateComment.cs index 36cbc3d..ed85298 100644 --- a/backend/src/Socialize.Api/Modules/Comments/Handlers/CreateComment.cs +++ b/backend/src/Socialize.Api/Modules/Comments/Handlers/CreateComment.cs @@ -1,7 +1,12 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Notifications.Contracts; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Comments.Data; +using Socialize.Api.Modules.Notifications.Contracts; -namespace Socialize.Modules.Comments.Handlers; +namespace Socialize.Api.Modules.Comments.Handlers; public record CreateCommentRequest( Guid WorkspaceId, diff --git a/backend/src/Socialize.Api/Modules/Comments/Handlers/GetComments.cs b/backend/src/Socialize.Api/Modules/Comments/Handlers/GetComments.cs index a1eed84..38e9bac 100644 --- a/backend/src/Socialize.Api/Modules/Comments/Handlers/GetComments.cs +++ b/backend/src/Socialize.Api/Modules/Comments/Handlers/GetComments.cs @@ -1,6 +1,11 @@ -using Socialize.Infrastructure.Security; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Modules.Comments.Data; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Infrastructure.Security; -namespace Socialize.Modules.Comments.Handlers; +namespace Socialize.Api.Modules.Comments.Handlers; public record GetCommentsRequest(Guid ContentItemId); diff --git a/backend/src/Socialize.Api/Modules/Comments/Handlers/ResolveComment.cs b/backend/src/Socialize.Api/Modules/Comments/Handlers/ResolveComment.cs index cd800a9..2cbe540 100644 --- a/backend/src/Socialize.Api/Modules/Comments/Handlers/ResolveComment.cs +++ b/backend/src/Socialize.Api/Modules/Comments/Handlers/ResolveComment.cs @@ -1,7 +1,12 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Notifications.Contracts; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Comments.Data; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Notifications.Contracts; -namespace Socialize.Modules.Comments.Handlers; +namespace Socialize.Api.Modules.Comments.Handlers; public class ResolveCommentHandler( AppDbContext dbContext, diff --git a/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItem.cs b/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItem.cs index 3166fcf..f668627 100644 --- a/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItem.cs +++ b/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItem.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.ContentItems.Data; +namespace Socialize.Api.Modules.ContentItems.Data; public class ContentItem { diff --git a/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItemModelConfiguration.cs b/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItemModelConfiguration.cs index 087ac90..3ed767c 100644 --- a/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItemModelConfiguration.cs +++ b/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItemModelConfiguration.cs @@ -1,4 +1,6 @@ -namespace Socialize.Modules.ContentItems.Data; +using Microsoft.EntityFrameworkCore; + +namespace Socialize.Api.Modules.ContentItems.Data; public static class ContentItemModelConfiguration { diff --git a/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItemRevision.cs b/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItemRevision.cs index f0a098c..e7dcd12 100644 --- a/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItemRevision.cs +++ b/backend/src/Socialize.Api/Modules/ContentItems/Data/ContentItemRevision.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.ContentItems.Data; +namespace Socialize.Api.Modules.ContentItems.Data; public class ContentItemRevision { diff --git a/backend/src/Socialize.Api/Modules/ContentItems/DependencyInjection.cs b/backend/src/Socialize.Api/Modules/ContentItems/DependencyInjection.cs index 50ea2e8..1ac67af 100644 --- a/backend/src/Socialize.Api/Modules/ContentItems/DependencyInjection.cs +++ b/backend/src/Socialize.Api/Modules/ContentItems/DependencyInjection.cs @@ -1,6 +1,6 @@ -using Socialize.Modules.ContentItems.Data; +using Socialize.Api.Modules.ContentItems.Data; -namespace Socialize.Modules.ContentItems; +namespace Socialize.Api.Modules.ContentItems; public static class DependencyInjection { diff --git a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/CreateContentItem.cs b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/CreateContentItem.cs index fb89fda..5bcf0df 100644 --- a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/CreateContentItem.cs +++ b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/CreateContentItem.cs @@ -1,7 +1,12 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Notifications.Contracts; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Notifications.Contracts; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Workspaces.Data; -namespace Socialize.Modules.ContentItems.Handlers; +namespace Socialize.Api.Modules.ContentItems.Handlers; public record CreateContentItemRequest( Guid WorkspaceId, diff --git a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/CreateContentItemRevision.cs b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/CreateContentItemRevision.cs index 41a8569..cfd190e 100644 --- a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/CreateContentItemRevision.cs +++ b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/CreateContentItemRevision.cs @@ -1,7 +1,11 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Notifications.Contracts; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Notifications.Contracts; -namespace Socialize.Modules.ContentItems.Handlers; +namespace Socialize.Api.Modules.ContentItems.Handlers; public record CreateContentItemRevisionRequest( string Title, diff --git a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItem.cs b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItem.cs index 83d46eb..b4e088b 100644 --- a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItem.cs +++ b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItem.cs @@ -1,7 +1,10 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.ContentItems.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.ContentItems.Data; -namespace Socialize.Modules.ContentItems.Handlers; +namespace Socialize.Api.Modules.ContentItems.Handlers; public record ContentItemDetailDto( Guid Id, diff --git a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItemRevisions.cs b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItemRevisions.cs index 2a148cc..e862175 100644 --- a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItemRevisions.cs +++ b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItemRevisions.cs @@ -1,5 +1,10 @@ -using Socialize.Infrastructure.Security; -namespace Socialize.Modules.ContentItems.Handlers; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.ContentItems.Data; + +namespace Socialize.Api.Modules.ContentItems.Handlers; public record ContentItemRevisionDto( Guid Id, diff --git a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItems.cs b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItems.cs index 1326561..b145e14 100644 --- a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItems.cs +++ b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/GetContentItems.cs @@ -1,7 +1,10 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.ContentItems.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.ContentItems.Data; -namespace Socialize.Modules.ContentItems.Handlers; +namespace Socialize.Api.Modules.ContentItems.Handlers; public record GetContentItemsRequest(Guid? WorkspaceId, Guid? ClientId, Guid? ProjectId); diff --git a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/UpdateContentItemStatus.cs b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/UpdateContentItemStatus.cs index 28ba497..07c2cef 100644 --- a/backend/src/Socialize.Api/Modules/ContentItems/Handlers/UpdateContentItemStatus.cs +++ b/backend/src/Socialize.Api/Modules/ContentItems/Handlers/UpdateContentItemStatus.cs @@ -1,8 +1,11 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.ContentItems.Data; -using Socialize.Modules.Notifications.Contracts; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Notifications.Contracts; -namespace Socialize.Modules.ContentItems.Handlers; +namespace Socialize.Api.Modules.ContentItems.Handlers; public record UpdateContentItemStatusRequest(string Status); diff --git a/backend/src/Socialize.Api/Modules/Identity/Configuration/JwtOptions.cs b/backend/src/Socialize.Api/Modules/Identity/Configuration/JwtOptions.cs index 2e3d953..5cbe9a0 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Configuration/JwtOptions.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Configuration/JwtOptions.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Identity.Configuration; +namespace Socialize.Api.Modules.Identity.Configuration; public record JwtOptions { diff --git a/backend/src/Socialize.Api/Modules/Identity/Contracts/IUserLookup.cs b/backend/src/Socialize.Api/Modules/Identity/Contracts/IUserLookup.cs index 3e26bc4..f62ae09 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Contracts/IUserLookup.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Contracts/IUserLookup.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Identity.Contracts; +namespace Socialize.Api.Modules.Identity.Contracts; public interface IUserLookup { diff --git a/backend/src/Socialize.Api/Modules/Identity/Contracts/KnownRoles.cs b/backend/src/Socialize.Api/Modules/Identity/Contracts/KnownRoles.cs index 110d3e8..460708b 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Contracts/KnownRoles.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Contracts/KnownRoles.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Identity.Contracts; +namespace Socialize.Api.Modules.Identity.Contracts; public static class KnownRoles { diff --git a/backend/src/Socialize.Api/Modules/Identity/Contracts/UserReference.cs b/backend/src/Socialize.Api/Modules/Identity/Contracts/UserReference.cs index cf192f6..ad1d20a 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Contracts/UserReference.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Contracts/UserReference.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Identity.Contracts; +namespace Socialize.Api.Modules.Identity.Contracts; public record UserReference( Guid Id, diff --git a/backend/src/Socialize.Api/Modules/Identity/Data/IdentityService.cs b/backend/src/Socialize.Api/Modules/Identity/Data/IdentityService.cs index 2b127ee..e85de89 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Data/IdentityService.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Data/IdentityService.cs @@ -1,8 +1,8 @@ using System.Security.Claims; -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Models; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Models; -namespace Socialize.Modules.Identity.Data; +namespace Socialize.Api.Modules.Identity.Data; public class IdentityService( UserManager userManager, diff --git a/backend/src/Socialize.Api/Modules/Identity/Data/Role.cs b/backend/src/Socialize.Api/Modules/Identity/Data/Role.cs index f599eea..85ad929 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Data/Role.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Data/Role.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Identity; -namespace Socialize.Modules.Identity.Data; +namespace Socialize.Api.Modules.Identity.Data; public class Role : IdentityRole { diff --git a/backend/src/Socialize.Api/Modules/Identity/Data/User.cs b/backend/src/Socialize.Api/Modules/Identity/Data/User.cs index 678fbde..3bbf0ce 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Data/User.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Data/User.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.AspNetCore.Identity; -namespace Socialize.Modules.Identity.Data; +namespace Socialize.Api.Modules.Identity.Data; public class User : IdentityUser { diff --git a/backend/src/Socialize.Api/Modules/Identity/Data/UserManager.cs b/backend/src/Socialize.Api/Modules/Identity/Data/UserManager.cs index 3b5e2e3..afc86e5 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Data/UserManager.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Data/UserManager.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Options; -namespace Socialize.Modules.Identity.Data; +namespace Socialize.Api.Modules.Identity.Data; public sealed class UserManager( IUserStore store, diff --git a/backend/src/Socialize.Api/Modules/Identity/DependencyInjection.cs b/backend/src/Socialize.Api/Modules/Identity/DependencyInjection.cs index 15b1e90..cb7dad8 100644 --- a/backend/src/Socialize.Api/Modules/Identity/DependencyInjection.cs +++ b/backend/src/Socialize.Api/Modules/Identity/DependencyInjection.cs @@ -1,11 +1,11 @@ -using Socialize.Data; -using Socialize.Modules.Identity.Configuration; -using Socialize.Modules.Identity.Contracts; -using Socialize.Modules.Identity.Data; -using Socialize.Modules.Identity.Services; +using Socialize.Api.Data; +using Socialize.Api.Modules.Identity.Configuration; +using Socialize.Api.Modules.Identity.Contracts; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Identity.Services; using Microsoft.AspNetCore.Identity; -namespace Socialize.Modules.Identity; +namespace Socialize.Api.Modules.Identity; public static class DependencyInjection { diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeAddress.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeAddress.cs index 662bdab..8e7547f 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeAddress.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeAddress.cs @@ -1,8 +1,9 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Data; +using FastEndpoints; using Microsoft.AspNetCore.Identity; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record ChangeAddressRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeAlias.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeAlias.cs index 79dbd84..3dc8c75 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeAlias.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeAlias.cs @@ -1,8 +1,9 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Data; +using FastEndpoints; using Microsoft.AspNetCore.Identity; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record ChangeAliasRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeBirthDate.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeBirthDate.cs index 9935282..da96606 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeBirthDate.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeBirthDate.cs @@ -1,8 +1,9 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Data; +using FastEndpoints; using Microsoft.AspNetCore.Identity; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record ChangeBirthDateRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeEmail.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeEmail.cs index 4cc845e..73a5d96 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeEmail.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeEmail.cs @@ -1,8 +1,9 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Data; +using FastEndpoints; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Data; using Microsoft.AspNetCore.Identity; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record ChangeEmailRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeFullname.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeFullname.cs index 53d40ae..3b923ff 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeFullname.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangeFullname.cs @@ -1,8 +1,9 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Data; +using FastEndpoints; using Microsoft.AspNetCore.Identity; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record ChangeFullnameRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangePhone.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangePhone.cs index 5d25d93..b326bae 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangePhone.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangePhone.cs @@ -1,8 +1,9 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Data; +using FastEndpoints; using Microsoft.AspNetCore.Identity; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record ChangePhoneRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangePortrait.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangePortrait.cs index e5f4e6c..f9330af 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangePortrait.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/ChangePortrait.cs @@ -1,9 +1,10 @@ -using Socialize.Infrastructure.BlobStorage.Contracts; -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Data; +using FastEndpoints; using Microsoft.AspNetCore.Identity; +using Socialize.Api.Infrastructure.BlobStorage.Contracts; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record ChangePortraitRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/ForgotPassword.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/ForgotPassword.cs index 061be8b..a31ca96 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/ForgotPassword.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/ForgotPassword.cs @@ -1,10 +1,11 @@ -using System.Web; -using Socialize.Infrastructure.Configuration; -using Socialize.Infrastructure.Emailer.Contracts; -using Socialize.Modules.Identity.Data; +using FastEndpoints; using Microsoft.Extensions.Options; +using System.Web; +using Socialize.Api.Infrastructure.Configuration; +using Socialize.Api.Infrastructure.Emailer.Contracts; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record ForgotPasswordRequest( @@ -53,29 +54,29 @@ public class ForgotPasswordHandler( string message = $"""

Reset Your Socialize Password

- +

Please click the button below to reset your password:

- + - +

If you did not request a password reset, please ignore this email.

- +

If the button doesn't work, you can copy and paste this link into your browser:
diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/GetCurrentUser.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/GetCurrentUser.cs index 9a75372..6abbdf8 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/GetCurrentUser.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/GetCurrentUser.cs @@ -1,9 +1,10 @@ +using FastEndpoints; using System.Security.Claims; -using Socialize.Modules.Identity.Data; -using Socialize.Modules.Identity.Models; -using Socialize.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Identity.Models; +using Socialize.Api.Infrastructure.Security; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public class GetCurrentUserQueryHandler( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/GetCurrentUserProfilePicture.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/GetCurrentUserProfilePicture.cs index 5836847..cd0c600 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/GetCurrentUserProfilePicture.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/GetCurrentUserProfilePicture.cs @@ -1,8 +1,9 @@ -using Socialize.Infrastructure.BlobStorage.Contracts; -using Socialize.Modules.Identity.Data; -using Socialize.Modules.Identity.Models; +using FastEndpoints; +using Socialize.Api.Infrastructure.BlobStorage.Contracts; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Identity.Models; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public class GetCurrentUserPortraitHandler( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/Login.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/Login.cs index 398292c..b7f5afc 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/Login.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/Login.cs @@ -1,10 +1,11 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Data; -using Socialize.Modules.Identity.Configuration; -using Socialize.Modules.Identity.Services; +using FastEndpoints; using Microsoft.Extensions.Options; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Identity.Configuration; +using Socialize.Api.Modules.Identity.Services; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record LoginRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/LoginWithFacebook.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/LoginWithFacebook.cs index b3f851c..8cdb908 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/LoginWithFacebook.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/LoginWithFacebook.cs @@ -1,13 +1,14 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Configuration; -using Socialize.Modules.Identity.Data; -using Socialize.Modules.Identity.Services; +using FastEndpoints; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Options; +using System.Text.Json; +using System.Text.Json.Serialization; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Configuration; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Identity.Services; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public class FacebookUserInfo diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/LoginWithGoogle.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/LoginWithGoogle.cs index 20defc1..0a1a8a2 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/LoginWithGoogle.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/LoginWithGoogle.cs @@ -1,13 +1,14 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Configuration; -using Socialize.Modules.Identity.Data; -using Socialize.Modules.Identity.Services; +using FastEndpoints; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Options; +using System.Text.Json; +using System.Text.Json.Serialization; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Configuration; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Identity.Services; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; internal class GoogleToken { diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/RefreshToken.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/RefreshToken.cs index b40870d..c96a5b3 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/RefreshToken.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/RefreshToken.cs @@ -1,10 +1,12 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Configuration; -using Socialize.Modules.Identity.Data; -using Socialize.Modules.Identity.Services; +using FastEndpoints; using Microsoft.Extensions.Options; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Configuration; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Identity.Services; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record RefreshTokenRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/Register.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/Register.cs index 1c7be79..b6f51ad 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/Register.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/Register.cs @@ -1,8 +1,9 @@ -using Socialize.Modules.Identity.Data; -using Socialize.Modules.Identity.Services; +using FastEndpoints; using Microsoft.AspNetCore.Identity; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Identity.Services; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record RegisterRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/ResendVerification.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/ResendVerification.cs index 14d9429..1bf930d 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/ResendVerification.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/ResendVerification.cs @@ -1,7 +1,8 @@ -using Socialize.Modules.Identity.Data; -using Socialize.Modules.Identity.Services; +using FastEndpoints; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Modules.Identity.Services; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record ResendVerificationRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/ResetPassword.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/ResetPassword.cs index 2e933f0..c5ab9a1 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/ResetPassword.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/ResetPassword.cs @@ -1,7 +1,8 @@ -using Socialize.Modules.Identity.Data; +using FastEndpoints; using Microsoft.AspNetCore.Identity; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record ResetPasswordRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/SetPassword.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/SetPassword.cs index c2d533d..9568454 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/SetPassword.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/SetPassword.cs @@ -1,8 +1,9 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Data; +using FastEndpoints; using Microsoft.AspNetCore.Identity; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record SetPasswordRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/Handlers/VerifyEmail.cs b/backend/src/Socialize.Api/Modules/Identity/Handlers/VerifyEmail.cs index febc059..961aaaa 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Handlers/VerifyEmail.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Handlers/VerifyEmail.cs @@ -1,8 +1,9 @@ -using System.Web; -using Socialize.Modules.Identity.Data; +using FastEndpoints; using Microsoft.AspNetCore.Identity; +using System.Web; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Handlers; +namespace Socialize.Api.Modules.Identity.Handlers; [PublicAPI] public record VerifyEmailRequest( diff --git a/backend/src/Socialize.Api/Modules/Identity/IdentityResultExtensions.cs b/backend/src/Socialize.Api/Modules/Identity/IdentityResultExtensions.cs index 0467a71..f2402d0 100644 --- a/backend/src/Socialize.Api/Modules/Identity/IdentityResultExtensions.cs +++ b/backend/src/Socialize.Api/Modules/Identity/IdentityResultExtensions.cs @@ -1,7 +1,7 @@ -using Socialize.Modules.Identity.Models; +using Socialize.Api.Modules.Identity.Models; using Microsoft.AspNetCore.Identity; -namespace Socialize.Modules.Identity; +namespace Socialize.Api.Modules.Identity; public static class IdentityResultExtensions { diff --git a/backend/src/Socialize.Api/Modules/Identity/Models/Result.cs b/backend/src/Socialize.Api/Modules/Identity/Models/Result.cs index e20ce55..31c5e65 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Models/Result.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Models/Result.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Identity.Models; +namespace Socialize.Api.Modules.Identity.Models; public class Result( bool succeeded, diff --git a/backend/src/Socialize.Api/Modules/Identity/Models/RoleModel.cs b/backend/src/Socialize.Api/Modules/Identity/Models/RoleModel.cs index e59cbc1..603af58 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Models/RoleModel.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Models/RoleModel.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Identity.Models; +namespace Socialize.Api.Modules.Identity.Models; public class RoleModel { diff --git a/backend/src/Socialize.Api/Modules/Identity/Models/UserDto.cs b/backend/src/Socialize.Api/Modules/Identity/Models/UserDto.cs index 76e648c..5f64a2b 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Models/UserDto.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Models/UserDto.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Identity.Models; +namespace Socialize.Api.Modules.Identity.Models; public class UserDto { diff --git a/backend/src/Socialize.Api/Modules/Identity/Models/UserModel.cs b/backend/src/Socialize.Api/Modules/Identity/Models/UserModel.cs index 5ba16ba..244c80b 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Models/UserModel.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Models/UserModel.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Identity.Models; +namespace Socialize.Api.Modules.Identity.Models; public class UserModel { diff --git a/backend/src/Socialize.Api/Modules/Identity/Services/AccessTokenFactory.cs b/backend/src/Socialize.Api/Modules/Identity/Services/AccessTokenFactory.cs index de801bc..87b4fb5 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Services/AccessTokenFactory.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Services/AccessTokenFactory.cs @@ -1,11 +1,11 @@ using System.Security.Claims; -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Configuration; -using Socialize.Modules.Identity.Contracts; -using Socialize.Modules.Identity.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Configuration; +using Socialize.Api.Modules.Identity.Contracts; +using Socialize.Api.Modules.Identity.Data; using Microsoft.Extensions.Options; -namespace Socialize.Modules.Identity.Services; +namespace Socialize.Api.Modules.Identity.Services; public sealed class AccessTokenFactory( UserManager userManager, diff --git a/backend/src/Socialize.Api/Modules/Identity/Services/EmailVerificationService.cs b/backend/src/Socialize.Api/Modules/Identity/Services/EmailVerificationService.cs index f1a455d..2b4255f 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Services/EmailVerificationService.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Services/EmailVerificationService.cs @@ -1,10 +1,10 @@ using System.Web; -using Socialize.Infrastructure.Configuration; -using Socialize.Infrastructure.Emailer.Contracts; -using Socialize.Modules.Identity.Data; +using Socialize.Api.Infrastructure.Configuration; +using Socialize.Api.Infrastructure.Emailer.Contracts; +using Socialize.Api.Modules.Identity.Data; using Microsoft.Extensions.Options; -namespace Socialize.Modules.Identity.Services; +namespace Socialize.Api.Modules.Identity.Services; [PublicAPI] public sealed class EmailVerificationService( diff --git a/backend/src/Socialize.Api/Modules/Identity/Services/UserLookup.cs b/backend/src/Socialize.Api/Modules/Identity/Services/UserLookup.cs index b8f7892..3d4b03b 100644 --- a/backend/src/Socialize.Api/Modules/Identity/Services/UserLookup.cs +++ b/backend/src/Socialize.Api/Modules/Identity/Services/UserLookup.cs @@ -1,7 +1,7 @@ -using Socialize.Modules.Identity.Contracts; -using Socialize.Modules.Identity.Data; +using Socialize.Api.Modules.Identity.Contracts; +using Socialize.Api.Modules.Identity.Data; -namespace Socialize.Modules.Identity.Services; +namespace Socialize.Api.Modules.Identity.Services; public sealed class UserLookup( UserManager userManager) diff --git a/backend/src/Socialize.Api/Modules/Notifications/Contracts/INotificationEventWriter.cs b/backend/src/Socialize.Api/Modules/Notifications/Contracts/INotificationEventWriter.cs index e0545cb..dc575f4 100644 --- a/backend/src/Socialize.Api/Modules/Notifications/Contracts/INotificationEventWriter.cs +++ b/backend/src/Socialize.Api/Modules/Notifications/Contracts/INotificationEventWriter.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Notifications.Contracts; +namespace Socialize.Api.Modules.Notifications.Contracts; public record NotificationEventWriteModel( Guid WorkspaceId, diff --git a/backend/src/Socialize.Api/Modules/Notifications/Data/NotificationEvent.cs b/backend/src/Socialize.Api/Modules/Notifications/Data/NotificationEvent.cs index 03fb1a2..10cfa9e 100644 --- a/backend/src/Socialize.Api/Modules/Notifications/Data/NotificationEvent.cs +++ b/backend/src/Socialize.Api/Modules/Notifications/Data/NotificationEvent.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Notifications.Data; +namespace Socialize.Api.Modules.Notifications.Data; public class NotificationEvent { diff --git a/backend/src/Socialize.Api/Modules/Notifications/Data/NotificationModelConfiguration.cs b/backend/src/Socialize.Api/Modules/Notifications/Data/NotificationModelConfiguration.cs index 9c4c1e1..8f47930 100644 --- a/backend/src/Socialize.Api/Modules/Notifications/Data/NotificationModelConfiguration.cs +++ b/backend/src/Socialize.Api/Modules/Notifications/Data/NotificationModelConfiguration.cs @@ -1,4 +1,6 @@ -namespace Socialize.Modules.Notifications.Data; +using Microsoft.EntityFrameworkCore; + +namespace Socialize.Api.Modules.Notifications.Data; public static class NotificationModelConfiguration { diff --git a/backend/src/Socialize.Api/Modules/Notifications/DependencyInjection.cs b/backend/src/Socialize.Api/Modules/Notifications/DependencyInjection.cs index 640b39b..8078c79 100644 --- a/backend/src/Socialize.Api/Modules/Notifications/DependencyInjection.cs +++ b/backend/src/Socialize.Api/Modules/Notifications/DependencyInjection.cs @@ -1,8 +1,8 @@ -using Socialize.Modules.Notifications.Contracts; -using Socialize.Modules.Notifications.Data; -using Socialize.Modules.Notifications.Services; +using Socialize.Api.Modules.Notifications.Contracts; +using Socialize.Api.Modules.Notifications.Data; +using Socialize.Api.Modules.Notifications.Services; -namespace Socialize.Modules.Notifications; +namespace Socialize.Api.Modules.Notifications; public static class DependencyInjection { diff --git a/backend/src/Socialize.Api/Modules/Notifications/Handlers/GetNotifications.cs b/backend/src/Socialize.Api/Modules/Notifications/Handlers/GetNotifications.cs index 54e617b..9717743 100644 --- a/backend/src/Socialize.Api/Modules/Notifications/Handlers/GetNotifications.cs +++ b/backend/src/Socialize.Api/Modules/Notifications/Handlers/GetNotifications.cs @@ -1,5 +1,11 @@ -using Socialize.Infrastructure.Security; -namespace Socialize.Modules.Notifications.Handlers; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.ContentItems.Data; +using Socialize.Api.Modules.Notifications.Data; + +namespace Socialize.Api.Modules.Notifications.Handlers; public record GetNotificationsRequest(Guid? WorkspaceId, Guid? ContentItemId); diff --git a/backend/src/Socialize.Api/Modules/Notifications/Handlers/MarkNotificationAsRead.cs b/backend/src/Socialize.Api/Modules/Notifications/Handlers/MarkNotificationAsRead.cs index ada7745..1c47893 100644 --- a/backend/src/Socialize.Api/Modules/Notifications/Handlers/MarkNotificationAsRead.cs +++ b/backend/src/Socialize.Api/Modules/Notifications/Handlers/MarkNotificationAsRead.cs @@ -1,7 +1,10 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Notifications.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Notifications.Data; -namespace Socialize.Modules.Notifications.Handlers; +namespace Socialize.Api.Modules.Notifications.Handlers; public class MarkNotificationAsReadHandler( AppDbContext dbContext, diff --git a/backend/src/Socialize.Api/Modules/Notifications/Services/NotificationEventWriter.cs b/backend/src/Socialize.Api/Modules/Notifications/Services/NotificationEventWriter.cs index 27ebbdf..16f9b17 100644 --- a/backend/src/Socialize.Api/Modules/Notifications/Services/NotificationEventWriter.cs +++ b/backend/src/Socialize.Api/Modules/Notifications/Services/NotificationEventWriter.cs @@ -1,7 +1,8 @@ -using Socialize.Modules.Notifications.Contracts; -using Socialize.Modules.Notifications.Data; +using Socialize.Api.Data; +using Socialize.Api.Modules.Notifications.Contracts; +using Socialize.Api.Modules.Notifications.Data; -namespace Socialize.Modules.Notifications.Services; +namespace Socialize.Api.Modules.Notifications.Services; public class NotificationEventWriter( AppDbContext dbContext) diff --git a/backend/src/Socialize.Api/Modules/Projects/Data/Project.cs b/backend/src/Socialize.Api/Modules/Projects/Data/Project.cs index 0bfded0..f18a024 100644 --- a/backend/src/Socialize.Api/Modules/Projects/Data/Project.cs +++ b/backend/src/Socialize.Api/Modules/Projects/Data/Project.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Projects.Data; +namespace Socialize.Api.Modules.Projects.Data; public class Project { diff --git a/backend/src/Socialize.Api/Modules/Projects/Data/ProjectModelConfiguration.cs b/backend/src/Socialize.Api/Modules/Projects/Data/ProjectModelConfiguration.cs index 0f6fd1d..ab871f1 100644 --- a/backend/src/Socialize.Api/Modules/Projects/Data/ProjectModelConfiguration.cs +++ b/backend/src/Socialize.Api/Modules/Projects/Data/ProjectModelConfiguration.cs @@ -1,4 +1,6 @@ -namespace Socialize.Modules.Projects.Data; +using Microsoft.EntityFrameworkCore; + +namespace Socialize.Api.Modules.Projects.Data; public static class ProjectModelConfiguration { diff --git a/backend/src/Socialize.Api/Modules/Projects/DependencyInjection.cs b/backend/src/Socialize.Api/Modules/Projects/DependencyInjection.cs index 1991718..a0db954 100644 --- a/backend/src/Socialize.Api/Modules/Projects/DependencyInjection.cs +++ b/backend/src/Socialize.Api/Modules/Projects/DependencyInjection.cs @@ -1,6 +1,6 @@ -using Socialize.Modules.Projects.Data; +using Socialize.Api.Modules.Projects.Data; -namespace Socialize.Modules.Projects; +namespace Socialize.Api.Modules.Projects; public static class DependencyInjection { diff --git a/backend/src/Socialize.Api/Modules/Projects/Handlers/CreateProject.cs b/backend/src/Socialize.Api/Modules/Projects/Handlers/CreateProject.cs index 941d8c5..0e9c7c5 100644 --- a/backend/src/Socialize.Api/Modules/Projects/Handlers/CreateProject.cs +++ b/backend/src/Socialize.Api/Modules/Projects/Handlers/CreateProject.cs @@ -1,5 +1,10 @@ -using Socialize.Infrastructure.Security; -namespace Socialize.Modules.Projects.Handlers; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Projects.Data; + +namespace Socialize.Api.Modules.Projects.Handlers; public record CreateProjectRequest( Guid WorkspaceId, diff --git a/backend/src/Socialize.Api/Modules/Projects/Handlers/GetProjects.cs b/backend/src/Socialize.Api/Modules/Projects/Handlers/GetProjects.cs index 82f88e2..2bbbcf2 100644 --- a/backend/src/Socialize.Api/Modules/Projects/Handlers/GetProjects.cs +++ b/backend/src/Socialize.Api/Modules/Projects/Handlers/GetProjects.cs @@ -1,7 +1,10 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Projects.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Projects.Data; -namespace Socialize.Modules.Projects.Handlers; +namespace Socialize.Api.Modules.Projects.Handlers; public record GetProjectsRequest(Guid? WorkspaceId, Guid? ClientId); diff --git a/backend/src/Socialize.Api/Modules/Workspaces/Data/Workspace.cs b/backend/src/Socialize.Api/Modules/Workspaces/Data/Workspace.cs index 34e6eb9..ac4a074 100644 --- a/backend/src/Socialize.Api/Modules/Workspaces/Data/Workspace.cs +++ b/backend/src/Socialize.Api/Modules/Workspaces/Data/Workspace.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Workspaces.Data; +namespace Socialize.Api.Modules.Workspaces.Data; public class Workspace { diff --git a/backend/src/Socialize.Api/Modules/Workspaces/Data/WorkspaceInvite.cs b/backend/src/Socialize.Api/Modules/Workspaces/Data/WorkspaceInvite.cs index b2399e9..2719d2b 100644 --- a/backend/src/Socialize.Api/Modules/Workspaces/Data/WorkspaceInvite.cs +++ b/backend/src/Socialize.Api/Modules/Workspaces/Data/WorkspaceInvite.cs @@ -1,4 +1,4 @@ -namespace Socialize.Modules.Workspaces.Data; +namespace Socialize.Api.Modules.Workspaces.Data; public class WorkspaceInvite { diff --git a/backend/src/Socialize.Api/Modules/Workspaces/Data/WorkspaceModelConfiguration.cs b/backend/src/Socialize.Api/Modules/Workspaces/Data/WorkspaceModelConfiguration.cs index f2582f6..553186c 100644 --- a/backend/src/Socialize.Api/Modules/Workspaces/Data/WorkspaceModelConfiguration.cs +++ b/backend/src/Socialize.Api/Modules/Workspaces/Data/WorkspaceModelConfiguration.cs @@ -1,4 +1,6 @@ -namespace Socialize.Modules.Workspaces.Data; +using Microsoft.EntityFrameworkCore; + +namespace Socialize.Api.Modules.Workspaces.Data; public static class WorkspaceModelConfiguration { diff --git a/backend/src/Socialize.Api/Modules/Workspaces/DependencyInjection.cs b/backend/src/Socialize.Api/Modules/Workspaces/DependencyInjection.cs index 95ea013..f74ea82 100644 --- a/backend/src/Socialize.Api/Modules/Workspaces/DependencyInjection.cs +++ b/backend/src/Socialize.Api/Modules/Workspaces/DependencyInjection.cs @@ -1,7 +1,7 @@ -using Socialize.Modules.Workspaces.Data; -using Socialize.Infrastructure.Development; +using Socialize.Api.Modules.Workspaces.Data; +using Socialize.Api.Infrastructure.Development; -namespace Socialize.Modules.Workspaces; +namespace Socialize.Api.Modules.Workspaces; public static class DependencyInjection { diff --git a/backend/src/Socialize.Api/Modules/Workspaces/Handlers/CreateWorkspace.cs b/backend/src/Socialize.Api/Modules/Workspaces/Handlers/CreateWorkspace.cs index c980531..6bafe95 100644 --- a/backend/src/Socialize.Api/Modules/Workspaces/Handlers/CreateWorkspace.cs +++ b/backend/src/Socialize.Api/Modules/Workspaces/Handlers/CreateWorkspace.cs @@ -1,7 +1,10 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Workspaces.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Workspaces.Data; -namespace Socialize.Modules.Workspaces.Handlers; +namespace Socialize.Api.Modules.Workspaces.Handlers; public record CreateWorkspaceRequest( string Name, diff --git a/backend/src/Socialize.Api/Modules/Workspaces/Handlers/CreateWorkspaceInvite.cs b/backend/src/Socialize.Api/Modules/Workspaces/Handlers/CreateWorkspaceInvite.cs index cd1c3f7..6046d1a 100644 --- a/backend/src/Socialize.Api/Modules/Workspaces/Handlers/CreateWorkspaceInvite.cs +++ b/backend/src/Socialize.Api/Modules/Workspaces/Handlers/CreateWorkspaceInvite.cs @@ -1,8 +1,11 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Identity.Contracts; -using Socialize.Modules.Workspaces.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Identity.Contracts; +using Socialize.Api.Modules.Workspaces.Data; -namespace Socialize.Modules.Workspaces.Handlers; +namespace Socialize.Api.Modules.Workspaces.Handlers; public record CreateWorkspaceInviteRequest( string Email, diff --git a/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaceInvites.cs b/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaceInvites.cs index 2d2a390..3a88da4 100644 --- a/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaceInvites.cs +++ b/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaceInvites.cs @@ -1,7 +1,10 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Workspaces.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Workspaces.Data; -namespace Socialize.Modules.Workspaces.Handlers; +namespace Socialize.Api.Modules.Workspaces.Handlers; public record WorkspaceInviteDto( Guid Id, diff --git a/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaceMembers.cs b/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaceMembers.cs index 3c3b36f..d26c328 100644 --- a/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaceMembers.cs +++ b/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaceMembers.cs @@ -1,7 +1,11 @@ +using FastEndpoints; +using Microsoft.EntityFrameworkCore; using System.Security.Claims; -using Socialize.Infrastructure.Security; +using Socialize.Api.Data; +using Socialize.Api.Modules.Identity.Data; +using Socialize.Api.Infrastructure.Security; -namespace Socialize.Modules.Workspaces.Handlers; +namespace Socialize.Api.Modules.Workspaces.Handlers; public record WorkspaceMemberDto( Guid Id, @@ -33,7 +37,7 @@ public class GetWorkspaceMembersHandler( string workspaceClaimValue = workspaceId.ToString(); - List users = await dbContext.Users + var users = await dbContext.Users .Where(candidate => dbContext.UserClaims.Any(claim => claim.UserId == candidate.Id && @@ -44,7 +48,7 @@ public class GetWorkspaceMembersHandler( .ThenBy(candidate => candidate.Email) .ToListAsync(ct); - List userIds = users + var userIds = users .Select(candidate => candidate.Id) .ToList(); @@ -66,7 +70,7 @@ public class GetWorkspaceMembersHandler( .ToArray(), ct); - List members = users + var members = users .Select(candidate => new WorkspaceMemberDto( candidate.Id, BuildDisplayName(candidate), diff --git a/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaces.cs b/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaces.cs index 3018d98..107b9d2 100644 --- a/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaces.cs +++ b/backend/src/Socialize.Api/Modules/Workspaces/Handlers/GetWorkspaces.cs @@ -1,7 +1,10 @@ -using Socialize.Infrastructure.Security; -using Socialize.Modules.Workspaces.Data; +using FastEndpoints; +using Microsoft.EntityFrameworkCore; +using Socialize.Api.Data; +using Socialize.Api.Infrastructure.Security; +using Socialize.Api.Modules.Workspaces.Data; -namespace Socialize.Modules.Workspaces.Handlers; +namespace Socialize.Api.Modules.Workspaces.Handlers; public record WorkspaceDto( Guid Id, diff --git a/backend/src/Socialize.Api/Program.cs b/backend/src/Socialize.Api/Program.cs index 907ccf5..5fd5533 100644 --- a/backend/src/Socialize.Api/Program.cs +++ b/backend/src/Socialize.Api/Program.cs @@ -1,79 +1,60 @@ using Azure.Identity; -using Socialize; -using Socialize.Data; -using Socialize.Infrastructure; -using Socialize.Infrastructure.Development; -using Socialize.Modules.Approvals; -using Socialize.Modules.Assets; -using Socialize.Modules.Clients; -using Socialize.Modules.Comments; -using Socialize.Modules.ContentItems; -using Socialize.Modules.Identity; -using Socialize.Modules.Notifications; -using Socialize.Modules.Projects; -using Socialize.Modules.Workspaces; +using FastEndpoints; +using FastEndpoints.Swagger; using Microsoft.AspNetCore.HttpOverrides; -using NSwag; -using NSwag.Generation.AspNetCore.Processors; -using NSwag.Generation.Processors.Security; +using Socialize; +using Socialize.Api.Infrastructure; +using Socialize.Api.Infrastructure.Development; +using Socialize.Api.Modules.Approvals; +using Socialize.Api.Modules.Assets; +using Socialize.Api.Modules.Clients; +using Socialize.Api.Modules.Comments; +using Socialize.Api.Modules.ContentItems; +using Socialize.Api.Modules.Identity; +using Socialize.Api.Modules.Notifications; +using Socialize.Api.Modules.Projects; +using Socialize.Api.Modules.Workspaces; -WebApplicationBuilder builder = WebApplication.CreateBuilder(args); + +var builder = WebApplication.CreateBuilder(args); if (!builder.Environment.IsDevelopment()) { - string? vaultUri = Environment.GetEnvironmentVariable("VaultUri"); - - if (vaultUri is null) - { - throw new InvalidOperationException("Missing VaultUri configuration setting"); - } + var vaultUri = Environment.GetEnvironmentVariable("VaultUri") ?? throw new InvalidOperationException("Missing VaultUri configuration setting"); builder.Configuration.AddAzureKeyVault(new Uri(vaultUri), new DefaultAzureCredential()); } builder.Services.AddCors(options => -{ options.AddPolicy( "AllowAll", policy => - { policy.AllowAnyOrigin() .AllowAnyMethod() - .AllowAnyHeader(); - }); -}); + .AllowAnyHeader() + ) +); // Add services to the container. builder.Services.AddWebServices(); builder.Services.AddAuthorizationAndAuthentication(builder.Configuration); -builder.Services.AddOpenApiDocument(( - configure, - _) => +builder.Services.AddFastEndpoints(); +builder.Services.SwaggerDocument(o => { - configure.Title = "Socialize API"; - - // Add JWT - configure.AddSecurity( - "JWT", - [], - new OpenApiSecurityScheme - { - Type = OpenApiSecuritySchemeType.ApiKey, - Name = "Authorization", - In = OpenApiSecurityApiKeyLocation.Header, - Description = "Type into the textbox: Bearer {your JWT token}." - }); - - configure.OperationProcessors.Add(new AspNetCoreOperationTagsProcessor()); - configure.OperationProcessors.Add(new AspNetCoreOperationSecurityScopeProcessor("JWT")); + o.EnableGetRequestsWithBody = false; + o.EnableJWTBearerAuth = true; + o.DocumentSettings = s => + { + s.Title = "Socialize API"; + s.Version = "v1"; + }; }); -string postgresConnectionString = builder.Configuration.GetConnectionString("PostgresConnection") +var postgresConnectionString = builder.Configuration.GetConnectionString("PostgresConnection") ?? throw new InvalidOperationException( "Missing ConnectionStrings:PostgresConnection"); -builder.Services.AddFastEndpoints(); builder.Services.AddAppData(postgresConnectionString); builder.AddInfrastructureModule(); builder.AddIdentityModule(); @@ -86,7 +67,7 @@ builder.AddCommentsModule(); builder.AddApprovalsModule(); builder.AddNotificationsModule(); -WebApplication app = builder.Build(); +var app = builder.Build(); app.UseForwardedHeaders( new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedProto } @@ -116,12 +97,7 @@ if (!app.Environment.IsDevelopment()) app.UseHttpsRedirection(); } -if (app.Environment.IsDevelopment()) -{ - app.UseOpenApi(); - app.UseSwaggerUi(options => options.Path = "/api"); -} - app.UseFastEndpoints(); +app.UseSwaggerGen(); -app.Run(); +await app.RunAsync(); diff --git a/backend/src/Socialize.Api/Socialize.Api.csproj b/backend/src/Socialize.Api/Socialize.Api.csproj index aac2906..c310501 100644 --- a/backend/src/Socialize.Api/Socialize.Api.csproj +++ b/backend/src/Socialize.Api/Socialize.Api.csproj @@ -10,35 +10,38 @@ true AllEnabledByDefault false - + + CA2007 - - - - - - - - - - - - - - - + + + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - - + + + + + +