- 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>
89 lines
1.9 KiB
C#
89 lines
1.9 KiB
C#
namespace GermanApp.Application.DTOs;
|
|
|
|
/// <summary>
|
|
/// DTO for admin user information.
|
|
/// </summary>
|
|
public record AdminUserDto(
|
|
int Id,
|
|
string Username,
|
|
string Email,
|
|
string Role,
|
|
string CurrentLevel,
|
|
int Streak,
|
|
int TotalPoints,
|
|
DateTime CreatedAt);
|
|
|
|
/// <summary>
|
|
/// DTO for user progress report.
|
|
/// </summary>
|
|
public record UserProgressReportDto(
|
|
int UserId,
|
|
string Username,
|
|
string Email,
|
|
string CurrentLevel,
|
|
int TotalLessonsCompleted,
|
|
int TotalQuizzesCompleted,
|
|
double AverageQuizScore,
|
|
int TotalPoints,
|
|
int CurrentStreak,
|
|
DateTime LastActivityDate);
|
|
|
|
/// <summary>
|
|
/// DTO for lesson completion status.
|
|
/// </summary>
|
|
public record LessonCompletionDto(
|
|
int LessonId,
|
|
string LessonTitle,
|
|
string LevelCode,
|
|
bool IsCompleted,
|
|
DateTime? CompletedAt);
|
|
|
|
/// <summary>
|
|
/// DTO for user quiz result (for admin reports).
|
|
/// </summary>
|
|
public record UserQuizResultDto(
|
|
int QuizId,
|
|
string QuizTitle,
|
|
int Score,
|
|
int PassingScore,
|
|
bool Passed,
|
|
DateTime AttemptDate);
|
|
|
|
/// <summary>
|
|
/// DTO for creating a new story via admin.
|
|
/// </summary>
|
|
public record AdminCreateStoryDto(
|
|
int LevelId,
|
|
string Theme,
|
|
int SegmentCount = 3,
|
|
bool GenerateAudio = false);
|
|
|
|
/// <summary>
|
|
/// DTO for admin dashboard statistics.
|
|
/// </summary>
|
|
public record AdminDashboardStatsDto(
|
|
int TotalUsers,
|
|
int TotalLessons,
|
|
int TotalQuizzes,
|
|
int TotalStorySegments,
|
|
int ActiveUsersThisWeek,
|
|
double AverageUserProgress);
|
|
|
|
/// <summary>
|
|
/// DTO for user list item (for admin user management).
|
|
/// </summary>
|
|
public record AdminUserListItemDto(
|
|
int Id,
|
|
string Username,
|
|
string Email,
|
|
string Role,
|
|
string CurrentLevel,
|
|
int TotalPoints,
|
|
int Streak,
|
|
DateTime CreatedAt);
|
|
|
|
/// <summary>
|
|
/// DTO for updating user role (admin only).
|
|
/// </summary>
|
|
public record UpdateUserRoleDto(
|
|
string Role);
|