This commit is contained in:
2026-04-29 20:58:36 -04:00
parent 20f8a14bfb
commit 43bcf449fd
126 changed files with 524 additions and 394 deletions

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Approvals.Data;
namespace Socialize.Api.Modules.Approvals.Data;
public class ApprovalDecision
{

View File

@@ -1,4 +1,6 @@
namespace Socialize.Modules.Approvals.Data;
using Microsoft.EntityFrameworkCore;
namespace Socialize.Api.Modules.Approvals.Data;
public static class ApprovalModelConfiguration
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Approvals.Data;
namespace Socialize.Api.Modules.Approvals.Data;
public class ApprovalRequest
{

View File

@@ -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
{

View File

@@ -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,

View File

@@ -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);

View File

@@ -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,

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Assets.Data;
namespace Socialize.Api.Modules.Assets.Data;
public class Asset
{

View File

@@ -1,4 +1,6 @@
namespace Socialize.Modules.Assets.Data;
using Microsoft.EntityFrameworkCore;
namespace Socialize.Api.Modules.Assets.Data;
public static class AssetModelConfiguration
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Assets.Data;
namespace Socialize.Api.Modules.Assets.Data;
public class AssetRevision
{

View File

@@ -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
{

View File

@@ -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,

View File

@@ -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,

View File

@@ -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)
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Clients.Data;
namespace Socialize.Api.Modules.Clients.Data;
public class Client
{

View File

@@ -1,4 +1,6 @@
namespace Socialize.Modules.Clients.Data;
using Microsoft.EntityFrameworkCore;
namespace Socialize.Api.Modules.Clients.Data;
public static class ClientModelConfiguration
{

View File

@@ -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
{

View File

@@ -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);

View File

@@ -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,

View File

@@ -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);

View File

@@ -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,

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Comments.Data;
namespace Socialize.Api.Modules.Comments.Data;
public class Comment
{

View File

@@ -1,4 +1,6 @@
namespace Socialize.Modules.Comments.Data;
using Microsoft.EntityFrameworkCore;
namespace Socialize.Api.Modules.Comments.Data;
public static class CommentModelConfiguration
{

View File

@@ -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
{

View File

@@ -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,

View File

@@ -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);

View File

@@ -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,

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.ContentItems.Data;
namespace Socialize.Api.Modules.ContentItems.Data;
public class ContentItem
{

View File

@@ -1,4 +1,6 @@
namespace Socialize.Modules.ContentItems.Data;
using Microsoft.EntityFrameworkCore;
namespace Socialize.Api.Modules.ContentItems.Data;
public static class ContentItemModelConfiguration
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.ContentItems.Data;
namespace Socialize.Api.Modules.ContentItems.Data;
public class ContentItemRevision
{

View File

@@ -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
{

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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);

View File

@@ -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);

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Identity.Configuration;
namespace Socialize.Api.Modules.Identity.Configuration;
public record JwtOptions
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Identity.Contracts;
namespace Socialize.Api.Modules.Identity.Contracts;
public interface IUserLookup
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Identity.Contracts;
namespace Socialize.Api.Modules.Identity.Contracts;
public static class KnownRoles
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Identity.Contracts;
namespace Socialize.Api.Modules.Identity.Contracts;
public record UserReference(
Guid Id,

View File

@@ -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,

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Identity;
namespace Socialize.Modules.Identity.Data;
namespace Socialize.Api.Modules.Identity.Data;
public class Role : IdentityRole<Guid>
{

View File

@@ -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<Guid>
{

View File

@@ -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<User> store,

View File

@@ -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
{

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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 = $"""
<div style="font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; color: #333;">
<h1 style="color: #2c3e50; margin-bottom: 20px;">Reset Your Socialize Password</h1>
<p style="font-size: 16px; line-height: 1.5; margin-bottom: 25px;">
Please click the button below to reset your password:
</p>
<div style="text-align: center; margin: 30px 0;">
<a href='{resetLink}'
style="background-color: #3498db;
color: white;
text-decoration: none;
padding: 12px 24px;
border-radius: 4px;
font-weight: bold;
display: inline-block;
<a href='{resetLink}'
style="background-color: #3498db;
color: white;
text-decoration: none;
padding: 12px 24px;
border-radius: 4px;
font-weight: bold;
display: inline-block;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);">
Reset Password
</a>
</div>
<p style="font-size: 14px; color: #7f8c8d; margin-top: 30px;">
If you did not request a password reset, please ignore this email.
</p>
<p style="font-size: 14px; color: #7f8c8d; margin-top: 20px;">
If the button doesn't work, you can copy and paste this link into your browser:
<br>

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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

View File

@@ -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
{

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Identity.Models;
namespace Socialize.Api.Modules.Identity.Models;
public class Result(
bool succeeded,

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Identity.Models;
namespace Socialize.Api.Modules.Identity.Models;
public class RoleModel
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Identity.Models;
namespace Socialize.Api.Modules.Identity.Models;
public class UserDto
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Identity.Models;
namespace Socialize.Api.Modules.Identity.Models;
public class UserModel
{

View File

@@ -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,

View File

@@ -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(

View File

@@ -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)

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Notifications.Contracts;
namespace Socialize.Api.Modules.Notifications.Contracts;
public record NotificationEventWriteModel(
Guid WorkspaceId,

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Notifications.Data;
namespace Socialize.Api.Modules.Notifications.Data;
public class NotificationEvent
{

View File

@@ -1,4 +1,6 @@
namespace Socialize.Modules.Notifications.Data;
using Microsoft.EntityFrameworkCore;
namespace Socialize.Api.Modules.Notifications.Data;
public static class NotificationModelConfiguration
{

View File

@@ -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
{

View File

@@ -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);

View File

@@ -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,

View File

@@ -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)

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Projects.Data;
namespace Socialize.Api.Modules.Projects.Data;
public class Project
{

View File

@@ -1,4 +1,6 @@
namespace Socialize.Modules.Projects.Data;
using Microsoft.EntityFrameworkCore;
namespace Socialize.Api.Modules.Projects.Data;
public static class ProjectModelConfiguration
{

View File

@@ -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
{

View File

@@ -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,

View File

@@ -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);

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Workspaces.Data;
namespace Socialize.Api.Modules.Workspaces.Data;
public class Workspace
{

View File

@@ -1,4 +1,4 @@
namespace Socialize.Modules.Workspaces.Data;
namespace Socialize.Api.Modules.Workspaces.Data;
public class WorkspaceInvite
{

View File

@@ -1,4 +1,6 @@
namespace Socialize.Modules.Workspaces.Data;
using Microsoft.EntityFrameworkCore;
namespace Socialize.Api.Modules.Workspaces.Data;
public static class WorkspaceModelConfiguration
{

View File

@@ -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
{

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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<User> 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<Guid> userIds = users
var userIds = users
.Select(candidate => candidate.Id)
.ToList();
@@ -66,7 +70,7 @@ public class GetWorkspaceMembersHandler(
.ToArray(),
ct);
List<WorkspaceMemberDto> members = users
var members = users
.Select(candidate => new WorkspaceMemberDto(
candidate.Id,
BuildDisplayName(candidate),

View File

@@ -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,