feat: reports; improved+simplifed modals; extractError funcction;

refactor: change jwt claims to lowercase; use response dtos for sensitive data
fix: nullify user on token clears; change appsettings.dev View_Internal_API_Key
This commit is contained in:
2026-01-14 19:41:52 -05:00
parent 1da88dba4e
commit 67447d51ae
39 changed files with 2291 additions and 454 deletions
@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace SharpbinV3.Server.DTOs.Report
{
public class ReportDto
{
[Required]
[MinLength(12), MaxLength(1000)]
public string Description { get; set; } = string.Empty;
[Required]
public string ReportType { get; set; } = string.Empty; // e.g., "Spam", "Abuse", etc.
public string ReportStatus { get; set; } = "Open";
public string? VerificationToken { get; set; }
}
}
@@ -0,0 +1,17 @@
using SharpbinV3.Server.Data.Entities;
namespace SharpbinV3.Server.DTOs.Report
{
public sealed record ReportQuery
{
public Guid? ReporterUUID { get; init; }
public Guid? UserUUID { get; init; }
public int? PastePID { get; init; }
public string? PasteId { get; init; }
public ReportTargetType? TargetType { get; init; }
public ReportType? Type { get; init; }
public ReportStatus? Status { get; init; }
public int Page { get; init; } = 1;
public int PageSize { get; init; } = 20;
}
}
@@ -0,0 +1,29 @@
using SharpbinV3.Server.Data.Entities;
namespace SharpbinV3.Server.DTOs.Report
{
public class ReportResponseDto
{
public int? ReportID { get; set; }
public ReportType Type { get; set; }
public ReportStatus Status { get; set; }
public string? Description { get; set; }
public long CreatedAt { get; set; }
public long? UpdatedAt { get; set; }
public Guid ReporterUUID { get; set; }
public string? ReporterUsername { get; set; }
public string? ReporterDisplayName { get; set; }
public ReportTargetType TargetType { get; set; }
public string? PasteId { get; set; }
public string? PasteTitle { get; set; }
public Guid? UserUUID { get; set; }
public string? TargetUsername { get; set; }
public string? TargetDisplayName { get; set; }
}
public class ReportOptionsDto
{
public string[] Types { get; set; } = [];
public string[] Statuses { get; set; } = [];
}
}
@@ -0,0 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace SharpbinV3.Server.DTOs.Report
{
public class ReportUpdateDto
{
public string? Status { get; set; }
public string? Type { get; set; }
[MaxLength(1000)]
public string? Description { get; set; }
}
}