diff --git a/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/AdminReview.razor b/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/AdminReview.razor deleted file mode 100644 index a2a1d61..0000000 --- a/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/AdminReview.razor +++ /dev/null @@ -1,179 +0,0 @@ -@using SZUAbsolventenverein.Module.PremiumArea.Services -@using SZUAbsolventenverein.Module.PremiumArea.Models -@namespace SZUAbsolventenverein.Module.PremiumArea -@inherits ModuleBase -@inject IEngineerApplicationService ApplicationService -@inject NavigationManager NavManager - -

Ingenieur-Anträge Prüfen

- -@if (_applications == null) -{ -

Laden...

-} -else -{ -
-
-
-
- - - - - - - - - - - -
-
- - @if (FilteredApplications.Count == 0) - { -

Keine Anträge gefunden.

- } - else - { - - - - - - - - @if (_filterStatus == "Reported") - { - - } - - - - - @foreach (var app in FilteredApplications) - { - - - - - - @if (_filterStatus == "Reported") - { - - } - - - } - -
Benutzer IDDateinameDatumStatusMeldegrundAktionen
@app.UserId@app.PdfFileName@(app.SubmittedOn?.ToShortDateString() ?? app.CreatedOn.ToShortDateString()) - @app.Status - @if(app.IsReported) { Gemeldet } - @app.ReportReason - -
- } -
-
- @if (_selectedApp != null) - { -
-
- Antragsdetails -
-
-
-
Benutzer ID
-
@_selectedApp.UserId
-
Datei
-
@_selectedApp.PdfFileName
-
Status
-
@_selectedApp.Status
- @if (_selectedApp.IsReported) - { -
Meldegrund
-
@_selectedApp.ReportReason (Anzahl: @_selectedApp.ReportCount)
- } -
- -
-
- -
-
- -
- @if (_selectedApp.Status != "Approved" || _selectedApp.IsReported) - { - - } - @if (_selectedApp.Status != "Rejected") - { - - } -
-
-
- } -
-
-} - -@code { - public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Edit; // Admin Only - - private List _applications; - private EngineerApplication _selectedApp; - private string _filterStatus = "Validation"; - - protected override async Task OnInitializedAsync() - { - await LoadApps(); - } - - private async Task LoadApps() - { - // Load All applications - _applications = await ApplicationService.GetApplicationsAsync(ModuleState.ModuleId); - } - - private List FilteredApplications - { - get - { - if (_applications == null) return new List(); - if (_filterStatus == "Validation") - return _applications.Where(a => a.Status == "Draft" || a.Status == "Submitted" || a.Status == "Published").ToList(); - - if (_filterStatus == "Reported") - return _applications.Where(a => a.IsReported).ToList(); - - return _applications.Where(a => a.Status == _filterStatus).ToList(); - } - } - - private void SelectApp(EngineerApplication app) - { - _selectedApp = app; - } - - private async Task ApproveApp() - { - if (_selectedApp == null) return; - await ApplicationService.ApproveApplicationAsync(_selectedApp.ApplicationId, ModuleState.ModuleId); - await LoadApps(); - _selectedApp = null; - } - - private async Task RejectApp() - { - if (_selectedApp == null) return; - // Basic rejection without custom reason for now since UI input was removed - await ApplicationService.RejectApplicationAsync(_selectedApp.ApplicationId, ModuleState.ModuleId, "Abgelehnt durch Admin"); - await LoadApps(); - _selectedApp = null; - } -} diff --git a/Server/Migrations/01000001_AddPremiumTables.cs b/Server/Migrations/01000001_AddPremiumTables.cs deleted file mode 100644 index 8aaeea6..0000000 --- a/Server/Migrations/01000001_AddPremiumTables.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Oqtane.Databases.Interfaces; -using Oqtane.Migrations; -using SZUAbsolventenverein.Module.PremiumArea.Migrations.EntityBuilders; -using SZUAbsolventenverein.Module.PremiumArea.Repository; - -namespace SZUAbsolventenverein.Module.PremiumArea.Migrations -{ - [DbContext(typeof(PremiumAreaContext))] - [Migration("SZUAbsolventenverein.Module.PremiumArea.01.00.00.01")] - public class AddPremiumTables : MultiDatabaseMigration - { - public AddPremiumTables(IDatabase database) : base(database) - { - } - - protected override void Up(MigrationBuilder migrationBuilder) - { - var engAppBuilder = new EngineerApplicationEntityBuilder(migrationBuilder, ActiveDatabase); - engAppBuilder.Create(); - - var userPremBuilder = new UserPremiumEntityBuilder(migrationBuilder, ActiveDatabase); - userPremBuilder.Create(); - - var premEventBuilder = new PremiumEventEntityBuilder(migrationBuilder, ActiveDatabase); - premEventBuilder.Create(); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - var engAppBuilder = new EngineerApplicationEntityBuilder(migrationBuilder, ActiveDatabase); - engAppBuilder.Drop(); - - var userPremBuilder = new UserPremiumEntityBuilder(migrationBuilder, ActiveDatabase); - userPremBuilder.Drop(); - - var premEventBuilder = new PremiumEventEntityBuilder(migrationBuilder, ActiveDatabase); - premEventBuilder.Drop(); - } - } -} diff --git a/Server/Migrations/01000002_AddReportAndFileColumns.cs b/Server/Migrations/01000002_AddReportAndFileColumns.cs deleted file mode 100644 index ddba6c0..0000000 --- a/Server/Migrations/01000002_AddReportAndFileColumns.cs +++ /dev/null @@ -1,90 +0,0 @@ -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Oqtane.Databases.Interfaces; -using Oqtane.Migrations; -using SZUAbsolventenverein.Module.PremiumArea.Migrations.EntityBuilders; -using SZUAbsolventenverein.Module.PremiumArea.Repository; -using System; - -namespace SZUAbsolventenverein.Module.PremiumArea.Migrations -{ - [DbContext(typeof(PremiumAreaContext))] - [Migration("SZUAbsolventenverein.Module.PremiumArea.01.00.00.02")] - public class AddReportAndFileColumns : MultiDatabaseMigration - { - public AddReportAndFileColumns(IDatabase database) : base(database) - { - } - - protected override void Up(MigrationBuilder migrationBuilder) - { - // Add FileId (nullable int) - assuming missing - migrationBuilder.AddColumn( - name: "FileId", - table: "SZUAbsolventenvereinEngineerApplications", - nullable: true); - - // Add PdfFileName (string 256) - migrationBuilder.AddColumn( - name: "PdfFileName", - table: "SZUAbsolventenvereinEngineerApplications", - maxLength: 256, - nullable: true); - - // Add ApprovedOn (DateTime nullable) - might exist but adding if missing? - // MigrationBuilder will fail if exists. We assume schema drift needs this. - // If it exists, user must handle. - migrationBuilder.AddColumn( - name: "ApprovedOn", - table: "SZUAbsolventenvereinEngineerApplications", - nullable: true); - - // Add IsReported (bool not null default false) - migrationBuilder.AddColumn( - name: "IsReported", - table: "SZUAbsolventenvereinEngineerApplications", - nullable: false, - defaultValue: false); - - // Add ReportReason (string max nullable) - migrationBuilder.AddColumn( - name: "ReportReason", - table: "SZUAbsolventenvereinEngineerApplications", - nullable: true); - - // Add ReportCount (int not null default 0) - migrationBuilder.AddColumn( - name: "ReportCount", - table: "SZUAbsolventenvereinEngineerApplications", - nullable: false, - defaultValue: 0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "IsReported", - table: "SZUAbsolventenvereinEngineerApplications"); - - migrationBuilder.DropColumn( - name: "ReportReason", - table: "SZUAbsolventenvereinEngineerApplications"); - - migrationBuilder.DropColumn( - name: "ReportCount", - table: "SZUAbsolventenvereinEngineerApplications"); - - migrationBuilder.DropColumn( - name: "FileId", - table: "SZUAbsolventenvereinEngineerApplications"); - - migrationBuilder.DropColumn( - name: "PdfFileName", - table: "SZUAbsolventenvereinEngineerApplications"); - - migrationBuilder.DropColumn( - name: "ApprovedOn", - table: "SZUAbsolventenvereinEngineerApplications"); - } - } -}