コード例 #1
0
ファイル: ExpenseService.java プロジェクト: sam101/GLO-4003
 public void unapprove(ApproveForm form)
     throws ApprovableNotFoundException, UserNotFoundException {
   User user = userRepository.getByUsername(form.getUsername());
   Expense expense = user.expenseWithDateAndTimestamp(form.getLocalDate(), form.getTimestamp());
   expense.unapprove();
 }
コード例 #2
0
ファイル: ExpenseService.java プロジェクト: sam101/GLO-4003
 public Collection<ExpenseViewModel> getAll() {
   User user = sessionService.getCurrentUser();
   Collection<UserApprovable<Expense>> expenses =
       user.expensesWithPayPeriod(payPeriodService.getCurrent());
   return expenseAssembler.toViewModel(expenses);
 }
コード例 #3
0
ファイル: ExpenseService.java プロジェクト: sam101/GLO-4003
 public void create(ExpenseForm form) throws ProjectNotFoundException {
   User user = sessionService.getCurrentUser();
   Project project = projectRepository.getByName(form.getProject());
   Expense expense = expenseAssembler.fromForm(project, form);
   user.addExpense(expense);
 }
コード例 #4
0
ファイル: ExpenseService.java プロジェクト: sam101/GLO-4003
 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));
 }