/** * Classification of a failed production-run write. * * Generic lifecycle actions must reload after ambiguous writes. Recording * output holds its exact request in memory and reconciles server batch * evidence before deciding whether that same operation can be resent. */ export type ProductionRunFailureKind = 'shortageAcknowledgementRequired' /** 422 — a bound ingredient has no known cost, so the output cannot be valued. */ | 'unknownIngredientCost' /** 422 — an output or bound ingredient is not valued by weighted average. */ | 'unsupportedValuation' /** 422 — this location's catalogue disagrees with what the run was planned against. */ | 'catalogueMismatch' /** 422 — a stock replay the write needs has no closing or snapshot to start from. */ | 'noStockCheckpoint' /** 400 — the action is not legal on the run's current status and data. */ | 'illegalAction' /** 409 — the run moved under us, or a claimed document is occupied. */ | 'conflict' /** 409 — the run was already prepared with different quantities. */ | 'alreadyPrepared' /** 409 — the run was already closed with a different remark. */ | 'alreadyClosed' /** 409 — the run was already cancelled with a different reason. */ | 'alreadyCancelled' /** 409 — a cancel while preparing is in progress or unfinished. */ | 'prepareUnfinished' | 'notFound' /** The request may never have reached the server. */ | 'timeout' | 'badRequest' | 'unknown'; export interface ProductionRunFailure { kind: ProductionRunFailureKind; message: string; /** * Classification alone never authorizes retransmission. Output recovery * may resend its durable request only after reconciling the current run. */ retrySameKey: boolean; /** The client's copy of the run is stale — re-read before offering actions. */ mustReload: boolean; shortages: FdoProductionRunIngredientShortage[]; /** The SKUs a valuation or catalogue refusal names. */ skuIds: string[]; /** What a no-checkpoint refusal needs a closing or stock snapshot before. */ checkpoint?: ProductionRunCheckpoint; } export interface ProductionRunCheckpoint { before: string; /** Output above the committed quantity, or recovery of an unfinished save. */ reason: 'overTarget' | 'recovery'; } /** * Turn whatever `defineApi` threw into a decision the UI can act on. * * `defineApi` wraps a failed response into `SvcCompanyApiError(message, body)` * — the body is the Nest error payload, so the status code is * `errorResponse.statusCode`, never a field on the error itself. A transport * failure produces the same class with no status code at all, which is why * everything unrecognised lands on `unknown` and requires a reload. */ export declare function classifyProductionRunError(e: unknown): ProductionRunFailure;