Skip to content

[TASK-SIM-003] feat: add owner phone search#2365

Open
BenjaminWong1205 wants to merge 1 commit intospring-projects:mainfrom
BenjaminWong1205:feature/TASK-SIM-003-search-owner-by-phone
Open

[TASK-SIM-003] feat: add owner phone search#2365
BenjaminWong1205 wants to merge 1 commit intospring-projects:mainfrom
BenjaminWong1205:feature/TASK-SIM-003-search-owner-by-phone

Conversation

@BenjaminWong1205
Copy link
Copy Markdown

[TASK-SIM-003] feat: add owner phone search

Summary

Added fuzzy search functionality for owners by phone number.

Changes

  • ✅ Added findByTelephoneContaining method to OwnerRepository
  • ✅ Enhanced GET /owners endpoint to support optional phone query parameter
  • ✅ Added 3 comprehensive test cases covering all scenarios

Test Results

  • ✅ All tests passed
  • OwnerController Coverage: 95% (Lines), 100% (Branches)
  • ✅ Spring Java Format check passed

API Usage

Endpoint Description
GET /owners Returns all owners
GET /owners?phone=5510 Returns owners with phone containing "5510"
GET /owners?phone=99999 Returns empty list if not found (200 OK)

Checklist

  • Code compiles without errors
  • All unit tests pass
  • Code coverage ≥ 85%
  • SQL injection safe (using Spring Data JPA derived queries)
  • Code follows project conventions

- Add findByTelephoneContaining to OwnerRepository

- Enhance GET /owners to support phone query param

- Add 3 test cases (empty/with/no-result phone)

- Coverage: OwnerController 95% (Lines), 100% (Branches)

- All tests passed

Closes TASK-SIM-003
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.

2 participants