// <auto-generated />
using System;
using Jiaowu.Api.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

#nullable disable

namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
{
    [DbContext(typeof(AppDbContext))]
    [Migration("20260809130121_ExamArrangementJobPayload")]
    partial class ExamArrangementJobPayload
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "10.0.10")
                .HasAnnotation("Relational:MaxIdentifierLength", 64);

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AcademicTerm", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("AcademicYear")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("ArchivedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("EndDate")
                        .HasColumnType("date");

                    b.Property<bool>("IsArchived")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("IsCurrent")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<int>("Season")
                        .HasColumnType("int");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("StartDate")
                        .HasColumnType("date");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("IsArchived");

                    b.HasIndex("IsCurrent");

                    b.HasIndex("IsEnabled", "SortOrder");

                    b.ToTable("AcademicTerms");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AdministrativeClass", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<string>("CounselorName")
                        .HasColumnType("longtext");

                    b.Property<Guid?>("CounselorUserId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Grade")
                        .HasColumnType("int");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<Guid>("MajorId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("CounselorUserId");

                    b.HasIndex("MajorId");

                    b.HasIndex("IsEnabled", "SortOrder");

                    b.ToTable("AdministrativeClasses");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AttendanceCheckInAttempt", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<double?>("AccuracyMeters")
                        .HasColumnType("double");

                    b.Property<Guid>("AttendanceSheetId")
                        .HasColumnType("char(36)");

                    b.Property<int>("CheckInMethod")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DeviceIdentifierHash")
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.Property<string>("DevicePlatform")
                        .HasMaxLength(32)
                        .HasColumnType("varchar(32)");

                    b.Property<double?>("DistanceMeters")
                        .HasColumnType("double");

                    b.Property<string>("FailureCode")
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.Property<string>("IpAddress")
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.Property<bool>("IsSuccessful")
                        .HasColumnType("tinyint(1)");

                    b.Property<decimal?>("Latitude")
                        .HasPrecision(10, 7)
                        .HasColumnType("decimal(10,7)");

                    b.Property<decimal?>("Longitude")
                        .HasPrecision(10, 7)
                        .HasColumnType("decimal(10,7)");

                    b.Property<string>("RiskFlags")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("UserAgent")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.HasKey("Id");

                    b.HasIndex("StudentId");

                    b.HasIndex("DeviceIdentifierHash", "CreatedAt");

                    b.HasIndex("IpAddress", "CreatedAt");

                    b.HasIndex("AttendanceSheetId", "StudentId", "CreatedAt");

                    b.ToTable("AttendanceCheckInAttempts");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AttendanceRecord", b =>
                {
                    b.Property<Guid>("AttendanceSheetId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<string>("AppealReason")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<string>("AppealReviewComment")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<DateTime?>("AppealReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("AppealStatus")
                        .HasColumnType("int");

                    b.Property<DateTime?>("AppealSubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<double?>("CheckInAccuracyMeters")
                        .HasColumnType("double");

                    b.Property<DateTime?>("CheckInAt")
                        .HasColumnType("datetime(6)");

                    b.Property<double?>("CheckInDistanceMeters")
                        .HasColumnType("double");

                    b.Property<decimal?>("CheckInLatitude")
                        .HasPrecision(10, 7)
                        .HasColumnType("decimal(10,7)");

                    b.Property<decimal?>("CheckInLongitude")
                        .HasPrecision(10, 7)
                        .HasColumnType("decimal(10,7)");

                    b.Property<int?>("CheckedInMethod")
                        .HasColumnType("int");

                    b.Property<string>("Notes")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.HasKey("AttendanceSheetId", "StudentId");

                    b.HasIndex("AppealStatus");

                    b.HasIndex("StudentId");

                    b.ToTable("AttendanceRecords");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AttendanceSheet", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("AttendanceDate")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("CheckInEndsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("CheckInMethod")
                        .HasColumnType("int");

                    b.Property<DateTime?>("CheckInStartsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("CheckInToken")
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("LocationRadiusMeters")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<decimal?>("TargetLatitude")
                        .HasPrecision(10, 7)
                        .HasColumnType("decimal(10,7)");

                    b.Property<decimal?>("TargetLongitude")
                        .HasPrecision(10, 7)
                        .HasColumnType("decimal(10,7)");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CheckInToken")
                        .IsUnique();

                    b.HasIndex("TeachingTaskId", "AttendanceDate");

                    b.ToTable("AttendanceSheets");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AutomaticScheduleJob", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("ActiveSchedulePlanId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("CompletedTasks")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("CreatedEntries")
                        .HasColumnType("int");

                    b.Property<string>("ErrorMessage")
                        .HasMaxLength(2000)
                        .HasColumnType("varchar(2000)");

                    b.Property<string>("MessagesJson")
                        .HasColumnType("longtext");

                    b.Property<int>("ProcessedTasks")
                        .HasColumnType("int");

                    b.Property<Guid?>("RequestedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("SchedulePlanId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("StartedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<int>("TotalTasks")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ActiveSchedulePlanId")
                        .IsUnique();

                    b.HasIndex("RequestedByUserId");

                    b.HasIndex("SchedulePlanId", "CreatedAt");

                    b.HasIndex("Status", "CreatedAt");

                    b.ToTable("AutomaticScheduleJobs");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Building", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("CampusId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CampusId");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("IsEnabled", "SortOrder");

                    b.ToTable("Buildings");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Campus", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("Address")
                        .HasColumnType("longtext");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("IsEnabled", "SortOrder");

                    b.ToTable("Campuses");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Classroom", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("BuildingId")
                        .HasColumnType("char(36)");

                    b.Property<int>("Capacity")
                        .HasColumnType("int");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Equipment")
                        .HasColumnType("longtext");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<string>("RoomType")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<int>("TeachingVenueNature")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("BuildingId");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("IsEnabled", "SortOrder");

                    b.ToTable("Classrooms");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ClassroomReservation", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("ApplicantCollegeId")
                        .HasColumnType("char(36)");

                    b.Property<string>("ApplicantName")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<Guid>("ApplicantUserId")
                        .HasColumnType("char(36)");

                    b.Property<int>("AttendeeCount")
                        .HasColumnType("int");

                    b.Property<DateTime?>("CancelledAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("ClassroomId")
                        .HasColumnType("char(36)");

                    b.Property<string>("ContactPhone")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("PeriodCount")
                        .HasColumnType("int");

                    b.Property<string>("Purpose")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<DateTime>("ReservationDate")
                        .HasColumnType("date");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("ReviewedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<int>("StartPeriod")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AcademicTermId");

                    b.HasIndex("ReviewedByUserId");

                    b.HasIndex("ApplicantCollegeId", "Status", "ReservationDate");

                    b.HasIndex("ApplicantUserId", "Status", "CreatedAt");

                    b.HasIndex("ClassroomId", "ReservationDate", "Status", "StartPeriod");

                    b.ToTable("ClassroomReservations");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.College", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("CampusId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<string>("ShortName")
                        .HasColumnType("longtext");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CampusId");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("IsEnabled", "SortOrder");

                    b.ToTable("Colleges");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Course", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<int>("AssessmentMethod")
                        .HasColumnType("int");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<Guid>("CollegeId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("CourseCategoryId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<decimal>("Credits")
                        .HasPrecision(5, 2)
                        .HasColumnType("decimal(5,2)");

                    b.Property<string>("Description")
                        .HasMaxLength(1000)
                        .HasColumnType("varchar(1000)");

                    b.Property<string>("EnglishName")
                        .HasMaxLength(150)
                        .HasColumnType("varchar(150)");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("LectureHours")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<int>("Nature")
                        .HasColumnType("int");

                    b.Property<int>("PracticeHours")
                        .HasColumnType("int");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<int>("TotalHours")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("CourseCategoryId");

                    b.HasIndex("CollegeId", "Nature");

                    b.HasIndex("IsEnabled", "SortOrder");

                    b.ToTable("Courses");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseAdjustment", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("ApplicantUserId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CancelDate")
                        .HasColumnType("date");

                    b.Property<int?>("CancelWeek")
                        .HasColumnType("int");

                    b.Property<Guid?>("ClassroomId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("DayOfWeek")
                        .HasColumnType("int");

                    b.Property<int?>("PeriodCount")
                        .HasColumnType("int");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("ReviewedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("SourceClassroomId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("SourceDate")
                        .HasColumnType("date");

                    b.Property<int?>("SourcePeriodCount")
                        .HasColumnType("int");

                    b.Property<Guid?>("SourceScheduleEntryId")
                        .HasColumnType("char(36)");

                    b.Property<int?>("SourceStartPeriod")
                        .HasColumnType("int");

                    b.Property<int?>("SourceWeek")
                        .HasColumnType("int");

                    b.Property<int?>("StartPeriod")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("SubstituteTeacherId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("TargetDate")
                        .HasColumnType("date");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<int>("Type")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ApplicantUserId");

                    b.HasIndex("ClassroomId");

                    b.HasIndex("SubstituteTeacherId");

                    b.HasIndex("SourceScheduleEntryId", "SourceWeek");

                    b.HasIndex("Status", "CreatedAt");

                    b.HasIndex("TeachingTaskId", "Status");

                    b.ToTable("CourseAdjustments");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseCategory", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("IsEnabled", "SortOrder");

                    b.ToTable("CourseCategories");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseEnrollment", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("CourseSelectionOfferingId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("EnrolledAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("EnrollmentType")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("WaitlistedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("WithdrawnAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CourseSelectionOfferingId", "StudentId")
                        .IsUnique();

                    b.HasIndex("StudentId", "Status");

                    b.HasIndex("CourseSelectionOfferingId", "Status", "WaitlistedAt")
                        .HasDatabaseName("IX_CE_Offering_Status_WaitlistedAt");

                    b.ToTable("CourseEnrollments");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseExemption", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("ReviewedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("TeachingTaskId");

                    b.HasIndex("Status", "CreatedAt");

                    b.HasIndex("StudentId", "TeachingTaskId")
                        .IsUnique();

                    b.ToTable("CourseExemptions");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseGradeStatistic", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<decimal>("AverageScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<int>("Below60Count")
                        .HasColumnType("int");

                    b.Property<DateTime>("CalculatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("CourseId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("From60To69Count")
                        .HasColumnType("int");

                    b.Property<int>("From70To79Count")
                        .HasColumnType("int");

                    b.Property<int>("From80To89Count")
                        .HasColumnType("int");

                    b.Property<int>("From90To100Count")
                        .HasColumnType("int");

                    b.Property<decimal>("HighestScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<decimal>("LowestScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<decimal>("PassRate")
                        .HasPrecision(5, 2)
                        .HasColumnType("decimal(5,2)");

                    b.Property<int>("PassedCount")
                        .HasColumnType("int");

                    b.Property<int>("Scope")
                        .HasColumnType("int");

                    b.Property<Guid?>("ScopeEntityId")
                        .HasColumnType("char(36)");

                    b.Property<int>("StudentCount")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AcademicTermId", "Scope", "ScopeEntityId");

                    b.HasIndex("CourseId", "AcademicTermId", "Scope", "ScopeEntityId")
                        .IsUnique()
                        .HasDatabaseName("UX_CourseGradeStatistics_Scope");

                    b.ToTable("CourseGradeStatistics");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseGradeStatisticsRefreshJob", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("ErrorMessage")
                        .HasMaxLength(2000)
                        .HasColumnType("varchar(2000)");

                    b.Property<Guid>("GradeSheetId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("StartedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GradeSheetId");

                    b.HasIndex("Status", "CreatedAt");

                    b.ToTable("CourseGradeStatisticsRefreshJobs");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseGradeStatisticsRefreshSetting", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<int>("BatchSize")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("IntervalSeconds")
                        .HasColumnType("int");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Key")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<DateTime?>("LastRunAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Key")
                        .IsUnique();

                    b.ToTable("CourseGradeStatisticsRefreshSettings");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseGroup", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Description")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.ToTable("CourseGroups");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseGroupCourse", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("CourseGroupId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("CourseId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CourseId");

                    b.HasIndex("CourseGroupId", "CourseId")
                        .IsUnique();

                    b.ToTable("CourseGroupCourses");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CoursePrerequisite", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("CourseId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("PrerequisiteCourseId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("PrerequisiteCourseId");

                    b.HasIndex("CourseId", "PrerequisiteCourseId")
                        .IsUnique();

                    b.ToTable("CoursePrerequisites");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseSelectionOffering", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<int>("Capacity")
                        .HasColumnType("int");

                    b.Property<Guid>("CourseSelectionRoundId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("IsOpenToAll")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("TeachingTaskId");

                    b.HasIndex("CourseSelectionRoundId", "TeachingTaskId")
                        .IsUnique();

                    b.ToTable("CourseSelectionOfferings");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseSelectionRound", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("EndsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("MaxCourseCount")
                        .HasColumnType("int");

                    b.Property<decimal>("MaxCredits")
                        .HasPrecision(6, 1)
                        .HasColumnType("decimal(6,1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime>("StartsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("WithdrawalEndsAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AcademicTermId", "Status");

                    b.ToTable("CourseSelectionRounds");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseSelectionRoundGrade", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("CourseSelectionRoundId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Grade")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Grade");

                    b.HasIndex("CourseSelectionRoundId", "Grade")
                        .IsUnique();

                    b.ToTable("CourseSelectionRoundGrades");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseSubstitution", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("OriginalCourseId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("ReviewedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("SubstituteCourseId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("OriginalCourseId");

                    b.HasIndex("SubstituteCourseId");

                    b.HasIndex("Status", "CreatedAt");

                    b.HasIndex("StudentId", "OriginalCourseId")
                        .IsUnique();

                    b.ToTable("CourseSubstitutions");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CurriculumCourse", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("CourseId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("CurriculumModuleId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("RecommendedSemester")
                        .HasColumnType("int");

                    b.Property<int>("Type")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CourseId");

                    b.HasIndex("CurriculumModuleId", "CourseId")
                        .IsUnique();

                    b.ToTable("CurriculumCourses");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CurriculumModule", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("CurriculumPlanId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<decimal>("RequiredCredits")
                        .HasPrecision(6, 2)
                        .HasColumnType("decimal(6,2)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CurriculumPlanId", "Code")
                        .IsUnique();

                    b.ToTable("CurriculumModules");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CurriculumPlan", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Description")
                        .HasMaxLength(1000)
                        .HasColumnType("varchar(1000)");

                    b.Property<int>("EffectiveGrade")
                        .HasColumnType("int");

                    b.Property<Guid>("MajorId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<decimal>("TotalCredits")
                        .HasPrecision(6, 2)
                        .HasColumnType("decimal(6,2)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Version")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.HasKey("Id");

                    b.HasIndex("Status", "EffectiveGrade");

                    b.HasIndex("MajorId", "EffectiveGrade", "Version")
                        .IsUnique();

                    b.ToTable("CurriculumPlans");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.DeferredExam", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("ReviewedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("TeachingTaskId");

                    b.HasIndex("Status", "CreatedAt");

                    b.HasIndex("StudentId", "TeachingTaskId")
                        .IsUnique();

                    b.ToTable("DeferredExams");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.DegreeAwardBatch", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CalculatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DegreeName")
                        .IsRequired()
                        .HasMaxLength(80)
                        .HasColumnType("varchar(80)");

                    b.Property<int>("GraduationYear")
                        .HasColumnType("int");

                    b.Property<decimal>("MinimumGradePoint")
                        .HasPrecision(3, 2)
                        .HasColumnType("decimal(3,2)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GraduationYear", "Status");

                    b.ToTable("DegreeAwardBatches");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.DegreeAwardResult", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<decimal>("AverageGradePoint")
                        .HasPrecision(4, 2)
                        .HasColumnType("decimal(4,2)");

                    b.Property<int>("CalculatedConclusion")
                        .HasColumnType("int");

                    b.Property<int>("Conclusion")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("DegreeAwardBatchId")
                        .HasColumnType("char(36)");

                    b.Property<string>("ExceptionReason")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<Guid>("GraduationAuditResultId")
                        .HasColumnType("char(36)");

                    b.Property<bool>("IsOverridden")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GraduationAuditResultId");

                    b.HasIndex("StudentId");

                    b.HasIndex("Conclusion", "IsOverridden");

                    b.HasIndex("DegreeAwardBatchId", "StudentId")
                        .IsUnique();

                    b.ToTable("DegreeAwardResults");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationDimension", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("EvaluationSetupId")
                        .HasColumnType("char(36)");

                    b.Property<int>("MaxScore")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(60)
                        .HasColumnType("varchar(60)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("EvaluationSetupId", "SortOrder");

                    b.ToTable("EvaluationDimensions");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationRecord", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("EvaluationSetupId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("StudentId");

                    b.HasIndex("TeachingTaskId");

                    b.HasIndex("EvaluationSetupId", "StudentId", "TeachingTaskId")
                        .IsUnique();

                    b.ToTable("EvaluationRecords");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationScore", b =>
                {
                    b.Property<Guid>("EvaluationRecordId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("EvaluationDimensionId")
                        .HasColumnType("char(36)");

                    b.Property<int>("Score")
                        .HasColumnType("int");

                    b.HasKey("EvaluationRecordId", "EvaluationDimensionId");

                    b.HasIndex("EvaluationDimensionId");

                    b.ToTable("EvaluationScores");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationSetup", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("EndsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<DateTime?>("StartsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AcademicTermId", "Status");

                    b.ToTable("EvaluationSetups");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamArrangementJob", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("ActivePlanId")
                        .HasColumnType("char(36)");

                    b.Property<bool>("AssignClassrooms")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("AssignInvigilators")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("CurrentStep")
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<string>("ErrorMessage")
                        .HasMaxLength(2000)
                        .HasColumnType("varchar(2000)");

                    b.Property<int>("Kind")
                        .HasColumnType("int");

                    b.Property<Guid>("PlanId")
                        .HasColumnType("char(36)");

                    b.Property<int>("ProcessedSessions")
                        .HasColumnType("int");

                    b.Property<string>("ProjectIdsJson")
                        .HasColumnType("longtext");

                    b.Property<Guid?>("RequestedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<string>("ResultMessage")
                        .HasMaxLength(2000)
                        .HasColumnType("varchar(2000)");

                    b.Property<string>("SessionIdsJson")
                        .HasColumnType("longtext");

                    b.Property<DateTime?>("StartedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<int>("TotalSessions")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("RequestedByUserId");

                    b.HasIndex("Kind", "ActivePlanId")
                        .IsUnique()
                        .HasDatabaseName("UX_ExamArrangementJobs_Kind_ActivePlan");

                    b.HasIndex("Status", "CreatedAt");

                    b.HasIndex("Kind", "PlanId", "CreatedAt")
                        .HasDatabaseName("IX_ExamArrangementJobs_Kind_Plan_CreatedAt");

                    b.ToTable("ExamArrangementJobs");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamPlan", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AcademicTermId", "Status");

                    b.ToTable("ExamPlans");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamPublishJob", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("ActivePlanId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("CurrentStep")
                        .HasColumnType("longtext");

                    b.Property<string>("ErrorMessage")
                        .HasColumnType("longtext");

                    b.Property<int>("Kind")
                        .HasColumnType("int");

                    b.Property<Guid>("PlanId")
                        .HasColumnType("char(36)");

                    b.Property<string>("ProjectIdsJson")
                        .HasColumnType("longtext");

                    b.Property<Guid?>("RequestedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("StartedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.ToTable("ExamPublishJobs");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamRoomAssignment", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("ClassroomId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("CourseId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("EndsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("ExamDate")
                        .HasColumnType("date");

                    b.Property<Guid>("ExamPlanId")
                        .HasColumnType("char(36)");

                    b.Property<int>("PeriodCount")
                        .HasColumnType("int");

                    b.Property<int>("RequiredInvigilatorCount")
                        .HasColumnType("int");

                    b.Property<int>("StartPeriod")
                        .HasColumnType("int");

                    b.Property<DateTime>("StartsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ClassroomId");

                    b.HasIndex("CourseId")
                        .HasDatabaseName("IX_ExamRooms_CourseId");

                    b.HasIndex("ExamPlanId", "StartsAt")
                        .HasDatabaseName("IX_ExamRooms_Plan_Time");

                    b.HasIndex("ExamPlanId", "ClassroomId", "StartsAt")
                        .HasDatabaseName("IX_ExamRooms_Plan_Room_Time");

                    b.ToTable("ExamRooms", (string)null);
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamRoomInvigilator", b =>
                {
                    b.Property<Guid>("ExamRoomId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("TeacherId")
                        .HasColumnType("char(36)");

                    b.HasKey("ExamRoomId", "TeacherId");

                    b.HasIndex("TeacherId")
                        .HasDatabaseName("IX_ExamRoomInvigilators_TeacherId");

                    b.ToTable("ExamRoomInvigilators", (string)null);
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamRoomSession", b =>
                {
                    b.Property<Guid>("ExamRoomId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("ExamSessionId")
                        .HasColumnType("char(36)");

                    b.HasKey("ExamRoomId", "ExamSessionId");

                    b.HasIndex("ExamSessionId")
                        .HasDatabaseName("IX_ExamRoomSessions_SessionId");

                    b.ToTable("ExamRoomSessions", (string)null);
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamSeatAssignment", b =>
                {
                    b.Property<Guid>("ExamRoomId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("ExamSessionId")
                        .HasColumnType("char(36)");

                    b.Property<int>("SeatNumber")
                        .HasColumnType("int");

                    b.HasKey("ExamRoomId", "StudentId");

                    b.HasIndex("StudentId")
                        .HasDatabaseName("IX_ExamSeats_StudentId");

                    b.HasIndex("ExamSessionId", "StudentId")
                        .IsUnique()
                        .HasDatabaseName("UX_ExamSeats_Session_Student");

                    b.ToTable("ExamSeats", (string)null);
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamSession", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("ClassroomId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("EndsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("ExamDate")
                        .HasColumnType("date");

                    b.Property<Guid>("ExamPlanId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("PeriodCount")
                        .HasColumnType("int");

                    b.Property<Guid?>("RequiredBuildingId")
                        .HasColumnType("char(36)");

                    b.Property<string>("RequiredBuildingIds")
                        .HasColumnType("longtext");

                    b.Property<int>("RequiredInvigilatorCount")
                        .HasColumnType("int");

                    b.Property<int>("StartPeriod")
                        .HasColumnType("int");

                    b.Property<DateTime>("StartsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ClassroomId");

                    b.HasIndex("RequiredBuildingId");

                    b.HasIndex("TeachingTaskId");

                    b.HasIndex("ExamPlanId", "ExamDate");

                    b.HasIndex("ExamPlanId", "StartsAt");

                    b.ToTable("ExamSessions");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamSessionInvigilator", b =>
                {
                    b.Property<Guid>("ExamSessionId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("TeacherId")
                        .HasColumnType("char(36)");

                    b.HasKey("ExamSessionId", "TeacherId");

                    b.HasIndex("TeacherId");

                    b.ToTable("ExamSessionInvigilators");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamSignInExportJob", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("CurrentStep")
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<string>("ErrorMessage")
                        .HasMaxLength(2000)
                        .HasColumnType("varchar(2000)");

                    b.Property<byte[]>("FileBytes")
                        .HasColumnType("longblob");

                    b.Property<string>("FileName")
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<int>("FileSize")
                        .HasColumnType("int");

                    b.Property<Guid>("PlanId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("RequestedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("StartedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("RequestedByUserId");

                    b.HasIndex("PlanId", "CreatedAt");

                    b.HasIndex("Status", "CreatedAt");

                    b.ToTable("ExamSignInExportJobs");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentBooking", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("BookedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime?>("CancelledAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("ExperimentProjectId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("ExperimentSessionId")
                        .HasColumnType("char(36)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("StudentId");

                    b.HasIndex("ExperimentProjectId", "StudentId")
                        .IsUnique();

                    b.HasIndex("ExperimentSessionId", "Status", "BookedAt");

                    b.ToTable("ExperimentBookings");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeItem", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("ExperimentGradeSheetId")
                        .HasColumnType("char(36)");

                    b.Property<int>("Kind")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(60)
                        .HasColumnType("varchar(60)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<decimal>("Weight")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.HasKey("Id");

                    b.HasIndex("ExperimentGradeSheetId", "SortOrder");

                    b.ToTable("ExperimentGradeItems");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeItemScore", b =>
                {
                    b.Property<Guid>("ExperimentGradeRecordId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("ExperimentGradeItemId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Comment")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<decimal?>("Score")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.HasKey("ExperimentGradeRecordId", "ExperimentGradeItemId");

                    b.HasIndex("ExperimentGradeItemId");

                    b.ToTable("ExperimentGradeItemScores");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeRecord", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<int>("AttemptNumber")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("ExperimentGradeSheetId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("ExperimentSessionId")
                        .HasColumnType("char(36)");

                    b.Property<bool>("IsLate")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool?>("IsPassed")
                        .HasColumnType("tinyint(1)");

                    b.Property<int>("ParticipationStatus")
                        .HasColumnType("int");

                    b.Property<bool>("SafetyViolation")
                        .HasColumnType("tinyint(1)");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<string>("SubmissionReference")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("TeacherComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<decimal?>("TotalScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ExperimentSessionId");

                    b.HasIndex("StudentId");

                    b.HasIndex("ExperimentGradeSheetId", "StudentId")
                        .IsUnique();

                    b.ToTable("ExperimentGradeRecords");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeSheet", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<decimal>("ContributionWeight")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("ExperimentProjectId")
                        .HasColumnType("char(36)");

                    b.Property<decimal>("PassScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ExperimentProjectId")
                        .IsUnique();

                    b.ToTable("ExperimentGradeSheets");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentProject", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<int>("ArrangementMode")
                        .HasColumnType("int");

                    b.Property<DateTime?>("ClosedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Description")
                        .HasMaxLength(1000)
                        .HasColumnType("varchar(1000)");

                    b.Property<DateTime>("EndDate")
                        .HasColumnType("date");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Requirements")
                        .HasMaxLength(1000)
                        .HasColumnType("varchar(1000)");

                    b.Property<Guid?>("ScheduleEntryId")
                        .HasColumnType("char(36)");

                    b.Property<int?>("ScheduleWeek")
                        .HasColumnType("int");

                    b.Property<DateTime>("StartDate")
                        .HasColumnType("date");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ScheduleEntryId");

                    b.HasIndex("Status", "StartDate", "EndDate");

                    b.HasIndex("TeachingTaskId", "Code", "ScheduleEntryId", "ScheduleWeek")
                        .IsUnique();

                    b.ToTable("ExperimentProjects");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentSession", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CancelledAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Capacity")
                        .HasColumnType("int");

                    b.Property<Guid>("ClassroomId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("ExperimentProjectId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("PeriodCount")
                        .HasColumnType("int");

                    b.Property<int>("ReservedCount")
                        .HasColumnType("int");

                    b.Property<DateTime>("SessionDate")
                        .HasColumnType("date");

                    b.Property<int>("StartPeriod")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ExperimentProjectId", "SessionDate", "StartPeriod");

                    b.HasIndex("ClassroomId", "SessionDate", "Status", "StartPeriod");

                    b.ToTable("ExperimentSessions");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeItem", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("GradeSheetId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(60)
                        .HasColumnType("varchar(60)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime?>("SourceSnapshotAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("SourceType")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .HasDefaultValue(1);

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<decimal>("Weight")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.HasKey("Id");

                    b.HasIndex("GradeSheetId", "SortOrder");

                    b.ToTable("GradeItems");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeItemScore", b =>
                {
                    b.Property<Guid>("GradeRecordId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("GradeItemId")
                        .HasColumnType("char(36)");

                    b.Property<decimal?>("Score")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.HasKey("GradeRecordId", "GradeItemId");

                    b.HasIndex("GradeItemId");

                    b.ToTable("GradeItemScores");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeModification", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("ApplicantUserId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CollegeReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("CollegeReviewedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<decimal>("CurrentScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<DateTime?>("FinalReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("FinalReviewedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("GradeRecordId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<decimal>("RequestedScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GradeRecordId");

                    b.HasIndex("Status", "CreatedAt");

                    b.ToTable("GradeModifications");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeRecord", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("ExamStatus")
                        .HasColumnType("int");

                    b.Property<decimal?>("FinalScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<decimal?>("GradePoint")
                        .HasPrecision(3, 1)
                        .HasColumnType("decimal(3,1)");

                    b.Property<Guid>("GradeSheetId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Notes")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<decimal?>("RegularScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<decimal?>("TotalScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GradeSheetId", "StudentId")
                        .IsUnique();

                    b.HasIndex("StudentId", "TotalScore");

                    b.ToTable("GradeRecords");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeSheet", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<decimal>("FinalWeight")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<decimal>("RegularWeight")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime?>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Status");

                    b.HasIndex("TeachingTaskId")
                        .IsUnique();

                    b.ToTable("GradeSheets");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationAuditBatch", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CalculatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("EnrollmentYear")
                        .HasColumnType("int");

                    b.Property<int>("GraduationYear")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Status");

                    b.HasIndex("GraduationYear", "EnrollmentYear");

                    b.ToTable("GraduationAuditBatches");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationAuditResult", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<int>("CalculatedConclusion")
                        .HasColumnType("int");

                    b.Property<int>("Conclusion")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("CurriculumPlanId")
                        .HasColumnType("char(36)");

                    b.Property<decimal>("EarnedCredits")
                        .HasPrecision(6, 2)
                        .HasColumnType("decimal(6,2)");

                    b.Property<int>("FailedCourseCount")
                        .HasColumnType("int");

                    b.Property<Guid>("GraduationAuditBatchId")
                        .HasColumnType("char(36)");

                    b.Property<bool>("IsOverridden")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("MissingCourseNames")
                        .IsRequired()
                        .HasMaxLength(2000)
                        .HasColumnType("varchar(2000)");

                    b.Property<int>("PassedRequiredCourseCount")
                        .HasColumnType("int");

                    b.Property<int>("RequiredCourseCount")
                        .HasColumnType("int");

                    b.Property<decimal>("RequiredCredits")
                        .HasPrecision(6, 2)
                        .HasColumnType("decimal(6,2)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<int>("StudentStatusSnapshot")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CurriculumPlanId");

                    b.HasIndex("StudentId");

                    b.HasIndex("Conclusion", "IsOverridden");

                    b.HasIndex("GraduationAuditBatchId", "StudentId")
                        .IsUnique();

                    b.ToTable("GraduationAuditResults");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceBatch", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("ClosedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("GraduationYear")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GraduationYear", "Status");

                    b.ToTable("GraduationClearanceBatches");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceItem", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("GraduationClearanceBatchId")
                        .HasColumnType("char(36)");

                    b.Property<bool>("IsRequired")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<string>("ResponsibleRole")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<string>("ResponsibleUnit")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GraduationClearanceBatchId", "Code")
                        .IsUnique();

                    b.ToTable("GraduationClearanceItems");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceRecord", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("CompletedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("GraduationClearanceItemId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("GraduationClearanceItemId", "StudentId")
                        .IsUnique();

                    b.HasIndex("StudentId", "Status");

                    b.ToTable("GraduationClearanceRecords");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Major", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<Guid>("CollegeId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DegreeType")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<int>("SchoolingYears")
                        .HasColumnType("int");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Code")
                        .IsUnique();

                    b.HasIndex("CollegeId");

                    b.HasIndex("IsEnabled", "SortOrder");

                    b.ToTable("Majors");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamAutoJob", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("CreatedSessions")
                        .HasColumnType("int");

                    b.Property<int>("EnrolledStudents")
                        .HasColumnType("int");

                    b.Property<string>("ErrorMessage")
                        .HasMaxLength(2000)
                        .HasColumnType("varchar(2000)");

                    b.Property<Guid>("MakeupExamPlanId")
                        .HasColumnType("char(36)");

                    b.Property<string>("MessagesJson")
                        .HasColumnType("longtext");

                    b.Property<int>("ProcessedCourses")
                        .HasColumnType("int");

                    b.Property<DateTime?>("StartedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<int>("TotalCourses")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("MakeupExamPlanId", "CreatedAt");

                    b.HasIndex("Status", "CreatedAt");

                    b.ToTable("MakeupExamAutoJobs");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamEnrollment", b =>
                {
                    b.Property<Guid>("MakeupExamSessionId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<decimal?>("MakeupScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<int>("Reason")
                        .HasColumnType("int");

                    b.Property<Guid?>("SourceDeferredExamId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("SourceGradeRecordId")
                        .HasColumnType("char(36)");

                    b.HasKey("MakeupExamSessionId", "StudentId");

                    b.HasIndex("SourceDeferredExamId");

                    b.HasIndex("SourceGradeRecordId");

                    b.HasIndex("StudentId", "MakeupExamSessionId");

                    b.ToTable("MakeupExamEnrollments");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamPlan", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AcademicTermId", "Status");

                    b.ToTable("MakeupExamPlans");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamSession", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("ClassroomId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("EndsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("ExamDate")
                        .HasColumnType("date");

                    b.Property<Guid>("MakeupExamPlanId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("PeriodCount")
                        .HasColumnType("int");

                    b.Property<Guid?>("RequiredBuildingId")
                        .HasColumnType("char(36)");

                    b.Property<string>("RequiredBuildingIds")
                        .HasColumnType("longtext");

                    b.Property<int>("RequiredInvigilatorCount")
                        .HasColumnType("int");

                    b.Property<int>("StartPeriod")
                        .HasColumnType("int");

                    b.Property<DateTime>("StartsAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ClassroomId");

                    b.HasIndex("RequiredBuildingId");

                    b.HasIndex("TeachingTaskId");

                    b.HasIndex("MakeupExamPlanId", "ExamDate");

                    b.HasIndex("MakeupExamPlanId", "StartsAt");

                    b.ToTable("MakeupExamSessions");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamSessionInvigilator", b =>
                {
                    b.Property<Guid>("MakeupExamSessionId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("TeacherId")
                        .HasColumnType("char(36)");

                    b.HasKey("MakeupExamSessionId", "TeacherId");

                    b.HasIndex("TeacherId");

                    b.ToTable("MakeupExamSessionInvigilators");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MessageDispatch", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("AudienceId")
                        .HasColumnType("char(36)");

                    b.Property<string>("AudienceName")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<int>("AudienceType")
                        .HasColumnType("int");

                    b.Property<int>("Category")
                        .HasColumnType("int");

                    b.Property<string>("Content")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("LinkUrl")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<int>("RecipientCount")
                        .HasColumnType("int");

                    b.Property<string>("SenderName")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<Guid>("SenderUserId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("SenderUserId", "CreatedAt");

                    b.ToTable("MessageDispatches");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Notification", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<int>("Category")
                        .HasColumnType("int");

                    b.Property<string>("Content")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("IsRead")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("LinkUrl")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<Guid?>("MessageDispatchId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("UserId")
                        .HasColumnType("char(36)");

                    b.HasKey("Id");

                    b.HasIndex("CreatedAt");

                    b.HasIndex("MessageDispatchId");

                    b.HasIndex("UserId", "IsRead");

                    b.HasIndex("UserId", "Category", "CreatedAt");

                    b.ToTable("Notifications");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OfficialDocument", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DocumentNumber")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<DateTime?>("InvalidatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("InvalidatedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<string>("InvalidationReason")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime>("IssuedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("IssuedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<byte[]>("PdfContent")
                        .IsRequired()
                        .HasColumnType("longblob");

                    b.Property<string>("PdfSha256")
                        .IsRequired()
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.Property<string>("Purpose")
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<Guid?>("ReissuedFromDocumentId")
                        .HasColumnType("char(36)");

                    b.Property<string>("SnapshotJson")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<int>("Type")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("VerificationCodeHash")
                        .IsRequired()
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.HasKey("Id");

                    b.HasIndex("DocumentNumber")
                        .IsUnique();

                    b.HasIndex("InvalidatedByUserId");

                    b.HasIndex("IssuedByUserId");

                    b.HasIndex("ReissuedFromDocumentId")
                        .IsUnique();

                    b.HasIndex("VerificationCodeHash")
                        .IsUnique();

                    b.HasIndex("Status", "IssuedAt");

                    b.HasIndex("StudentId", "IssuedAt");

                    b.ToTable("OfficialDocuments");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OfficialDocumentDownload", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("DownloadedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<string>("IpAddress")
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.Property<Guid>("OfficialDocumentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("UserAgent")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.HasKey("Id");

                    b.HasIndex("DownloadedByUserId", "CreatedAt");

                    b.HasIndex("OfficialDocumentId", "CreatedAt");

                    b.ToTable("OfficialDocumentDownloads");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OtherExamBatch", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("ExamCode")
                        .HasMaxLength(60)
                        .HasColumnType("varchar(60)");

                    b.Property<DateTime>("ExamDate")
                        .HasColumnType("date");

                    b.Property<string>("LevelOptions")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<decimal?>("MaxScore")
                        .HasPrecision(8, 2)
                        .HasColumnType("decimal(8,2)");

                    b.Property<int>("MetricKind")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(150)
                        .HasColumnType("varchar(150)");

                    b.Property<string>("Organizer")
                        .HasMaxLength(150)
                        .HasColumnType("varchar(150)");

                    b.Property<int>("PublicationCount")
                        .HasColumnType("int");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Status", "ExamDate");

                    b.ToTable("OtherExamBatches");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OtherExamResult", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<int>("AttemptNumber")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<bool?>("IsPassed")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Level")
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<Guid>("OtherExamBatchId")
                        .HasColumnType("char(36)");

                    b.Property<decimal?>("Score")
                        .HasPrecision(8, 2)
                        .HasColumnType("decimal(8,2)");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("StudentId", "OtherExamBatchId");

                    b.HasIndex("OtherExamBatchId", "StudentId", "AttemptNumber")
                        .IsUnique();

                    b.ToTable("OtherExamResults");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.PublishedScheduleOccurrence", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("ClassroomId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("DayOfWeek")
                        .HasColumnType("int");

                    b.Property<int>("Kind")
                        .HasColumnType("int");

                    b.Property<int>("PeriodCount")
                        .HasColumnType("int");

                    b.Property<Guid>("ScheduleEntryId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("SchedulePlanId")
                        .HasColumnType("char(36)");

                    b.Property<int>("StartPeriod")
                        .HasColumnType("int");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Week")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ClassroomId");

                    b.HasIndex("TeachingTaskId");

                    b.HasIndex("ScheduleEntryId", "Week")
                        .IsUnique();

                    b.HasIndex("AcademicTermId", "TeachingTaskId", "Week");

                    b.HasIndex("AcademicTermId", "Week", "DayOfWeek", "StartPeriod", "ClassroomId");

                    b.HasIndex("SchedulePlanId", "ClassroomId", "Week", "DayOfWeek", "StartPeriod");

                    b.ToTable("PublishedScheduleOccurrences");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ScheduleEntry", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("ClassroomId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("DayOfWeek")
                        .HasColumnType("int");

                    b.Property<int>("EndWeek")
                        .HasColumnType("int");

                    b.Property<int>("Kind")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .HasDefaultValue(1);

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("PeriodCount")
                        .HasColumnType("int");

                    b.Property<Guid>("SchedulePlanId")
                        .HasColumnType("char(36)");

                    b.Property<int>("StartPeriod")
                        .HasColumnType("int");

                    b.Property<int>("StartWeek")
                        .HasColumnType("int");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("WeekPattern")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("ClassroomId");

                    b.HasIndex("TeachingTaskId");

                    b.HasIndex("SchedulePlanId", "DayOfWeek", "StartPeriod");

                    b.ToTable("ScheduleEntries");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.SchedulePlan", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Version")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.HasKey("Id");

                    b.HasIndex("AcademicTermId", "Status");

                    b.HasIndex("AcademicTermId", "Version")
                        .IsUnique();

                    b.ToTable("SchedulePlans");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.SchedulePublishJob", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("ActiveAcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("CompletedSteps")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("CurrentStep")
                        .HasMaxLength(200)
                        .HasColumnType("varchar(200)");

                    b.Property<string>("ErrorMessage")
                        .HasMaxLength(2000)
                        .HasColumnType("varchar(2000)");

                    b.Property<Guid?>("RequestedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("SchedulePlanId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("StartedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<int>("TotalSteps")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ActiveAcademicTermId")
                        .IsUnique();

                    b.HasIndex("RequestedByUserId");

                    b.HasIndex("SchedulePlanId", "CreatedAt");

                    b.HasIndex("Status", "CreatedAt");

                    b.ToTable("SchedulePublishJobs");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ScheduleTimeSlot", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<TimeSpan>("EndsAt")
                        .HasColumnType("time");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<int>("PeriodNumber")
                        .HasColumnType("int");

                    b.Property<TimeSpan>("StartsAt")
                        .HasColumnType("time");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AcademicTermId", "PeriodNumber")
                        .IsUnique();

                    b.ToTable("ScheduleTimeSlots");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Student", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AdministrativeClassId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Biography")
                        .HasMaxLength(1000)
                        .HasColumnType("varchar(1000)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("CurrentAddress")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<DateTime?>("DateOfBirth")
                        .HasColumnType("date");

                    b.Property<string>("Email")
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<string>("EmergencyContactName")
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<string>("EmergencyContactPhone")
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<string>("EmergencyContactRelationship")
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<string>("EnglishName")
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<DateTime>("EnrollmentDate")
                        .HasColumnType("date");

                    b.Property<int>("EnrollmentYear")
                        .HasColumnType("int");

                    b.Property<string>("Ethnicity")
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<int>("Gender")
                        .HasColumnType("int");

                    b.Property<string>("HouseholdAddress")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<string>("IdCardNumber")
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<string>("Nationality")
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<string>("NativePlace")
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<string>("Phone")
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<string>("PoliticalStatus")
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<string>("PostalCode")
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)");

                    b.Property<string>("Qq")
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<string>("SpecialNeeds")
                        .HasMaxLength(1000)
                        .HasColumnType("varchar(1000)");

                    b.Property<string>("SpecialTags")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<string>("StudentNumber")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("UserId")
                        .HasColumnType("char(36)");

                    b.Property<string>("WeChat")
                        .HasMaxLength(60)
                        .HasColumnType("varchar(60)");

                    b.HasKey("Id");

                    b.HasIndex("EnrollmentYear");

                    b.HasIndex("StudentNumber")
                        .IsUnique();

                    b.HasIndex("UserId");

                    b.HasIndex("AdministrativeClassId", "Status");

                    b.ToTable("Students");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.StudentStatusChange", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("ApprovedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("OriginalStatus")
                        .HasColumnType("int");

                    b.Property<string>("Reason")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("varchar(1000)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("State")
                        .HasColumnType("int");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("TargetStatus")
                        .HasColumnType("int");

                    b.Property<int>("Type")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("StudentId", "State");

                    b.ToTable("StudentStatusChanges");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Teacher", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("CollegeId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Email")
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<int>("Gender")
                        .HasColumnType("int");

                    b.Property<DateTime?>("HireDate")
                        .HasColumnType("date");

                    b.Property<bool>("IsExternal")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<string>("Phone")
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<string>("TeacherNumber")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<string>("Title")
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("UserId")
                        .HasColumnType("char(36)");

                    b.HasKey("Id");

                    b.HasIndex("TeacherNumber")
                        .IsUnique();

                    b.HasIndex("UserId");

                    b.HasIndex("CollegeId", "Status");

                    b.ToTable("Teachers");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeacherCourseApplication", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("CourseId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("ReviewComment")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("ReviewedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("ReviewedByUserId")
                        .HasColumnType("char(36)");

                    b.Property<string>("Statement")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<DateTime>("SubmittedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("TeacherId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("CourseId");

                    b.HasIndex("ReviewedByUserId");

                    b.HasIndex("TeacherId");

                    b.HasIndex("Status", "AcademicTermId");

                    b.HasIndex("AcademicTermId", "TeacherId", "CourseId")
                        .IsUnique();

                    b.ToTable("TeacherCourseApplications");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTask", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<int>("Capacity")
                        .HasColumnType("int");

                    b.Property<Guid>("CourseId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("EndWeek")
                        .HasColumnType("int");

                    b.Property<string>("GenerationBatchCode")
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(120)
                        .HasColumnType("varchar(120)");

                    b.Property<string>("Notes")
                        .HasMaxLength(500)
                        .HasColumnType("varchar(500)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("SchedulingMode")
                        .HasColumnType("int");

                    b.Property<int>("StartWeek")
                        .HasColumnType("int");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<string>("TaskNumber")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("WeeklyHours")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("CourseId");

                    b.HasIndex("TaskNumber")
                        .IsUnique();

                    b.HasIndex("AcademicTermId", "Status");

                    b.ToTable("TeachingTasks");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskAllowedClassroom", b =>
                {
                    b.Property<Guid>("TeachingTaskScheduleConstraintId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("ClassroomId")
                        .HasColumnType("char(36)");

                    b.HasKey("TeachingTaskScheduleConstraintId", "ClassroomId");

                    b.HasIndex("ClassroomId");

                    b.ToTable("TeachingTaskAllowedClassrooms");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskAllowedExperimentClassroom", b =>
                {
                    b.Property<Guid>("TeachingTaskScheduleConstraintId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("ClassroomId")
                        .HasColumnType("char(36)");

                    b.HasKey("TeachingTaskScheduleConstraintId", "ClassroomId");

                    b.HasIndex("ClassroomId");

                    b.ToTable("TeachingTaskAllowedExperimentClassrooms");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskClass", b =>
                {
                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AdministrativeClassId")
                        .HasColumnType("char(36)");

                    b.HasKey("TeachingTaskId", "AdministrativeClassId");

                    b.HasIndex("AdministrativeClassId");

                    b.ToTable("TeachingTaskClasses");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskGradeScoreBand", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Label")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<decimal>("LowerBound")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<int>("SortOrder")
                        .HasColumnType("int");

                    b.Property<int>("StudentCount")
                        .HasColumnType("int");

                    b.Property<Guid>("TeachingTaskGradeStatisticId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<decimal?>("UpperBound")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.HasKey("Id");

                    b.HasIndex("TeachingTaskGradeStatisticId", "SortOrder")
                        .IsUnique();

                    b.ToTable("TeachingTaskGradeScoreBands");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskGradeStatistic", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<decimal>("AverageScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<DateTime>("CalculatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("CourseId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("ExcellentCount")
                        .HasColumnType("int");

                    b.Property<decimal>("ExcellentRate")
                        .HasPrecision(5, 2)
                        .HasColumnType("decimal(5,2)");

                    b.Property<Guid>("GradeSheetId")
                        .HasColumnType("char(36)");

                    b.Property<decimal>("HighestScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<decimal>("LowestScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<decimal>("MedianScore")
                        .HasPrecision(5, 1)
                        .HasColumnType("decimal(5,1)");

                    b.Property<decimal>("PassRate")
                        .HasPrecision(5, 2)
                        .HasColumnType("decimal(5,2)");

                    b.Property<int>("PassedCount")
                        .HasColumnType("int");

                    b.Property<decimal>("StandardDeviation")
                        .HasPrecision(6, 2)
                        .HasColumnType("decimal(6,2)");

                    b.Property<int>("StudentCount")
                        .HasColumnType("int");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AcademicTermId");

                    b.HasIndex("GradeSheetId")
                        .IsUnique();

                    b.HasIndex("TeachingTaskId")
                        .IsUnique();

                    b.HasIndex("CourseId", "AcademicTermId");

                    b.ToTable("TeachingTaskGradeStatistics");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskScheduleConstraint", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("AllowedDayOfWeeks")
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)");

                    b.Property<int>("AllowedExperimentVenueNatures")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int?>("EarliestPeriod")
                        .HasColumnType("int");

                    b.Property<Guid?>("ExperimentRequiredBuildingId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("ExperimentRequiredCampusId")
                        .HasColumnType("char(36)");

                    b.Property<int?>("LatestPeriod")
                        .HasColumnType("int");

                    b.Property<Guid?>("RequiredBuildingId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("RequiredCampusId")
                        .HasColumnType("char(36)");

                    b.Property<bool>("RequiresClassroom")
                        .HasColumnType("tinyint(1)");

                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ExperimentRequiredBuildingId");

                    b.HasIndex("ExperimentRequiredCampusId");

                    b.HasIndex("RequiredBuildingId");

                    b.HasIndex("RequiredCampusId");

                    b.HasIndex("TeachingTaskId")
                        .IsUnique();

                    b.ToTable("TeachingTaskScheduleConstraints");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskTeacher", b =>
                {
                    b.Property<Guid>("TeachingTaskId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("TeacherId")
                        .HasColumnType("char(36)");

                    b.Property<bool>("IsPrimary")
                        .HasColumnType("tinyint(1)");

                    b.HasKey("TeachingTaskId", "TeacherId");

                    b.HasIndex("TeacherId");

                    b.ToTable("TeachingTaskTeachers");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.WarningRecord", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<string>("AcknowledgeComment")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<DateTime?>("AcknowledgedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Detail")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("varchar(1000)");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)");

                    b.Property<decimal>("TriggerValue")
                        .HasPrecision(7, 2)
                        .HasColumnType("decimal(7,2)");

                    b.Property<int>("Type")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Status");

                    b.HasIndex("StudentId", "AcademicTermId", "Type")
                        .IsUnique();

                    b.ToTable("WarningRecords");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.WarningRule", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<Guid>("AcademicTermId")
                        .HasColumnType("char(36)");

                    b.Property<bool>("AutoCheckEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<int?>("CheckDayOfWeek")
                        .HasColumnType("int");

                    b.Property<int>("CheckHour")
                        .HasColumnType("int");

                    b.Property<int>("CheckMinute")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Description")
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime?>("LastCheckAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<bool>("NotifyCounselor")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("NotifyStudent")
                        .HasColumnType("tinyint(1)");

                    b.Property<decimal>("Threshold")
                        .HasPrecision(7, 2)
                        .HasColumnType("decimal(7,2)");

                    b.Property<int>("Type")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("AcademicTermId", "Type")
                        .IsUnique();

                    b.ToTable("WarningRules");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Identity.ApplicationRole", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("longtext");

                    b.Property<int>("DataScope")
                        .HasColumnType("int");

                    b.Property<string>("Description")
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<string>("Name")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasDatabaseName("RoleNameIndex");

                    b.ToTable("AspNetRoles", (string)null);
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Identity.ApplicationUser", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<int>("AccessFailedCount")
                        .HasColumnType("int");

                    b.Property<DateTime?>("CalendarSubscriptionCreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("CalendarSubscriptionStamp")
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.Property<Guid?>("CollegeId")
                        .HasColumnType("char(36)");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("longtext");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)");

                    b.Property<string>("Email")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.Property<bool>("EmailConfirmed")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime?>("LastLoginAt")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("LockoutEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTimeOffset?>("LockoutEnd")
                        .HasColumnType("datetime");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.Property<string>("PasswordHash")
                        .HasColumnType("longtext");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("longtext");

                    b.Property<bool>("PhoneNumberConfirmed")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("SecurityStamp")
                        .HasColumnType("longtext");

                    b.Property<string>("StaffNumber")
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)");

                    b.Property<bool>("TwoFactorEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("UserName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasDatabaseName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasDatabaseName("UserNameIndex");

                    b.HasIndex("StaffNumber");

                    b.ToTable("AspNetUsers", (string)null);
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Identity.RefreshSession", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("ClientType")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("ExpiresAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("LastRefreshedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("ReplacedBySessionId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("RevokedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("SecurityStamp")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<string>("TokenHash")
                        .IsRequired()
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.Property<Guid>("UserId")
                        .HasColumnType("char(36)");

                    b.HasKey("Id");

                    b.HasIndex("TokenHash")
                        .IsUnique();

                    b.HasIndex("UserId", "ExpiresAt");

                    b.ToTable("RefreshSessions");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.System.AppUpdateRelease", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<byte[]>("BundleContent")
                        .IsRequired()
                        .HasColumnType("longblob");

                    b.Property<string>("Channel")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("CreatedByUserName")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasMaxLength(180)
                        .HasColumnType("varchar(180)");

                    b.Property<long>("FileSize")
                        .HasColumnType("bigint");

                    b.Property<string>("NativeVersion")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.Property<string>("Platform")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("PublishedByUserName")
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<string>("ReleaseNotes")
                        .HasMaxLength(1000)
                        .HasColumnType("varchar(1000)");

                    b.Property<string>("Sha256")
                        .IsRequired()
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Version")
                        .IsRequired()
                        .HasMaxLength(40)
                        .HasColumnType("varchar(40)");

                    b.HasKey("Id");

                    b.HasIndex("CreatedAt");

                    b.HasIndex("Platform", "Channel", "NativeVersion", "Status");

                    b.HasIndex("Platform", "Channel", "NativeVersion", "Version")
                        .IsUnique();

                    b.ToTable("AppUpdateReleases");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.System.AuditLog", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("IpAddress")
                        .HasMaxLength(64)
                        .HasColumnType("varchar(64)");

                    b.Property<string>("Method")
                        .IsRequired()
                        .HasMaxLength(10)
                        .HasColumnType("varchar(10)");

                    b.Property<string>("Path")
                        .IsRequired()
                        .HasMaxLength(300)
                        .HasColumnType("varchar(300)");

                    b.Property<int>("StatusCode")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid?>("UserId")
                        .HasColumnType("char(36)");

                    b.Property<string>("UserName")
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.HasKey("Id");

                    b.HasIndex("CreatedAt");

                    b.ToTable("AuditLogs");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.System.BackgroundJobOutboxMessage", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<Guid>("JobId")
                        .HasColumnType("char(36)");

                    b.Property<int>("JobKind")
                        .HasColumnType("int");

                    b.Property<string>("LastError")
                        .HasMaxLength(2000)
                        .HasColumnType("varchar(2000)");

                    b.Property<DateTime?>("LeaseExpiresAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("ProcessingAttempts")
                        .HasColumnType("int");

                    b.Property<Guid?>("ProcessingToken")
                        .HasColumnType("char(36)");

                    b.Property<int>("PublishAttempts")
                        .HasColumnType("int");

                    b.Property<DateTime?>("PublishedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("State")
                        .HasColumnType("int");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("LeaseExpiresAt");

                    b.HasIndex("JobKind", "JobId")
                        .IsUnique();

                    b.HasIndex("State", "CompletedAt");

                    b.HasIndex("State", "CreatedAt");

                    b.ToTable("BackgroundJobOutboxMessages");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.System.SystemFeatureSetting", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Key")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("Key")
                        .IsUnique();

                    b.ToTable("SystemFeatureSettings");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("ClaimType")
                        .HasColumnType("longtext");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("longtext");

                    b.Property<Guid>("RoleId")
                        .HasColumnType("char(36)");

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("ClaimType")
                        .HasColumnType("longtext");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("longtext");

                    b.Property<Guid>("UserId")
                        .HasColumnType("char(36)");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
                {
                    b.Property<string>("LoginProvider")
                        .HasColumnType("varchar(255)");

                    b.Property<string>("ProviderKey")
                        .HasColumnType("varchar(255)");

                    b.Property<string>("ProviderDisplayName")
                        .HasColumnType("longtext");

                    b.Property<Guid>("UserId")
                        .HasColumnType("char(36)");

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("char(36)");

                    b.Property<Guid>("RoleId")
                        .HasColumnType("char(36)");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("char(36)");

                    b.Property<string>("LoginProvider")
                        .HasColumnType("varchar(255)");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.Property<string>("Value")
                        .HasColumnType("longtext");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens", (string)null);
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AdministrativeClass", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", "CounselorUser")
                        .WithMany()
                        .HasForeignKey("CounselorUserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.Major", "Major")
                        .WithMany()
                        .HasForeignKey("MajorId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("CounselorUser");

                    b.Navigation("Major");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AttendanceCheckInAttempt", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AttendanceSheet", "AttendanceSheet")
                        .WithMany("CheckInAttempts")
                        .HasForeignKey("AttendanceSheetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("AttendanceSheet");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AttendanceRecord", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AttendanceSheet", "AttendanceSheet")
                        .WithMany("Records")
                        .HasForeignKey("AttendanceSheetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("AttendanceSheet");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AttendanceSheet", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AutomaticScheduleJob", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("RequestedByUserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.SchedulePlan", "SchedulePlan")
                        .WithMany()
                        .HasForeignKey("SchedulePlanId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("SchedulePlan");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Building", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Campus", "Campus")
                        .WithMany()
                        .HasForeignKey("CampusId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Campus");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Classroom", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Building", "Building")
                        .WithMany()
                        .HasForeignKey("BuildingId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Building");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ClassroomReservation", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.College", "ApplicantCollege")
                        .WithMany()
                        .HasForeignKey("ApplicantCollegeId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", "ApplicantUser")
                        .WithMany()
                        .HasForeignKey("ApplicantUserId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
                        .WithMany()
                        .HasForeignKey("ClassroomId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", "ReviewedByUser")
                        .WithMany()
                        .HasForeignKey("ReviewedByUserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("AcademicTerm");

                    b.Navigation("ApplicantCollege");

                    b.Navigation("ApplicantUser");

                    b.Navigation("Classroom");

                    b.Navigation("ReviewedByUser");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.College", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Campus", "Campus")
                        .WithMany()
                        .HasForeignKey("CampusId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("Campus");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Course", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.College", "College")
                        .WithMany()
                        .HasForeignKey("CollegeId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.CourseCategory", "CourseCategory")
                        .WithMany()
                        .HasForeignKey("CourseCategoryId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.Navigation("College");

                    b.Navigation("CourseCategory");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseAdjustment", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
                        .WithMany()
                        .HasForeignKey("ClassroomId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.Teacher", "SubstituteTeacher")
                        .WithMany()
                        .HasForeignKey("SubstituteTeacherId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Classroom");

                    b.Navigation("SubstituteTeacher");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseEnrollment", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.CourseSelectionOffering", "CourseSelectionOffering")
                        .WithMany("Enrollments")
                        .HasForeignKey("CourseSelectionOfferingId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("CourseSelectionOffering");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseExemption", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Student");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseGradeStatistic", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", null)
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", null)
                        .WithMany()
                        .HasForeignKey("CourseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseGradeStatisticsRefreshJob", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.GradeSheet", null)
                        .WithMany()
                        .HasForeignKey("GradeSheetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseGroupCourse", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.CourseGroup", "CourseGroup")
                        .WithMany("Courses")
                        .HasForeignKey("CourseGroupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", "Course")
                        .WithMany()
                        .HasForeignKey("CourseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Course");

                    b.Navigation("CourseGroup");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CoursePrerequisite", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", "Course")
                        .WithMany("Prerequisites")
                        .HasForeignKey("CourseId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", "PrerequisiteCourse")
                        .WithMany("RequiredByCourses")
                        .HasForeignKey("PrerequisiteCourseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Course");

                    b.Navigation("PrerequisiteCourse");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseSelectionOffering", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.CourseSelectionRound", "CourseSelectionRound")
                        .WithMany("Offerings")
                        .HasForeignKey("CourseSelectionRoundId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("CourseSelectionRound");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseSelectionRound", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("AcademicTerm");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseSelectionRoundGrade", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.CourseSelectionRound", "CourseSelectionRound")
                        .WithMany("EligibleGrades")
                        .HasForeignKey("CourseSelectionRoundId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CourseSelectionRound");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseSubstitution", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", "OriginalCourse")
                        .WithMany()
                        .HasForeignKey("OriginalCourseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", "SubstituteCourse")
                        .WithMany()
                        .HasForeignKey("SubstituteCourseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("OriginalCourse");

                    b.Navigation("Student");

                    b.Navigation("SubstituteCourse");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CurriculumCourse", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", "Course")
                        .WithMany()
                        .HasForeignKey("CourseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.CurriculumModule", "CurriculumModule")
                        .WithMany("Courses")
                        .HasForeignKey("CurriculumModuleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Course");

                    b.Navigation("CurriculumModule");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CurriculumModule", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.CurriculumPlan", "CurriculumPlan")
                        .WithMany("Modules")
                        .HasForeignKey("CurriculumPlanId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("CurriculumPlan");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CurriculumPlan", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Major", "Major")
                        .WithMany()
                        .HasForeignKey("MajorId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Major");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.DeferredExam", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Student");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.DegreeAwardResult", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.DegreeAwardBatch", "DegreeAwardBatch")
                        .WithMany("Results")
                        .HasForeignKey("DegreeAwardBatchId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.GraduationAuditResult", "GraduationAuditResult")
                        .WithMany()
                        .HasForeignKey("GraduationAuditResultId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("DegreeAwardBatch");

                    b.Navigation("GraduationAuditResult");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationDimension", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.EvaluationSetup", "EvaluationSetup")
                        .WithMany("Dimensions")
                        .HasForeignKey("EvaluationSetupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("EvaluationSetup");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationRecord", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.EvaluationSetup", "EvaluationSetup")
                        .WithMany("Records")
                        .HasForeignKey("EvaluationSetupId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("EvaluationSetup");

                    b.Navigation("Student");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationScore", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.EvaluationDimension", "EvaluationDimension")
                        .WithMany("Scores")
                        .HasForeignKey("EvaluationDimensionId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.EvaluationRecord", "EvaluationRecord")
                        .WithMany("Scores")
                        .HasForeignKey("EvaluationRecordId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("EvaluationDimension");

                    b.Navigation("EvaluationRecord");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationSetup", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("AcademicTerm");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamPlan", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("AcademicTerm");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamRoomAssignment", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
                        .WithMany()
                        .HasForeignKey("ClassroomId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", "Course")
                        .WithMany()
                        .HasForeignKey("CourseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.ExamPlan", "ExamPlan")
                        .WithMany("Rooms")
                        .HasForeignKey("ExamPlanId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Classroom");

                    b.Navigation("Course");

                    b.Navigation("ExamPlan");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamRoomInvigilator", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.ExamRoomAssignment", "ExamRoom")
                        .WithMany("Invigilators")
                        .HasForeignKey("ExamRoomId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Teacher", "Teacher")
                        .WithMany()
                        .HasForeignKey("TeacherId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("ExamRoom");

                    b.Navigation("Teacher");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamRoomSession", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.ExamRoomAssignment", "ExamRoom")
                        .WithMany("SessionLinks")
                        .HasForeignKey("ExamRoomId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.ExamSession", "ExamSession")
                        .WithMany("RoomLinks")
                        .HasForeignKey("ExamSessionId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("ExamRoom");

                    b.Navigation("ExamSession");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamSeatAssignment", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.ExamRoomAssignment", "ExamRoom")
                        .WithMany("Seats")
                        .HasForeignKey("ExamRoomId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.ExamSession", "ExamSession")
                        .WithMany("SeatAssignments")
                        .HasForeignKey("ExamSessionId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("ExamRoom");

                    b.Navigation("ExamSession");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamSession", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
                        .WithMany()
                        .HasForeignKey("ClassroomId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.ExamPlan", "ExamPlan")
                        .WithMany("Sessions")
                        .HasForeignKey("ExamPlanId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Building", "RequiredBuilding")
                        .WithMany()
                        .HasForeignKey("RequiredBuildingId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Classroom");

                    b.Navigation("ExamPlan");

                    b.Navigation("RequiredBuilding");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamSessionInvigilator", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.ExamSession", "ExamSession")
                        .WithMany("Invigilators")
                        .HasForeignKey("ExamSessionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Teacher", "Teacher")
                        .WithMany()
                        .HasForeignKey("TeacherId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("ExamSession");

                    b.Navigation("Teacher");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentBooking", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.ExperimentProject", "ExperimentProject")
                        .WithMany("Bookings")
                        .HasForeignKey("ExperimentProjectId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.ExperimentSession", "ExperimentSession")
                        .WithMany("Bookings")
                        .HasForeignKey("ExperimentSessionId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("ExperimentProject");

                    b.Navigation("ExperimentSession");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeItem", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.ExperimentGradeSheet", "ExperimentGradeSheet")
                        .WithMany("Items")
                        .HasForeignKey("ExperimentGradeSheetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("ExperimentGradeSheet");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeItemScore", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.ExperimentGradeItem", "ExperimentGradeItem")
                        .WithMany("Scores")
                        .HasForeignKey("ExperimentGradeItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.ExperimentGradeRecord", "ExperimentGradeRecord")
                        .WithMany("ItemScores")
                        .HasForeignKey("ExperimentGradeRecordId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("ExperimentGradeItem");

                    b.Navigation("ExperimentGradeRecord");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeRecord", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.ExperimentGradeSheet", "ExperimentGradeSheet")
                        .WithMany("Records")
                        .HasForeignKey("ExperimentGradeSheetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.ExperimentSession", "ExperimentSession")
                        .WithMany()
                        .HasForeignKey("ExperimentSessionId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("ExperimentGradeSheet");

                    b.Navigation("ExperimentSession");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeSheet", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.ExperimentProject", "ExperimentProject")
                        .WithOne("GradeSheet")
                        .HasForeignKey("Jiaowu.Api.Domain.Academic.ExperimentGradeSheet", "ExperimentProjectId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("ExperimentProject");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentProject", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.ScheduleEntry", "ScheduleEntry")
                        .WithMany()
                        .HasForeignKey("ScheduleEntryId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("ScheduleEntry");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentSession", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
                        .WithMany()
                        .HasForeignKey("ClassroomId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.ExperimentProject", "ExperimentProject")
                        .WithMany("Sessions")
                        .HasForeignKey("ExperimentProjectId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Classroom");

                    b.Navigation("ExperimentProject");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeItem", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.GradeSheet", "GradeSheet")
                        .WithMany("Items")
                        .HasForeignKey("GradeSheetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("GradeSheet");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeItemScore", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.GradeItem", "GradeItem")
                        .WithMany("Scores")
                        .HasForeignKey("GradeItemId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.GradeRecord", "GradeRecord")
                        .WithMany("ItemScores")
                        .HasForeignKey("GradeRecordId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("GradeItem");

                    b.Navigation("GradeRecord");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeModification", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.GradeRecord", "GradeRecord")
                        .WithMany()
                        .HasForeignKey("GradeRecordId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("GradeRecord");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeRecord", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.GradeSheet", "GradeSheet")
                        .WithMany("Records")
                        .HasForeignKey("GradeSheetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("GradeSheet");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeSheet", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationAuditResult", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.CurriculumPlan", "CurriculumPlan")
                        .WithMany()
                        .HasForeignKey("CurriculumPlanId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.GraduationAuditBatch", "GraduationAuditBatch")
                        .WithMany("Results")
                        .HasForeignKey("GraduationAuditBatchId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("CurriculumPlan");

                    b.Navigation("GraduationAuditBatch");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceItem", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.GraduationClearanceBatch", "GraduationClearanceBatch")
                        .WithMany("Items")
                        .HasForeignKey("GraduationClearanceBatchId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("GraduationClearanceBatch");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceRecord", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.GraduationClearanceItem", "GraduationClearanceItem")
                        .WithMany("Records")
                        .HasForeignKey("GraduationClearanceItemId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("GraduationClearanceItem");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Major", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.College", "College")
                        .WithMany()
                        .HasForeignKey("CollegeId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("College");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamAutoJob", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.MakeupExamPlan", "MakeupExamPlan")
                        .WithMany()
                        .HasForeignKey("MakeupExamPlanId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("MakeupExamPlan");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamEnrollment", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.MakeupExamSession", "MakeupExamSession")
                        .WithMany("Enrollments")
                        .HasForeignKey("MakeupExamSessionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.DeferredExam", "SourceDeferredExam")
                        .WithMany()
                        .HasForeignKey("SourceDeferredExamId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.GradeRecord", "SourceGradeRecord")
                        .WithMany()
                        .HasForeignKey("SourceGradeRecordId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("MakeupExamSession");

                    b.Navigation("SourceDeferredExam");

                    b.Navigation("SourceGradeRecord");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamPlan", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("AcademicTerm");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamSession", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
                        .WithMany()
                        .HasForeignKey("ClassroomId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.MakeupExamPlan", "MakeupExamPlan")
                        .WithMany("Sessions")
                        .HasForeignKey("MakeupExamPlanId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Building", "RequiredBuilding")
                        .WithMany()
                        .HasForeignKey("RequiredBuildingId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Classroom");

                    b.Navigation("MakeupExamPlan");

                    b.Navigation("RequiredBuilding");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamSessionInvigilator", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.MakeupExamSession", "MakeupExamSession")
                        .WithMany("Invigilators")
                        .HasForeignKey("MakeupExamSessionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Teacher", "Teacher")
                        .WithMany()
                        .HasForeignKey("TeacherId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("MakeupExamSession");

                    b.Navigation("Teacher");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Notification", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.MessageDispatch", "MessageDispatch")
                        .WithMany("Notifications")
                        .HasForeignKey("MessageDispatchId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("MessageDispatch");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OfficialDocument", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", "InvalidatedByUser")
                        .WithMany()
                        .HasForeignKey("InvalidatedByUserId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", "IssuedByUser")
                        .WithMany()
                        .HasForeignKey("IssuedByUserId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.OfficialDocument", "ReissuedFromDocument")
                        .WithMany()
                        .HasForeignKey("ReissuedFromDocumentId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("InvalidatedByUser");

                    b.Navigation("IssuedByUser");

                    b.Navigation("ReissuedFromDocument");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OfficialDocumentDownload", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", "DownloadedByUser")
                        .WithMany()
                        .HasForeignKey("DownloadedByUserId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.OfficialDocument", "OfficialDocument")
                        .WithMany("Downloads")
                        .HasForeignKey("OfficialDocumentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("DownloadedByUser");

                    b.Navigation("OfficialDocument");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OtherExamResult", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.OtherExamBatch", "OtherExamBatch")
                        .WithMany("Results")
                        .HasForeignKey("OtherExamBatchId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("OtherExamBatch");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.PublishedScheduleOccurrence", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
                        .WithMany()
                        .HasForeignKey("ClassroomId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.ScheduleEntry", "ScheduleEntry")
                        .WithMany()
                        .HasForeignKey("ScheduleEntryId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Classroom");

                    b.Navigation("ScheduleEntry");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ScheduleEntry", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
                        .WithMany()
                        .HasForeignKey("ClassroomId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.SchedulePlan", "SchedulePlan")
                        .WithMany("Entries")
                        .HasForeignKey("SchedulePlanId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Classroom");

                    b.Navigation("SchedulePlan");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.SchedulePlan", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("AcademicTerm");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.SchedulePublishJob", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("RequestedByUserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.SchedulePlan", "SchedulePlan")
                        .WithMany()
                        .HasForeignKey("SchedulePlanId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("SchedulePlan");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ScheduleTimeSlot", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("AcademicTerm");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Student", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AdministrativeClass", "AdministrativeClass")
                        .WithMany("Students")
                        .HasForeignKey("AdministrativeClassId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("AdministrativeClass");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.StudentStatusChange", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Teacher", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.College", "College")
                        .WithMany()
                        .HasForeignKey("CollegeId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("College");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeacherCourseApplication", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", "Course")
                        .WithMany()
                        .HasForeignKey("CourseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("ReviewedByUserId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("Jiaowu.Api.Domain.Academic.Teacher", "Teacher")
                        .WithMany()
                        .HasForeignKey("TeacherId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("AcademicTerm");

                    b.Navigation("Course");

                    b.Navigation("Teacher");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTask", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", "Course")
                        .WithMany()
                        .HasForeignKey("CourseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("AcademicTerm");

                    b.Navigation("Course");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskAllowedClassroom", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
                        .WithMany()
                        .HasForeignKey("ClassroomId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTaskScheduleConstraint", "TeachingTaskScheduleConstraint")
                        .WithMany("AllowedClassrooms")
                        .HasForeignKey("TeachingTaskScheduleConstraintId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Classroom");

                    b.Navigation("TeachingTaskScheduleConstraint");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskAllowedExperimentClassroom", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
                        .WithMany()
                        .HasForeignKey("ClassroomId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTaskScheduleConstraint", "TeachingTaskScheduleConstraint")
                        .WithMany("AllowedExperimentClassrooms")
                        .HasForeignKey("TeachingTaskScheduleConstraintId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Classroom");

                    b.Navigation("TeachingTaskScheduleConstraint");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskClass", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AdministrativeClass", "AdministrativeClass")
                        .WithMany()
                        .HasForeignKey("AdministrativeClassId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany("Classes")
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("AdministrativeClass");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskGradeScoreBand", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTaskGradeStatistic", "TeachingTaskGradeStatistic")
                        .WithMany("ScoreBands")
                        .HasForeignKey("TeachingTaskGradeStatisticId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("TeachingTaskGradeStatistic");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskGradeStatistic", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", null)
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.Course", null)
                        .WithMany()
                        .HasForeignKey("CourseId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.GradeSheet", "GradeSheet")
                        .WithOne()
                        .HasForeignKey("Jiaowu.Api.Domain.Academic.TeachingTaskGradeStatistic", "GradeSheetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithOne()
                        .HasForeignKey("Jiaowu.Api.Domain.Academic.TeachingTaskGradeStatistic", "TeachingTaskId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("GradeSheet");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskScheduleConstraint", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Building", "ExperimentRequiredBuilding")
                        .WithMany()
                        .HasForeignKey("ExperimentRequiredBuildingId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Jiaowu.Api.Domain.Academic.Campus", "ExperimentRequiredCampus")
                        .WithMany()
                        .HasForeignKey("ExperimentRequiredCampusId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Jiaowu.Api.Domain.Academic.Building", "RequiredBuilding")
                        .WithMany()
                        .HasForeignKey("RequiredBuildingId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Jiaowu.Api.Domain.Academic.Campus", "RequiredCampus")
                        .WithMany()
                        .HasForeignKey("RequiredCampusId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany()
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("ExperimentRequiredBuilding");

                    b.Navigation("ExperimentRequiredCampus");

                    b.Navigation("RequiredBuilding");

                    b.Navigation("RequiredCampus");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskTeacher", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Teacher", "Teacher")
                        .WithMany()
                        .HasForeignKey("TeacherId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Academic.TeachingTask", "TeachingTask")
                        .WithMany("Teachers")
                        .HasForeignKey("TeachingTaskId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Teacher");

                    b.Navigation("TeachingTask");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.WarningRecord", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
                        .WithMany()
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.WarningRule", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
                        .WithMany()
                        .HasForeignKey("AcademicTermId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("AcademicTerm");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Identity.RefreshSession", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("User");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
                {
                    b.HasOne("Jiaowu.Api.Domain.Identity.ApplicationUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AdministrativeClass", b =>
                {
                    b.Navigation("Students");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.AttendanceSheet", b =>
                {
                    b.Navigation("CheckInAttempts");

                    b.Navigation("Records");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Course", b =>
                {
                    b.Navigation("Prerequisites");

                    b.Navigation("RequiredByCourses");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseGroup", b =>
                {
                    b.Navigation("Courses");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseSelectionOffering", b =>
                {
                    b.Navigation("Enrollments");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CourseSelectionRound", b =>
                {
                    b.Navigation("EligibleGrades");

                    b.Navigation("Offerings");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CurriculumModule", b =>
                {
                    b.Navigation("Courses");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.CurriculumPlan", b =>
                {
                    b.Navigation("Modules");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.DegreeAwardBatch", b =>
                {
                    b.Navigation("Results");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationDimension", b =>
                {
                    b.Navigation("Scores");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationRecord", b =>
                {
                    b.Navigation("Scores");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.EvaluationSetup", b =>
                {
                    b.Navigation("Dimensions");

                    b.Navigation("Records");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamPlan", b =>
                {
                    b.Navigation("Rooms");

                    b.Navigation("Sessions");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamRoomAssignment", b =>
                {
                    b.Navigation("Invigilators");

                    b.Navigation("Seats");

                    b.Navigation("SessionLinks");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamSession", b =>
                {
                    b.Navigation("Invigilators");

                    b.Navigation("RoomLinks");

                    b.Navigation("SeatAssignments");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeItem", b =>
                {
                    b.Navigation("Scores");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeRecord", b =>
                {
                    b.Navigation("ItemScores");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentGradeSheet", b =>
                {
                    b.Navigation("Items");

                    b.Navigation("Records");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentProject", b =>
                {
                    b.Navigation("Bookings");

                    b.Navigation("GradeSheet");

                    b.Navigation("Sessions");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExperimentSession", b =>
                {
                    b.Navigation("Bookings");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeItem", b =>
                {
                    b.Navigation("Scores");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeRecord", b =>
                {
                    b.Navigation("ItemScores");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GradeSheet", b =>
                {
                    b.Navigation("Items");

                    b.Navigation("Records");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationAuditBatch", b =>
                {
                    b.Navigation("Results");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceBatch", b =>
                {
                    b.Navigation("Items");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceItem", b =>
                {
                    b.Navigation("Records");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamPlan", b =>
                {
                    b.Navigation("Sessions");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MakeupExamSession", b =>
                {
                    b.Navigation("Enrollments");

                    b.Navigation("Invigilators");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.MessageDispatch", b =>
                {
                    b.Navigation("Notifications");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OfficialDocument", b =>
                {
                    b.Navigation("Downloads");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OtherExamBatch", b =>
                {
                    b.Navigation("Results");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.SchedulePlan", b =>
                {
                    b.Navigation("Entries");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTask", b =>
                {
                    b.Navigation("Classes");

                    b.Navigation("Teachers");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskGradeStatistic", b =>
                {
                    b.Navigation("ScoreBands");
                });

            modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskScheduleConstraint", b =>
                {
                    b.Navigation("AllowedClassrooms");

                    b.Navigation("AllowedExperimentClassrooms");
                });
#pragma warning restore 612, 618
        }
    }
}
