class ProjectService {

  @Transactional
  public void createProject(String name) {
    if (projectRepository.existsById(name)) {
      throw new IllegalArgumentException(String.format("Project already exists: %s", name));
    }
    Project project = new Project(name);
    projectRepository.saveAndFlush(project);
  }

  @Autowired public  ProjectService(ProjectRepository projectRepository);

}