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

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