Admin suite: monitoring dashboard, user management/ban, broadcast, reports, SMS test
- /Admin/Overview: platform monitoring stats (users by role, facilities, listings, applies, push subs, queue, reports, bans) - /Admin/Users: search/filter + ban/unban (User.IsBanned + reason); banned users blocked at login - /Admin/Broadcast: send announcement (in-app + web push) to all / staff / employers via NotificationService - Reports: report button on shift/job detail → /report endpoint → /Admin/Reports (resolve/dismiss) - Settings: 'send test SMS' button; admin cross-nav links; SMS API config already in place - migration AdminBanReports; verified overview/users/broadcast/report persist Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -93,3 +93,6 @@ public enum IngestionMode
|
||||
Manual = 0, // همهچیز به صف بررسی میرود؛ ادمین تأیید میکند
|
||||
Automatic = 1 // موارد تأییدشده (طبق آستانه/هوش مصنوعی) خودکار منتشر میشوند
|
||||
}
|
||||
|
||||
public enum ReportTargetType { Shift = 0, Job = 1, Facility = 2, User = 3 }
|
||||
public enum ReportStatus { Open = 0, Resolved = 1, Dismissed = 2 }
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace JobsMedical.Web.Models;
|
||||
|
||||
/// <summary>A user-submitted report against a listing/facility/user (abuse, fake, wrong info).</summary>
|
||||
public class Report
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public ReportTargetType TargetType { get; set; }
|
||||
public int TargetId { get; set; }
|
||||
[MaxLength(160)] public string? TargetLabel { get; set; } // snapshot for the admin list
|
||||
|
||||
[Required, MaxLength(500)]
|
||||
public string Reason { get; set; } = "";
|
||||
|
||||
public int? ReporterUserId { get; set; }
|
||||
[MaxLength(36)] public string? ReporterVisitorId { get; set; }
|
||||
|
||||
public ReportStatus Status { get; set; } = ReportStatus.Open;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
@@ -20,6 +20,10 @@ public class User
|
||||
|
||||
public bool IsPhoneVerified { get; set; }
|
||||
|
||||
/// <summary>Banned users can't log in or post (set by admin).</summary>
|
||||
public bool IsBanned { get; set; }
|
||||
[MaxLength(300)] public string? BanReason { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
// Navigation
|
||||
|
||||
Reference in New Issue
Block a user