Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusting course phase participation api #82

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

niclasheun
Copy link
Contributor

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:

  • Changed PassStatus type from db.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]
  • Added a helper function GetPassStatusDBModel to convert *db.PassStatus to db.NullPassStatus. (server/coursePhase/coursePhaseParticipation/coursePhaseParticipationDTO/pass_status.go server/coursePhase/coursePhaseParticipation/coursePhaseParticipationDTO/pass_status.goR11-R22)

Batch Update Functionality:

  • Introduced batch update functionality for course phase participations, allowing multiple updates in a single request. (server/coursePhase/coursePhaseParticipation/router.go [1] [2]; server/coursePhase/coursePhaseParticipation/service.go [3]

Error Handling Improvements:

Testing Enhancements:

  • Added new test cases to cover the creation and updating of course phase participations, including the new batch update functionality. (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.

@niclasheun niclasheun self-assigned this Jan 19, 2025
@niclasheun niclasheun merged commit 8a1fb67 into main Jan 20, 2025
7 of 8 checks passed
@niclasheun niclasheun deleted the adjusting-course-phase-participation-api branch February 10, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant