feat: finished creating services from controllers, continued implementing entrepreneurServiceApi with some validation
Some checks failed
Format / formatting (push) Failing after 6s
CI / build (push) Successful in 11s

This commit is contained in:
Théo Le Lez
2025-02-26 17:35:52 +01:00
parent e75a5c9d2c
commit f9de5ed6bf
11 changed files with 219 additions and 125 deletions

View File

@ -34,7 +34,7 @@ public class ProjectService {
public Project getProjectById(Long id) {
Optional<Project> project = this.projectRepository.findById(id);
if (project.isEmpty()) {
System.err.println("Project with id " + id + " not found");
logger.error("No project found with id {}", id);
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Ce projet n'existe pas");
}
return project.get();
@ -77,7 +77,7 @@ public class ProjectService {
if (projectStatus != null) {
if (!validateStatus(projectStatus)) {
System.err.println("updateProjectStatus: Invalid status " + projectStatus);
logger.error("updateProjectStatus: Invalid status {}", projectStatus);
throw new ResponseStatusException(
HttpStatus.NOT_ACCEPTABLE, "Ce status n'est pas accepté");
}