Skip to content

Commit

Permalink
misc: inspection fixes (#80)
Browse files Browse the repository at this point in the history
* Update properties in FileStorageService and Medal classes to mutable

* Remove unused methods and properties from repositories and enums
  • Loading branch information
johanaam authored Apr 30, 2026
1 parent 369c871 commit b93d2dd
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 163 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,4 @@ interface PupilGameProgressRepository : JpaRepository<PupilGameProgress, PupilGa
pupilUserId: Long,
classroomId: Long,
): PupilGameProgress?

/**
* Finds all progress records for a classroom.
*
* @param classroomId the classroom ID
* @return all progress records registered for the classroom, ordered for leaderboard display
*/
fun findAllByClassroomIdOrderByTotalScoreDescTotalXpDescCurrentLevelDescLastActivityAtDesc(
classroomId: Long,
): List<PupilGameProgress>
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ package edu.ntnu.idi.idatt.backend.game.tasks.domain
* Coarse content categories for authored tasks.
*/
enum class TaskType {
EMAIL_REVIEW,
NEWS_COMPARISON,
IMAGE_ASSESSMENT,
IMAGE_SELECT,
PASSWORD_EVALUATION,
SOCIAL_SCENARIO,
FINAL_BOSS,
GENERIC,
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ package edu.ntnu.idi.idatt.backend.iam.domain
enum class UserStatus {
ACTIVE,
INACTIVE,
SUSPENDED,
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ import jakarta.persistence.Table
class Medal(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long = 0,
var id: Long = 0,
@Column(nullable = false, unique = true)
val code: String,
var code: String,
@Column(nullable = false)
val title: String,
var title: String,
@Column
val description: String?,
var description: String?,
@Enumerated(EnumType.STRING)
@Column(nullable = false)
val medalType: MedalType,
var medalType: MedalType,
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "stop_id")
val stop: MapStop?,
var stop: MapStop?,
@Column
val iconUrl: String?,
var iconUrl: String?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ interface WeeklyMysteryRepository : JpaRepository<WeeklyMystery, Long> {
/** Full history ordered newest-first. Used by the teacher management view. */
fun findAllByClassroomIdOrderByWeekStartDesc(classroomId: Long): List<WeeklyMystery>

/** Whether a given submission is already featured in a specific week. Used for UI hints. */
fun existsByClassroomIdAndSubmissionIdAndWeekStart(
classroomId: Long,
submissionId: Long,
weekStart: LocalDate,
): Boolean

/** Removes a specific featured entry so a teacher can un-feature a submission from a week. */
fun deleteByIdAndClassroomId(
id: Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import java.util.UUID
*/
@Service
class FileStorageService(
@Value("\${app.uploads.base-url}") private val baseUrl: String,
@Value($$"${app.uploads.base-url}") private val baseUrl: String,
@Value($$"${app.uploads.base-dir:${user.home}/nettdetektivene/uploads}") private val baseDirPath: String,
) {
private val baseStorageDir by lazy { Paths.get(baseDirPath).toAbsolutePath() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ interface PupilXpEventRepository : JpaRepository<PupilXpEvent, PupilXpEventId> {
*/
fun findAllByIdPupilUserId(pupilUserId: Long): List<PupilXpEvent>

/**
* Checks whether one XP event has already been awarded to one pupil.
*
* @param pupilUserId identifier of the pupil.
* @param xpEventId identifier of the XP event definition.
* @return `true` when the composite award row already exists.
*/
fun existsByIdPupilUserIdAndIdXpEventId(
pupilUserId: Long,
xpEventId: Long,
): Boolean

/**
* Finds the awarded XP row for one pupil-event pair.
*
Expand Down

0 comments on commit b93d2dd

Please sign in to comment.