You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
875: Migrate QuestionBank / QuestionBankRepository to use Optional
PR Type
Enhancement
Description
Migrated QuestionBank description field to Optional.
Updated QuestionBankRepository read methods to return Optional.
Adapted service components to consume Optional returns.
Refactored tests to handle Optional types.
Diagram Walkthrough
flowchart LR
A[QuestionBank Model] --> B[QuestionBank Repository]
B --> C[Service Components]
C --> D[Tests]
A -- "description: String -> Optional<String>" --> B
B -- "get/find methods: QuestionBank -> Optional<QuestionBank>" --> C
C -- "Adapt to Optional unwrapping" --> D
D -- "Update mocks & assertions" --> F[Enhanced Null Safety]
Loading
File Walkthrough
Relevant files
Enhancement
6 files
DuelManager.java
Adapted question retrieval to handle Optional returns from repository
The PR description mentions migrating both QuestionBank and Question to use Optional. While QuestionBank changes are visible, the Question model is not part of this diff. Please confirm that the Question model's description field has also been updated to Optional<String> to maintain consistency and prevent potential type mismatches, especially in line 216 of SubmissionsHandler.java where bankQuestion.getDescription() is directly assigned.
The @NotNullColumn and @NullColumn annotations were removed from the QuestionBank model, with nullability now handled by Optional at the Java level. Please ensure that the corresponding database schema for the description column (and any other columns previously marked with these annotations) still correctly enforces or allows nullability as intended. This PR does not include database migration files, so it's important to verify the existing schema aligns with the new Java model.
875: Migrate QuestionBank / QuestionBankRepository to use Optional
PR Type
Enhancement
Description
Migrates QuestionBank model's description to Optional<String>.
Updates QuestionBankRepository read methods to return Optional<QuestionBank>.
Adapts DuelManager and SubmissionsHandler to handle Optional returns.
Refactors SQL repository and DTOs for Optional compatibility.
Diagram Walkthrough
flowchart LR
A[QuestionBank Model] --> B[QuestionBankRepository Interface]
B --> C[QuestionBankSqlRepository Implementation]
B --> D[DuelManager]
B --> E[SubmissionsHandler]
A --> F[QuestionBankDto]
C --> G[Tests]
D --> G
E --> G
Loading
File Walkthrough
Relevant files
Enhancement
6 files
DuelManager.java
Adapts duel logic to handle Optional returns from QuestionBankRepository
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
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.
875
Description of changes
-Used Optional in QuestionBank and Question
-Fixed other stuff
Checklist before review
Screenshots
Dev
Screen.Recording.2026-03-18.at.4.13.51.PM.mov
Staging
Screen.Recording.2026-03-18.at.4.20.01.PM.mov