Changeset 2d64b2e


Ignore:
Timestamp:
12/09/25 14:54:20 (10 months ago)
Author:
imbrsk <boris696boris@…>
Branches:
master
Children:
33c69d6, 691f152
Parents:
22439d3
Message:

Refactor model properties for consistency and clarity

Location:
iknow-api
Files:
10 edited
2 moved

Legend:

Unmodified
Added
Removed
  • iknow-api/DTOs/UserDTO.cs

    r22439d3 r2d64b2e  
    1919    {
    2020        public string Name { get; set; } = string.Empty;
     21        public string? MiddleName { get; set; }
    2122        public string Surname { get; set; } = string.Empty;
    2223        public string EMBG { get; set; } = string.Empty;
     
    3637        public Quota quotaType { get; set; }
    3738        public int majorType { get; set; }
    38 
     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; }
    3944    }
    4045
  • iknow-api/Migrations/20251209133847_InitalCreate.Designer.cs

    r22439d3 r2d64b2e  
    1313{
    1414    [DbContext(typeof(AppDbContext))]
    15     [Migration("20251209115716_InitialCreate")]
    16     partial class InitialCreate
     15    [Migration("20251209133847_InitalCreate")]
     16    partial class InitalCreate
    1717    {
    1818        /// <inheritdoc />
     
    3434                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
    3535
    36                     b.Property<int>("UserId")
    37                         .HasColumnType("integer");
    38 
    39                     b.Property<string>("address")
    40                         .HasColumnType("text");
    41 
    42                     b.Property<string>("city")
    43                         .HasColumnType("text");
    44 
    45                     b.Property<string>("microsoftEmail")
    46                         .HasColumnType("text");
    47 
    48                     b.Property<string>("municipality")
    49                         .HasColumnType("text");
    50 
    51                     b.Property<string>("phoneNumber")
    52                         .HasColumnType("text");
     36                    b.Property<string>("Address")
     37                        .HasColumnType("text");
     38
     39                    b.Property<string>("City")
     40                        .HasColumnType("text");
     41
     42                    b.Property<string>("MicrosoftEmail")
     43                        .HasColumnType("text");
     44
     45                    b.Property<string>("Municipality")
     46                        .HasColumnType("text");
     47
     48                    b.Property<string>("PhoneNumber")
     49                        .HasColumnType("text");
     50
     51                    b.Property<int>("UserId")
     52                        .HasColumnType("integer");
    5353
    5454                    b.HasKey("Id");
     
    8383                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
    8484
    85                     b.Property<string>("body")
    86                         .HasColumnType("text");
    87 
    88                     b.Property<int>("cost")
    89                         .HasColumnType("integer");
    90 
    91                     b.Property<string>("name")
     85                    b.Property<string>("Body")
     86                        .HasColumnType("text");
     87
     88                    b.Property<int>("Cost")
     89                        .HasColumnType("integer");
     90
     91                    b.Property<string>("Name")
    9292                        .HasColumnType("text");
    9393
     
    139139                    b.Property<int>("MajorId")
    140140                        .HasColumnType("integer");
     141
     142                    b.Property<string>("StudyStatus")
     143                        .HasColumnType("text");
     144
     145                    b.Property<string>("StudyType")
     146                        .HasColumnType("text");
    141147
    142148                    b.Property<int>("UserId")
     
    170176                        .HasColumnType("real");
    171177
    172                     b.Property<int>("UserId")
    173                         .HasColumnType("integer");
    174 
    175                     b.Property<int>("tip")
     178                    b.Property<int>("HighSchoolType")
     179                        .HasColumnType("integer");
     180
     181                    b.Property<string>("StudyLanguage")
     182                        .HasColumnType("text");
     183
     184                    b.Property<int>("UserId")
    176185                        .HasColumnType("integer");
    177186
     
    230239                        .HasColumnType("integer");
    231240
    232                     b.Property<int>("Akreditacija")
     241                    b.Property<int>("Accreditation")
    233242                        .HasColumnType("integer");
    234243
     
    382391                        .HasColumnType("timestamp with time zone");
    383392
     393                    b.Property<string>("Citizenship")
     394                        .HasColumnType("text");
     395
    384396                    b.Property<DateTime>("CreatedAt")
    385397                        .HasColumnType("timestamp with time zone");
     
    391403                        .HasColumnType("text");
    392404
     405                    b.Property<string>("Gender")
     406                        .HasColumnType("text");
     407
    393408                    b.Property<string>("Index")
    394409                        .HasColumnType("text");
    395410
     411                    b.Property<string>("MiddleName")
     412                        .HasColumnType("text");
     413
    396414                    b.Property<string>("Name")
     415                        .HasColumnType("text");
     416
     417                    b.Property<string>("Nationality")
    397418                        .HasColumnType("text");
    398419
  • iknow-api/Migrations/20251209133847_InitalCreate.cs

    r22439d3 r2d64b2e  
    1010{
    1111    /// <inheritdoc />
    12     public partial class InitialCreate : Migration
     12    public partial class InitalCreate : Migration
    1313    {
    1414        /// <inheritdoc />
     
    2121                    Id = table.Column<int>(type: "integer", nullable: false)
    2222                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
    23                     name = table.Column<string>(type: "text", nullable: true),
    24                     body = table.Column<string>(type: "text", nullable: true),
    25                     cost = table.Column<int>(type: "integer", nullable: false)
     23                    Name = table.Column<string>(type: "text", nullable: true),
     24                    Body = table.Column<string>(type: "text", nullable: true),
     25                    Cost = table.Column<int>(type: "integer", nullable: false)
    2626                },
    2727                constraints: table =>
     
    7171                    Email = table.Column<string>(type: "text", nullable: true),
    7272                    PasswordHash = table.Column<string>(type: "text", nullable: true),
     73                    MiddleName = table.Column<string>(type: "text", nullable: true),
     74                    Gender = table.Column<string>(type: "text", nullable: true),
     75                    Nationality = table.Column<string>(type: "text", nullable: true),
     76                    Citizenship = table.Column<string>(type: "text", nullable: true),
    7377                    Bday = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
    7478                    CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
     
    111115                    SubjectId = table.Column<int>(type: "integer", nullable: false),
    112116                    MandatorySemester = table.Column<int>(type: "integer", nullable: false),
    113                     Akreditacija = table.Column<int>(type: "integer", nullable: false)
     117                    Accreditation = table.Column<int>(type: "integer", nullable: false)
    114118                },
    115119                constraints: table =>
     
    136140                    Id = table.Column<int>(type: "integer", nullable: false)
    137141                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
    138                     city = table.Column<string>(type: "text", nullable: true),
    139                     address = table.Column<string>(type: "text", nullable: true),
    140                     municipality = table.Column<string>(type: "text", nullable: true),
    141                     phoneNumber = table.Column<string>(type: "text", nullable: true),
    142                     microsoftEmail = table.Column<string>(type: "text", nullable: true),
     142                    City = table.Column<string>(type: "text", nullable: true),
     143                    Address = table.Column<string>(type: "text", nullable: true),
     144                    Municipality = table.Column<string>(type: "text", nullable: true),
     145                    PhoneNumber = table.Column<string>(type: "text", nullable: true),
     146                    MicrosoftEmail = table.Column<string>(type: "text", nullable: true),
    143147                    UserId = table.Column<int>(type: "integer", nullable: false)
    144148                },
     
    192196                    quota = table.Column<int>(type: "integer", nullable: false),
    193197                    MajorId = table.Column<int>(type: "integer", nullable: false),
    194                     UserId = table.Column<int>(type: "integer", nullable: false)
     198                    UserId = table.Column<int>(type: "integer", nullable: false),
     199                    StudyType = table.Column<string>(type: "text", nullable: true),
     200                    StudyStatus = table.Column<string>(type: "text", nullable: true)
    195201                },
    196202                constraints: table =>
     
    218224                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
    219225                    GPA = table.Column<float>(type: "real", nullable: false),
    220                     tip = table.Column<int>(type: "integer", nullable: false),
    221                     UserId = table.Column<int>(type: "integer", nullable: false)
     226                    HighSchoolType = table.Column<int>(type: "integer", nullable: false),
     227                    UserId = table.Column<int>(type: "integer", nullable: false),
     228                    StudyLanguage = table.Column<string>(type: "text", nullable: true)
    222229                },
    223230                constraints: table =>
  • iknow-api/Migrations/AppDbContextModelSnapshot.cs

    r22439d3 r2d64b2e  
    3131                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
    3232
    33                     b.Property<int>("UserId")
    34                         .HasColumnType("integer");
    35 
    36                     b.Property<string>("address")
    37                         .HasColumnType("text");
    38 
    39                     b.Property<string>("city")
    40                         .HasColumnType("text");
    41 
    42                     b.Property<string>("microsoftEmail")
    43                         .HasColumnType("text");
    44 
    45                     b.Property<string>("municipality")
    46                         .HasColumnType("text");
    47 
    48                     b.Property<string>("phoneNumber")
    49                         .HasColumnType("text");
     33                    b.Property<string>("Address")
     34                        .HasColumnType("text");
     35
     36                    b.Property<string>("City")
     37                        .HasColumnType("text");
     38
     39                    b.Property<string>("MicrosoftEmail")
     40                        .HasColumnType("text");
     41
     42                    b.Property<string>("Municipality")
     43                        .HasColumnType("text");
     44
     45                    b.Property<string>("PhoneNumber")
     46                        .HasColumnType("text");
     47
     48                    b.Property<int>("UserId")
     49                        .HasColumnType("integer");
    5050
    5151                    b.HasKey("Id");
     
    8080                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
    8181
    82                     b.Property<string>("body")
    83                         .HasColumnType("text");
    84 
    85                     b.Property<int>("cost")
    86                         .HasColumnType("integer");
    87 
    88                     b.Property<string>("name")
     82                    b.Property<string>("Body")
     83                        .HasColumnType("text");
     84
     85                    b.Property<int>("Cost")
     86                        .HasColumnType("integer");
     87
     88                    b.Property<string>("Name")
    8989                        .HasColumnType("text");
    9090
     
    136136                    b.Property<int>("MajorId")
    137137                        .HasColumnType("integer");
     138
     139                    b.Property<string>("StudyStatus")
     140                        .HasColumnType("text");
     141
     142                    b.Property<string>("StudyType")
     143                        .HasColumnType("text");
    138144
    139145                    b.Property<int>("UserId")
     
    167173                        .HasColumnType("real");
    168174
    169                     b.Property<int>("UserId")
    170                         .HasColumnType("integer");
    171 
    172                     b.Property<int>("tip")
     175                    b.Property<int>("HighSchoolType")
     176                        .HasColumnType("integer");
     177
     178                    b.Property<string>("StudyLanguage")
     179                        .HasColumnType("text");
     180
     181                    b.Property<int>("UserId")
    173182                        .HasColumnType("integer");
    174183
     
    227236                        .HasColumnType("integer");
    228237
    229                     b.Property<int>("Akreditacija")
     238                    b.Property<int>("Accreditation")
    230239                        .HasColumnType("integer");
    231240
     
    379388                        .HasColumnType("timestamp with time zone");
    380389
     390                    b.Property<string>("Citizenship")
     391                        .HasColumnType("text");
     392
    381393                    b.Property<DateTime>("CreatedAt")
    382394                        .HasColumnType("timestamp with time zone");
     
    388400                        .HasColumnType("text");
    389401
     402                    b.Property<string>("Gender")
     403                        .HasColumnType("text");
     404
    390405                    b.Property<string>("Index")
    391406                        .HasColumnType("text");
    392407
     408                    b.Property<string>("MiddleName")
     409                        .HasColumnType("text");
     410
    393411                    b.Property<string>("Name")
     412                        .HasColumnType("text");
     413
     414                    b.Property<string>("Nationality")
    394415                        .HasColumnType("text");
    395416
  • iknow-api/Models/ContactInfo.cs

    r22439d3 r2d64b2e  
    66    {
    77        public int Id { get; set; }
    8         public string? city { get; set; }
    9         public string? address { get; set; }
    10         public string? municipality { get; set; }
    11         public string? phoneNumber { get; set; }
    12         public string? microsoftEmail { get; set; }
     8        public string? City { get; set; }
     9        public string? Address { get; set; }
     10        public string? Municipality { get; set; }
     11        public string? PhoneNumber { get; set; }
     12        public string? MicrosoftEmail { get; set; }
    1313       
    1414        public int UserId { get; set; }
  • iknow-api/Models/Documents.cs

    r22439d3 r2d64b2e  
    44    {
    55        public int Id { get; set; }
    6         public string? name { get; set; }
    7         public string? body { get; set; }
    8         public int cost { get; set; }
     6        public string? Name { get; set; }
     7        public string? Body { get; set; }
     8        public int Cost { get; set; }
    99        public ICollection<UserDocuments>? User { get; set; }
    1010    }
  • iknow-api/Models/EnrollmentInfo.cs

    r22439d3 r2d64b2e  
    11using System.ComponentModel.DataAnnotations.Schema;
     2using Microsoft.AspNetCore.SignalR;
     3using Microsoft.Net.Http.Headers;
    24
    35namespace iknow_api.Models
     
    1113        public int Id { get; set; }
    1214        public int enrollmentYear { get; set; }
    13         // CS1597 fix: no semicolon after accessor block
    1415        public Quota quota { get; set; }
    1516        public int MajorId { get; set; }
     
    1718        public int UserId { get; set; }
    1819        public User? User { get; set; }
     20        public string? StudyType { get; set; }
     21        public string? StudyStatus { get; set; }
    1922
    2023    }
  • iknow-api/Models/HighSchool.cs

    r22439d3 r2d64b2e  
    33namespace iknow_api.Models
    44{
    5     public enum type
     5    public enum HighSchoolType
    66    {
    7         strucen, gimnazija
     7        Strucen, Gimnazija
    88    }
    99    public class HighSchool
     
    1111        public int Id { get; set; }
    1212        public float GPA { get; set; }
    13         public type tip { get; set; }
    14 
     13        public HighSchoolType HighSchoolType { get; set; }
    1514        public int UserId { get; set; }
    16         public User User { get; set; }
     15        public User? User { get; set; }
     16        public string? StudyLanguage { get; set; }
    1717    }
    1818}
  • iknow-api/Models/MajorSubjects.cs

    r22439d3 r2d64b2e  
    66        public int SubjectId { get; set; }
    77        public int MandatorySemester { get; set; }
    8         public int Akreditacija { get; set; }
     8        public int Accreditation { get; set; }
    99        public Major? Majors { get; set; }
    1010        public Subject? Subjects { get; set; }
  • iknow-api/Models/RefreshToken.cs

    r22439d3 r2d64b2e  
    77        public int Id { get; set; }
    88        public int UserId { get; set; }
    9         public User User { get; set; }
     9        public User? User { get; set; }
    1010        public string? Token { get; set; }
    1111        public DateTime ExpiresAt { get; set; }
  • iknow-api/Models/User.cs

    r22439d3 r2d64b2e  
    1919        public string? Email { get; set; }
    2020        public string? PasswordHash { get; set; }
     21        public string? MiddleName { get; set; }
     22        public string? Gender { get; set; }
     23        public string? Nationality { get; set; }
     24        public string? Citizenship { get; set; }
    2125        public DateTime Bday { get; set; }
    2226        public DateTime CreatedAt { get; set; }
  • iknow-api/Services/Implementations/AuthService.cs

    r22439d3 r2d64b2e  
    5656                {
    5757                    Name = registerDto.Name,
     58                    MiddleName = registerDto.MiddleName,
    5859                    Surname = registerDto.Surname,
    5960                    Index = registerDto.Index,
     
    6364                    CreatedAt = DateTime.UtcNow,
    6465                    Role = (Models.UserRole)registerDto.Role,
    65                     EMBG = registerDto.EMBG
     66                    EMBG = registerDto.EMBG,
     67                    Nationality = registerDto.nationality,
     68                    Citizenship = registerDto.citizenship,
     69                    Gender = registerDto.gender
    6670                };
    6771
     
    7478                {
    7579                    UserId = userId,
    76                     city = registerDto.city,
    77                     address = registerDto.address,
    78                     municipality = registerDto.municipality,
    79                     phoneNumber = registerDto.phoneNumber,
    80                     microsoftEmail = registerDto.microsoftEmail
     80                    City = registerDto.city,
     81                    Address = registerDto.address,
     82                    Municipality = registerDto.municipality,
     83                    PhoneNumber = registerDto.phoneNumber,
     84                    MicrosoftEmail = registerDto.microsoftEmail
    8185                };
    8286               
     
    8690                    enrollmentYear = registerDto.enrollmentYear,
    8791                    quota = (Models.Quota)registerDto.quotaType,
    88                     MajorId = registerDto.majorType
     92                    MajorId = registerDto.majorType,
     93                    StudyStatus = registerDto.studyStatus,
     94                    StudyType = registerDto.studyType
    8995                };
    9096               
     
    9399                    UserId = userId,
    94100                    GPA = registerDto.gpa,
    95                     tip = (Models.type)registerDto.tip
     101                    HighSchoolType = (Models.HighSchoolType)registerDto.tip
    96102                };
    97103
Note: See TracChangeset for help on using the changeset viewer.