Declare the stop emission of a wave (DeclareEmission)
POST/waves/:waveId/emission-declarations
Records the planner's declared marginal greenhouse emission of ONE delivery stop on the wave (the stop's share of the route's driving), in grams of CO2 equivalent (roadmap feature C9; ADR 0016), and publishes WaveEmissionDeclared for order-sourcing's estimatedCo2eGrams. The emission is per stop (the G11 stopKey grouping), never per package. 0 is a legal declared zero marginal emission; a wave with no declaration reports 0 and leaves a consumer's estimate incomplete. Allowed while the wave still runs (OPEN, INDUCTION_CLOSED or DISPATCHED, illegal-transition once CANCELLED or COMPLETED); a later declaration overwrites the earlier one and publishes again. Ranking is untouched by this fact: carbon is recorded, not optimised, in this slice.
Request
Responses
- 201
- 400
- 404
- 409
- 422
- 500
Stop emission declared.
Response Headers
Present, with the value true, only when the answer is a replay of the stored first answer.
The request is malformed at the HTTP level. Problem types idempotency-key-required (no Idempotency-Key header), idempotency-key-invalid (not 1 to 128 printable ASCII characters), invalid-limit, invalid-cursor, unknown-query-parameter. invalid-limit is a limit outside 1 to 500, empty or repeated; invalid-cursor a cursor that is not a page token or is repeated.
The wave, route, partner or (for an attempt) the package on the route does not exist, or the path matches no route or holds a NUL character. Problem types not-found, package-not-on-route, resource-not-found.
Response Headers
Present, with the value true, only when the answer is a replay of the stored first answer.
Conflict with the aggregate's state or capacity. Problem types: illegal-transition, concurrent-update, route-over-capacity, route-not-started, already-delivered, attempt-already-recorded, package-not-inducted, package-already-routed, stop-key-mismatch, partner-inactive, partner-station-mismatch, route-incomplete. idempotency-key-reused (the Idempotency-Key was already used with a different method, path or body). ErrWaveFull (wave-full), ErrInductionClosed (induction-closed) and ErrAlreadyInducted (already-inducted) are raised only by policy-driven induction, which has no route.
Response Headers
Present, with the value true, only when the answer is a replay of the stored first answer.
Validation failed. Problem types: validation-failed (body that is not valid JSON for the operation, with an unknown field, empty, with trailing data or over 64 KiB; a NUL character in the query or body; a missing or malformed query filter; a value-object rule), invalid-wave-times (ErrInvalidWaveTimes), invalid-van-capacity (ErrInvalidVanCapacity), unknown-station (ErrUnknownStation).
Response Headers
Present, with the value true, only when the answer is a replay of the stored first answer.
Unexpected failure: problem type internal-error, detail "an unexpected error occurred". Never stored for idempotent replay.