feat(CX-215): add first name search to find owners form#86
Draft
meysholdt wants to merge 1 commit into
Draft
Conversation
Add a first name input field to the find owners form so users can narrow results when multiple owners share a surname. Both fields are optional and use prefix matching. - Add findByFirstNameStartingWithAndLastNameStartingWith to OwnerRepository - Update OwnerController to filter by both first and last name - Add first name input to findOwners.html template - Preserve both query params in ownersList.html pagination links - Add tests for first-name-only, combined, and no-results scenarios Co-authored-by: Ona <no-reply@ona.com>
|
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.



Automated implementation by Ona Agent. See the linked Linear issue CX-215 for requirements.
Problem
The find owners form only searches by last name. When multiple owners share a surname, there is no way to narrow results without clicking through each match.
Changes
OwnerRepository— AddedfindByFirstNameStartingWithAndLastNameStartingWithquery method (Spring Data derives the SQL automatically)OwnerController—processFindFormnow reads bothfirstNameandlastName, defaulting each to""for the broadest match. Search terms are passed to the model for paginationfindOwners.html— Added a first name input field above the existing last name fieldownersList.html— Pagination links now preserve bothfirstNameandlastNamequery parameters using Thymeleaf URL syntaxOwnerControllerTests— Updated existing mocks to use the new repository method. Added 3 new tests: first-name-only search, combined first+last search, and first-name-only no-resultsBehavior
first_namecolumn already exists in all DB variants (H2, MySQL, Postgres)Test results
✅ 62/62 tests pass (unit + integration)