-
Notifications
You must be signed in to change notification settings - Fork 131
fix: get student repeating year #1252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
066dcad
fix: get student repeating year
DyferHerioss a267e8a
fix: test
DyferHerioss 107bb14
chore: format
DyferHerioss 6afc834
chore: rename class
DyferHerioss b926005
chore: apply request change
DyferHerioss bbbd774
chore: format
DyferHerioss 6a31a53
chore: get levels between two date instead before of one date
DyferHerioss 95217b5
feat: replace getCourseResultByIdAndLevel by delegating it to groupFl…
tokyramarozaka 7a5b525
chore: add GroupFlowPeriod dto
tokyramarozaka 3a052de
chore: refactor grade
DyferHerioss 7af7239
chore: rename variable
DyferHerioss 69748c5
chore: remove unused method
DyferHerioss 3b61d07
fix: grade result test
DyferHerioss d2a0355
fix: warning
DyferHerioss dcc5e3b
chore: resolve conflict
DyferHerioss 2a5d577
chore: change expression
DyferHerioss 183daed
chore: test for student repeating year
DyferHerioss 7ed611f
Merge branch 'preprod' into fix/grades-for-student-repeating-year
DyferHerioss e67cdb3
chore: format
DyferHerioss 815432b
chore: remove unused method
DyferHerioss 98678f4
chore: format
DyferHerioss d6183b6
chore: remove unused method
DyferHerioss 8f3ec40
chore: create record class instead of using map
DyferHerioss 4b47c21
chore: format
DyferHerioss cd92ba5
chore: apply request change
DyferHerioss a9f5532
chor: format
DyferHerioss 476748c
fix: sonar check
DyferHerioss 5cf9e13
chore: fiw warning
DyferHerioss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
12 changes: 12 additions & 0 deletions
12
src/main/java/school/hei/haapi/model/dto/GroupFlowPeriod.java
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package school.hei.haapi.model.dto; | ||
|
|
||
| import java.time.Instant; | ||
| import school.hei.haapi.model.Group; | ||
|
|
||
| public record GroupFlowPeriod(Group group, Instant start, Instant end) { | ||
| public boolean contains(Instant instant) { | ||
| boolean afterStart = !instant.isBefore(start); | ||
| boolean beforeEnd = (end == null) || instant.isBefore(end); | ||
| return afterStart && beforeEnd; | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
src/main/java/school/hei/haapi/model/dto/GroupFlowPeriodCourseAssignment.java
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package school.hei.haapi.model.dto; | ||
|
|
||
| import java.util.List; | ||
| import school.hei.haapi.model.CourseAssignment; | ||
|
|
||
| public record GroupFlowPeriodCourseAssignment( | ||
| GroupFlowPeriod groupFlowPeriod, List<CourseAssignment> courseAssignments) {} |
This file contains hidden or 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 hidden or 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
17 changes: 15 additions & 2 deletions
17
src/main/java/school/hei/haapi/repository/GroupFlowRepository.java
This file contains hidden or 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,12 +1,25 @@ | ||
| package school.hei.haapi.repository; | ||
|
|
||
| import java.util.List; | ||
| import org.springframework.data.domain.Sort; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.data.jpa.repository.Query; | ||
| import org.springframework.data.repository.query.Param; | ||
| import org.springframework.stereotype.Repository; | ||
| import school.hei.haapi.endpoint.rest.model.StudentLevel; | ||
| import school.hei.haapi.model.GroupFlow; | ||
| import school.hei.haapi.model.User; | ||
|
|
||
| @Repository | ||
| public interface GroupFlowRepository extends JpaRepository<GroupFlow, String> { | ||
| List<GroupFlow> findAllByGroupId(String groupId, Sort sortable); | ||
| @Query( | ||
| """ | ||
| SELECT gf FROM GroupFlow gf | ||
| JOIN gf.group g | ||
| JOIN CourseAssignment ca ON g MEMBER OF ca.groups | ||
| JOIN ca.course c | ||
| WHERE gf.student = :student | ||
| AND c.studentLevel = :level | ||
| """) | ||
| List<GroupFlow> findByFlowTypeAndStudentAndLevel( | ||
| @Param("student") User student, @Param("level") StudentLevel level); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.