Skip to content

Commit

Permalink
Corrected Sotuyo's mistakes checklist (#113)
Browse files Browse the repository at this point in the history
Corrected Sotuyo's mistakes checklist

- Removed unnecesary commented code (tests, services, daos)
- Spring Security only ignores the favicon resource
- Removed Result class completely
- Checked null for empty lists and int returning instead of Integer
- Reformated and cleaned code
- Removed unused files (JSP, static, Javascript)
- Remove loop in getCorrelativeCoursesByFilter and rename getCorrelativeCourses
- Add transactional to userExists method
  • Loading branch information
gibarsin authored Feb 5, 2017
1 parent 87c82e8 commit 3e81771
Show file tree
Hide file tree
Showing 111 changed files with 252 additions and 10,063 deletions.

This file was deleted.

22 changes: 7 additions & 15 deletions interfaces/src/main/java/ar/edu/itba/paw/interfaces/AdminDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ public interface AdminDao {
/**
*
* @param admin The admin to be persisted in the database.
* @return OK if the admin could be created;
* ADMIN_EXISTS_DNI if there is an admin whose dni is equal to this new admin;
* ERROR_UNKNOWN else;
*/
boolean create(Admin admin);
void create(Admin admin);

/**
* Gets all the data associated with the user that has the
* given dni.
* @param dni
* @param dni the dni of the admin
* @return The admin that has the given dni; null if no admin was found.
*/
Admin getByDni(int dni);
Expand All @@ -45,22 +42,18 @@ public interface AdminDao {
/**
* Delete the admin that matches the given dni.
* @param dni The admin's dni
* @return OK if the dni was deleted;
* ERROR_UNKNOWN else;
*/
boolean delete(int dni);
void delete(int dni);

/**
* Enable the student's authority to add and delete inscriptions
* @return true if the inscriptions were enabled properly; else false
*/
boolean enableInscriptions();
void enableInscriptions();

/**
* Disable the student's authority to add and delete inscriptions
* @return true if the inscriptions were disabled properly; else false
*/
boolean disableInscriptions();
void disableInscriptions();

/**
* @return A boolean indicating whether the inscriptions are enabled
Expand All @@ -81,8 +74,7 @@ public interface AdminDao {

/**
* Answer an existing procedure
* @param procedure
* @return if the procedure was successfully answered
* @param procedure the answer to a procedure
*/
boolean answerProcedure(Procedure procedure);
void answerProcedure(Procedure procedure);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ public interface AdminService {
/**
*
* @param admin The admin to be persisted in the database.
* @return OK if the admin could be created;
* ADMIN_EXISTS_DNI if there is an admin whose dni is equal to this new admin;
* ERROR_UNKNOWN else;
*/
boolean create(Admin admin);
void create(Admin admin);

/**
* Gets all the data associated with the user that has the
* given dni.
* @param dni
* @param dni the dni of the administrator
* @return The admin that has the given dni; null if no admin was found.
*/
Admin getByDni(int dni);
Expand All @@ -49,23 +46,18 @@ public interface AdminService {
/**
* Delete the admin that matches the given dni.
* @param dni The admin's dni
* @return OK if the admin was deleted;
* ERROR_DNI_OUT_OF_BOUNDS if the dni is invalid;
* ERROR_UNKNOWN else;
*/
boolean deleteAdmin(int dni);
void deleteAdmin(int dni);

/**
* Disables inscription authority for Students
* @return The Result code of the operation
*/
boolean disableInscriptions();
void disableInscriptions();

/**
* Enables inscription authority for Students
* @return The Result code of the operation
*/
boolean enableInscriptions();
void enableInscriptions();

/**
* @return A boolean indicating whether the inscriptions are enabled
Expand All @@ -90,8 +82,7 @@ public interface AdminService {

/**
* Answer an existing procedure
* @param procedure
* @return if the procedure was successfully answered
* @param procedure the answer to a procedure
*/
boolean answerProcedure(Procedure procedure);
void answerProcedure(Procedure procedure);
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ public interface CourseDao {
/**
* Attempts to delete the course with the given id
* @param courseId of the course to delete
* @return true if the course was deleted;
* false in other case;
*/
boolean deleteCourse(String courseId);
void deleteCourse(String courseId);

/**
* @param courseId The id of the course.
Expand All @@ -91,9 +89,8 @@ public interface CourseDao {
*
* @param id The id of the course who will have the correlativity
* @param correlativeId The id of the course correlative course
* @return The insertion result.
*/
boolean addCorrelativity(String id, String correlativeId);
void addCorrelativity(String id, String correlativeId);

/**
* Check whether a course exists or not
Expand Down Expand Up @@ -125,15 +122,14 @@ public interface CourseDao {
*
* @param courseId The id of the course.
* @param correlativeId The id of the correlative for the given course.
* @return OK if no errors were found, UNKNOWN_ERROR otherwise.
*/
boolean deleteCorrelative(String courseId, String correlativeId);
void deleteCorrelative(String courseId, String correlativeId);

/**
* Get the number of semesters.
* @return Integer indicating the number of semesters
*/
Integer getTotalSemesters();
int getTotalSemesters();

/**
*
Expand All @@ -147,7 +143,7 @@ public interface CourseDao {
* Get the total credits of the plan.
* @return Integer indicating the total credits of the plan.
*/
Integer getTotalPlanCredits();
int getTotalPlanCredits();

/**
* Gets the student that passed both the given course and the course's final exam
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ public interface CourseService {
/**
*
* @param course The course to be persisted in the database.
* @return The Result code of the insertion.
*/
boolean create(Course course);
void create(Course course);

/**
* Update a course
* @param courseId Id the previous course.
* @param course Modified course.
* @return The result code of the insertion.
* @return The true if the course was updated
*/
boolean update(String courseId, Course course);

Expand Down Expand Up @@ -65,8 +64,6 @@ public interface CourseService {
/**
* Attempts to delete the course with the given id
* @param id of the course to delete
* @return true if the course was deleted;
* false in other case;
*/
boolean deleteCourse(String id);

Expand Down Expand Up @@ -108,9 +105,10 @@ public interface CourseService {
*
* @param courseId The id of the course.
* @param correlativeId The id of the correlative for the given course.
* @return OK if no errors were found, UNKNOWN_ERROR otherwise.
* @return true if the correlative was deleted;
* false if either of the correlatives did not exist
*/
boolean deleteCorrelative(String courseId, String correlativeId);
void deleteCorrelative(String courseId, String correlativeId);

/**
*
Expand All @@ -127,10 +125,9 @@ public interface CourseService {
/**
*
* @param courseId The id of the course.
* @param courseFilter The course's filter. If null, no filter is applied.
* @return A list of correlatives courses to the given course, with the filter applied.
*/
List<Course> getCorrelativesByFilter(String courseId, CourseFilter courseFilter);
List<Course> getCorrelativeCourses(String courseId);

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ public interface ProcedureDao {
/**
* Create a new procedure
* @param procedure the procedure to persist
* @return true if the procedure was created successfully; else false
*/
boolean createProcedure(Procedure procedure);
void createProcedure(Procedure procedure);

/**
* Respond to a specific procedure already created
* @param procedure the original procedure with the changes
* @return true if the procedure was modified successfully; else false
*/
public boolean updateProcedure(Procedure procedure);
void updateProcedure(Procedure procedure);

/**
* Get all the procedures created by a user
Expand Down
28 changes: 11 additions & 17 deletions interfaces/src/main/java/ar/edu/itba/paw/interfaces/StudentDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import ar.edu.itba.paw.models.users.Student;
import ar.edu.itba.paw.shared.StudentFilter;

import java.math.BigDecimal;
import java.util.List;

public interface StudentDao {
Expand Down Expand Up @@ -46,9 +45,8 @@ public interface StudentDao {
/**
*
* @param student The student to be persisted in the database.
* @return true if the student was inserted; else false
*/
boolean create(Student student);
void create(Student student);

/**
* Update student
Expand All @@ -68,10 +66,8 @@ public interface StudentDao {
/**
* Delete the student that matches the given docket.
* @param docket The student's docket
* @return OK if the student was deleted;
* ERROR_UNKNOWN else;
*/
boolean deleteStudent(int docket);
void deleteStudent(int docket);

/**
*
Expand All @@ -94,11 +90,10 @@ public interface StudentDao {
void addFinalGrade(Grade grade, FinalGrade finalGrade);

/**
* @param newGrade The new grade values
* @param oldGrade The grade to be updated
* @return The result code of the Update
*/
boolean editGrade(Grade newGrade, BigDecimal oldGrade);
* @param newGrade The new grade values
*
*/
void editGrade(Grade newGrade);

/**
* Enrolls the student with the given docket into the course with the specified id.
Expand All @@ -108,7 +103,7 @@ public interface StudentDao {
void enroll(int studentDocket, String courseId);

/**
* Unenrolls the student with the given docket of the course with the specified id.
* Unrolls the student with the given docket of the course with the specified id.
*
* @param studentDocket The student's docket
* @param courseId The course id
Expand Down Expand Up @@ -181,17 +176,16 @@ public interface StudentDao {
List<FinalInscription> getAllFinalInscriptionsFromOpenInstance();

/**
*
* @param procedure
* @return
* Create a new procedure
* @param procedure the procedure to be created
*/
boolean createProcedure(Procedure procedure);
void createProcedure(Procedure procedure);

/**
* Gets the final inscriptions for a course corresponding to the open final instance.
*
* @param course The course corresponding to de final inscriptions
* @return
* @return the list of final inscriptions
*/
List<FinalInscription> getOpenFinalInscriptionsByCourse(Course course);

Expand Down
Loading

0 comments on commit 3e81771

Please sign in to comment.