class DemoService {

    @Transactional
    public ProjectDTO create() throws BadRequestException {
        if (projectService.findOne(PROJECT_CODE_DEMO).isPresent()) {
            throw new BadRequestException(Messages.RULE_DEMO_PROJECT_ALREADY_EXISTS, Entities.PROJECT, "demo-exists");
        }

        // IMPORTANT: Use DTO constructors everywhere,
        // to make sure the project will not compile when new fields are not thought about for the demo project

        final ProjectDTO project = demoSettingsLoader.createProjectWithCommunicationsAndRootCauses();
        long projectId = project.getId().longValue();

        demoSettingsLoader.setCommunications(projectId);

        demoSettingsLoader.createSources(projectId);
        demoSettingsLoader.createTypes(projectId);
        demoSettingsLoader.createCountries(projectId);
        demoSettingsLoader.createSeverities(projectId);

        List<TeamDTO> teams = demoSettingsLoader.createTeams(projectId);
        demoProblemLoader.createProblems(projectId, teams);

        final Map<String, Long> functionalityIds = demoFunctionalityLoader.createFunctionalityTree(projectId, teams);
        demoScenarioLoader.createScenarios(projectId, functionalityIds);
        final List<CycleDefinitionDTO> cycleDefinitions = demoSettingsLoader.createCycleDefinitions(projectId);
        demoExecutionLoader.importExecution(projectId, functionalityIds, cycleDefinitions);

        return project;
    }

}