Class IncomeService

java.lang.Object
com.truebubo.maniflow.income.IncomeService
All Implemented Interfaces:
MoneyExchangeService<Income>

@Service public class IncomeService extends Object implements MoneyExchangeService<Income>
Handles business logic behind income
  • Constructor Details

    • IncomeService

      public IncomeService(@NonNull IncomeRepository incomeRepository)
      Service for incomes
      Parameters:
      incomeRepository - Repository for data about incomes
  • Method Details

    • get

      public List<Income> get()
      Gets the list of all the incomes saved by the user
      Specified by:
      get in interface MoneyExchangeService<Income>
      Returns:
      All the incomes saved
    • add

      public void add(@NonNull Income income)
      Saves the income
      Specified by:
      add in interface MoneyExchangeService<Income>
      Parameters:
      income - Information about the income to be added
    • change

      public void change(int id, @NonNull BigDecimal newAmount)
      Change the value on the income with given id
      Specified by:
      change in interface MoneyExchangeService<Income>
      Parameters:
      id - ID identifying the income. It is the left value displayed when calling showIncomes
      newAmount - Will update the value to this value. If set to zero. The value will be removed