示例#1
0
 public Collection<ExpenseViewModel> getAll() {
   User user = sessionService.getCurrentUser();
   Collection<UserApprovable<Expense>> expenses =
       user.expensesWithPayPeriod(payPeriodService.getCurrent());
   return expenseAssembler.toViewModel(expenses);
 }
示例#2
0
 public Collection<ExpenseViewModel> getAllWaiting() {
   Users users = userRepository.users();
   Collection<UserApprovable<Expense>> expenses = users.waitingExpenses();
   return expenseAssembler.toViewModel(expenses);
 }
示例#3
0
 public ExpenseViewModel getOne(String username, LocalDate localDate, String timestamp)
     throws ApprovableNotFoundException, UserNotFoundException {
   User user = userRepository.getByUsername(username);
   Expense expense = user.expenseWithDateAndTimestamp(localDate, timestamp);
   return expenseAssembler.toViewModel(new UserApprovable<Expense>(user, expense));
 }