class NoteService {

  @Transactional
  public Note updateNote(Note updatedNote, User user) {
    Note referencedNote = findById(updatedNote.getId());
    referencedNote.setText(updatedNote.getText());
    referencedNote = noteRepository.save(referencedNote);
    activityService.createActivity(user, referencedNote, Action.EDITED);
    return referencedNote;
  }

  @Autowired public  NoteService(NoteRepository noteRepository, ActivityService activityService);

}