import type { FCurrency, FdoDecimal, FdoDinero, FdoEmployeeRef } from '@feedmepos/core/entity'; import { type ProductionRunUnitSnapshot } from '../shared/model/production-run-unit-snapshot'; /** * Shared builders for the production-run specs. * * These documents cross the JS→Dart bridge, which deserialises them strictly: * a missing required field is a runtime error, not an undefined read. So the * builders below produce FULLY POPULATED documents and let a spec override only * what it is actually asserting on. * * The unit setup is deliberate: the base unit is **kg** and `GRAM` is a * measurement on it, so a run recorded partly in grams and partly in kilograms * exercises the conversion every quantity in this module depends on. */ export declare function dec(value: number, precision?: number): FdoDecimal; export declare function dinero(value: number, precision?: number, currency?: FCurrency): FdoDinero; export declare const ACTOR: FdoEmployeeRef; /** Grams, expressed against a kilogram base unit: 1 g = 0.001 kg. */ export declare const GRAM: FdoUnitMeasurement; export declare const KILOGRAM: FdoInventoryUnit; export declare const LITRE: FdoInventoryUnit; /** Explicit production snapshots; generic adjustment measurements stay separate. */ export declare const KILOGRAM_SNAPSHOT: ProductionRunUnitSnapshot; export declare const LITRE_SNAPSHOT: ProductionRunUnitSnapshot; export declare const GRAM_SNAPSHOT: ProductionRunUnitSnapshot; export declare function sku(id: string, unit?: FdoInventoryUnit): FdoInventorySku; export declare function item(skuId: string, requested: number, measurement?: FdoUnitMeasurement | ProductionRunUnitSnapshot): FdoProductionRunItem; export interface IssuanceLine { skuId: string; committed: number; measurement?: FdoUnitMeasurement | ProductionRunUnitSnapshot; unit?: FdoInventoryUnit; } export declare function issuance(lines: IssuanceLine[], overrides?: Partial): FdoProductionRunIssuance; export declare function pendingIssuance(lines?: IssuanceLine[], overrides?: Partial): FdoProductionRunPendingIssuance; export interface BatchLine { skuId: string; produced: number; measurement?: FdoUnitMeasurement | ProductionRunUnitSnapshot; unit?: FdoInventoryUnit; } export declare function batch(lines: BatchLine[], overrides?: Partial): FdoProductionRunBatch; export declare function activityLog(action: F_PRODUCTION_RUN_ACTION, performedAt: string, remark?: string | null): FdoProductionRunActivityLog; /** * Test-only convenience shape: flat `items`/`requestedIngredientPlan`/ * `issuances`/`pendingIssuance` are accepted here for a terser call site, but * are never carried onto the emitted document — they are grouped into the * canonical `plan`/`preparation` objects below. A flat field overrides its own * slot of an inherited `plan`/`preparation` (for example when spreading an * already-resolved fixture run and overriding just `issuances`), while the * rest of that inherited object survives untouched. */ export type ProductionRunFixtureOverrides = Omit, 'plan' | 'preparation'> & { items?: FdoProductionRunItem[]; requestedIngredientPlan?: FdoProductionIngredientRequirements | null; issuances?: FdoProductionRunIssuance[]; pendingIssuance?: FdoProductionRunPendingIssuance | null; plan?: FdoProductionRunPlan; preparation?: FdoProductionRunPreparation; }; export declare function productionRun(overrides?: ProductionRunFixtureOverrides): FdoProductionRun; /** * An issue adjustment, shaped the way the backend writes one: each amount * carries `ref` (the output SKU the draw serves) and the value Inventory gave * it, so specs can prove the quantity views never read that value. */ export declare function issueAdjustment(): FdoInventoryAdjustment;