-
-
Notifications
You must be signed in to change notification settings - Fork 69
Labels
good first issueGood for newcomersGood for newcomers
Description
_🛠️ Refactor suggestion_
Add validation constraint for mastery score range.
The JavaDoc specifies a range [0.0, 1.0] but there's no validation to enforce this constraint.
+import jakarta.validation.constraints.DecimalMax;
+import jakarta.validation.constraints.DecimalMin;
/**
* A value in the range [0.0, 1.0].
*/
+@DecimalMin(value = "0.0", message = "Mastery score must be between 0.0 and 1.0")
+@DecimalMax(value = "1.0", message = "Mastery score must be between 0.0 and 1.0")
private Float masteryScore;
🤖 Prompt for AI Agents
In src/main/java/ai/elimu/entity/analytics/LetterSoundAssessmentEvent.java
around lines 29 to 32, the masteryScore field has a JavaDoc specifying it should
be in the range [0.0, 1.0], but no validation enforces this. Add a validation
annotation such as @DecimalMin("0.0") and @DecimalMax("1.0") to the masteryScore
field to ensure the value stays within the specified range.
Originally posted by @coderabbitai[bot] in #2195 (comment)
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers