Class DebtService

java.lang.Object
com.truebubo.maniflow.debt.DebtService

@Service public class DebtService extends Object
Handles business logic behind debts
  • Constructor Details

    • DebtService

      public DebtService(DebtRepository debtRepository)
      Service for debts
      Parameters:
      debtRepository - Repository for data about debts
  • Method Details

    • getDebts

      public List<Debt> getDebts()
      Gets the list of all the debts saved by the user
      Returns:
      All the debts saved
    • addDebt

      public void addDebt(Debt debt)
      Saves the debt
      Parameters:
      debt - Information about the debt to be added
    • payDebt

      public void payDebt(int id, BigDecimal amount)
      Pay the value on the debt with given id
      Parameters:
      id - ID identifying the debt. It is the left value displayed when calling showDebts
      amount - Will deduct this much from the debt