| | | 1 | | using Estud.Back.Domain.Institutions; |
| | | 2 | | |
| | | 3 | | namespace Estud.Back.Database.Institutions; |
| | | 4 | | |
| | | 5 | | public class InstitutionDbConfig : IEntityTypeConfiguration<Institution> |
| | | 6 | | { |
| | | 7 | | public void Configure(EntityTypeBuilder<Institution> entity) |
| | | 8 | | { |
| | 4 | 9 | | entity.ToTable("institutions", DbSchemas.Estud); |
| | | 10 | | |
| | 4 | 11 | | entity.HasKey(e => e.Id); |
| | | 12 | | |
| | 4 | 13 | | entity.HasMany(e => e.Campi) |
| | 4 | 14 | | .WithOne() |
| | 4 | 15 | | .HasForeignKey(c => c.InstitutionId); |
| | | 16 | | |
| | 4 | 17 | | entity.HasMany(e => e.Classes) |
| | 4 | 18 | | .WithOne() |
| | 4 | 19 | | .HasForeignKey(c => c.InstitutionId); |
| | | 20 | | |
| | 4 | 21 | | entity.HasMany(e => e.Classrooms) |
| | 4 | 22 | | .WithOne() |
| | 4 | 23 | | .HasForeignKey(c => c.InstitutionId); |
| | | 24 | | |
| | 4 | 25 | | entity.HasMany(e => e.Commands) |
| | 4 | 26 | | .WithOne(c => c.Institution) |
| | 4 | 27 | | .HasForeignKey(c => c.InstitutionId); |
| | | 28 | | |
| | 4 | 29 | | entity.HasMany(e => e.CommandBatches) |
| | 4 | 30 | | .WithOne() |
| | 4 | 31 | | .HasForeignKey(cb => cb.InstitutionId); |
| | | 32 | | |
| | 4 | 33 | | entity.HasMany(e => e.CourseCurriculums) |
| | 4 | 34 | | .WithOne() |
| | 4 | 35 | | .HasForeignKey(cc => cc.InstitutionId); |
| | | 36 | | |
| | 4 | 37 | | entity.HasMany(e => e.CourseOfferings) |
| | 4 | 38 | | .WithOne() |
| | 4 | 39 | | .HasForeignKey(co => co.InstitutionId); |
| | | 40 | | |
| | 4 | 41 | | entity.HasMany(e => e.Courses) |
| | 4 | 42 | | .WithOne() |
| | 4 | 43 | | .HasForeignKey(c => c.InstitutionId); |
| | | 44 | | |
| | 4 | 45 | | entity.HasMany(e => e.Disciplines) |
| | 4 | 46 | | .WithOne() |
| | 4 | 47 | | .HasForeignKey(d => d.InstitutionId); |
| | | 48 | | |
| | 4 | 49 | | entity.HasMany(e => e.ResetPasswordTokens) |
| | 4 | 50 | | .WithOne() |
| | 4 | 51 | | .HasForeignKey(rpt => rpt.InstitutionId); |
| | | 52 | | |
| | 4 | 53 | | entity.HasMany(e => e.SsoConfigurations) |
| | 4 | 54 | | .WithOne() |
| | 4 | 55 | | .HasForeignKey(sc => sc.InstitutionId); |
| | | 56 | | |
| | 4 | 57 | | entity.HasMany(e => e.Users) |
| | 4 | 58 | | .WithOne(u => u.Institution) |
| | 4 | 59 | | .HasForeignKey(u => u.InstitutionId); |
| | | 60 | | |
| | 4 | 61 | | entity.HasMany(e => e.Notifications) |
| | 4 | 62 | | .WithOne() |
| | 4 | 63 | | .HasForeignKey(n => n.InstitutionId); |
| | | 64 | | |
| | 4 | 65 | | entity.HasMany(e => e.AcademicPeriods) |
| | 4 | 66 | | .WithOne() |
| | 4 | 67 | | .HasForeignKey(ap => ap.InstitutionId); |
| | | 68 | | |
| | 4 | 69 | | entity.HasMany(e => e.EnrollmentPeriods) |
| | 4 | 70 | | .WithOne() |
| | 4 | 71 | | .HasForeignKey(ep => ep.InstitutionId); |
| | | 72 | | |
| | 4 | 73 | | entity.HasMany(e => e.Students) |
| | 4 | 74 | | .WithOne() |
| | 4 | 75 | | .HasForeignKey(s => s.InstitutionId); |
| | | 76 | | |
| | 4 | 77 | | entity.HasMany(e => e.Teachers) |
| | 4 | 78 | | .WithOne() |
| | 4 | 79 | | .HasForeignKey(t => t.InstitutionId); |
| | | 80 | | |
| | 4 | 81 | | entity.HasMany(e => e.WebhookSubscriptions) |
| | 4 | 82 | | .WithOne() |
| | 4 | 83 | | .HasForeignKey(w => w.InstitutionId); |
| | | 84 | | |
| | 4 | 85 | | entity.HasMany(e => e.WebhookCalls) |
| | 4 | 86 | | .WithOne() |
| | 4 | 87 | | .HasForeignKey(w => w.InstitutionId); |
| | 4 | 88 | | } |
| | | 89 | | } |