source: iknow-api/DTOs/UserDTO.cs

Last change on this file 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
RevLine 
[c2f79d7]1using System.Text.Json.Serialization;
2
3namespace iknow_api.DTOs
[5b42c8d]4{
[c7d4a59]5 // Login DTO
6 public class LoginDto
[5b42c8d]7 {
[c7d4a59]8 public string Email { get; set; } = string.Empty;
9 public string Password { get; set; } = string.Empty;
[3347c1b]10 public bool GenerateRefreshToken { get; set; }
[c7d4a59]11 }
[cab02ad]12 public class GetUserDataDto
13 {
[3592476]14 public string? JWT { get; set; }
[cab02ad]15 }
[c7d4a59]16
17 // Registration DTO
18 public class RegisterDto
19 {
20 public string Name { get; set; } = string.Empty;
[2d64b2e]21 public string? MiddleName { get; set; }
[c7d4a59]22 public string Surname { get; set; } = string.Empty;
[f8af32b]23 public string EMBG { get; set; } = string.Empty;
[c7d4a59]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; }
[b38c39c]29 public float gpa { get; set; }
[c2f79d7]30 public HighSchoolType tip { get; set; }
[b38c39c]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; }
[3592476]37 public Quota quotaType { get; set; }
[a92a2a4]38 public int majorType { get; set; }
[2d64b2e]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; }
[c7d4a59]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
[5b42c8d]65 }
[c2f79d7]66 public enum HighSchoolType
[b38c39c]67 {
68 strucen, gimnazija
69 }
[3592476]70 public enum Quota
[b38c39c]71 {
72 drzavna, privatna, stipendija
73 }
[5b42c8d]74}
Note: See TracBrowser for help on using the repository browser.