@@ -0,0 +1,1560 @@
+package io.teiler.api.service;%0A%0Aimport java.util.List;%0A%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.stereotype.Service;%0A%0Aimport io.teiler.server.dto.Expense;%0Aimport io.teiler.server.dto.Person;%0Aimport io.teiler.server.dto.Share;%0Aimport io.teiler.server.persistence.entities.ExpenseEntity;%0Aimport io.teiler.server.persistence.repositories.ExpenseRepository;%0Aimport io.teiler.server.persistence.repositories.ProfiteerRepository;%0A%0A/**%0A * Provides service-methods for Expenses.%0A * %0A * @author pbaechli%0A */%0A@Service%0Apublic class ExpenseService %7B%0A%0A    @Autowired%0A    private ExpenseRepository expenseRepository;%0A    %0A    @Autowired%0A    private ProfiteerRepository profiteerRepository;%0A    %0A    /**%0A     * Creates a new Expense.%0A     * %0A     * @param title Title of the Expense%0A     * @param amount Amount of money involved in the Expense%0A     * @param payer Person who spent the money%0A     * @param shares %7B@link List%7D of %7B@link Share%7D related to the Expense%0A     * @return Information about the Expense%0A     */%0A    public Expense createExpense(String title, int amount, Person payer, List%3CShare%3E shares) %7B%0A        Expense expense = new Expense(null, amount, payer, title, shares);%0A        %0A        ExpenseEntity expenseEntity = expenseRepository.create(expense);%0A        %0A        for(Share share : shares) %7B%0A            share.setExpenseId(expenseEntity.getId());%0A            profiteerRepository.create(share);%0A        %7D%0A        %0A        return expenseRepository.getById(expenseEntity.getId()).toExpense();%0A    %7D%0A    %0A%7D%0A

add expense service (#173)