Skip to content

Commit

Permalink
Add various final inscription endpoints & refactored some service/dao…
Browse files Browse the repository at this point in the history
… methods (#53)
  • Loading branch information
MatiasMercado authored Jan 26, 2017
1 parent 5ec1c79 commit 18ef123
Show file tree
Hide file tree
Showing 18 changed files with 1,028 additions and 898 deletions.
45 changes: 39 additions & 6 deletions interfaces/src/main/java/ar/edu/itba/paw/interfaces/CourseDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ar.edu.itba.paw.models.Course;
import ar.edu.itba.paw.models.FinalInscription;
import ar.edu.itba.paw.models.users.Student;
import ar.edu.itba.paw.shared.CourseFilter;

import java.util.List;
Expand Down Expand Up @@ -146,15 +147,47 @@ public interface CourseDao {
*/
Integer getTotalPlanCredits();

/* +++ xtest */
/* +++ xdocument */
Course getStudentsThatPassedCourse(String id);
/**
* Gets the student that passed both the given course and the course's final exam
* @param courseId The Course's Id
* @return The list of students that passed the course
*/

List<Student> getStudentsThatPassedCourse(String courseId);


/**
* Get the final inscriptions corresponding to a course.
* @param courseId The course's id
* @return A list of all the final inscriptions for the given course
*/
List<FinalInscription> getCourseFinalInscriptions(String courseId);

/**
* Get the open final inscriptions corresponding to a course.
* @param id The course's id
* @return The list containing all the final inscriptions.
* @param courseId The course's id
* @return A list of all the open final inscriptions for the given course
*/
List<FinalInscription> getCourseOpenFinalInscriptions(String courseId);

/**
* Get a final inscription by it's id
* @param id The given's final inscription's id
* @return The Final Inscription
*/
FinalInscription getFinalInscription(int id);

/**
* Creates a new final inscription
* @param finalInscription The final inscription to be created
* @return The created inscription's id
*/
List<FinalInscription> getOpenFinalInsciptions(Integer id);
int addFinalInscription(FinalInscription finalInscription);

/**
* Deletes the a final inscription with the given id
* @param finalInscriptionId The final inscription's id
*/
void deleteFinalInscription(int finalInscriptionId);

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface CourseService {
*/
boolean update(String courseId, Course course);

/**
/**
* Get all the current available courses
* @return a list containing all the current available courses, if any.
*/
Expand Down Expand Up @@ -113,9 +113,8 @@ public interface CourseService {
/**
*
* @param courseId Given the id of a course, delete all the correlative
* @return The result code of the operation
*/
boolean deleteCourseCorrelatives(String courseId);
void deleteCourseCorrelatives(String courseId);

/**
* Get the number of semesters.
Expand Down Expand Up @@ -144,16 +143,41 @@ public interface CourseService {
*/
int getTotalPlanCredits();

/* +++xtest */
/* +++xdocument */
Course getStudentsThatPassedCourse(String courseId, StudentFilter studentFilter);
/**
* Gets the student that passed both the given course and the course's final exam
* @param courseId The Course's Id
* @param studentFilter The list of filters to apply
* @return The list of students that passed the course and complies with the given filters
*/
List<Student> getStudentsThatPassedCourse(String courseId, StudentFilter studentFilter);

/**
* Get the final inscriptions corresponding to a course.
* @param courseId The course's id
* @return A list of all the final inscriptions for the given course
*/
List<FinalInscription> getCourseFinalInscriptions(String courseId);

/**
* Get the open final inscriptions corresponding to a course.
* @param id The course's id
* @return The list containing all the final inscriptions.
* @param courseId The course's id
* @return A list of all the open final inscriptions for the given course
*/
List<FinalInscription> getOpenFinalInsciptions(Integer id);
List<FinalInscription> getCourseOpenFinalInscriptions(String courseId);

/**
* Get a final inscription by it's id
* @param id The given's final inscription's id
* @return The Final Inscription
*/
FinalInscription getFinalInscription(int id);

/**
* Creates a new final inscription
* @param finalInscription The final inscription to be created
* @return The created inscription's id
*/
int addFinalInscription(FinalInscription finalInscription);

/**
* Get the student's inscribed in a FinalInscription
Expand All @@ -162,11 +186,9 @@ public interface CourseService {
*/
Set<Student> getFinalStudents(int id);


/**
* Get a final inscription by it's id
* @param id The given's final inscription's id
* @return The Final Inscription
* Deletes the a final inscription with the given id
* @param finalInscriptionId The final inscription's id
*/
FinalInscription getFinalInscription(int id);
void deleteFinalInscription(int finalInscriptionId);
}
Loading

0 comments on commit 18ef123

Please sign in to comment.