feat: dynamic member types and validation hardening for Member and Mentor #667
Merged
dricazenck merged 17 commits intoJun 15, 2026
Conversation
The CollaboratorPage record was using the Member entity directly in its collaborators list, coupling the API response layer to the domain model. This caused a mismatch since collaborators should be presented as DTOs rather than exposing the full entity with its validation constraints.
Bean validation constraints on Member, MemberDto, and LeadershipMember previously used generic messages that were unhelpful to API consumers. This change adds @validated, human-readable error messages, and moves memberTypes assignment to MemberService so the field remains server- controlled rather than populated from client input.
Mentor previously hardcoded [MENTOR] as its memberTypes in the constructor, silently discarding any prior types when an existing Member registered as a Mentor. MentorshipService now assigns memberTypes explicitly and merges them with the existing member's types, preserving the full type history across community roles.
Mentee and Skills validation constraints used @NotNull for list fields where an empty list is equally invalid. This replaces them with @notempty, adds @validated, and provides context-specific messages to give API consumers clearer feedback when registration input is missing required fields like spoken languages or mentorship focus areas.
Lombok's @builder strips field initializers by default, so EmailRequest lost its default values for recipients (empty list) and html (true) when constructed via the builder API. @Builder.Default restores the intended defaults. PaginationUtil gains @validated to enable method- level constraint checking on its parameters.
…into feat/member-type-handling-and-validation
…into feat/member-type-handling-and-validation
… update related tests Standardize API responses and improve consistency by switching MentorshipService methods to return MentorDto, updating tests and controller logic accordingly.
…lidation' into feat/member-type-handling-and-validation
nverbic
reviewed
May 12, 2026
nverbic
reviewed
May 12, 2026
nverbic
reviewed
May 12, 2026
…mber-type-handling-and-validation # Conflicts: # src/main/java/com/wcc/platform/domain/platform/mentorship/Mentee.java # src/testInt/java/com/wcc/platform/repository/postgres/PostgresMemberRepositoryIntegrationTest.java
|
…into feat/member-type-handling-and-validation
goelsonali
reviewed
Jun 14, 2026
goelsonali
approved these changes
Jun 14, 2026
goelsonali
left a comment
Contributor
There was a problem hiding this comment.
Looks fine, but i think we should not change the service layer to return the DTO object, rather do the mapping in the controller. @dricazenck - what do you think ?
…into feat/member-type-handling-and-validation
…onversions, and clean up unused dependencies in tests
… with CollectionUtils checks
…and MemberDto, enhance builder pattern usage, and clean up tests
|
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.





Description
This PR introduces two main improvements to the member and mentorship domain.
Mentor.memberTypesis now dynamically configured via constructor parameter instead of being hardcoded to[MENTOR], making member type assignment consistent and flexible across the platform.Member,MemberDto,Mentee, andSkills, so consumers receive clear error feedback on bad input.CollaboratorPagenow correctly usesMemberDtoinstead ofMember(which lacked the necessary serialisation contract),EmailRequestbuilder defaults are restored and@Validatedis added to the controller, and a set of failing integration tests are corrected to align.Related Issue
Change Type
Screenshots
Pull request checklist
Please check if your PR fulfills the following requirements: