A short recipe for flagging a sample for re-collection when the customer agrees the original sample cannot be analysed and a fresh one will be drawn.
When a sample cannot be analysed — damaged in transit, insufficient quantity, broken cold chain, or any other deviation that prevents a valid measurement — and the customer agrees to a re-collection, mark the current sample for re-sampling.
The current sample auto-transitions to CANCELLED and the customer expects a fresh collection to resume the workflow.
When NOT to use this flow: If the customer rejects the sample with no intention of re-collecting, use theREJECToutcome (transitions toREJECTED). If the customer authorises proceeding with the deviation, usePROCEED_AS_IS(fires the §7.8.2.2 disclaimer).
Before logging the outcome, confirm:
RESAMPLE).conditionOnArrival field, choose the value that describes the failure (e.g. DAMAGED, INSUFFICIENT_QUANTITY, TEMPERATURE_BREACH, LEAKED).customerConsultedAt), select the user who spoke with the customer (customerConsultedById), and optionally add notes.consultationOutcome, select Re-sample (RESAMPLE).CANCELLED with a status-log entry (noteCode: SAMPLE_CANCELLED_FOR_RESAMPLING).No manual status change is required — the transition is performed by the resolver as soon as the outcome is saved.
Saving the sample with consultationOutcome = RESAMPLE triggers the following chain:
applyConsultationStatusTransition(), which updates the status to CANCELLED (see apps/agrometrisis-api/src/app/modules/samples/sample.resolver.ts:1593).noteCode = 'SAMPLE_CANCELLED_FOR_RESAMPLING' and parameters carrying the consultation timestamp and the consulting user (sample.resolver.ts:1596-1615).CANCELLATION_RESAMPLE template, referencing the sample code and proposed re-sampling.sampleStatusChanged websocket event are emitted so other operators' grids refresh without a reload (sample.resolver.ts:1619-1623).The ConsultationOutcome.RESAMPLE value is defined at apps/agrometrisis-api/src/app/modules/samples/enums/consultation-outcome.enum.ts:10 and is the only outcome that cancels the sample without rejecting it.