Add specific weeks of disciplines #10

Merged
Wesser merged 7 commits from feat/improved-sugroup into release/v1.0.0 2024-05-19 13:57:09 +03:00
2 changed files with 12 additions and 8 deletions
Showing only changes of commit d8f2f51cd7 - Show all commits

View File

@ -11,13 +11,15 @@ public class GetScheduleListQueryHandler(ILessonDbContext dbContext) : IRequestH
{
public async Task<ScheduleListVm> Handle(GetScheduleListQuery request, CancellationToken cancellationToken)
{
var query = dbContext.Lessons.Include(l => l.LessonAssociations)
var query = dbContext.Lessons
.Include(l => l.LessonAssociations)
.ThenInclude(la => la.LectureHall)
.ThenInclude(lh => lh!.Campus)
.Include(l => l.LessonAssociations)
.ThenInclude(la => la.Professor)
.Include(l => l.LessonAssociations)
.ThenInclude(la => la.TypeOfOccupation)
.Include(l => l.Group)
.Include(l => l.TypeOfOccupation)
.Include(l => l.Discipline)
.AsQueryable();
@ -46,7 +48,9 @@ public class GetScheduleListQueryHandler(ILessonDbContext dbContext) : IRequestH
DayOfWeek = l.DayOfWeek,
PairNumber = l.PairNumber,
IsEven = l.IsEven,
TypeOfOccupation = l.TypeOfOccupation!.ShortName,
TypeOfOccupations = l.LessonAssociations!
.Where(la => !string.IsNullOrEmpty(la.TypeOfOccupation?.ShortName))
.Select(la => la.TypeOfOccupation!.ShortName),
Discipline = l.Discipline!.Name,
DisciplineId = l.DisciplineId,

View File

@ -33,11 +33,6 @@ public class ScheduleLookupDto
/// </summary>
public required int DisciplineId { get; set; }
/// <summary>
/// Gets or sets the type of occupation.
/// </summary>
public required string TypeOfOccupation { get; set; }
/// <summary>
/// Gets or sets the name of the group.
/// </summary>
@ -48,6 +43,11 @@ public class ScheduleLookupDto
/// </summary>
public required int GroupId { get; set; }
/// <summary>
/// Gets or sets the type of occupation.
/// </summary>
public required IEnumerable<string> TypeOfOccupations { get; set; }
/// <summary>
/// Gets or sets the names of the lecture halls.
/// </summary>