Skip to content

feat(CX-215): add first name search to find owners form#86

Draft
meysholdt wants to merge 1 commit into
mainfrom
ona/linear-issue
Draft

feat(CX-215): add first name search to find owners form#86
meysholdt wants to merge 1 commit into
mainfrom
ona/linear-issue

Conversation

@meysholdt
Copy link
Copy Markdown
Contributor

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 — Added findByFirstNameStartingWithAndLastNameStartingWith query method (Spring Data derives the SQL automatically)
  • OwnerControllerprocessFindForm now reads both firstName and lastName, defaulting each to "" for the broadest match. Search terms are passed to the model for pagination
  • findOwners.html — Added a first name input field above the existing last name field
  • ownersList.html — Pagination links now preserve both firstName and lastName query parameters using Thymeleaf URL syntax
  • OwnerControllerTests — 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-results

Behavior

  • Both fields are optional. Leaving either blank matches all values for that field
  • Empty form still returns all owners (backward compatible)
  • No schema changes needed — first_name column already exists in all DB variants (H2, MySQL, Postgres)

Test results

✅ 62/62 tests pass (unit + integration)

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>
@sonarqubecloud
Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant