wip
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Approvals.Data;
|
||||
namespace Socialize.Api.Modules.Approvals.Data;
|
||||
|
||||
public class ApprovalDecision
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Socialize.Modules.Approvals.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Socialize.Api.Modules.Approvals.Data;
|
||||
|
||||
public static class ApprovalModelConfiguration
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Approvals.Data;
|
||||
namespace Socialize.Api.Modules.Approvals.Data;
|
||||
|
||||
public class ApprovalRequest
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Assets.Data;
|
||||
namespace Socialize.Api.Modules.Assets.Data;
|
||||
|
||||
public class Asset
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Socialize.Modules.Assets.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Socialize.Api.Modules.Assets.Data;
|
||||
|
||||
public static class AssetModelConfiguration
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Assets.Data;
|
||||
namespace Socialize.Api.Modules.Assets.Data;
|
||||
|
||||
public class AssetRevision
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Clients.Data;
|
||||
namespace Socialize.Api.Modules.Clients.Data;
|
||||
|
||||
public class Client
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Socialize.Modules.Clients.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Socialize.Api.Modules.Clients.Data;
|
||||
|
||||
public static class ClientModelConfiguration
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Comments.Data;
|
||||
namespace Socialize.Api.Modules.Comments.Data;
|
||||
|
||||
public class Comment
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Socialize.Modules.Comments.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Socialize.Api.Modules.Comments.Data;
|
||||
|
||||
public static class CommentModelConfiguration
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.ContentItems.Data;
|
||||
namespace Socialize.Api.Modules.ContentItems.Data;
|
||||
|
||||
public class ContentItem
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Socialize.Modules.ContentItems.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Socialize.Api.Modules.ContentItems.Data;
|
||||
|
||||
public static class ContentItemModelConfiguration
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.ContentItems.Data;
|
||||
namespace Socialize.Api.Modules.ContentItems.Data;
|
||||
|
||||
public class ContentItemRevision
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Identity.Configuration;
|
||||
namespace Socialize.Api.Modules.Identity.Configuration;
|
||||
|
||||
public record JwtOptions
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Identity.Contracts;
|
||||
namespace Socialize.Api.Modules.Identity.Contracts;
|
||||
|
||||
public interface IUserLookup
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Identity.Contracts;
|
||||
namespace Socialize.Api.Modules.Identity.Contracts;
|
||||
|
||||
public static class KnownRoles
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Identity.Contracts;
|
||||
namespace Socialize.Api.Modules.Identity.Contracts;
|
||||
|
||||
public record UserReference(
|
||||
Guid Id,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Socialize.Modules.Identity.Data;
|
||||
namespace Socialize.Api.Modules.Identity.Data;
|
||||
|
||||
public class Role : IdentityRole<Guid>
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Identity.Models;
|
||||
namespace Socialize.Api.Modules.Identity.Models;
|
||||
|
||||
public class Result(
|
||||
bool succeeded,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Identity.Models;
|
||||
namespace Socialize.Api.Modules.Identity.Models;
|
||||
|
||||
public class RoleModel
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Identity.Models;
|
||||
namespace Socialize.Api.Modules.Identity.Models;
|
||||
|
||||
public class UserDto
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Identity.Models;
|
||||
namespace Socialize.Api.Modules.Identity.Models;
|
||||
|
||||
public class UserModel
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Notifications.Contracts;
|
||||
namespace Socialize.Api.Modules.Notifications.Contracts;
|
||||
|
||||
public record NotificationEventWriteModel(
|
||||
Guid WorkspaceId,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Notifications.Data;
|
||||
namespace Socialize.Api.Modules.Notifications.Data;
|
||||
|
||||
public class NotificationEvent
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Socialize.Modules.Notifications.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Socialize.Api.Modules.Notifications.Data;
|
||||
|
||||
public static class NotificationModelConfiguration
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Projects.Data;
|
||||
namespace Socialize.Api.Modules.Projects.Data;
|
||||
|
||||
public class Project
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Socialize.Modules.Projects.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Socialize.Api.Modules.Projects.Data;
|
||||
|
||||
public static class ProjectModelConfiguration
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Workspaces.Data;
|
||||
namespace Socialize.Api.Modules.Workspaces.Data;
|
||||
|
||||
public class Workspace
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Socialize.Modules.Workspaces.Data;
|
||||
namespace Socialize.Api.Modules.Workspaces.Data;
|
||||
|
||||
public class WorkspaceInvite
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Socialize.Modules.Workspaces.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Socialize.Api.Modules.Workspaces.Data;
|
||||
|
||||
public static class WorkspaceModelConfiguration
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user