-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve access check and include due date
- Loading branch information
1 parent
02ac43a
commit 07e7d5f
Showing
2 changed files
with
8 additions
and
9 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
9 changes: 6 additions & 3 deletions
9
src/main/java/de/tum/in/www1/artemis/web/rest/dto/competency/CompetencyProgressDTO.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,12 +1,15 @@ | ||
package de.tum.in.www1.artemis.web.rest.dto.competency; | ||
|
||
import java.time.ZonedDateTime; | ||
|
||
import de.tum.in.www1.artemis.domain.competency.CompetencyProgress; | ||
import de.tum.in.www1.artemis.service.competency.CompetencyProgressService; | ||
|
||
public record CompetencyProgressDTO(long id, String title, Double progress, Double confidence, Double mastery) { | ||
public record CompetencyProgressDTO(long id, String title, ZonedDateTime softDueDate, Double progress, Double confidence, Double mastery) { | ||
|
||
public static CompetencyProgressDTO of(CompetencyProgress competencyProgress) { | ||
return new CompetencyProgressDTO(competencyProgress.getCompetency().getId(), competencyProgress.getCompetency().getTitle(), competencyProgress.getProgress(), | ||
competencyProgress.getConfidence(), CompetencyProgressService.getMastery(competencyProgress)); | ||
return new CompetencyProgressDTO(competencyProgress.getCompetency().getId(), competencyProgress.getCompetency().getTitle(), | ||
competencyProgress.getCompetency().getSoftDueDate(), competencyProgress.getProgress(), competencyProgress.getConfidence(), | ||
CompetencyProgressService.getMastery(competencyProgress)); | ||
} | ||
} |