Package com.plannaplan.services
Class AssignmentService
java.lang.Object
com.plannaplan.services.AssignmentService
@Service
public class AssignmentService
extends java.lang.Object
Service of Assignment which can save assignments, diplay assignments, get
ammount of assigments.
-
Constructor Summary
Constructors Constructor Description AssignmentService()
-
Method Summary
Modifier and Type Method Description void
callAcceptAlgorythm()
this method will activate accept algorythm for all students.long
getAssignmentsAmmount()
get ammount of all assignments (not only for selected commision)java.util.Optional<Assignment>
getById(java.lang.Long id)
Get assigmnent by idjava.util.List<Assignment>
getCommisionAssignments(Commision com)
gets list of assignments of given commisionAssignment
save(Assignment assignment)
Save given assignmentjava.util.List<Assignment>
saveAll(java.util.List<Assignment> toSave)
-
Constructor Details
-
AssignmentService
public AssignmentService()
-
-
Method Details
-
save
Save given assignment- Parameters:
assignment
- assignment to save- Returns:
- assignment saved assignment with database id
-
getCommisionAssignments
gets list of assignments of given commision- Parameters:
com
- Commision to get assinments from- Returns:
- list of assignments
-
getAssignmentsAmmount
public long getAssignmentsAmmount()get ammount of all assignments (not only for selected commision)- Returns:
- long - ammount of assingments
-
getById
Get assigmnent by id- Parameters:
id
- id of assigmnent- Returns:
- Optional of assignment
-
callAcceptAlgorythm
public void callAcceptAlgorythm()this method will activate accept algorythm for all students. Algorythm is takeing each student in order defined by ranking and accept for him groups that are joinable for him -
saveAll
- Parameters:
toSave
- list of entites to save to db- Returns:
- list of assignments entities with ids from db
-