Skip to content

issue 5#21

Merged
treblereel merged 23 commits into
casehubio:mainfrom
treblereel:issue_5
May 7, 2026
Merged

issue 5#21
treblereel merged 23 commits into
casehubio:mainfrom
treblereel:issue_5

Conversation

@treblereel
Copy link
Copy Markdown
Contributor

@treblereel treblereel commented May 7, 2026

Summary

  • Implement POST /api/v1/cases/{caseId}/signals endpoint
  • Bean Validation for request DTO
  • RFC 7807 error responses
  • Integration with CaseHubRuntime.signal()
  • Comprehensive unit and integration tests

Implementation Details

  • SignalResource with reactive Mutiny Uni
  • SendSignalRequest/SignalResponse DTOs in dto package
  • ConstraintViolationExceptionMapper for validation errors
  • Case existence pre-validation via query()
  • 202 Accepted for async signal processing

Test Coverage

  • 6 unit tests with @InjectMock
  • 2 integration tests with real CaseHubRuntime
  • All 63 tests passing

Closes #5

🤖 Generated with Claude Code

treblereel and others added 23 commits May 7, 2026 00:09
Add design spec for POST /api/v1/cases/{caseId}/signals endpoint
(issue casehubio#5). Defines REST API for sending external signals to case
instances via CaseHubRuntime.signal().

Key decisions:
- Separate SignalResource for clean isolation
- Direct mapping: {path, value} → signal(caseId, path, value)
- 202 Accepted async model
- Minimal validation (null-checks only)
- Idempotency deferred to future iteration

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Create detailed TDD implementation plan for POST /api/v1/cases/{caseId}/signals
endpoint. Plan includes 10 tasks with bite-sized steps following red-green-refactor
cycle.

Tasks cover:
- DTOs (SendSignalRequest, SignalResponse)
- SignalResource with validation and error handling
- Unit tests with mocked CaseHubRuntime
- Integration tests with real runtime
- Manual verification

Estimated: 45-60 minutes for complete implementation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…dependency

- Add @InjectMock annotation to CaseHubRuntime field in SignalResourceTest
- Add verification that signal() method was called with correct parameters
- Add quarkus-junit-mockito dependency for mock support
- Test now properly verifies mock interactions as required by spec
- Total: 63 tests all passing (61 unit + 2 integration)
- Compilation: clean with no warnings
- Coverage: REST endpoints, database persistence, error handling, context management
- Manual test scenarios documented for end-to-end validation
Move PagedResponse from io.casehub.flow.rest to io.casehub.flow.rest.dto
for better package organization. All DTOs are now in the dto package.
Remove duplicate ProblemDetail inner records from CaseDefinitionResource
and CaseInstanceResource. All resources now use the shared ProblemDetail
from io.casehub.flow.rest.dto package for consistent RFC 7807 error responses.
Signed-off-by: Dmitrii Tikhomirov <chani.liet@gmail.com>
@treblereel
Copy link
Copy Markdown
Contributor Author

/retest

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

✅ Tests restarted — check the Actions tab

@treblereel treblereel merged commit 0a0a719 into casehubio:main May 7, 2026
1 of 2 checks passed
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.

Implement REST API v1 — signal endpoint for external events

1 participant