Record completion of a released work unit
POST/work-units/:id/completions
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
Finishes a released work unit — the RecordCompletion use case. Transitions Released → Completed and publishes WorkUnitCompleted, which updates backlog telemetry projections. Enforces the WorkUnit aggregate's at-most-once-completion invariant: completing an already completed unit, or one that was never released, returns 409. This endpoint is also the target of the additive TaskCompleted Kafka consumer (Task 8) — fulfillment-execution's task completion drives the exact same use case as this HTTP call. Superseded by the TaskCompleted consumer (K14): fulfillment-execution publishes task completion on Kafka and this service consumes it to drive the same use case; removal planned with the next breaking window.
Request
Responses
- 200
- 400
- 404
- 409
- 500
The completed work unit, now in Completed state.
Response Headers
Present, with value true, only when this answer is a replay of a stored earlier answer for the same Idempotency-Key.
The Idempotency-Key header is missing (idempotency-key-required) or malformed (idempotency-key-invalid).
No work unit exists with this id.
The work unit was never released (work-unit-not-released), was already completed (work-unit-already-completed), was cancelled (work-unit-cancelled), the pool was modified concurrently (concurrent-modification), or the Idempotency-Key was already used with a different request (idempotency-key-reused). Distinguish by the problem type.
An unexpected server-side failure (e.g. a repository or event-publisher error).