import type { FdoDecimal } from '@feedmepos/core/entity'; /** * What the run was issued against, per production item, summed across every * issuance. This — not `requestedAmount` — is the denominator of every figure * after issuance: a run that committed more than it requested is not at 120% * of anything. */ export declare function committedBySku(run: FdoProductionRun): Record; /** Exact base-unit commitments for callers that must retain decimal precision. */ export declare function committedBaseDecimalsBySku(run: FdoProductionRun): Record; /** What the run has produced, per production item, summed across every batch. */ export declare function producedBySku(run: FdoProductionRun): Record; /** Total committed across production items. Zero on a run that has not issued. */ export declare function committedTotal(run: FdoProductionRun): number; /** Total produced across production items. */ export declare function producedTotal(run: FdoProductionRun): number; /** * Committed minus produced per production item, floored at 0 — what the run * still owes. * * Keyed on the COMMITTED items: a sku produced but never committed to (a * byproduct, once those land) owes nothing and would otherwise appear as a * negative remainder. Overproduction clamps to 0 for the same reason — it * leaves nothing unaccounted. */ export declare function remainingBySku(run: FdoProductionRun): Record; /** * Output attainment at 100%: every committed item produced in full. * * Asked of core rather than derived from the totals above, because the totals * are cross-sku SUMS and this is a per-sku question. A two-output run that made * 15 of one and 5 of another against 10 each sums to 20 of 20 and is not at * target; core compares item by item. * * It is **attainment, not yield** — the denominator is what the run committed * to make, not the ingredient quantity issued. And it decides nothing: the run * stays open until someone closes it. Callers use it to offer closure, to show * the persistent target-reached state, and to derive a closed run's outcome. */ export declare function isAtTarget(run: FdoProductionRun): boolean; /** * One stored amount in base units, kept as a decimal. * * Prefer {@link baseAmount} for anything that renders. This exists for the one * case that must NOT flatten: handing a converted figure back to a core * controller, where going through `number` would re-derive the precision the * decimal already carries. */ export declare function baseDecimal(amount: FdoDecimal, measurement: FdoProductionUnitSnapshot): FdoDecimal; /** One production amount in base units. Its durable snapshot is always explicit. */ export declare function baseAmount(amount: FdoDecimal, measurement: FdoProductionUnitSnapshot): number; /** * Legacy inventory adjustments predate Production's required snapshot and may * still encode base as null. Keep that compatibility at the adjustment read * edge; durable Production quantities must use {@link baseAmount} instead. */ export declare function adjustmentBaseAmount(amount: FdoDecimal, measurement?: FdoUnitMeasurement | null): number;