Ignore:
Timestamp:
12/08/25 21:51:12 (10 months ago)
Author:
Stefan-Saveski <stefan@…>
Branches:
master
Children:
18e0c10
Parents:
5e22720
Message:

Refactor and enhance application structure

Enhanced error handling in AuthController with detailed exception handling for user registration. Updated UserDTO to improve JSON serialization and renamed enums for clarity. Introduced new entities (Major, PassedSubject, etc.) and seeded initial data in AppDbContext.

Replaced legacy migrations with 20251208203846_InitialCreate, reflecting the updated schema. Fixed typographical errors and improved JSON serialization in Program.cs with case-insensitive property matching and enum handling.

Refactored repository interfaces for better null safety. Improved debugging in AuthService and updated connection strings. Added the PassedSubject entity and cleaned up redundant code and unused imports for better maintainability.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • iknow-api/Services/Implementations/AuthService.cs

    r5e22720 rf0fc386  
    2929        public async Task<bool> RegisterAsync(RegisterDto registerDto)
    3030        {
     31            // Debug: Log all incoming DTO values
     32            Console.WriteLine("=== RegisterDto Debug Info ===");
     33            Console.WriteLine($"Name: {registerDto.Name}");
     34            Console.WriteLine($"Email: {registerDto.Email}");
     35            Console.WriteLine($"majorType: {registerDto.majorType}");
     36            Console.WriteLine($"enrollmentYear: {registerDto.enrollmentYear}");
     37            Console.WriteLine($"quotaType: {registerDto.quotaType}");
     38            Console.WriteLine($"Role: {registerDto.Role}");
     39            Console.WriteLine($"tip: {registerDto.tip}");
     40            Console.WriteLine("==============================");
     41
     42            // Check if user already exists
    3143            if (await _userRepository.UserExistsAsync(registerDto.Email))
    32                 return false;
     44                throw new InvalidOperationException("User with this email already exists");
    3345
    3446            var user = new User
Note: See TracChangeset for help on using the changeset viewer.