-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modification and acquisition of sprints now require the context of a …
…project and user
- Loading branch information
Igor Kedzierawski
committed
Dec 17, 2023
1 parent
495e684
commit ae8572b
Showing
7 changed files
with
106 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
corn-backend/src/main/java/dev/corn/cornbackend/api/sprint/interfaces/SprintService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
package dev.corn.cornbackend.api.sprint.interfaces; | ||
|
||
import dev.corn.cornbackend.api.sprint.data.SprintResponse; | ||
import dev.corn.cornbackend.entities.project.Project; | ||
import dev.corn.cornbackend.entities.user.User; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
public interface SprintService { | ||
|
||
SprintResponse addNewSprint(String name, LocalDate startDate, LocalDate endDate, String description); | ||
SprintResponse addNewSprint(String name, LocalDate startDate, LocalDate endDate, String description, User user); | ||
|
||
SprintResponse getSprintById(long sprintId, User user); | ||
|
||
List<SprintResponse> getSprintsOnPage(int page, User user); | ||
List<SprintResponse> getSprintsOnPage(int page, long projectId, User user); | ||
|
||
SprintResponse updateSprintsName(String name, long sprintId); | ||
SprintResponse updateSprintsName(String name, long sprintId, User user); | ||
|
||
SprintResponse updateSprintsDescription(String description, long sprintId); | ||
SprintResponse updateSprintsDescription(String description, long sprintId, User user); | ||
|
||
SprintResponse updateSprintsStartDate(LocalDate startDate, long sprintId); | ||
SprintResponse updateSprintsStartDate(LocalDate startDate, long sprintId, User user); | ||
|
||
SprintResponse updateSprintsEndDate(LocalDate endDate, long sprintId); | ||
SprintResponse updateSprintsEndDate(LocalDate endDate, long sprintId, User user); | ||
|
||
SprintResponse deleteSprint(long sprintId); | ||
SprintResponse deleteSprint(long sprintId, User user); | ||
|
||
} |
10 changes: 7 additions & 3 deletions
10
...ckend/src/main/java/dev/corn/cornbackend/entities/sprint/interfaces/SprintRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
package dev.corn.cornbackend.entities.sprint.interfaces; | ||
|
||
import dev.corn.cornbackend.entities.sprint.Sprint; | ||
import dev.corn.cornbackend.entities.user.User; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface SprintRepository extends JpaRepository<Sprint, Long> { | ||
|
||
Page<Sprint> findAllByOwnerOrderByName(User owner, Pageable pageable); | ||
|
||
} | ||
@Query("SELECT s FROM Sprint s WHERE s.project.projectId = ?1") | ||
Page<Sprint> findAllByProjectId(long projectId, Pageable pageable); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.