Added CommisionService into javadoc

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-12-02 10:22:50 +01:00
parent 3faa228745
commit 20341d5441
Signed by: y0rune
GPG Key ID: F204C385F57EB348

View File

@ -22,20 +22,38 @@ public class CommisionService {
public CommisionService() { public CommisionService() {
} }
/*
* save
*
* @param commision which assignment should be save in service
* @return commision
*/
public Commision save(Commision commision) { public Commision save(Commision commision) {
this.repo.save(commision); this.repo.save(commision);
return commision; return commision;
} }
/*
* getUsersCommisions
* Return given users id
*/
public List<Commision> getUsersCommisions(User user) { public List<Commision> getUsersCommisions(User user) {
return this.repo.getUsers(user.getId()); return this.repo.getUsers(user.getId());
} }
/*
* getNewestCommision
* Return the newest commision of the user
*/
public Optional<Commision> getNewestCommision(User user) { public Optional<Commision> getNewestCommision(User user) {
return this.repo.getNewestCommision(user.getId()).stream().findFirst(); return this.repo.getNewestCommision(user.getId()).stream().findFirst();
} }
/*
* getCommisionsAmmount
* Return ammount of commisions
*/
public long getCommisionsAmmount() { public long getCommisionsAmmount() {
return this.repo.count(); return this.repo.count();
} }