Added CommisionService into javadoc
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
parent
3faa228745
commit
20341d5441
@ -22,20 +22,38 @@ public class CommisionService {
|
||||
public CommisionService() {
|
||||
}
|
||||
|
||||
/*
|
||||
* save
|
||||
*
|
||||
* @param commision which assignment should be save in service
|
||||
* @return commision
|
||||
*/
|
||||
public Commision save(Commision commision) {
|
||||
this.repo.save(commision);
|
||||
return commision;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* getUsersCommisions
|
||||
* Return given users id
|
||||
*/
|
||||
public List<Commision> getUsersCommisions(User user) {
|
||||
return this.repo.getUsers(user.getId());
|
||||
}
|
||||
|
||||
/*
|
||||
* getNewestCommision
|
||||
* Return the newest commision of the user
|
||||
*/
|
||||
public Optional<Commision> getNewestCommision(User user) {
|
||||
return this.repo.getNewestCommision(user.getId()).stream().findFirst();
|
||||
}
|
||||
|
||||
/*
|
||||
* getCommisionsAmmount
|
||||
* Return ammount of commisions
|
||||
*/
|
||||
public long getCommisionsAmmount() {
|
||||
return this.repo.count();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user