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 commisions
`java.util.List<ExportData>` | `getExportData()` |
`java.util.Optional<Commision>` | `getNewestCommision​(User user)` | get newest commision ov given user
`java.util.List<Commision>` | `getUsersCommisions​(User user)` | gets user commisions
`Commision` | `save​(Commision commision)` | save to database commision.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CommisionService

public CommisionService()

## 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