Repository navigation
feat: add mentorship cycle creation endpoint - #804
Open
MichaelaMatiskova wants to merge 4 commits into
Open
MichaelaMatiskova wants to merge 4 commits into
MichaelaMatiskova wants to merge 4 commits into
Conversation
MichaelaMatiskova
requested review from
OlenaReukova,
Sowmiya07,
Tooonia,
dricazenck,
goelsonali,
lauracabtay and
nverbic
October 4, 2026 10:37
dricazenck
reviewed
Oct 5, 2026
dricazenck
reviewed
Oct 5, 2026
dricazenck
reviewed
Oct 5, 2026
dricazenck
reviewed
Oct 5, 2026
dricazenck
approved these changes
Oct 5, 2026
dricazenck
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the contribuition @MichaelaMatiskova nice changes, I left a few comments, once you address them and the open question from @Sowmiya07 is clarified we can merge the pr.
Would be nice if you can add the screenshot in the PR description to the success/failure cases so we can see working on swagger ;)
Contributor
|
@MichaelaMatiskova Thanks for picking up this issue. It's one of the critical pieces needed, and happy to see your contribution. Can you please address the review comments & resolve the conflicts please? |
Allow authorized admins to create mentorship cycles in draft status with date validation, default mentee capacity, and duplicate-cycle conflict handling. Add request validation and unit/integration coverage for successful creation, invalid values, authorization, and conflicts.
Create the mentorship cycle request before the assertion so the exception-testing lambda contains only the service invocation.
Add Year and Month types with future-date validation for mentorship cycle creation, restrict new cycles to February through November, and return a readable error for invalid month values. Add matching entity validation, a Flyway database constraint, and update affected tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MichaelaMatiskova
force-pushed
the
feature/801-add-new-mentorship-cycle
branch
from
October 11, 2026 15:25
611771b to
51ad21e
Compare
3 of 8 tasks
Restore the standard JaCoCo unit report location expected by CI and make coverage verification depend on both unit and integration reports. Split the mentorship cycle unit and integration tests into focused classes so they comply with the PMD TooManyMethods rule while preserving existing coverage and test behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Allow authorized admins to create mentorship cycles in draft status with date validation, default mentee capacity, and duplicate-cycle conflict handling. Add request validation and unit/integration coverage for successful creation, invalid values, authorization, and conflicts.
Description
This pull request adds support for creating mentorship cycles through the admin API.
Authorized administrators can create new mentorship cycles in DRAFT status. The implementation includes:
• A new POST /api/platform/v1/admin/mentorship/cycles endpoint.
• Authorization for ADMIN and MENTORSHIP_ADMIN roles.
• A dedicated request DTO with Bean Validation constraints.
• Validation for registration and cycle date ordering.
• A default value of five mentees per mentor when no capacity is provided.
• Duplicate-cycle detection based on year, mentorship type, and month.
• Proper 409 CONFLICT responses for duplicate cycles.
Test Coverage
The change includes:
• Unit tests for cycle creation and draft status.
• Unit tests for default mentee capacity.
• Unit tests for date validation and duplicate exceptions.
• Controller tests for service delegation and role authorization.
• Integration tests for successful creation through the REST endpoint.
• Integration tests for duplicate-cycle conflicts.
• Integration tests for missing and invalid request values.
• Integration tests for invalid date ordering.
Note
The new cycles are always created in DRAFT status. They must be transitioned separately before becoming available for registration.
Swagger Verification
The endpoint was tested in Swagger UI with the following cases:
Success Case
Successfully created a mentorship cycle using valid request data. The response confirms that the cycle was created in DRAFT status.
Screenshot:
Failure Case
Attempted to create a mentorship cycle with invalid request data. The API returned an error response as expected.
Screenshots:
Change Type
Pull request checklist
Please check if your PR fulfills the following requirements: