Admin suite: monitoring dashboard, user management/ban, broadcast, reports, SMS test
CI/CD / CI · dotnet build (push) Failing after 1m40s
CI/CD / Deploy · hamkadr (push) Has been skipped

- /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:
soroush.asadi
2026-06-04 13:19:20 +03:30
parent b46bd49c32
commit eae38373b9
26 changed files with 1689 additions and 4 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,70 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace JobsMedical.Web.Migrations
{
/// <inheritdoc />
public partial class AdminBanReports : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "BanReason",
table: "Users",
type: "character varying(300)",
maxLength: 300,
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsBanned",
table: "Users",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "Reports",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
TargetType = table.Column<int>(type: "integer", nullable: false),
TargetId = table.Column<int>(type: "integer", nullable: false),
TargetLabel = table.Column<string>(type: "character varying(160)", maxLength: 160, nullable: true),
Reason = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: false),
ReporterUserId = table.Column<int>(type: "integer", nullable: true),
ReporterVisitorId = table.Column<string>(type: "character varying(36)", maxLength: 36, nullable: true),
Status = table.Column<int>(type: "integer", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Reports", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Reports_Status",
table: "Reports",
column: "Status");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Reports");
migrationBuilder.DropColumn(
name: "BanReason",
table: "Users");
migrationBuilder.DropColumn(
name: "IsBanned",
table: "Users");
}
}
}
@@ -522,6 +522,49 @@ namespace JobsMedical.Web.Migrations
b.ToTable("RawListings");
});
modelBuilder.Entity("JobsMedical.Web.Models.Report", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Reason")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<int?>("ReporterUserId")
.HasColumnType("integer");
b.Property<string>("ReporterVisitorId")
.HasMaxLength(36)
.HasColumnType("character varying(36)");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<int>("TargetId")
.HasColumnType("integer");
b.Property<string>("TargetLabel")
.HasMaxLength(160)
.HasColumnType("character varying(160)");
b.Property<int>("TargetType")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("Status");
b.ToTable("Reports");
});
modelBuilder.Entity("JobsMedical.Web.Models.Role", b =>
{
b.Property<int>("Id")
@@ -630,6 +673,10 @@ namespace JobsMedical.Web.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("BanReason")
.HasMaxLength(300)
.HasColumnType("character varying(300)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
@@ -637,6 +684,9 @@ namespace JobsMedical.Web.Migrations
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<bool>("IsBanned")
.HasColumnType("boolean");
b.Property<bool>("IsPhoneVerified")
.HasColumnType("boolean");