source: iknow-api/DTOs/UserDTO.cs@ f844b7e

Last change on this file since f844b7e was f844b7e, checked in by stefansaveski <stefansaveski19@…>, 11 months ago

Add EMBG property and consolidate migrations

Added EMBG property to User and RegisterDto classes to store unique user identifiers. Removed outdated migration files and introduced a new consolidated migration (20251029131316_InitialCreate) to define the database schema, including User, ContactInfo, EnrollmentInfo, HighSchool, and RefreshToken tables with appropriate relationships. Updated AppDbContextModelSnapshot to reflect the new schema. Changed the development database connection string in appsettings.Development.json for improved configuration.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1namespace iknow_api.DTOs
2{
3 // Login DTO
4 public class LoginDto
5 {
6 public string Email { get; set; } = string.Empty;
7 public string Password { get; set; } = string.Empty;
8 public bool GenerateRefreshToken { get; set; }
9 }
10 public class GetUserDataDto
11 {
12 public string JWT { get; set; }
13 }
14
15 // Registration DTO
16 public class RegisterDto
17 {
18 public string Name { get; set; } = string.Empty;
19 public string Surname { get; set; } = string.Empty;
20 public string EMBG { get; set; } = string.Empty;
21 public string? Index { get; set; }
22 public string Email { get; set; } = string.Empty;
23 public string Password { get; set; } = string.Empty;
24 public DateTime Bday { get; set; }
25 public UserRole Role { get; set; }
26 public float gpa { get; set; }
27 public type tip { get; set; }
28 public string city { get; set; } = string.Empty;
29 public string address { get; set; } = string.Empty;
30 public string municipality { get; set; } = string.Empty;
31 public string phoneNumber { get; set; } = string.Empty;
32 public string microsoftEmail { get; set; } = string.Empty;
33 public int enrollmentYear { get; set; }
34 public quota quotaType { get; set; }
35 public major majorType { get; set; }
36
37 }
38
39 // User response DTO (for returning user data without password)
40 public class UserResponseDto
41 {
42 public int Id { get; set; }
43 public string? Name { get; set; }
44 public string? Surname { get; set; }
45 public string? Index { get; set; }
46 public string? Email { get; set; }
47 public DateTime Bday { get; set; }
48 public DateTime CreatedAt { get; set; }
49 public UserRole Role { get; set; }
50 }
51
52 // User role enum
53 public enum UserRole
54 {
55 Admin,
56 Professor,
57 Student
58 }
59 public enum type
60 {
61 strucen, gimnazija
62 }
63 public enum quota
64 {
65 drzavna, privatna, stipendija
66 }
67 public enum major
68 {
69 SIIS, PIT, KN, KI, IMB, IE, SSP, SEIS
70 }
71}
Note: See TracBrowser for help on using the repository browser.