- Add Role property to User entity with migration - Create BootstrapController for first admin user creation - Remove [AllowAnonymous] from all learning content controllers - Create AdminController with admin-only endpoints - Create AdminService for user management - Create UserReportService for progress reports - Add UserRepository implementation - Update AuthService with role support feat(frontend): Implement authentication system - Add AuthStore with React context for auth state management - Create Login, Register, Landing, and Home pages - Add ProtectedRoute and AdminRoute components - Create Auth API types and client - Configure Vite with @/ path alias - Add comprehensive CSS styles for auth and landing pages BREAKING CHANGE: All learning content now requires authentication. Users must register and sign in before accessing lessons, quizzes, and stories. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
53 lines
2 KiB
C#
53 lines
2 KiB
C#
using GermanApp.Application.DTOs;
|
|
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GermanApp.Application.Interfaces;
|
|
|
|
/// <summary>
|
|
/// Interface for admin services.
|
|
/// Part of the Application layer.
|
|
/// </summary>
|
|
public interface IAdminService
|
|
{
|
|
/// <summary>
|
|
/// Gets all users for admin view.
|
|
/// </summary>
|
|
/// <param name="cancellationToken">Cancellation token</param>
|
|
/// <returns>List of all users</returns>
|
|
Task<IReadOnlyList<AdminUserListItemDto>> GetAllUsersAsync(CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Gets a specific user by ID.
|
|
/// </summary>
|
|
/// <param name="userId">The user ID</param>
|
|
/// <param name="cancellationToken">Cancellation token</param>
|
|
/// <returns>The user DTO</returns>
|
|
Task<AdminUserDto?> GetUserByIdAsync(int userId, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Updates a user's role.
|
|
/// </summary>
|
|
/// <param name="userId">The user ID</param>
|
|
/// <param name="newRole">The new role</param>
|
|
/// <param name="cancellationToken">Cancellation token</param>
|
|
/// <returns>The updated user DTO</returns>
|
|
Task<AdminUserDto?> UpdateUserRoleAsync(int userId, string newRole, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Deletes a user (admin only, cannot delete self).
|
|
/// </summary>
|
|
/// <param name="userId">The user ID to delete</param>
|
|
/// <param name="adminUserId">The admin user ID making the request</param>
|
|
/// <param name="cancellationToken">Cancellation token</param>
|
|
/// <returns>True if successful</returns>
|
|
Task<bool> DeleteUserAsync(int userId, int adminUserId, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Gets admin dashboard statistics.
|
|
/// </summary>
|
|
/// <param name="cancellationToken">Cancellation token</param>
|
|
/// <returns>Dashboard statistics</returns>
|
|
Task<AdminDashboardStatsDto> GetDashboardStatsAsync(CancellationToken cancellationToken = default);
|
|
}
|