Skip to content

Implement REST API v1 — signal endpoint for external events #5

@treblereel

Description

@treblereel

Context

Part of epic #1 — Build production-ready REST microservice with k8s deployment on top of casehub-engine. This provides the mechanism for external systems to send events/signals into running cases to trigger state transitions.

What

Implement signal injection endpoint:

  • POST /api/v1/cases/{caseId}/signals — send external event/signal into case with payload { signalName, data }

Acceptance Criteria

  • POST endpoint accepts signal name and optional data payload
  • Signal is routed to casehub-engine's signal processing mechanism
  • Returns 202 Accepted if signal queued successfully
  • Returns 404 if caseId doesn't exist
  • Returns 400 if signal payload validation fails
  • Idempotency: duplicate signals within idempotency window are deduplicated
  • Error responses follow RFC 7807 format
  • Integration tests verify signal triggers worker execution and context updates

Notes

  • Leverage casehub-engine's signal/event dispatching mechanism
  • Check if casehub-engine has built-in signal deduplication (DLQ module from #194, #193)
  • Consider adding signal ID for client-side idempotency tracking
  • Response should include signal acceptance confirmation, not execution result (async model)
  • File paths: casehub-engine's signal handling, WorkerScheduleEventHandler

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions