Package com.plannaplan.services
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 Summary
Constructors Constructor Description CommisionService()
-
Method Summary
Modifier and Type Method Description long
getCommisionsAmmount()
get ammpounts of commisionsjava.util.List<ExportData>
getExportData()
java.util.Optional<Commision>
getNewestCommision(User user)
get newest commision ov given userjava.util.List<Commision>
getUsersCommisions(User user)
gets user commisionsCommision
save(Commision commision)
save to database commision.
-
Constructor Details
-
CommisionService
public CommisionService()
-
-
Method Details
-
save
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
gets user commisions- Parameters:
user
- owner of commisions- Returns:
- list of user commisions
-
getNewestCommision
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
- Returns:
- list of ExportData inmstancces keeping data to exprt to file
-