fix(backend): make API types internal
This commit is contained in:
@@ -11,7 +11,7 @@ using Microsoft.IdentityModel.Tokens;
|
|||||||
|
|
||||||
namespace Socialize;
|
namespace Socialize;
|
||||||
|
|
||||||
public static class ApplicationRegistration
|
internal static class ApplicationRegistration
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddWebServices(this IServiceCollection services)
|
public static IServiceCollection AddWebServices(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Common.Domain;
|
namespace Socialize.Api.Common.Domain;
|
||||||
|
|
||||||
public abstract class Entity
|
internal abstract class Entity
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid CreatedBy { get; init; }
|
public Guid CreatedBy { get; init; }
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ using Socialize.Api.Modules.Workspaces.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Data;
|
namespace Socialize.Api.Data;
|
||||||
|
|
||||||
public class AppDbContext(
|
internal class AppDbContext(
|
||||||
DbContextOptions<AppDbContext> options)
|
DbContextOptions<AppDbContext> options)
|
||||||
: IdentityDbContext<User, Role, Guid>(options)
|
: IdentityDbContext<User, Role, Guid>(options)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Infrastructure.BlobStorage.Configuration;
|
namespace Socialize.Api.Infrastructure.BlobStorage.Configuration;
|
||||||
|
|
||||||
public sealed class LocalBlobStorageOptions
|
internal sealed class LocalBlobStorageOptions
|
||||||
{
|
{
|
||||||
public const string SectionName = "LocalBlobStorage";
|
public const string SectionName = "LocalBlobStorage";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
||||||
|
|
||||||
public static class CommonFileNames
|
internal static class CommonFileNames
|
||||||
{
|
{
|
||||||
public const string ProfilePicture = "profilePicture";
|
public const string ProfilePicture = "profilePicture";
|
||||||
public const string LogoPicture = "logoPicture";
|
public const string LogoPicture = "logoPicture";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
||||||
|
|
||||||
public static class ContentTypes
|
internal static class ContentTypes
|
||||||
{
|
{
|
||||||
private const string ImagePng = "image/png";
|
private const string ImagePng = "image/png";
|
||||||
private const string ImageJpeg = "image/jpeg";
|
private const string ImageJpeg = "image/jpeg";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
||||||
|
|
||||||
public interface IBlobStorage
|
internal interface IBlobStorage
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Upload a file to blob storage.
|
/// Upload a file to blob storage.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
||||||
|
|
||||||
public static class SubDirectoryNames
|
internal static class SubDirectoryNames
|
||||||
{
|
{
|
||||||
public const string Profile = "profile";
|
public const string Profile = "profile";
|
||||||
public const string Contents = "contents";
|
public const string Contents = "contents";
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.BlobStorage.Services;
|
namespace Socialize.Api.Infrastructure.BlobStorage.Services;
|
||||||
|
|
||||||
public sealed class LocalBlobStorage(
|
internal sealed class LocalBlobStorage(
|
||||||
IWebHostEnvironment environment,
|
IWebHostEnvironment environment,
|
||||||
IHttpContextAccessor httpContextAccessor,
|
IHttpContextAccessor httpContextAccessor,
|
||||||
IOptions<LocalBlobStorageOptions> options,
|
IOptions<LocalBlobStorageOptions> options,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Infrastructure.Configuration;
|
namespace Socialize.Api.Infrastructure.Configuration;
|
||||||
|
|
||||||
public class WebsiteOptions
|
internal class WebsiteOptions
|
||||||
{
|
{
|
||||||
public const string SectionName = "Website";
|
public const string SectionName = "Website";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Infrastructure.Emailer.Configuration;
|
namespace Socialize.Api.Infrastructure.Emailer.Configuration;
|
||||||
|
|
||||||
public class EmailerOptions
|
internal class EmailerOptions
|
||||||
{
|
{
|
||||||
public const string ConfigurationSection = "Emailer";
|
public const string ConfigurationSection = "Emailer";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Infrastructure.Emailer.Contracts;
|
namespace Socialize.Api.Infrastructure.Emailer.Contracts;
|
||||||
|
|
||||||
public interface IEmailSender
|
internal interface IEmailSender
|
||||||
{
|
{
|
||||||
Task SendEmailAsync(string email, string subject, string message);
|
Task SendEmailAsync(string email, string subject, string message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Socialize.Api.Infrastructure.Emailer.Contracts;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.Emailer.Services;
|
namespace Socialize.Api.Infrastructure.Emailer.Services;
|
||||||
|
|
||||||
public class LoggerEmailSender(ILogger<IEmailSender> logger)
|
internal class LoggerEmailSender(ILogger<IEmailSender> logger)
|
||||||
: IEmailSender
|
: IEmailSender
|
||||||
{
|
{
|
||||||
public Task SendEmailAsync(string email, string subject, string message)
|
public Task SendEmailAsync(string email, string subject, string message)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using PostmarkDotNet;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.Emailer.Services;
|
namespace Socialize.Api.Infrastructure.Emailer.Services;
|
||||||
|
|
||||||
public class PostmarkEmailSender : IEmailSender
|
internal class PostmarkEmailSender : IEmailSender
|
||||||
{
|
{
|
||||||
private readonly PostmarkClient _client;
|
private readonly PostmarkClient _client;
|
||||||
private readonly EmailerOptions _options;
|
private readonly EmailerOptions _options;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using Microsoft.Extensions.Options;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.Emailer.Services;
|
namespace Socialize.Api.Infrastructure.Emailer.Services;
|
||||||
|
|
||||||
public class ResendEmailSender : IEmailSender
|
internal class ResendEmailSender : IEmailSender
|
||||||
{
|
{
|
||||||
private static readonly Uri EndpointUri = new("https://api.resend.com/emails");
|
private static readonly Uri EndpointUri = new("https://api.resend.com/emails");
|
||||||
private readonly HttpClient _httpClient;
|
private readonly HttpClient _httpClient;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using Socialize.Api.Infrastructure.Payments.Stripe.Configuration;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure;
|
namespace Socialize.Api.Infrastructure;
|
||||||
|
|
||||||
public static class InfrastructureRegistration
|
internal static class InfrastructureRegistration
|
||||||
{
|
{
|
||||||
public static WebApplicationBuilder AddInfrastructureModule(
|
public static WebApplicationBuilder AddInfrastructureModule(
|
||||||
this WebApplicationBuilder builder)
|
this WebApplicationBuilder builder)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.Payments.Stripe.Configuration;
|
namespace Socialize.Api.Infrastructure.Payments.Stripe.Configuration;
|
||||||
|
|
||||||
public class StripeOptions
|
internal class StripeOptions
|
||||||
{
|
{
|
||||||
public const string ConfigurationSection = "Stripe";
|
public const string ConfigurationSection = "Stripe";
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using Socialize.Api.Modules.Organizations.Services;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.Security;
|
namespace Socialize.Api.Infrastructure.Security;
|
||||||
|
|
||||||
public sealed class AccessScopeService(
|
internal sealed class AccessScopeService(
|
||||||
OrganizationAccessService organizationAccessService)
|
OrganizationAccessService organizationAccessService)
|
||||||
{
|
{
|
||||||
public bool IsManager(ClaimsPrincipal user)
|
public bool IsManager(ClaimsPrincipal user)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.Security;
|
namespace Socialize.Api.Infrastructure.Security;
|
||||||
|
|
||||||
public static class ClaimsPrincipalExtensions
|
internal static class ClaimsPrincipalExtensions
|
||||||
{
|
{
|
||||||
public static IReadOnlyCollection<Guid> GetScopeIds(this ClaimsPrincipal claims, string key)
|
public static IReadOnlyCollection<Guid> GetScopeIds(this ClaimsPrincipal claims, string key)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using Microsoft.IdentityModel.Tokens;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.Security;
|
namespace Socialize.Api.Infrastructure.Security;
|
||||||
|
|
||||||
public static class JwtTokenHelper
|
internal static class JwtTokenHelper
|
||||||
{
|
{
|
||||||
public static string GenerateJwtToken(
|
public static string GenerateJwtToken(
|
||||||
TimeSpan expiresIn,
|
TimeSpan expiresIn,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Infrastructure.Security;
|
namespace Socialize.Api.Infrastructure.Security;
|
||||||
|
|
||||||
public static class KnownClaims
|
internal static class KnownClaims
|
||||||
{
|
{
|
||||||
public const string Alias = "alias";
|
public const string Alias = "alias";
|
||||||
public const string PortraitUrl = "portraitUrl";
|
public const string PortraitUrl = "portraitUrl";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
namespace Socialize.Api.Infrastructure.Security;
|
namespace Socialize.Api.Infrastructure.Security;
|
||||||
|
|
||||||
public class MissingClaimException(
|
internal class MissingClaimException(
|
||||||
string claimName)
|
string claimName)
|
||||||
: Exception($"Claim '{claimName}' is missing.");
|
: Exception($"Claim '{claimName}' is missing.");
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using System.Text;
|
|||||||
namespace Socialize.Api.Infrastructure.Security;
|
namespace Socialize.Api.Infrastructure.Security;
|
||||||
|
|
||||||
// If we need to add special characters we can alternate between 2 pools.
|
// If we need to add special characters we can alternate between 2 pools.
|
||||||
public static class PasswordGenerator
|
internal static class PasswordGenerator
|
||||||
{
|
{
|
||||||
private const string LowerLetters = "abcdefghijklmnopqrstuvwxyz";
|
private const string LowerLetters = "abcdefghijklmnopqrstuvwxyz";
|
||||||
private const string UpperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
private const string UpperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Security.Cryptography;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.Security;
|
namespace Socialize.Api.Infrastructure.Security;
|
||||||
|
|
||||||
public static class RefreshTokenGenerator
|
internal static class RefreshTokenGenerator
|
||||||
{
|
{
|
||||||
public static string Next()
|
public static string Next()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ using Microsoft.AspNetCore.Identity;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.TestData;
|
namespace Socialize.Api.Infrastructure.TestData;
|
||||||
|
|
||||||
public static class TestDataSeedExtensions
|
internal static class TestDataSeedExtensions
|
||||||
{
|
{
|
||||||
private static readonly Guid OrganizationId = Guid.Parse("99999999-9999-9999-9999-999999999999");
|
private static readonly Guid OrganizationId = Guid.Parse("99999999-9999-9999-9999-999999999999");
|
||||||
private static readonly Guid WorkspaceId = Guid.Parse("11111111-1111-1111-1111-111111111111");
|
private static readonly Guid WorkspaceId = Guid.Parse("11111111-1111-1111-1111-111111111111");
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Text.RegularExpressions;
|
|||||||
|
|
||||||
namespace Socialize.Api.Infrastructure.YouTube;
|
namespace Socialize.Api.Infrastructure.YouTube;
|
||||||
|
|
||||||
public static class YouTubeUrlHelper
|
internal static class YouTubeUrlHelper
|
||||||
{
|
{
|
||||||
private static readonly Regex VideoIdRegex = new(
|
private static readonly Regex VideoIdRegex = new(
|
||||||
@"(?:youtube\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^""&?/\s]{11})",
|
@"(?:youtube\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^""&?/\s]{11})",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace Socialize.Api.Migrations
|
namespace Socialize.Api.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class Initial : Migration
|
internal partial class Initial : Migration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Approvals.Data;
|
namespace Socialize.Api.Modules.Approvals.Data;
|
||||||
|
|
||||||
public class ApprovalDecision
|
internal class ApprovalDecision
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid ApprovalRequestId { get; set; }
|
public Guid ApprovalRequestId { get; set; }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Approvals.Data;
|
namespace Socialize.Api.Modules.Approvals.Data;
|
||||||
|
|
||||||
public static class ApprovalModelConfiguration
|
internal static class ApprovalModelConfiguration
|
||||||
{
|
{
|
||||||
public static ModelBuilder ConfigureApprovalsModule(this ModelBuilder modelBuilder)
|
public static ModelBuilder ConfigureApprovalsModule(this ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Approvals.Data;
|
namespace Socialize.Api.Modules.Approvals.Data;
|
||||||
|
|
||||||
public class ApprovalRequest
|
internal class ApprovalRequest
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid WorkspaceId { get; set; }
|
public Guid WorkspaceId { get; set; }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Approvals.Data;
|
namespace Socialize.Api.Modules.Approvals.Data;
|
||||||
|
|
||||||
public class ApprovalWorkflowInstance
|
internal class ApprovalWorkflowInstance
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid WorkspaceId { get; set; }
|
public Guid WorkspaceId { get; set; }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Approvals.Data;
|
namespace Socialize.Api.Modules.Approvals.Data;
|
||||||
|
|
||||||
public class WorkspaceApprovalStepConfiguration
|
internal class WorkspaceApprovalStepConfiguration
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid WorkspaceId { get; set; }
|
public Guid WorkspaceId { get; set; }
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ using Socialize.Api.Infrastructure.Security;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Approvals.Handlers;
|
namespace Socialize.Api.Modules.Approvals.Handlers;
|
||||||
|
|
||||||
public record GetApprovalsRequest(Guid ContentItemId);
|
internal record GetApprovalsRequest(Guid ContentItemId);
|
||||||
|
|
||||||
public record ApprovalDecisionDto(
|
internal record ApprovalDecisionDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
Guid ApprovalRequestId,
|
Guid ApprovalRequestId,
|
||||||
string Decision,
|
string Decision,
|
||||||
@@ -20,7 +20,7 @@ public record ApprovalDecisionDto(
|
|||||||
string? DecidedByPortraitUrl,
|
string? DecidedByPortraitUrl,
|
||||||
DateTimeOffset CreatedAt);
|
DateTimeOffset CreatedAt);
|
||||||
|
|
||||||
public record ApprovalRequestDto(
|
internal record ApprovalRequestDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
Guid ContentItemId,
|
Guid ContentItemId,
|
||||||
@@ -40,7 +40,7 @@ public record ApprovalRequestDto(
|
|||||||
DateTimeOffset? CompletedAt,
|
DateTimeOffset? CompletedAt,
|
||||||
IReadOnlyCollection<ApprovalDecisionDto> Decisions);
|
IReadOnlyCollection<ApprovalDecisionDto> Decisions);
|
||||||
|
|
||||||
public class GetApprovalsHandler(
|
internal class GetApprovalsHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<GetApprovalsRequest, IReadOnlyCollection<ApprovalRequestDto>>
|
: Endpoint<GetApprovalsRequest, IReadOnlyCollection<ApprovalRequestDto>>
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ using System.Text.Json;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Approvals.Handlers;
|
namespace Socialize.Api.Modules.Approvals.Handlers;
|
||||||
|
|
||||||
public record SubmitApprovalDecisionRequest(
|
internal record SubmitApprovalDecisionRequest(
|
||||||
string Decision,
|
string Decision,
|
||||||
string? ReviewerName,
|
string? ReviewerName,
|
||||||
string? ReviewerEmail);
|
string? ReviewerEmail);
|
||||||
|
|
||||||
public class SubmitApprovalDecisionRequestValidator
|
internal class SubmitApprovalDecisionRequestValidator
|
||||||
: Validator<SubmitApprovalDecisionRequest>
|
: Validator<SubmitApprovalDecisionRequest>
|
||||||
{
|
{
|
||||||
public SubmitApprovalDecisionRequestValidator()
|
public SubmitApprovalDecisionRequestValidator()
|
||||||
@@ -31,7 +31,7 @@ public class SubmitApprovalDecisionRequestValidator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SubmitApprovalDecisionHandler(
|
internal class SubmitApprovalDecisionHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService,
|
AccessScopeService accessScopeService,
|
||||||
ApprovalWorkflowRuntimeService approvalWorkflowRuntimeService,
|
ApprovalWorkflowRuntimeService approvalWorkflowRuntimeService,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Socialize.Api.Modules.Approvals.Services;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Approvals;
|
namespace Socialize.Api.Modules.Approvals;
|
||||||
|
|
||||||
public static class ModuleRegistration
|
internal static class ModuleRegistration
|
||||||
{
|
{
|
||||||
public static WebApplicationBuilder AddApprovalsModule(
|
public static WebApplicationBuilder AddApprovalsModule(
|
||||||
this WebApplicationBuilder builder)
|
this WebApplicationBuilder builder)
|
||||||
|
|||||||
@@ -2,20 +2,20 @@ using Socialize.Api.Modules.Identity.Contracts;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Approvals.Services;
|
namespace Socialize.Api.Modules.Approvals.Services;
|
||||||
|
|
||||||
public static class ApprovalStepTargetTypes
|
internal static class ApprovalStepTargetTypes
|
||||||
{
|
{
|
||||||
public const string Role = "Role";
|
public const string Role = "Role";
|
||||||
public const string Membership = "Membership";
|
public const string Membership = "Membership";
|
||||||
public const string Member = "Member";
|
public const string Member = "Member";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ApprovalMembershipTargets
|
internal static class ApprovalMembershipTargets
|
||||||
{
|
{
|
||||||
public const string Team = "Team";
|
public const string Team = "Team";
|
||||||
public const string Client = "Client";
|
public const string Client = "Client";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ApprovalStepConfigurationRules
|
internal static class ApprovalStepConfigurationRules
|
||||||
{
|
{
|
||||||
public static readonly IReadOnlySet<string> AllowedTargetTypes = new HashSet<string>(StringComparer.Ordinal)
|
public static readonly IReadOnlySet<string> AllowedTargetTypes = new HashSet<string>(StringComparer.Ordinal)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Socialize.Api.Modules.Identity.Contracts;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Approvals.Services;
|
namespace Socialize.Api.Modules.Approvals.Services;
|
||||||
|
|
||||||
public static class ApprovalModes
|
internal static class ApprovalModes
|
||||||
{
|
{
|
||||||
public const string None = "None";
|
public const string None = "None";
|
||||||
public const string Optional = "Optional";
|
public const string Optional = "Optional";
|
||||||
@@ -10,7 +10,7 @@ public static class ApprovalModes
|
|||||||
public const string MultiLevel = "Multi-level";
|
public const string MultiLevel = "Multi-level";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ApprovalWorkflowRules
|
internal static class ApprovalWorkflowRules
|
||||||
{
|
{
|
||||||
public static bool BlocksManualApprovedOrScheduledStatus(string approvalMode)
|
public static bool BlocksManualApprovedOrScheduledStatus(string approvalMode)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ using Socialize.Api.Modules.Workspaces.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Approvals.Services;
|
namespace Socialize.Api.Modules.Approvals.Services;
|
||||||
|
|
||||||
public record ApprovalWorkflowStartResult(bool Succeeded, string? ErrorMessage);
|
internal record ApprovalWorkflowStartResult(bool Succeeded, string? ErrorMessage);
|
||||||
|
|
||||||
public record ApprovalWorkflowDecisionResult(
|
internal record ApprovalWorkflowDecisionResult(
|
||||||
bool Succeeded,
|
bool Succeeded,
|
||||||
string? ErrorMessage,
|
string? ErrorMessage,
|
||||||
int StatusCode,
|
int StatusCode,
|
||||||
bool IsWorkflowStep);
|
bool IsWorkflowStep);
|
||||||
|
|
||||||
public class ApprovalWorkflowRuntimeService(
|
internal class ApprovalWorkflowRuntimeService(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
INotificationEventWriter notificationEventWriter)
|
INotificationEventWriter notificationEventWriter)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Assets.Data;
|
namespace Socialize.Api.Modules.Assets.Data;
|
||||||
|
|
||||||
public class Asset
|
internal class Asset
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid WorkspaceId { get; set; }
|
public Guid WorkspaceId { get; set; }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Assets.Data;
|
namespace Socialize.Api.Modules.Assets.Data;
|
||||||
|
|
||||||
public static class AssetModelConfiguration
|
internal static class AssetModelConfiguration
|
||||||
{
|
{
|
||||||
public static ModelBuilder ConfigureAssetsModule(this ModelBuilder modelBuilder)
|
public static ModelBuilder ConfigureAssetsModule(this ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Assets.Data;
|
namespace Socialize.Api.Modules.Assets.Data;
|
||||||
|
|
||||||
public class AssetRevision
|
internal class AssetRevision
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid AssetId { get; set; }
|
public Guid AssetId { get; set; }
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ using System.Text.Json;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Assets.Handlers;
|
namespace Socialize.Api.Modules.Assets.Handlers;
|
||||||
|
|
||||||
public record CreateAssetRevisionRequest(
|
internal record CreateAssetRevisionRequest(
|
||||||
string SourceReference,
|
string SourceReference,
|
||||||
string? PreviewUrl,
|
string? PreviewUrl,
|
||||||
string? Notes);
|
string? Notes);
|
||||||
|
|
||||||
public class CreateAssetRevisionRequestValidator
|
internal class CreateAssetRevisionRequestValidator
|
||||||
: Validator<CreateAssetRevisionRequest>
|
: Validator<CreateAssetRevisionRequest>
|
||||||
{
|
{
|
||||||
public CreateAssetRevisionRequestValidator()
|
public CreateAssetRevisionRequestValidator()
|
||||||
@@ -26,7 +26,7 @@ public class CreateAssetRevisionRequestValidator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateAssetRevisionHandler(
|
internal class CreateAssetRevisionHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService,
|
AccessScopeService accessScopeService,
|
||||||
IContentItemActivityWriter activityWriter,
|
IContentItemActivityWriter activityWriter,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ using System.Text.Json;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Assets.Handlers;
|
namespace Socialize.Api.Modules.Assets.Handlers;
|
||||||
|
|
||||||
public record CreateGoogleDriveAssetRequest(
|
internal record CreateGoogleDriveAssetRequest(
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
Guid ContentItemId,
|
Guid ContentItemId,
|
||||||
string AssetType,
|
string AssetType,
|
||||||
@@ -19,7 +19,7 @@ public record CreateGoogleDriveAssetRequest(
|
|||||||
string GoogleDriveLink,
|
string GoogleDriveLink,
|
||||||
string? PreviewUrl);
|
string? PreviewUrl);
|
||||||
|
|
||||||
public class CreateGoogleDriveAssetRequestValidator
|
internal class CreateGoogleDriveAssetRequestValidator
|
||||||
: Validator<CreateGoogleDriveAssetRequest>
|
: Validator<CreateGoogleDriveAssetRequest>
|
||||||
{
|
{
|
||||||
public CreateGoogleDriveAssetRequestValidator()
|
public CreateGoogleDriveAssetRequestValidator()
|
||||||
@@ -34,7 +34,7 @@ public class CreateGoogleDriveAssetRequestValidator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateGoogleDriveAssetHandler(
|
internal class CreateGoogleDriveAssetHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService,
|
AccessScopeService accessScopeService,
|
||||||
IContentItemActivityWriter activityWriter,
|
IContentItemActivityWriter activityWriter,
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ using Socialize.Api.Infrastructure.Security;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Assets.Handlers;
|
namespace Socialize.Api.Modules.Assets.Handlers;
|
||||||
|
|
||||||
public record GetAssetsRequest(Guid ContentItemId);
|
internal record GetAssetsRequest(Guid ContentItemId);
|
||||||
|
|
||||||
public record AssetRevisionDto(
|
internal record AssetRevisionDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
Guid AssetId,
|
Guid AssetId,
|
||||||
int RevisionNumber,
|
int RevisionNumber,
|
||||||
@@ -17,7 +17,7 @@ public record AssetRevisionDto(
|
|||||||
Guid? CreatedByUserId,
|
Guid? CreatedByUserId,
|
||||||
DateTimeOffset CreatedAt);
|
DateTimeOffset CreatedAt);
|
||||||
|
|
||||||
public record AssetDto(
|
internal record AssetDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
Guid ContentItemId,
|
Guid ContentItemId,
|
||||||
@@ -31,7 +31,7 @@ public record AssetDto(
|
|||||||
DateTimeOffset CreatedAt,
|
DateTimeOffset CreatedAt,
|
||||||
IReadOnlyCollection<AssetRevisionDto> Revisions);
|
IReadOnlyCollection<AssetRevisionDto> Revisions);
|
||||||
|
|
||||||
public class GetAssetsHandler(
|
internal class GetAssetsHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<GetAssetsRequest, IReadOnlyCollection<AssetDto>>
|
: Endpoint<GetAssetsRequest, IReadOnlyCollection<AssetDto>>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Socialize.Api.Modules.Assets.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Assets;
|
namespace Socialize.Api.Modules.Assets;
|
||||||
|
|
||||||
public static class ModuleRegistration
|
internal static class ModuleRegistration
|
||||||
{
|
{
|
||||||
public static WebApplicationBuilder AddAssetsModule(
|
public static WebApplicationBuilder AddAssetsModule(
|
||||||
this WebApplicationBuilder builder)
|
this WebApplicationBuilder builder)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
||||||
|
|
||||||
public class CalendarCatalogEntry
|
internal class CalendarCatalogEntry
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public required string Title { get; set; }
|
public required string Title { get; set; }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
||||||
|
|
||||||
public static class CalendarCatalogSeed
|
internal static class CalendarCatalogSeed
|
||||||
{
|
{
|
||||||
public static readonly CalendarCatalogEntry[] Entries =
|
public static readonly CalendarCatalogEntry[] Entries =
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
||||||
|
|
||||||
public class CalendarEvent
|
internal class CalendarEvent
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid CalendarSourceId { get; set; }
|
public Guid CalendarSourceId { get; set; }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
||||||
|
|
||||||
public class CalendarSource
|
internal class CalendarSource
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public required string Scope { get; set; }
|
public required string Scope { get; set; }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
||||||
|
|
||||||
public static class CalendarSourceModelConfiguration
|
internal static class CalendarSourceModelConfiguration
|
||||||
{
|
{
|
||||||
public static ModelBuilder ConfigureCalendarIntegrationsModule(this ModelBuilder modelBuilder)
|
public static ModelBuilder ConfigureCalendarIntegrationsModule(this ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Data;
|
||||||
|
|
||||||
public class UserCalendarExportFeed
|
internal class UserCalendarExportFeed
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid UserId { get; set; }
|
public Guid UserId { get; set; }
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using Socialize.Api.Modules.CalendarIntegrations.Services;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
||||||
|
|
||||||
public record CalendarSourceDto(
|
internal record CalendarSourceDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
string Scope,
|
string Scope,
|
||||||
Guid? OrganizationId,
|
Guid? OrganizationId,
|
||||||
@@ -47,7 +47,7 @@ public record CalendarSourceDto(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public record UpsertCalendarSourceRequest(
|
internal record UpsertCalendarSourceRequest(
|
||||||
string Scope,
|
string Scope,
|
||||||
Guid? OrganizationId,
|
Guid? OrganizationId,
|
||||||
Guid? WorkspaceId,
|
Guid? WorkspaceId,
|
||||||
@@ -59,7 +59,7 @@ public record UpsertCalendarSourceRequest(
|
|||||||
bool IsEnabled,
|
bool IsEnabled,
|
||||||
string? InheritanceMode);
|
string? InheritanceMode);
|
||||||
|
|
||||||
public class UpsertCalendarSourceRequestValidator
|
internal class UpsertCalendarSourceRequestValidator
|
||||||
: FastEndpoints.Validator<UpsertCalendarSourceRequest>
|
: FastEndpoints.Validator<UpsertCalendarSourceRequest>
|
||||||
{
|
{
|
||||||
public UpsertCalendarSourceRequestValidator()
|
public UpsertCalendarSourceRequestValidator()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Socialize.Api.Modules.Organizations.Services;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
||||||
|
|
||||||
public class CreateCalendarSourceHandler(
|
internal class CreateCalendarSourceHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService,
|
AccessScopeService accessScopeService,
|
||||||
OrganizationAccessService organizationAccessService)
|
OrganizationAccessService organizationAccessService)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Socialize.Api.Modules.Organizations.Services;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
||||||
|
|
||||||
public class DeleteCalendarSourceHandler(
|
internal class DeleteCalendarSourceHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService,
|
AccessScopeService accessScopeService,
|
||||||
OrganizationAccessService organizationAccessService)
|
OrganizationAccessService organizationAccessService)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using Socialize.Api.Modules.CalendarIntegrations.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
||||||
|
|
||||||
public sealed class ListCalendarCatalogRequest
|
internal sealed class ListCalendarCatalogRequest
|
||||||
{
|
{
|
||||||
public string? Search { get; set; }
|
public string? Search { get; set; }
|
||||||
public string? Country { get; set; }
|
public string? Country { get; set; }
|
||||||
@@ -16,7 +16,7 @@ public sealed class ListCalendarCatalogRequest
|
|||||||
public string? Provider { get; set; }
|
public string? Provider { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public record CalendarCatalogEntryDto(
|
internal record CalendarCatalogEntryDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
string Title,
|
string Title,
|
||||||
string Description,
|
string Description,
|
||||||
@@ -30,7 +30,7 @@ public record CalendarCatalogEntryDto(
|
|||||||
string TrustLevel,
|
string TrustLevel,
|
||||||
string DefaultColor);
|
string DefaultColor);
|
||||||
|
|
||||||
public class ListCalendarCatalogHandler(AppDbContext dbContext)
|
internal class ListCalendarCatalogHandler(AppDbContext dbContext)
|
||||||
: Endpoint<ListCalendarCatalogRequest, IReadOnlyCollection<CalendarCatalogEntryDto>>
|
: Endpoint<ListCalendarCatalogRequest, IReadOnlyCollection<CalendarCatalogEntryDto>>
|
||||||
{
|
{
|
||||||
public override void Configure()
|
public override void Configure()
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ using Socialize.Api.Modules.CalendarIntegrations.Services;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
||||||
|
|
||||||
public sealed class ListCalendarEventsRequest
|
internal sealed class ListCalendarEventsRequest
|
||||||
{
|
{
|
||||||
public Guid? WorkspaceId { get; set; }
|
public Guid? WorkspaceId { get; set; }
|
||||||
public DateOnly? StartDate { get; set; }
|
public DateOnly? StartDate { get; set; }
|
||||||
public DateOnly? EndDate { get; set; }
|
public DateOnly? EndDate { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public record CalendarEventDto(
|
internal record CalendarEventDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
Guid CalendarSourceId,
|
Guid CalendarSourceId,
|
||||||
string SourceEventUid,
|
string SourceEventUid,
|
||||||
@@ -35,7 +35,7 @@ public record CalendarEventDto(
|
|||||||
DateTimeOffset? SourceLastModifiedAt,
|
DateTimeOffset? SourceLastModifiedAt,
|
||||||
DateTimeOffset ImportedAt);
|
DateTimeOffset ImportedAt);
|
||||||
|
|
||||||
public class ListCalendarEventsHandler(
|
internal class ListCalendarEventsHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<ListCalendarEventsRequest, IReadOnlyCollection<CalendarEventDto>>
|
: Endpoint<ListCalendarEventsRequest, IReadOnlyCollection<CalendarEventDto>>
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ using Socialize.Api.Modules.CalendarIntegrations.Services;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
||||||
|
|
||||||
public record ListCalendarSourcesRequest(Guid? WorkspaceId);
|
internal record ListCalendarSourcesRequest(Guid? WorkspaceId);
|
||||||
|
|
||||||
public class ListCalendarSourcesHandler(
|
internal class ListCalendarSourcesHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<ListCalendarSourcesRequest, IReadOnlyCollection<CalendarSourceDto>>
|
: Endpoint<ListCalendarSourcesRequest, IReadOnlyCollection<CalendarSourceDto>>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Socialize.Api.Modules.Organizations.Services;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
||||||
|
|
||||||
public class RefreshCalendarSourceHandler(
|
internal class RefreshCalendarSourceHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService,
|
AccessScopeService accessScopeService,
|
||||||
OrganizationAccessService organizationAccessService,
|
OrganizationAccessService organizationAccessService,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Socialize.Api.Modules.Organizations.Services;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
||||||
|
|
||||||
public class UpdateCalendarSourceHandler(
|
internal class UpdateCalendarSourceHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService,
|
AccessScopeService accessScopeService,
|
||||||
OrganizationAccessService organizationAccessService)
|
OrganizationAccessService organizationAccessService)
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ using Socialize.Api.Modules.Identity.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Handlers;
|
||||||
|
|
||||||
public record UserCalendarExportFeedDto(
|
internal record UserCalendarExportFeedDto(
|
||||||
bool IsEnabled,
|
bool IsEnabled,
|
||||||
string? FeedUrl,
|
string? FeedUrl,
|
||||||
DateTimeOffset? CreatedAt,
|
DateTimeOffset? CreatedAt,
|
||||||
DateTimeOffset? UpdatedAt,
|
DateTimeOffset? UpdatedAt,
|
||||||
DateTimeOffset? RevokedAt);
|
DateTimeOffset? RevokedAt);
|
||||||
|
|
||||||
public class GetUserCalendarExportFeedHandler(AppDbContext dbContext)
|
internal class GetUserCalendarExportFeedHandler(AppDbContext dbContext)
|
||||||
: EndpointWithoutRequest<UserCalendarExportFeedDto>
|
: EndpointWithoutRequest<UserCalendarExportFeedDto>
|
||||||
{
|
{
|
||||||
public override void Configure()
|
public override void Configure()
|
||||||
@@ -33,7 +33,7 @@ public class GetUserCalendarExportFeedHandler(AppDbContext dbContext)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EnableUserCalendarExportFeedHandler(AppDbContext dbContext)
|
internal class EnableUserCalendarExportFeedHandler(AppDbContext dbContext)
|
||||||
: EndpointWithoutRequest<UserCalendarExportFeedDto>
|
: EndpointWithoutRequest<UserCalendarExportFeedDto>
|
||||||
{
|
{
|
||||||
public override void Configure()
|
public override void Configure()
|
||||||
@@ -81,7 +81,7 @@ public class EnableUserCalendarExportFeedHandler(AppDbContext dbContext)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RegenerateUserCalendarExportFeedHandler(AppDbContext dbContext)
|
internal class RegenerateUserCalendarExportFeedHandler(AppDbContext dbContext)
|
||||||
: EndpointWithoutRequest<UserCalendarExportFeedDto>
|
: EndpointWithoutRequest<UserCalendarExportFeedDto>
|
||||||
{
|
{
|
||||||
public override void Configure()
|
public override void Configure()
|
||||||
@@ -120,7 +120,7 @@ public class RegenerateUserCalendarExportFeedHandler(AppDbContext dbContext)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RevokeUserCalendarExportFeedHandler(AppDbContext dbContext)
|
internal class RevokeUserCalendarExportFeedHandler(AppDbContext dbContext)
|
||||||
: EndpointWithoutRequest<UserCalendarExportFeedDto>
|
: EndpointWithoutRequest<UserCalendarExportFeedDto>
|
||||||
{
|
{
|
||||||
public override void Configure()
|
public override void Configure()
|
||||||
@@ -147,7 +147,7 @@ public class RevokeUserCalendarExportFeedHandler(AppDbContext dbContext)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetUserCalendarExportFeedIcsHandler(
|
internal class GetUserCalendarExportFeedIcsHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
CalendarExportFeedService feedService)
|
CalendarExportFeedService feedService)
|
||||||
: EndpointWithoutRequest
|
: EndpointWithoutRequest
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.CalendarIntegrations;
|
namespace Socialize.Api.Modules.CalendarIntegrations;
|
||||||
|
|
||||||
public static class ModuleRegistration
|
internal static class ModuleRegistration
|
||||||
{
|
{
|
||||||
public static WebApplicationBuilder AddCalendarIntegrationsModule(this WebApplicationBuilder builder)
|
public static WebApplicationBuilder AddCalendarIntegrationsModule(this WebApplicationBuilder builder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Text;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
||||||
|
|
||||||
public sealed record CalendarExportFeedEvent(
|
internal sealed record CalendarExportFeedEvent(
|
||||||
string Uid,
|
string Uid,
|
||||||
string Title,
|
string Title,
|
||||||
DateTimeOffset StartsAt,
|
DateTimeOffset StartsAt,
|
||||||
@@ -11,7 +11,7 @@ public sealed record CalendarExportFeedEvent(
|
|||||||
string? Description,
|
string? Description,
|
||||||
string? Url);
|
string? Url);
|
||||||
|
|
||||||
public class CalendarExportFeedBuilder
|
internal class CalendarExportFeedBuilder
|
||||||
{
|
{
|
||||||
public string Build(string calendarName, IReadOnlyCollection<CalendarExportFeedEvent> events)
|
public string Build(string calendarName, IReadOnlyCollection<CalendarExportFeedEvent> events)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using Socialize.Api.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
||||||
|
|
||||||
public class CalendarExportFeedService(AppDbContext dbContext, CalendarExportFeedBuilder feedBuilder)
|
internal class CalendarExportFeedService(AppDbContext dbContext, CalendarExportFeedBuilder feedBuilder)
|
||||||
{
|
{
|
||||||
public async Task<string> BuildUserFeedAsync(Guid userId, string? userEmail, string appBaseUrl, CancellationToken ct)
|
public async Task<string> BuildUserFeedAsync(Guid userId, string? userEmail, string appBaseUrl, CancellationToken ct)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Security.Cryptography;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
||||||
|
|
||||||
public static class CalendarExportFeedTokenService
|
internal static class CalendarExportFeedTokenService
|
||||||
{
|
{
|
||||||
public static string GenerateToken()
|
public static string GenerateToken()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
||||||
|
|
||||||
public sealed class CalendarImportBackgroundService(
|
internal sealed class CalendarImportBackgroundService(
|
||||||
IServiceScopeFactory scopeFactory,
|
IServiceScopeFactory scopeFactory,
|
||||||
ILogger<CalendarImportBackgroundService> logger)
|
ILogger<CalendarImportBackgroundService> logger)
|
||||||
: BackgroundService
|
: BackgroundService
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using System.Text.Json;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
||||||
|
|
||||||
public sealed class CalendarImportSyncService(
|
internal sealed class CalendarImportSyncService(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
IHttpClientFactory httpClientFactory,
|
IHttpClientFactory httpClientFactory,
|
||||||
IcsCalendarParser parser)
|
IcsCalendarParser parser)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
||||||
|
|
||||||
public static class CalendarSourceScopes
|
internal static class CalendarSourceScopes
|
||||||
{
|
{
|
||||||
public const string Organization = "Organization";
|
public const string Organization = "Organization";
|
||||||
public const string Workspace = "Workspace";
|
public const string Workspace = "Workspace";
|
||||||
public const string User = "User";
|
public const string User = "User";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CalendarSourceInheritanceModes
|
internal static class CalendarSourceInheritanceModes
|
||||||
{
|
{
|
||||||
public const string Required = "Required";
|
public const string Required = "Required";
|
||||||
public const string Optional = "Optional";
|
public const string Optional = "Optional";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Socialize.Api.Modules.CalendarIntegrations.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
||||||
|
|
||||||
public static class CalendarSourceRules
|
internal static class CalendarSourceRules
|
||||||
{
|
{
|
||||||
public static readonly string[] SupportedScopes =
|
public static readonly string[] SupportedScopes =
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Globalization;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
namespace Socialize.Api.Modules.CalendarIntegrations.Services;
|
||||||
|
|
||||||
public record ParsedCalendarEvent(
|
internal record ParsedCalendarEvent(
|
||||||
string SourceEventUid,
|
string SourceEventUid,
|
||||||
string Title,
|
string Title,
|
||||||
string? Description,
|
string? Description,
|
||||||
@@ -39,7 +39,7 @@ internal sealed record IcsRawEvent(
|
|||||||
string? SourceUrl,
|
string? SourceUrl,
|
||||||
DateTimeOffset? LastModifiedAt);
|
DateTimeOffset? LastModifiedAt);
|
||||||
|
|
||||||
public sealed class IcsCalendarParser
|
internal sealed class IcsCalendarParser
|
||||||
{
|
{
|
||||||
public IReadOnlyCollection<ParsedCalendarEvent> Parse(
|
public IReadOnlyCollection<ParsedCalendarEvent> Parse(
|
||||||
string content,
|
string content,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Campaigns.Data;
|
namespace Socialize.Api.Modules.Campaigns.Data;
|
||||||
|
|
||||||
public class Campaign
|
internal class Campaign
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid WorkspaceId { get; set; }
|
public Guid WorkspaceId { get; set; }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Campaigns.Data;
|
namespace Socialize.Api.Modules.Campaigns.Data;
|
||||||
|
|
||||||
public static class CampaignModelConfiguration
|
internal static class CampaignModelConfiguration
|
||||||
{
|
{
|
||||||
public static ModelBuilder ConfigureCampaignsModule(this ModelBuilder modelBuilder)
|
public static ModelBuilder ConfigureCampaignsModule(this ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Socialize.Api.Modules.Campaigns.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Campaigns.Handlers;
|
namespace Socialize.Api.Modules.Campaigns.Handlers;
|
||||||
|
|
||||||
public record CreateCampaignRequest(
|
internal record CreateCampaignRequest(
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
Guid ClientId,
|
Guid ClientId,
|
||||||
string Name,
|
string Name,
|
||||||
@@ -15,7 +15,7 @@ public record CreateCampaignRequest(
|
|||||||
string? Description,
|
string? Description,
|
||||||
string? Notes);
|
string? Notes);
|
||||||
|
|
||||||
public class CreateCampaignRequestValidator
|
internal class CreateCampaignRequestValidator
|
||||||
: Validator<CreateCampaignRequest>
|
: Validator<CreateCampaignRequest>
|
||||||
{
|
{
|
||||||
public CreateCampaignRequestValidator()
|
public CreateCampaignRequestValidator()
|
||||||
@@ -32,7 +32,7 @@ public class CreateCampaignRequestValidator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateCampaignHandler(
|
internal class CreateCampaignHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<CreateCampaignRequest, CampaignDto>
|
: Endpoint<CreateCampaignRequest, CampaignDto>
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ using Socialize.Api.Modules.Campaigns.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Campaigns.Handlers;
|
namespace Socialize.Api.Modules.Campaigns.Handlers;
|
||||||
|
|
||||||
public record GetCampaignsRequest(Guid? WorkspaceId, Guid? ClientId);
|
internal record GetCampaignsRequest(Guid? WorkspaceId, Guid? ClientId);
|
||||||
|
|
||||||
public record CampaignDto(
|
internal record CampaignDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
Guid ClientId,
|
Guid ClientId,
|
||||||
@@ -19,7 +19,7 @@ public record CampaignDto(
|
|||||||
DateTimeOffset StartDate,
|
DateTimeOffset StartDate,
|
||||||
DateTimeOffset EndDate);
|
DateTimeOffset EndDate);
|
||||||
|
|
||||||
public class GetCampaignsHandler(
|
internal class GetCampaignsHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<GetCampaignsRequest, IReadOnlyCollection<CampaignDto>>
|
: Endpoint<GetCampaignsRequest, IReadOnlyCollection<CampaignDto>>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Socialize.Api.Modules.Campaigns.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Campaigns;
|
namespace Socialize.Api.Modules.Campaigns;
|
||||||
|
|
||||||
public static class ModuleRegistration
|
internal static class ModuleRegistration
|
||||||
{
|
{
|
||||||
public static WebApplicationBuilder AddCampaignsModule(
|
public static WebApplicationBuilder AddCampaignsModule(
|
||||||
this WebApplicationBuilder builder)
|
this WebApplicationBuilder builder)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Channels.Data;
|
namespace Socialize.Api.Modules.Channels.Data;
|
||||||
|
|
||||||
public class Channel
|
internal class Channel
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid WorkspaceId { get; set; }
|
public Guid WorkspaceId { get; set; }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Channels.Data;
|
namespace Socialize.Api.Modules.Channels.Data;
|
||||||
|
|
||||||
public static class ChannelModelConfiguration
|
internal static class ChannelModelConfiguration
|
||||||
{
|
{
|
||||||
public static ModelBuilder ConfigureChannelsModule(this ModelBuilder modelBuilder)
|
public static ModelBuilder ConfigureChannelsModule(this ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Channels.Handlers;
|
namespace Socialize.Api.Modules.Channels.Handlers;
|
||||||
|
|
||||||
public record ChannelDto(
|
internal record ChannelDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
string Name,
|
string Name,
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ using Socialize.Api.Modules.Channels.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Channels.Handlers;
|
namespace Socialize.Api.Modules.Channels.Handlers;
|
||||||
|
|
||||||
public record CreateChannelRequest(
|
internal record CreateChannelRequest(
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
string Name,
|
string Name,
|
||||||
string Network,
|
string Network,
|
||||||
string? Handle,
|
string? Handle,
|
||||||
string? ExternalUrl);
|
string? ExternalUrl);
|
||||||
|
|
||||||
public class CreateChannelRequestValidator
|
internal class CreateChannelRequestValidator
|
||||||
: Validator<CreateChannelRequest>
|
: Validator<CreateChannelRequest>
|
||||||
{
|
{
|
||||||
private static readonly string[] AllowedNetworks =
|
private static readonly string[] AllowedNetworks =
|
||||||
@@ -39,7 +39,7 @@ public class CreateChannelRequestValidator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateChannelHandler(
|
internal class CreateChannelHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<CreateChannelRequest, ChannelDto>
|
: Endpoint<CreateChannelRequest, ChannelDto>
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ using Socialize.Api.Modules.Channels.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Channels.Handlers;
|
namespace Socialize.Api.Modules.Channels.Handlers;
|
||||||
|
|
||||||
public record GetChannelsRequest(Guid? WorkspaceId);
|
internal record GetChannelsRequest(Guid? WorkspaceId);
|
||||||
|
|
||||||
public class GetChannelsHandler(
|
internal class GetChannelsHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<GetChannelsRequest, IReadOnlyCollection<ChannelDto>>
|
: Endpoint<GetChannelsRequest, IReadOnlyCollection<ChannelDto>>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Channels;
|
namespace Socialize.Api.Modules.Channels;
|
||||||
|
|
||||||
public static class ModuleRegistration
|
internal static class ModuleRegistration
|
||||||
{
|
{
|
||||||
public static WebApplicationBuilder AddChannelsModule(
|
public static WebApplicationBuilder AddChannelsModule(
|
||||||
this WebApplicationBuilder builder)
|
this WebApplicationBuilder builder)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Clients.Data;
|
namespace Socialize.Api.Modules.Clients.Data;
|
||||||
|
|
||||||
public class Client
|
internal class Client
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid WorkspaceId { get; set; }
|
public Guid WorkspaceId { get; set; }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Clients.Data;
|
namespace Socialize.Api.Modules.Clients.Data;
|
||||||
|
|
||||||
public static class ClientModelConfiguration
|
internal static class ClientModelConfiguration
|
||||||
{
|
{
|
||||||
public static ModelBuilder ConfigureClientsModule(this ModelBuilder modelBuilder)
|
public static ModelBuilder ConfigureClientsModule(this ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ using Socialize.Api.Modules.Clients.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Clients.Handlers;
|
namespace Socialize.Api.Modules.Clients.Handlers;
|
||||||
|
|
||||||
public record ChangeClientPortraitRequest(
|
internal record ChangeClientPortraitRequest(
|
||||||
IFormFile File);
|
IFormFile File);
|
||||||
|
|
||||||
public record ChangeClientPortraitResponse(
|
internal record ChangeClientPortraitResponse(
|
||||||
string BlobUrl);
|
string BlobUrl);
|
||||||
|
|
||||||
public sealed class ChangeClientPortraitRequestValidator : Validator<ChangeClientPortraitRequest>
|
internal sealed class ChangeClientPortraitRequestValidator : Validator<ChangeClientPortraitRequest>
|
||||||
{
|
{
|
||||||
public ChangeClientPortraitRequestValidator()
|
public ChangeClientPortraitRequestValidator()
|
||||||
{
|
{
|
||||||
@@ -23,7 +23,7 @@ public sealed class ChangeClientPortraitRequestValidator : Validator<ChangeClien
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ChangeClientPortraitHandler(
|
internal class ChangeClientPortraitHandler(
|
||||||
AppDbContext clientsDbContext,
|
AppDbContext clientsDbContext,
|
||||||
IBlobStorage blobStorage,
|
IBlobStorage blobStorage,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Socialize.Api.Infrastructure.Security;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Clients.Handlers;
|
namespace Socialize.Api.Modules.Clients.Handlers;
|
||||||
|
|
||||||
public record CreateClientRequest(
|
internal record CreateClientRequest(
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
string Name,
|
string Name,
|
||||||
string? PortraitUrl,
|
string? PortraitUrl,
|
||||||
@@ -14,7 +14,7 @@ public record CreateClientRequest(
|
|||||||
string? PrimaryContactEmail,
|
string? PrimaryContactEmail,
|
||||||
string? PrimaryContactPortraitUrl);
|
string? PrimaryContactPortraitUrl);
|
||||||
|
|
||||||
public class CreateClientRequestValidator
|
internal class CreateClientRequestValidator
|
||||||
: Validator<CreateClientRequest>
|
: Validator<CreateClientRequest>
|
||||||
{
|
{
|
||||||
public CreateClientRequestValidator()
|
public CreateClientRequestValidator()
|
||||||
@@ -28,7 +28,7 @@ public class CreateClientRequestValidator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateClientHandler(
|
internal class CreateClientHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<CreateClientRequest, ClientDto>
|
: Endpoint<CreateClientRequest, ClientDto>
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ using Socialize.Api.Modules.Clients.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Clients.Handlers;
|
namespace Socialize.Api.Modules.Clients.Handlers;
|
||||||
|
|
||||||
public record GetClientsRequest(Guid? WorkspaceId);
|
internal record GetClientsRequest(Guid? WorkspaceId);
|
||||||
|
|
||||||
public record ClientDto(
|
internal record ClientDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
string Name,
|
string Name,
|
||||||
@@ -18,7 +18,7 @@ public record ClientDto(
|
|||||||
string? PrimaryContactEmail,
|
string? PrimaryContactEmail,
|
||||||
string? PrimaryContactPortraitUrl);
|
string? PrimaryContactPortraitUrl);
|
||||||
|
|
||||||
public class GetClientsHandler(
|
internal class GetClientsHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<GetClientsRequest, IReadOnlyCollection<ClientDto>>
|
: Endpoint<GetClientsRequest, IReadOnlyCollection<ClientDto>>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Socialize.Api.Modules.Clients.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Clients.Handlers;
|
namespace Socialize.Api.Modules.Clients.Handlers;
|
||||||
|
|
||||||
public record UpdateClientRequest(
|
internal record UpdateClientRequest(
|
||||||
string Name,
|
string Name,
|
||||||
string? PortraitUrl,
|
string? PortraitUrl,
|
||||||
string Status,
|
string Status,
|
||||||
@@ -14,7 +14,7 @@ public record UpdateClientRequest(
|
|||||||
string? PrimaryContactEmail,
|
string? PrimaryContactEmail,
|
||||||
string? PrimaryContactPortraitUrl);
|
string? PrimaryContactPortraitUrl);
|
||||||
|
|
||||||
public class UpdateClientRequestValidator
|
internal class UpdateClientRequestValidator
|
||||||
: Validator<UpdateClientRequest>
|
: Validator<UpdateClientRequest>
|
||||||
{
|
{
|
||||||
public UpdateClientRequestValidator()
|
public UpdateClientRequestValidator()
|
||||||
@@ -28,7 +28,7 @@ public class UpdateClientRequestValidator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UpdateClientHandler(
|
internal class UpdateClientHandler(
|
||||||
AppDbContext clientsDbContext,
|
AppDbContext clientsDbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<UpdateClientRequest, ClientDto>
|
: Endpoint<UpdateClientRequest, ClientDto>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Socialize.Api.Modules.Clients.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Clients;
|
namespace Socialize.Api.Modules.Clients;
|
||||||
|
|
||||||
public static class ModuleRegistration
|
internal static class ModuleRegistration
|
||||||
{
|
{
|
||||||
public static WebApplicationBuilder AddClientsModule(
|
public static WebApplicationBuilder AddClientsModule(
|
||||||
this WebApplicationBuilder builder)
|
this WebApplicationBuilder builder)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.Comments.Data;
|
namespace Socialize.Api.Modules.Comments.Data;
|
||||||
|
|
||||||
public class Comment
|
internal class Comment
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid WorkspaceId { get; set; }
|
public Guid WorkspaceId { get; set; }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Comments.Data;
|
namespace Socialize.Api.Modules.Comments.Data;
|
||||||
|
|
||||||
public static class CommentModelConfiguration
|
internal static class CommentModelConfiguration
|
||||||
{
|
{
|
||||||
public static ModelBuilder ConfigureCommentsModule(this ModelBuilder modelBuilder)
|
public static ModelBuilder ConfigureCommentsModule(this ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ using System.Text.Json;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Comments.Handlers;
|
namespace Socialize.Api.Modules.Comments.Handlers;
|
||||||
|
|
||||||
public record CreateCommentRequest(
|
internal record CreateCommentRequest(
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
Guid ContentItemId,
|
Guid ContentItemId,
|
||||||
Guid? ParentCommentId,
|
Guid? ParentCommentId,
|
||||||
string Body,
|
string Body,
|
||||||
IFormFile? Attachment);
|
IFormFile? Attachment);
|
||||||
|
|
||||||
public class CreateCommentRequestValidator
|
internal class CreateCommentRequestValidator
|
||||||
: Validator<CreateCommentRequest>
|
: Validator<CreateCommentRequest>
|
||||||
{
|
{
|
||||||
public CreateCommentRequestValidator()
|
public CreateCommentRequestValidator()
|
||||||
@@ -29,7 +29,7 @@ public class CreateCommentRequestValidator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateCommentHandler(
|
internal class CreateCommentHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService,
|
AccessScopeService accessScopeService,
|
||||||
IBlobStorage blobStorage,
|
IBlobStorage blobStorage,
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ using Socialize.Api.Infrastructure.Security;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Comments.Handlers;
|
namespace Socialize.Api.Modules.Comments.Handlers;
|
||||||
|
|
||||||
public record GetCommentsRequest(Guid ContentItemId);
|
internal record GetCommentsRequest(Guid ContentItemId);
|
||||||
|
|
||||||
public record CommentDto(
|
internal record CommentDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
Guid ContentItemId,
|
Guid ContentItemId,
|
||||||
@@ -25,7 +25,7 @@ public record CommentDto(
|
|||||||
string? AttachmentBlobUrl,
|
string? AttachmentBlobUrl,
|
||||||
DateTimeOffset CreatedAt);
|
DateTimeOffset CreatedAt);
|
||||||
|
|
||||||
public class GetCommentsHandler(
|
internal class GetCommentsHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: Endpoint<GetCommentsRequest, IReadOnlyCollection<CommentDto>>
|
: Endpoint<GetCommentsRequest, IReadOnlyCollection<CommentDto>>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Socialize.Api.Modules.Comments.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.Comments;
|
namespace Socialize.Api.Modules.Comments;
|
||||||
|
|
||||||
public static class ModuleRegistration
|
internal static class ModuleRegistration
|
||||||
{
|
{
|
||||||
public static WebApplicationBuilder AddCommentsModule(
|
public static WebApplicationBuilder AddCommentsModule(
|
||||||
this WebApplicationBuilder builder)
|
this WebApplicationBuilder builder)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.ContentItems.Contracts;
|
namespace Socialize.Api.Modules.ContentItems.Contracts;
|
||||||
|
|
||||||
public record ContentItemActivityWriteModel(
|
internal record ContentItemActivityWriteModel(
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
Guid ContentItemId,
|
Guid ContentItemId,
|
||||||
string EventType,
|
string EventType,
|
||||||
@@ -11,7 +11,7 @@ public record ContentItemActivityWriteModel(
|
|||||||
string? ActorEmail,
|
string? ActorEmail,
|
||||||
string? MetadataJson);
|
string? MetadataJson);
|
||||||
|
|
||||||
public interface IContentItemActivityWriter
|
internal interface IContentItemActivityWriter
|
||||||
{
|
{
|
||||||
Task WriteAsync(ContentItemActivityWriteModel model, CancellationToken cancellationToken = default);
|
Task WriteAsync(ContentItemActivityWriteModel model, CancellationToken cancellationToken = default);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.ContentItems.Data;
|
namespace Socialize.Api.Modules.ContentItems.Data;
|
||||||
|
|
||||||
public class ContentItem
|
internal class ContentItem
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid WorkspaceId { get; set; }
|
public Guid WorkspaceId { get; set; }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.ContentItems.Data;
|
namespace Socialize.Api.Modules.ContentItems.Data;
|
||||||
|
|
||||||
public class ContentItemActivityEntry
|
internal class ContentItemActivityEntry
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public Guid WorkspaceId { get; set; }
|
public Guid WorkspaceId { get; set; }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.ContentItems.Data;
|
namespace Socialize.Api.Modules.ContentItems.Data;
|
||||||
|
|
||||||
public static class ContentItemModelConfiguration
|
internal static class ContentItemModelConfiguration
|
||||||
{
|
{
|
||||||
public static ModelBuilder ConfigureContentItemsModule(this ModelBuilder modelBuilder)
|
public static ModelBuilder ConfigureContentItemsModule(this ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace Socialize.Api.Modules.ContentItems.Data;
|
namespace Socialize.Api.Modules.ContentItems.Data;
|
||||||
|
|
||||||
public class ContentItemRevision
|
internal class ContentItemRevision
|
||||||
{
|
{
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public Guid ContentItemId { get; set; }
|
public Guid ContentItemId { get; set; }
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ using System.Text.Json;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.ContentItems.Handlers;
|
namespace Socialize.Api.Modules.ContentItems.Handlers;
|
||||||
|
|
||||||
public record CreateContentItemRequest(
|
internal record CreateContentItemRequest(
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
Guid ClientId,
|
Guid ClientId,
|
||||||
Guid CampaignId,
|
Guid CampaignId,
|
||||||
@@ -20,7 +20,7 @@ public record CreateContentItemRequest(
|
|||||||
string? Hashtags,
|
string? Hashtags,
|
||||||
DateTimeOffset? DueDate);
|
DateTimeOffset? DueDate);
|
||||||
|
|
||||||
public class CreateContentItemRequestValidator
|
internal class CreateContentItemRequestValidator
|
||||||
: Validator<CreateContentItemRequest>
|
: Validator<CreateContentItemRequest>
|
||||||
{
|
{
|
||||||
public CreateContentItemRequestValidator()
|
public CreateContentItemRequestValidator()
|
||||||
@@ -35,7 +35,7 @@ public class CreateContentItemRequestValidator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateContentItemHandler(
|
internal class CreateContentItemHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService,
|
AccessScopeService accessScopeService,
|
||||||
IContentItemActivityWriter activityWriter,
|
IContentItemActivityWriter activityWriter,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using System.Text.Json;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.ContentItems.Handlers;
|
namespace Socialize.Api.Modules.ContentItems.Handlers;
|
||||||
|
|
||||||
public record CreateContentItemRevisionRequest(
|
internal record CreateContentItemRevisionRequest(
|
||||||
string Title,
|
string Title,
|
||||||
string PublicationMessage,
|
string PublicationMessage,
|
||||||
string PublicationTargets,
|
string PublicationTargets,
|
||||||
@@ -17,7 +17,7 @@ public record CreateContentItemRevisionRequest(
|
|||||||
string? ChangeSummary,
|
string? ChangeSummary,
|
||||||
DateTimeOffset? DueDate);
|
DateTimeOffset? DueDate);
|
||||||
|
|
||||||
public class CreateContentItemRevisionRequestValidator
|
internal class CreateContentItemRevisionRequestValidator
|
||||||
: Validator<CreateContentItemRevisionRequest>
|
: Validator<CreateContentItemRevisionRequest>
|
||||||
{
|
{
|
||||||
public CreateContentItemRevisionRequestValidator()
|
public CreateContentItemRevisionRequestValidator()
|
||||||
@@ -30,7 +30,7 @@ public class CreateContentItemRevisionRequestValidator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateContentItemRevisionHandler(
|
internal class CreateContentItemRevisionHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService,
|
AccessScopeService accessScopeService,
|
||||||
IContentItemActivityWriter activityWriter,
|
IContentItemActivityWriter activityWriter,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Socialize.Api.Modules.ContentItems.Data;
|
|||||||
|
|
||||||
namespace Socialize.Api.Modules.ContentItems.Handlers;
|
namespace Socialize.Api.Modules.ContentItems.Handlers;
|
||||||
|
|
||||||
public record ContentItemDetailDto(
|
internal record ContentItemDetailDto(
|
||||||
Guid Id,
|
Guid Id,
|
||||||
Guid WorkspaceId,
|
Guid WorkspaceId,
|
||||||
Guid ClientId,
|
Guid ClientId,
|
||||||
@@ -21,7 +21,7 @@ public record ContentItemDetailDto(
|
|||||||
int CurrentRevisionNumber,
|
int CurrentRevisionNumber,
|
||||||
DateTimeOffset CreatedAt);
|
DateTimeOffset CreatedAt);
|
||||||
|
|
||||||
public class GetContentItemHandler(
|
internal class GetContentItemHandler(
|
||||||
AppDbContext dbContext,
|
AppDbContext dbContext,
|
||||||
AccessScopeService accessScopeService)
|
AccessScopeService accessScopeService)
|
||||||
: EndpointWithoutRequest<ContentItemDetailDto>
|
: EndpointWithoutRequest<ContentItemDetailDto>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user