Adjusting course phase participation api #82
Merged
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.
The main change is that I introduced the ability to "update" course phase participations with uuid.Nil. This is required if a course phase modifies a course phase participation that does not yet exist.
This pull request includes several changes to the course phase participation feature, focusing on refactoring the handling of
PassStatus
, adding batch update functionality, and improving error handling and testing. Here are the most important changes:Refactoring
PassStatus
Handling:PassStatus
type fromdb.NullPassStatus
to*db.PassStatus
across various DTOs and functions to simplify the code and improve clarity. (server/coursePhase/coursePhaseParticipation/coursePhaseParticipationDTO/create_course_phase_participation.go
[1] [2];server/coursePhase/coursePhaseParticipation/coursePhaseParticipationDTO/update_course_phase_participation.go
[3] [4]GetPassStatusDBModel
to convert*db.PassStatus
todb.NullPassStatus
. (server/coursePhase/coursePhaseParticipation/coursePhaseParticipationDTO/pass_status.go
server/coursePhase/coursePhaseParticipation/coursePhaseParticipationDTO/pass_status.goR11-R22)Batch Update Functionality:
server/coursePhase/coursePhaseParticipation/router.go
[1] [2];server/coursePhase/coursePhaseParticipation/service.go
[3]Error Handling Improvements:
server/coursePhase/coursePhaseParticipation/service.go
server/coursePhase/coursePhaseParticipation/service.goR78-R80)server/coursePhase/coursePhaseParticipation/service.go
server/coursePhase/coursePhaseParticipation/service.goL89-R93)Testing Enhancements:
server/coursePhase/coursePhaseParticipation/router_test.go
[1] [2] [3];server/coursePhase/coursePhaseParticipation/service_test.go
[4] [5]These changes collectively improve the robustness, maintainability, and functionality of the course phase participation feature.