source: iknow-api/Migrations/AppDbContextModelSnapshot.cs@ 4f5d8fd

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

Add user-related models, services, and JWT validation

Added ContactInfo, EnrollmentInfo, and HighSchool models with relationships to the User entity. Updated AppDbContext and migrations to reflect these changes. Introduced UserService and IUserService for handling user data retrieval via JWT validation. Added UserController with a getUser endpoint to fetch user data based on JWT.

Enhanced IUserRepository and UserRepository with a method to fetch users by ID. Registered UserService in the DI container. Defined enums for EnrollmentInfo and HighSchool. Removed outdated migration files and performed general refactoring and cleanup.

  • Property mode set to 100644
File size: 5.8 KB
Line 
1// <auto-generated />
2using System;
3using Microsoft.EntityFrameworkCore;
4using Microsoft.EntityFrameworkCore.Infrastructure;
5using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
6using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
7using iknow_api.Data;
8
9#nullable disable
10
11namespace iknow_api.Migrations
12{
13 [DbContext(typeof(AppDbContext))]
14 partial class AppDbContextModelSnapshot : ModelSnapshot
15 {
16 protected override void BuildModel(ModelBuilder modelBuilder)
17 {
18#pragma warning disable 612, 618
19 modelBuilder
20 .HasAnnotation("ProductVersion", "9.0.10")
21 .HasAnnotation("Relational:MaxIdentifierLength", 63);
22
23 NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
24
25 modelBuilder.Entity("iknow_api.Models.ContactInfo", b =>
26 {
27 b.Property<int>("Id")
28 .ValueGeneratedOnAdd()
29 .HasColumnType("integer");
30
31 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
32
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");
50
51 b.HasKey("Id");
52
53 b.HasIndex("UserId");
54
55 b.ToTable("ContactInfo");
56 });
57
58 modelBuilder.Entity("iknow_api.Models.EnrollmentInfo", b =>
59 {
60 b.Property<int>("Id")
61 .ValueGeneratedOnAdd()
62 .HasColumnType("integer");
63
64 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
65
66 b.Property<int>("UserId")
67 .HasColumnType("integer");
68
69 b.Property<int>("enrollmentYear")
70 .HasColumnType("integer");
71
72 b.Property<int>("major")
73 .HasColumnType("integer");
74
75 b.HasKey("Id");
76
77 b.HasIndex("UserId");
78
79 b.ToTable("EnrollmentInfo");
80 });
81
82 modelBuilder.Entity("iknow_api.Models.HighSchool", b =>
83 {
84 b.Property<int>("Id")
85 .ValueGeneratedOnAdd()
86 .HasColumnType("integer");
87
88 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
89
90 b.Property<float>("GPA")
91 .HasColumnType("real");
92
93 b.Property<int>("UserId")
94 .HasColumnType("integer");
95
96 b.Property<int>("tip")
97 .HasColumnType("integer");
98
99 b.HasKey("Id");
100
101 b.HasIndex("UserId");
102
103 b.ToTable("HighSchool");
104 });
105
106 modelBuilder.Entity("iknow_api.Models.User", b =>
107 {
108 b.Property<int>("Id")
109 .ValueGeneratedOnAdd()
110 .HasColumnType("integer");
111
112 NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
113
114 b.Property<DateTime>("Bday")
115 .HasColumnType("timestamp with time zone");
116
117 b.Property<DateTime>("CreatedAt")
118 .HasColumnType("timestamp with time zone");
119
120 b.Property<string>("Email")
121 .HasColumnType("text");
122
123 b.Property<string>("Index")
124 .HasColumnType("text");
125
126 b.Property<string>("Name")
127 .HasColumnType("text");
128
129 b.Property<string>("PasswordHash")
130 .HasColumnType("text");
131
132 b.Property<int>("Role")
133 .HasColumnType("integer");
134
135 b.Property<string>("Surname")
136 .HasColumnType("text");
137
138 b.HasKey("Id");
139
140 b.ToTable("User");
141 });
142
143 modelBuilder.Entity("iknow_api.Models.ContactInfo", b =>
144 {
145 b.HasOne("iknow_api.Models.User", "User")
146 .WithMany()
147 .HasForeignKey("UserId")
148 .OnDelete(DeleteBehavior.Cascade)
149 .IsRequired();
150
151 b.Navigation("User");
152 });
153
154 modelBuilder.Entity("iknow_api.Models.EnrollmentInfo", b =>
155 {
156 b.HasOne("iknow_api.Models.User", "User")
157 .WithMany()
158 .HasForeignKey("UserId")
159 .OnDelete(DeleteBehavior.Cascade)
160 .IsRequired();
161
162 b.Navigation("User");
163 });
164
165 modelBuilder.Entity("iknow_api.Models.HighSchool", b =>
166 {
167 b.HasOne("iknow_api.Models.User", "User")
168 .WithMany()
169 .HasForeignKey("UserId")
170 .OnDelete(DeleteBehavior.Cascade)
171 .IsRequired();
172
173 b.Navigation("User");
174 });
175#pragma warning restore 612, 618
176 }
177 }
178}
Note: See TracBrowser for help on using the repository browser.