Class CommisionService

java.lang.Object
com.plannaplan.services.CommisionService

@Service
public class CommisionService
extends java.lang.Object
Service of CommisionService which can save commision, get user's commisions, get newest user's commision, get ammount of commisions.
  • Constructor Details

  • Method Details

    • save

      public Commision save​(Commision commision)
      save to database commision. It also checks for missing assignments from previous commision (you can not get rid of accepted assignment)
      Parameters:
      commision - to save to db
      Returns:
      Commision instance with id from database
    • getUsersCommisions

      public java.util.List<Commision> getUsersCommisions​(User user)
      gets user commisions
      Parameters:
      user - owner of commisions
      Returns:
      list of user commisions
    • getNewestCommision

      public java.util.Optional<Commision> getNewestCommision​(User user)
      get newest commision ov given user
      Parameters:
      user - owener of commision we attemp to get
      Returns:
      optional if commition was found
    • getCommisionsAmmount

      public long getCommisionsAmmount()
      get ammpounts of commisions
      Returns:
      long - ammounts of commisions (all even from history, not only cutrrent one)
    • getExportData

      public java.util.List<ExportData> getExportData()
      Returns:
      list of ExportData inmstancces keeping data to exprt to file