Skip to content

Commit

Permalink
Merge pull request #436 from kzi-nastava/feat/reportB
Browse files Browse the repository at this point in the history
[Update] Course and EnrollmentRequest services
  • Loading branch information
DusicaPesic authored May 27, 2024
2 parents 96ff622 + 531f6ec commit 13de063
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LangLang/BusinessLogic/UseCases/CourseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void DeleteByTutor(Tutor tutor)
else
{
EnrollmentRequestService enrollmentRequestService = new();
enrollmentRequestService.
enrollmentRequestService.Delete(course);
Delete(course.Id);
}
}
Expand Down
8 changes: 8 additions & 0 deletions LangLang/BusinessLogic/UseCases/EnrollmentRequestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ public List<EnrollmentRequest> GetByCourse(Course course)
return _enrollmentRequests.GetByCourse(course);
}

public void Delete(Course course)
{
foreach (EnrollmentRequest enrollmentRequest in GetByCourse(course))
{
Delete(enrollmentRequest.Id);
}
}

public void CancelRequest(int id, Course course)
{
if (course.DaysUntilStart() < Constants.COURSE_CANCELLATION_PERIOD)
Expand Down
10 changes: 5 additions & 5 deletions LangLang/Data/courses.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
0|0|English|B1|4|Monday Wednesday|True|1|20|2025-01-01|False|False|False
1|1|Spanish|A1|10|Thursday|True|0|5|2024-05-01|False|False|False
2|0|Serbian|C2|7|Wednesday|True|2|3|2024-01-02|False|False|False
3|0|Italian|A1|5|Thursday Friday|True|0|30|2024-10-12|False|True|False
4|0|Korean|B2|6|Monday Thursday|True|2|0|2024-05-05|False|False|False
0|0|English|B1|4|Monday Wednesday|True|1|20|1/1/2025 12:00:00 PM|False|False|False
1|1|Spanish|A1|10|Thursday|True|0|5|5/1/2024 2:00:00 PM|False|False|False
2|0|Serbian|C2|7|Wednesday|True|2|3|1/2/2024 4:00:00 PM|False|False|False
3|0|Italian|A1|5|Thursday Friday|True|0|30|10/12/2024 6:00:00 PM|False|True|False
4|0|Korean|B2|6|Monday Thursday|True|2|0|5/5/2024 10:00:00 AM|False|False|False
2 changes: 1 addition & 1 deletion LangLang/Domain/Models/Course.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public override string ToString()
{
sbDays.Remove(sbDays.Length - 1, 1);
}
return string.Join("|", new object[] { Id, TutorId, Language, Level.ToString(), NumberOfWeeks, sbDays.ToString(), Online, NumberOfStudents, MaxStudents, StartDateTime.ToString(Constants.DATE_FORMAT), CreatedByDirector, Modifiable, GratitudeEmailSent });
return string.Join("|", new object[] { Id, TutorId, Language, Level.ToString(), NumberOfWeeks, sbDays.ToString(), Online, NumberOfStudents, MaxStudents, StartDateTime.ToString(), CreatedByDirector, Modifiable, GratitudeEmailSent });
}
}
}

0 comments on commit 13de063

Please sign in to comment.