Implement Sztab Domain Queries using `JpaSpecificationExecutor` (SZ-2)
rk@tigase.net opened 3 weeks ago

Title: SZ-2 – Implement Sztab Domain Queries using JpaSpecificationExecutor

Goal:
Enable dynamic filtering in REST endpoints for core domain entities using Spring Data JPA Specifications. This will make it easier to search by status, priority, etc., through query params.

Entities involved:

  • User
  • Project
  • Issue

Tasks:

  • Make sure all repositories extend JpaSpecificationExecutor
  • Create spec builder classes (one per entity)
    • User: filter by username, email, roles
    • Project: filter by owner, startDate, endDate
    • Issue: filter by status, priority, severity, assignee, project
  • Update service layer to support composition of specs via filters
  • Update controllers to accept these filters via @RequestParam
  • Add pagination + sorting support (use Pageable)
  • Write integration tests for filtered GET endpoints
  • Cover edge cases (null filters, invalid values, empty results)
  • Update API docs or README with examples like:
    • /issues?status=OPEN&priority=HIGH
    • /users?role=ADMIN&email=gmail.com

Why this is a separate issue: This builds directly on basic CRUD but focuses specifically on dynamic search — splitting this out helps keep the logic focused and testable.

Time estimate:

  • Spec builder classes: ~1.5h
  • Service logic + controller wiring: ~2h
  • Tests: ~2h
  • Docs/README updates: ~1h
  • Buffer: ~1h Total: ~6.5–7.5 hours
issue 1 of 1
Type
New Feature
Priority
Normal
Assignee
Version
1
Sprints
n/a
Customer
n/a
Issue Votes (0)
Watchers (3)
Reference
SZ-2
Please wait...
Page is in error, reload to recover