diff --git a/ApiDto/Responses/Schedule/DisciplineScheduleResponse.cs b/ApiDto/Responses/Schedule/DisciplineScheduleResponse.cs index bf4a337..ffc5578 100644 --- a/ApiDto/Responses/Schedule/DisciplineScheduleResponse.cs +++ b/ApiDto/Responses/Schedule/DisciplineScheduleResponse.cs @@ -31,7 +31,7 @@ public class DisciplineScheduleInfo /// Gets or sets the type of occupation for the schedule entry. /// [Required] - public required string TypeOfOccupation { get; set; } + public required IEnumerable TypeOfOccupation { get; set; } /// /// Gets or sets the names of the group for the schedule entry. diff --git a/ApiDto/Responses/Schedule/GroupScheduleResponse.cs b/ApiDto/Responses/Schedule/GroupScheduleResponse.cs index 7fa13d1..c85778c 100644 --- a/ApiDto/Responses/Schedule/GroupScheduleResponse.cs +++ b/ApiDto/Responses/Schedule/GroupScheduleResponse.cs @@ -43,7 +43,7 @@ public class GroupScheduleInfo /// Gets or sets the type of occupation for the schedule entry. /// [Required] - public required string TypeOfOccupation { get; set; } + public required IEnumerable TypeOfOccupations { get; set; } /// /// Gets or sets the names of the lecture halls for the schedule entry. diff --git a/ApiDto/Responses/Schedule/LectureHallScheduleResponse.cs b/ApiDto/Responses/Schedule/LectureHallScheduleResponse.cs index 369a8f5..294876f 100644 --- a/ApiDto/Responses/Schedule/LectureHallScheduleResponse.cs +++ b/ApiDto/Responses/Schedule/LectureHallScheduleResponse.cs @@ -43,7 +43,7 @@ public class LectureHallScheduleInfo /// Gets or sets the type of occupation for the schedule entry. /// [Required] - public required string TypeOfOccupation { get; set; } + public required IEnumerable TypeOfOccupations { get; set; } /// /// Gets or sets the names of the group for the schedule entry. diff --git a/ApiDto/Responses/Schedule/ProfessorScheduleResponse.cs b/ApiDto/Responses/Schedule/ProfessorScheduleResponse.cs index 3a53ebf..07a7471 100644 --- a/ApiDto/Responses/Schedule/ProfessorScheduleResponse.cs +++ b/ApiDto/Responses/Schedule/ProfessorScheduleResponse.cs @@ -43,7 +43,7 @@ public class ProfessorScheduleInfo /// Gets or sets the type of occupation for the schedule entry. /// [Required] - public required string TypeOfOccupation { get; set; } + public required IEnumerable TypeOfOccupations { get; set; } /// /// Gets or sets the names of the group for the schedule entry. diff --git a/ApiDto/Responses/Schedule/ScheduleResponse.cs b/ApiDto/Responses/Schedule/ScheduleResponse.cs index 2a03178..8698ed7 100644 --- a/ApiDto/Responses/Schedule/ScheduleResponse.cs +++ b/ApiDto/Responses/Schedule/ScheduleResponse.cs @@ -43,7 +43,7 @@ public class ScheduleResponse /// Gets or sets the type of occupation for the schedule entry. /// [Required] - public required string TypeOfOccupation { get; set; } + public required IEnumerable TypeOfOccupations { get; set; } /// /// Gets or sets the name of the group for the schedule entry. diff --git a/Endpoint/Controllers/V1/ScheduleController.cs b/Endpoint/Controllers/V1/ScheduleController.cs index 43b47ad..3e9a5ed 100644 --- a/Endpoint/Controllers/V1/ScheduleController.cs +++ b/Endpoint/Controllers/V1/ScheduleController.cs @@ -27,10 +27,10 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1 public async Task>> Get([FromBody] ScheduleRequest request) { - if ((request.Groups == null || !request.Groups.Any()) && - (request.Disciplines == null || !request.Disciplines.Any()) && - (request.Professors == null || !request.Professors.Any()) && - (request.LectureHalls == null || !request.LectureHalls.Any())) + if ((request.Groups == null || request.Groups.Length == 0) && + (request.Disciplines == null || request.Disciplines.Length == 0) && + (request.Professors == null || request.Professors.Length == 0) && + (request.LectureHalls == null || request.LectureHalls.Length == 0)) { return BadRequest(new ErrorResponse() { @@ -60,7 +60,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1 IsEven = s.IsEven, Discipline = s.Discipline, DisciplineId = s.DisciplineId, - TypeOfOccupation = s.TypeOfOccupation, + TypeOfOccupations = s.TypeOfOccupations, Group = s.Group, GroupId = s.GroupId, LectureHalls = s.LectureHalls, @@ -117,7 +117,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1 IsEven = g.IsEven, Discipline = g.Discipline, DisciplineId = g.DisciplineId, - TypeOfOccupation = g.TypeOfOccupation, + TypeOfOccupations = g.TypeOfOccupations, LectureHalls = g.LectureHalls, LectureHallsId = g.LectureHallsId, Professors = g.Professors, @@ -176,7 +176,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1 IsEven = p.IsEven, Discipline = p.Discipline, DisciplineId = p.DisciplineId, - TypeOfOccupation = p.TypeOfOccupation, + TypeOfOccupations = p.TypeOfOccupations, Group = p.Group, GroupId = p.GroupId, LectureHalls = p.LectureHalls, @@ -235,7 +235,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1 IsEven = l.IsEven, Discipline = l.Discipline, DisciplineId = l.DisciplineId, - TypeOfOccupation = l.TypeOfOccupation, + TypeOfOccupations = l.TypeOfOccupations, Group = l.Group, GroupId = l.GroupId, Professors = l.Professors, @@ -273,7 +273,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1 IsEven = isEven, DisciplineIds = [id], GroupIds = groups, - LectureHallIds = [id], + LectureHallIds = lectureHalls, ProfessorIds = professors })).Schedules; @@ -288,7 +288,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1 DayOfWeek = d.DayOfWeek, PairNumber = d.PairNumber, IsEven = d.IsEven, - TypeOfOccupation = d.TypeOfOccupation, + TypeOfOccupation = d.TypeOfOccupations, Group = d.Group, GroupId = d.GroupId, LectureHalls = d.LectureHalls,