Skip to content

BE-8: Search Books (by Name/Author) #8

@tecnodeveloper

Description

@tecnodeveloper

Add search capability to find books by name or author.

User Story

Given books exist
When I search by keyword
Then I should get matching books

Endpoint

GET /books/search?q=<keyword>

Tasks

  • Create /books/search route
  • Parse q query param
  • Implement search logic:
    • Match against name
    • Match against author
  • Use partial matching (LIKE / ILIKE)
  • Handle empty query
  • Add Swagger documentation

Acceptance Criteria

  • Returns matching books
  • Case-insensitive search
  • Partial matches work
  • Empty query returns 400
  • Swagger UI supports testing

Testing Steps

  • Add sample books

  • Test:

    /books/search?q=harry
    
  • Verify results include matching name/author

  • Test empty query → expect 400

Definition of Done

  • Search implemented
  • Edge cases handled
  • Swagger updated
  • Code linted and formatted

Metadata

Metadata

Labels

No labels
No labels

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions