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. /// Gets or sets the type of occupation for the schedule entry.
/// </summary> /// </summary>
[Required] [Required]
public required string TypeOfOccupation { get; set; } public required IEnumerable<string> TypeOfOccupation { get; set; }
/// <summary> /// <summary>
/// Gets or sets the names of the group for the schedule entry. /// 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. /// Gets or sets the type of occupation for the schedule entry.
/// </summary> /// </summary>
[Required] [Required]
public required string TypeOfOccupation { get; set; } public required IEnumerable<string> TypeOfOccupations { get; set; }
/// <summary> /// <summary>
/// Gets or sets the names of the lecture halls for the schedule entry. /// 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. /// Gets or sets the type of occupation for the schedule entry.
/// </summary> /// </summary>
[Required] [Required]
public required string TypeOfOccupation { get; set; } public required IEnumerable<string> TypeOfOccupations { get; set; }
/// <summary> /// <summary>
/// Gets or sets the names of the group for the schedule entry. /// 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. /// Gets or sets the type of occupation for the schedule entry.
/// </summary> /// </summary>
[Required] [Required]
public required string TypeOfOccupation { get; set; } public required IEnumerable<string> TypeOfOccupations { get; set; }
/// <summary> /// <summary>
/// Gets or sets the names of the group for the schedule entry. /// 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. /// Gets or sets the type of occupation for the schedule entry.
/// </summary> /// </summary>
[Required] [Required]
public required string TypeOfOccupation { get; set; } public required IEnumerable<string> TypeOfOccupations { get; set; }
/// <summary> /// <summary>
/// Gets or sets the name of the group for the schedule entry. /// 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) public async Task<ActionResult<List<ScheduleResponse>>> Get([FromBody] ScheduleRequest request)
{ {
if ((request.Groups == null || !request.Groups.Any()) && if ((request.Groups == null || request.Groups.Length == 0) &&
(request.Disciplines == null || !request.Disciplines.Any()) && (request.Disciplines == null || request.Disciplines.Length == 0) &&
(request.Professors == null || !request.Professors.Any()) && (request.Professors == null || request.Professors.Length == 0) &&
(request.LectureHalls == null || !request.LectureHalls.Any())) (request.LectureHalls == null || request.LectureHalls.Length == 0))
{ {
return BadRequest(new ErrorResponse() return BadRequest(new ErrorResponse()
{ {
@ -60,7 +60,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1
IsEven = s.IsEven, IsEven = s.IsEven,
Discipline = s.Discipline, Discipline = s.Discipline,
DisciplineId = s.DisciplineId, DisciplineId = s.DisciplineId,
TypeOfOccupation = s.TypeOfOccupation, TypeOfOccupations = s.TypeOfOccupations,
Group = s.Group, Group = s.Group,
GroupId = s.GroupId, GroupId = s.GroupId,
LectureHalls = s.LectureHalls, LectureHalls = s.LectureHalls,
@ -117,7 +117,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1
IsEven = g.IsEven, IsEven = g.IsEven,
Discipline = g.Discipline, Discipline = g.Discipline,
DisciplineId = g.DisciplineId, DisciplineId = g.DisciplineId,
TypeOfOccupation = g.TypeOfOccupation, TypeOfOccupations = g.TypeOfOccupations,
LectureHalls = g.LectureHalls, LectureHalls = g.LectureHalls,
LectureHallsId = g.LectureHallsId, LectureHallsId = g.LectureHallsId,
Professors = g.Professors, Professors = g.Professors,
@ -176,7 +176,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1
IsEven = p.IsEven, IsEven = p.IsEven,
Discipline = p.Discipline, Discipline = p.Discipline,
DisciplineId = p.DisciplineId, DisciplineId = p.DisciplineId,
TypeOfOccupation = p.TypeOfOccupation, TypeOfOccupations = p.TypeOfOccupations,
Group = p.Group, Group = p.Group,
GroupId = p.GroupId, GroupId = p.GroupId,
LectureHalls = p.LectureHalls, LectureHalls = p.LectureHalls,
@ -235,7 +235,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1
IsEven = l.IsEven, IsEven = l.IsEven,
Discipline = l.Discipline, Discipline = l.Discipline,
DisciplineId = l.DisciplineId, DisciplineId = l.DisciplineId,
TypeOfOccupation = l.TypeOfOccupation, TypeOfOccupations = l.TypeOfOccupations,
Group = l.Group, Group = l.Group,
GroupId = l.GroupId, GroupId = l.GroupId,
Professors = l.Professors, Professors = l.Professors,
@ -273,7 +273,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1
IsEven = isEven, IsEven = isEven,
DisciplineIds = [id], DisciplineIds = [id],
GroupIds = groups, GroupIds = groups,
LectureHallIds = [id], LectureHallIds = lectureHalls,
ProfessorIds = professors ProfessorIds = professors
})).Schedules; })).Schedules;
@ -288,7 +288,7 @@ public class ScheduleController(IMediator mediator) : BaseControllerV1
DayOfWeek = d.DayOfWeek, DayOfWeek = d.DayOfWeek,
PairNumber = d.PairNumber, PairNumber = d.PairNumber,
IsEven = d.IsEven, IsEven = d.IsEven,
TypeOfOccupation = d.TypeOfOccupation, TypeOfOccupation = d.TypeOfOccupations,
Group = d.Group, Group = d.Group,
GroupId = d.GroupId, GroupId = d.GroupId,
LectureHalls = d.LectureHalls, LectureHalls = d.LectureHalls,