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 Details

  • Method Details

    • save

      public Assignment save​(Assignment assignment)
      Save given assignment
      Parameters:
      assignment - assignment to save
      Returns:
      assignment saved assignment with database id
    • getCommisionAssignments

      public java.util.List<Assignment> getCommisionAssignments​(Commision com)
      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

      public java.util.Optional<Assignment> getById​(java.lang.Long id)
      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

      public java.util.List<Assignment> saveAll​(java.util.List<Assignment> toSave)
      Parameters:
      toSave - list of entites to save to db
      Returns:
      list of assignments entities with ids from db