Skip to content

Commit 8c5ed27

Browse files
committed
feat: update the facade
1 parent a7f7677 commit 8c5ed27

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

src/main/java/com/itasocialacademy/oitassist/user/api/facade/UserFacadeImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,12 @@ public Optional<UserProfileDetails> findProfileById(Long userId) {
9999
public List<UserProfileDetails> findProfilesByIds(List<Long> userIds) {
100100
return userService.findProfilesDetailsByIds(userIds);
101101
}
102+
103+
/**
104+
* {@inheritDoc}
105+
*/
106+
@Override
107+
public Optional<List<Long>> findUserIdsBySearchWithinIds(String search, List<Long> candidateIds) {
108+
return userService.findUserIdsBySearch(search, candidateIds);
109+
}
102110
}

src/main/java/com/itasocialacademy/oitassist/user/api/interfaces/UserFacade.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,21 @@ public interface UserFacade {
135135
* omitted from the result, consistent with {@link #findByIds}.
136136
*/
137137
List<UserProfileDetails> findProfilesByIds(List<Long> userIds);
138+
139+
/**
140+
* Filters a provided list of candidate user IDs based on a text search against
141+
* the user's first name, surname or email, required by {@code participation}
142+
* module.
143+
* <p>
144+
* This method is designed to perform a constrained search. Instead of searching
145+
* the entire database, it only searches within the provided
146+
* {@code candidateIds}.
147+
* </p>
148+
*
149+
* @param search the text search query (e.g., "Ivan", "ivan@email.com").
150+
* @param candidateIds the pool of user IDs to restrict the search to.
151+
* @return an {@code Optional} containing the filtered list of matching user
152+
* IDs, or {@code Optional.empty()} if the search string is null/blank.
153+
*/
154+
Optional<List<Long>> findUserIdsBySearchWithinIds(String search, List<Long> candidateIds);
138155
}

0 commit comments

Comments
 (0)