Skip to content

Implement search through given userIds #561

Description

@serggalel

As a Developer I want to expose a candidate-based text search method in the UserFacade so that other modules can filter specific subsets of users by name or email without violating Modulith database boundaries.

Assumptions & Constraints

  1. To prevent scanning the entire database, the search must be restricted to a provided list of candidateIds.
  2. Search inputs must be heavily sanitized to prevent SQL Wildcard Injection (e.g., treating % and _ as literal characters, not wildcards).

Preconditions
The User database entity contains firstName, surname, and email.

Acceptance Criteria

  1. The UserFacade defines the method: Optional<List> findUserIdsBySearch(String search, List candidateIds).
  2. If the search string is null, empty, or only whitespace, the method returns Optional.empty(). (This signals to the caller that no filtering occurred).
  3. The service normalizes the search string by trimming it, collapsing multiple spaces into a single space, and escaping SQL wildcards (, %, _).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions