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
6 changed files with 15 additions and 15 deletions
Showing only changes of commit ca18804a33 - Show all commits

View File

@ -31,7 +31,7 @@ public class DisciplineScheduleInfo
/// Gets or sets the type of occupation for the schedule entry.
/// </summary>
[Required]
public required string TypeOfOccupation { get; set; }
public required IEnumerable<string> TypeOfOccupation { get; set; }
/// <summary>
/// Gets or sets the names of the group for the schedule entry.

View File

@ -43,7 +43,7 @@ public class GroupScheduleInfo
/// Gets or sets the type of occupation for the schedule entry.
/// </summary>
[Required]
public required string TypeOfOccupation { get; set; }
public required IEnumerable<string> TypeOfOccupations { get; set; }
/// <summary>
/// Gets or sets the names of the lecture halls for the schedule entry.

View File

@ -43,7 +43,7 @@ public class LectureHallScheduleInfo
/// Gets or sets the type of occupation for the schedule entry.
/// </summary>
[Required]
public required string TypeOfOccupation { get; set; }
public required IEnumerable<string> TypeOfOccupations { get; set; }
/// <summary>
/// Gets or sets the names of the group for the schedule entry.

View File

@ -43,7 +43,7 @@ public class ProfessorScheduleInfo
/// Gets or sets the type of occupation for the schedule entry.
/// </summary>
[Required]
public required string TypeOfOccupation { get; set; }
public required IEnumerable<string> TypeOfOccupations { get; set; }
/// <summary>
/// Gets or sets the names of the group for the schedule entry.

View File

@ -43,7 +43,7 @@ public class ScheduleResponse
/// Gets or sets the type of occupation for the schedule entry.
/// </summary>
[Required]
public required string TypeOfOccupation { get; set; }
public required IEnumerable<string> TypeOfOccupations { get; set; }
/// <summary>
/// Gets or sets the name of the group for the schedule entry.

View File

@ -27,10 +27,10 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1
public async Task<ActionResult<List<ScheduleResponse>>> 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,