Files
Academic-Affairs-System/src/Jiaowu.Api/Domain/Academic/CourseSelectionEntities.cs
T
biss f62cd21319 已把选课的“年级划分”和限制规则补成完整闭环:
选课批次可指定多个适用年级;留空兼容原有“全部年级”。
新增可选的“最多课程门数”,与原有学分上限并行。
年级、门数限制统一作用于学生可见批次、自主选课、候补、管理员代选和自动递补。
普通候选名单遵守年级及行政班范围;强制选课可绕过业务限制,但仍严格遵守管理员学院权限。
管理页面会展示“2026 级 · 最多 6 门 · 最多 30 学分”,名单和候补列表也增加年级列。
新增 MySQL 迁移:[CourseSelectionGradeLimits.cs](E:/jiaowu/src/Jiaowu.Api/Infrastructure/Persistence/Migrations/MySql/20260726180000_CourseSelectionGradeLimits.cs)。
2026-07-26 16:12:21 +08:00

75 lines
2.3 KiB
C#

using Jiaowu.Api.Domain.Common;
namespace Jiaowu.Api.Domain.Academic;
public sealed class CourseSelectionRound : EntityBase
{
public Guid AcademicTermId { get; set; }
public AcademicTerm? AcademicTerm { get; set; }
public required string Name { get; set; }
public DateTime StartsAt { get; set; }
public DateTime EndsAt { get; set; }
public DateTime WithdrawalEndsAt { get; set; }
public decimal MaxCredits { get; set; } = 30;
public int? MaxCourseCount { get; set; }
public CourseSelectionRoundStatus Status { get; set; } =
CourseSelectionRoundStatus.Draft;
public string? Notes { get; set; }
public ICollection<CourseSelectionRoundGrade> EligibleGrades { get; set; } = [];
public ICollection<CourseSelectionOffering> Offerings { get; set; } = [];
}
public sealed class CourseSelectionRoundGrade : EntityBase
{
public Guid CourseSelectionRoundId { get; set; }
public CourseSelectionRound? CourseSelectionRound { get; set; }
public int Grade { get; set; }
}
public sealed class CourseSelectionOffering : EntityBase
{
public Guid CourseSelectionRoundId { get; set; }
public CourseSelectionRound? CourseSelectionRound { get; set; }
public Guid TeachingTaskId { get; set; }
public TeachingTask? TeachingTask { get; set; }
public int Capacity { get; set; }
public bool IsOpenToAll { get; set; }
public string? Notes { get; set; }
public ICollection<CourseEnrollment> Enrollments { get; set; } = [];
}
public sealed class CourseEnrollment : EntityBase
{
public Guid CourseSelectionOfferingId { get; set; }
public CourseSelectionOffering? CourseSelectionOffering { get; set; }
public Guid StudentId { get; set; }
public Student? Student { get; set; }
public CourseEnrollmentStatus Status { get; set; } = CourseEnrollmentStatus.Enrolled;
public EnrollmentType EnrollmentType { get; set; } = EnrollmentType.Normal;
public DateTime EnrolledAt { get; set; } = DateTime.UtcNow;
public DateTime? WaitlistedAt { get; set; }
public DateTime? WithdrawnAt { get; set; }
}
public enum CourseSelectionRoundStatus
{
Draft = 1,
Open = 2,
Closed = 3
}
public enum CourseEnrollmentStatus
{
Enrolled = 1,
Withdrawn = 2,
Waitlisted = 3,
Cancelled = 4,
Expired = 5
}
public enum EnrollmentType
{
Normal = 1,
Retake = 2
}