Define (or revise) the engineered labor standard for a TaskType
POST/standards
If a standard is already active for this TaskType, it is closed (its effective range ends now) and a new one starts — append-only history, never an in-place overwrite.
A standard may optionally be declared for one handling unit (handlingUnit: EACH, CASE or PALLET), so a case handle has its own expected time distinct from an each pick. At most one standard is open per (taskType, handlingUnit): defining a CASE standard never closes the task-type-only one, and revising it closes only the prior CASE standard. A CASE standard may also declare a heavy-case teamLift (ADR 0035).
A standard may optionally be scoped to one site (siteCode, a facility-layout site code, ADR 0038). Absent means the site-less standard that applies to every site, exactly as before. At most one standard is open per (taskType, handlingUnit, siteCode): a site's standard never closes the site-less one, nor the reverse, and revising it closes only the prior standard of the same site. Scoring is unchanged: completed tasks are still scored against site-less standards only.
Idempotent retries: clients MUST always send an Idempotency-Key header (1-128 printable ASCII characters, a client-generated UUID per logical submit); a retried request with the same key, method, path and body replays the original response byte-for-byte, with the response header Idempotency-Replayed: true, instead of defining the standard a second time. The same key with a different method, path or body is 409 idempotency-key-reused.
What is replayed: a 2xx, and a refusal that is final for the request (a validation answer such as 400 unknown-task-type or 422 non-positive-expected-seconds). A refusal that depends on state that can change is NOT stored and its key is released, so the same request under the same key executes again: 409 concurrent-modification and 409 standard-conflict, and every 5xx or panic. A different body under a released key is a new request.
Request
Responses
- 201
- 400
- 409
- 422
- 500
Standard defined (or the revision recorded)
Response Headers
Set to true on a replay of a stored answer (a retry carrying the same Idempotency-Key, method, path and body), and only on a replay: the first execution of a key never carries it.
Unknown task type (including an absent or empty taskType), unknown handling unit (not EACH, CASE or PALLET), a siteCode longer than 32 characters or containing whitespace (invalid-site-code), a body that is not valid JSON or contains a NUL character (malformed-request-body), a missing Idempotency-Key header (idempotency-key-required), or an Idempotency-Key that is not 1-128 printable ASCII characters (idempotency-key-invalid).
The Idempotency-Key was already used with a different method, path or body (idempotency-key-reused), the write lost a concurrency race: another writer modified the same labor standard after this request's snapshot (concurrent-modification), or another standard is already open for this task type, handling unit and site (standard-conflict). concurrent-modification and standard-conflict are not stored: the Idempotency-Key is released, so re-fetch and retry the same request with the same key and it executes again. An idempotency-key-reused is never retried with the same key.
Expected seconds must be greater than zero, travelComponentSeconds is negative or exceeds expectedSeconds, or a teamLift is declared on a standard whose handlingUnit is not CASE (team-lift-requires-case-unit) or with a non-positive thresholdG or expectedSeconds.
Unexpected server error (problem type internal-error). Also the answer when an infrastructure failure aborts the request; a 5xx on POST /standards is never stored against its Idempotency-Key, so the same key can be retried.