source: iknow-api/DTOs/UserDTO.cs@ 2d64b2e

Last change on this file since 2d64b2e was 2d64b2e, checked in by imbrsk <boris696boris@…>, 10 months ago

Refactor model properties for consistency and clarity

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