feat: switched from String to ProjectDecisionValues
All checks were successful
Format / formatting (push) Successful in 6s
Build / build (push) Successful in 28s
CI / build (push) Successful in 11s

This commit is contained in:
Pierre Tellier 2025-03-12 10:25:19 +01:00
parent e011a5534e
commit 419ceec1bc
3 changed files with 6 additions and 3 deletions

View File

@ -2,6 +2,7 @@ package enseirb.myinpulse.repository;
import enseirb.myinpulse.model.Administrator;
import enseirb.myinpulse.model.Project;
import enseirb.myinpulse.model.ProjectDecisionValue;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@ -10,5 +11,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource;
public interface ProjectRepository extends JpaRepository<Project, Long> {
Iterable<Project> findByProjectAdministrator(Administrator administrator);
Iterable<Project> findByProjectStatus(Long status);
Iterable<Project> findByProjectStatus(ProjectDecisionValue status);
}

View File

@ -61,7 +61,9 @@ public class AdminApiService {
// TODO: solve todo + test
public void addNewProject(Project project) {
projectService.addNewProject(project); // TODO: how can the front know the ID ?
projectService.addNewProject(
project); // TODO: how can the front know the ID ? => it does not, thus needing to
// have null in the project id field
}
// TODO

View File

@ -102,7 +102,7 @@ public class ProjectService {
}
public Iterable<Project> getPendingProjects() {
return this.projectRepository.findByProjectStatus((long) PENDING.ordinal());
return this.projectRepository.findByProjectStatus(PENDING);
}
public void deleteProjectById(Long id) {