/** * These represent types of objects that can be sent to the MM API. * Each class implements {@link IToRESTApiObject} / {@link IToFullApiObject} and a static * {@link fromPlainObject} for cache/SQLite-style rows (and optional custom-field keys). */ import type { MMWorkOrderOperationStatusValue, MMWorkOrderStatusValue } from "../../../types/erp-types.js"; /** * Interface for entities that can be sent to the MM ERP API. * * Returns a JSON-serializable map. Core fields are usually strings (or `string | null` for * optional dates); implementations may add `customFields` (object) via * {@link applyNonEmptyCustomFieldsToRest}. */ export interface IToRESTApiObject { toRESTApiObject(): Record; } /** * Optional additive interface for entities that need to send richer JSON payloads * (e.g. `customFields` objects) to the MM ERP API. * * MMApiClient will prefer this method when available and fall back to `toRESTApiObject()`. */ export interface IToFullApiObject { toFullApiObject(): Record; } export declare class MMSendPerson implements IToRESTApiObject, IToFullApiObject { personId: string; firstName: string; lastName: string; isActive: boolean; customFieldsSchemaRef?: number | null | undefined; customFields?: (Record | null) | undefined; constructor(personId: string, firstName: string, lastName: string, isActive: boolean, customFieldsSchemaRef?: number | null | undefined, customFields?: (Record | null) | undefined); toRESTApiObject(): Record & { customFields?: Record; }; toFullApiObject(): Record; static fromPlainObject(data: Record): MMSendPerson; } export declare class MMSendResource implements IToRESTApiObject, IToFullApiObject { resourceId: string; name: string; isResourceGroup: boolean; description: string; type: string; productionBurdenRateHourly: number; setupBurdenRateHourly: number; customFieldsSchemaRef?: number | null | undefined; customFields?: (Record | null) | undefined; constructor(resourceId: string, // Unique identifier that the ERP uses to describe a resource name: string, // A colloquial name for the resource, sometimes also just the resource_id isResourceGroup: boolean, // Whether or not this record represents an individual machine/piece of hardware, or a group/type of machines description: string, // Text description of the resource (optional) type: string, // The type of resource (optional) productionBurdenRateHourly: number, // The cost associated with running this machine in production/hour (optional) setupBurdenRateHourly: number, // The cost associated with running this machine in setup/hour (optional) customFieldsSchemaRef?: number | null | undefined, customFields?: (Record | null) | undefined); toRESTApiObject(): Record & { customFields?: Record; }; toFullApiObject(): Record; /** * Optional `customFields` / `customFieldsSchemaRef` when present on the row (e.g. merged from * connector config). Do not use `|| {}` for `customFields` so full API payloads omit empty objects. */ static fromPlainObject(data: Record): MMSendResource; } export declare class MMSendPart implements IToRESTApiObject, IToFullApiObject { partNumber: string; partRevision: string; method: string; customFieldsSchemaRef?: number | null | undefined; customFields?: (Record | null) | undefined; constructor(partNumber: string, partRevision: string, method: string, customFieldsSchemaRef?: number | null | undefined, customFields?: (Record | null) | undefined); toRESTApiObject(): Record & { customFields?: Record; }; toFullApiObject(): Record; static fromPlainObject(data: Record): MMSendPart; } export declare class MMSendPartOperation implements IToRESTApiObject, IToFullApiObject { partNumber: string; partRevision: string; method: string; sequenceNumber: string; resourceId: string; cycleTimeMs: number; setupTimeMs: number; description: string; quantityPerPart: number; customFieldsSchemaRef?: number | null | undefined; customFields?: (Record | null) | undefined; partName?: string | null | undefined; constructor(partNumber: string, partRevision: string, method: string, sequenceNumber: string, resourceId: string, cycleTimeMs: number, setupTimeMs: number, description: string, quantityPerPart: number, customFieldsSchemaRef?: number | null | undefined, customFields?: (Record | null) | undefined, partName?: string | null | undefined); toRESTApiObject(): Record & { customFields?: Record; }; toFullApiObject(): Record; static fromPlainObject(data: Record): MMSendPartOperation; } export declare class MMSendWorkOrder implements IToRESTApiObject, IToFullApiObject { workOrderId: string; lot: string; split: string; sub: string; /** One of {@code MMWorkOrderStatus} (preferred) or a free-form string. */ status: MMWorkOrderStatusValue; dueDate: string | null; description: string; scheduledStartDate: string | null; scheduledEndDate: string | null; closedDate: string | null; quantityRequired: number; partNumber: string; partRevision: string; method: string; customFieldsSchemaRef?: number | null | undefined; customFields?: (Record | null) | undefined; constructor(workOrderId: string, lot: string, split: string, sub: string, /** One of {@code MMWorkOrderStatus} (preferred) or a free-form string. */ status: MMWorkOrderStatusValue, dueDate: string | null, description: string, scheduledStartDate: string | null, scheduledEndDate: string | null, closedDate: string | null, quantityRequired: number, partNumber: string, partRevision: string, method: string, customFieldsSchemaRef?: number | null | undefined, customFields?: (Record | null) | undefined); toRESTApiObject(): Record & { customFields?: Record; }; toFullApiObject(): Record; static fromPlainObject(data: Record): MMSendWorkOrder; } export declare class MMSendWorkOrderOperation implements IToRESTApiObject, IToFullApiObject { workOrderId: string; lot: string; split: string; sub: string; sequenceNumber: string; resourceId: string; startQuantity: number; finishQuantity: number; expectedRejectRate: number; scheduledStartDate: string | null; scheduledFinishDate: string | null; closedDate: string | null; cycleTimeMs: number; setupTimeMs: number; productionburdenRateHourly: number; setupburdenRatehourly: number; operationType: string; quantityPerPart: number; /** One of {@code MMWorkOrderOperationStatus} (preferred) or a free-form string. */ status: MMWorkOrderOperationStatusValue; customFieldsSchemaRef?: number | null | undefined; customFields?: (Record | null) | undefined; constructor(workOrderId: string, lot: string, split: string, sub: string, sequenceNumber: string, resourceId: string, startQuantity: number, finishQuantity: number, expectedRejectRate: number, scheduledStartDate: string | null, scheduledFinishDate: string | null, closedDate: string | null, cycleTimeMs: number, setupTimeMs: number, productionburdenRateHourly: number, setupburdenRatehourly: number, operationType: string, quantityPerPart: number, /** One of {@code MMWorkOrderOperationStatus} (preferred) or a free-form string. */ status: MMWorkOrderOperationStatusValue, customFieldsSchemaRef?: number | null | undefined, customFields?: (Record | null) | undefined); toRESTApiObject(): Record & { customFields?: Record; }; toFullApiObject(): Record; static fromPlainObject(data: Record): MMSendWorkOrderOperation; } /** * Partial work order operation payload for labor-ticket NATS sync: natural keys plus only * `status`, `closedDate`, and custom field properties — no quantities, rates, or schedules. */ export type MMSendWorkOrderOperationLaborTicketSyncPatch = { closedDate?: string | null; status?: MMWorkOrderOperationStatusValue; customFields?: Record | null; customFieldsSchemaRef?: number | null; }; export declare class MMSendWorkOrderOperationLaborTicketSync implements IToRESTApiObject, IToFullApiObject { workOrderId: string; lot: string; split: string; sub: string; sequenceNumber: string; resourceId: string; private readonly patch; customFieldsSchemaRef?: number | null; customFields?: Record | null; constructor(workOrderId: string, lot: string, split: string, sub: string, sequenceNumber: string, resourceId: string, patch: MMSendWorkOrderOperationLaborTicketSyncPatch); toRESTApiObject(): Record; toFullApiObject(): Record; } /** * Status-only work order upsert: identity keys plus `status`. The MM import derives * `update_columns` from the fields present in each record, so this changes nothing but the * status — no other column can be clobbered, and `closedDate` is never touched (so the * payload is independent of erp-api's opt-in `?clearColumns` handling). Used by deletion * reconciliation to mark work orders DELETED. */ export declare class MMSendWorkOrderStatusPatch implements IToRESTApiObject, IToFullApiObject { workOrderId: string; lot: string; split: string; sub: string; status: MMWorkOrderStatusValue; constructor(workOrderId: string, lot: string, split: string, sub: string, status: MMWorkOrderStatusValue); toRESTApiObject(): Record; toFullApiObject(): Record; } /** * Status-only work order operation upsert: the five identity keys plus `status`. Same * partial-update semantics as {@link MMSendWorkOrderStatusPatch}. Used by deletion * reconciliation to mark operations DELETED. */ export declare class MMSendWorkOrderOperationStatusPatch implements IToRESTApiObject, IToFullApiObject { workOrderId: string; lot: string; split: string; sub: string; sequenceNumber: string; status: MMWorkOrderOperationStatusValue; constructor(workOrderId: string, lot: string, split: string, sub: string, sequenceNumber: string, status: MMWorkOrderOperationStatusValue); toRESTApiObject(): Record; toFullApiObject(): Record; } /** Full-row work order send vs status-only patch (same MM endpoint). */ export type MMSendWorkOrderPayload = MMSendWorkOrder | MMSendWorkOrderStatusPatch; /** Full-row WOO send vs partial patches (labor-ticket close-out, status-only) — same MM endpoint. */ export type MMSendWorkOrderOperationPayload = MMSendWorkOrderOperation | MMSendWorkOrderOperationLaborTicketSync | MMSendWorkOrderOperationStatusPatch; export declare class MMSendReason implements IToRESTApiObject, IToFullApiObject { reasonId: string; category: string; code: string; description: string; entityType: string; customFieldsSchemaRef?: number | null | undefined; customFields?: (Record | null) | undefined; constructor(reasonId: string, category: string, code: string, description: string, entityType: string, customFieldsSchemaRef?: number | null | undefined, customFields?: (Record | null) | undefined); toRESTApiObject(): Record & { customFields?: Record; }; toFullApiObject(): Record; static fromPlainObject(data: Record): MMSendReason; } export declare class MMSendLaborTicket implements IToRESTApiObject, IToFullApiObject { workOrderId: string; lot: string; split: string; sub: string; sequenceNumber: string; resourceId: string; personId: string; laborTicketId: string; transactionDate: string | null; clockIn: string | null; clockOut: string | null; goodParts: number; badParts: number; type: string; comment: string; state: string; customFieldsSchemaRef?: number | null | undefined; customFields?: (Record | null) | undefined; laborTicketRef?: number | null | undefined; /** Present on real-time NATS creates; often absent on ERP import/sync paths */ machineRef?: string | null | undefined; /** * MM reason code (e.g. "NCTQ"). When present, erp-api's import handler writes the * rel_labor_ticket_reason association (insertErpLaborTicketsWithReasonsMutation), so * NATS-created/closed tickets carry the same reason association as Dashboard-created * ones. Without it, the to-erp poller recomputes a reason-less business signature that * never matches the NATS-recorded signature, defeating ledger dedup. */ reasonId?: string | null | undefined; constructor(workOrderId: string, lot: string, split: string, sub: string, sequenceNumber: string, resourceId: string, personId: string, laborTicketId: string, transactionDate: string | null, clockIn: string | null, clockOut: string | null, goodParts: number, badParts: number, type: string, comment: string, state: string, customFieldsSchemaRef?: number | null | undefined, customFields?: (Record | null) | undefined, laborTicketRef?: number | null | undefined, /** Present on real-time NATS creates; often absent on ERP import/sync paths */ machineRef?: string | null | undefined, /** * MM reason code (e.g. "NCTQ"). When present, erp-api's import handler writes the * rel_labor_ticket_reason association (insertErpLaborTicketsWithReasonsMutation), so * NATS-created/closed tickets carry the same reason association as Dashboard-created * ones. Without it, the to-erp poller recomputes a reason-less business signature that * never matches the NATS-recorded signature, defeating ledger dedup. */ reasonId?: string | null | undefined); toRESTApiObject(): Record & { customFields?: Record; machineRef?: string; }; toFullApiObject(): Record; static fromPlainObject(data: Record): MMSendLaborTicket; } /** * Flattened interface for Work Order related entities that maintains referential integrity * by processing parts, part operations, work orders, and work order operations together */ export interface MMSendWorkOrderBatch { parts: MMSendPart[]; partOperations: MMSendPartOperation[]; workOrders: MMSendWorkOrder[]; workOrderOperations: MMSendWorkOrderOperation[]; } export declare class MMSendDispatchPriority { /** The operation's id as issued by the ordering authority. Required by the SDK (MM does not enforce it). */ authorityOperationId: string; /** The queue the ordering is valid within: an ERP resource id (machine or group). */ scopeResourceId: string; workOrderId: string; /** Routing step (MM stores it numerically). Not the sort key. */ sequenceNumber: string | number; lot: string; split: string; sub: string; /** Ordinal sort key within the scope; no contiguity or integrality promise. */ priority: number; /** The authority's pin to one machine within a group scope; null when ranked at large or the scope is a machine. */ preallocatedMachineResourceId: string | null; customFieldsSchemaRef?: number | null | undefined; customFields?: (Record | null) | undefined; constructor( /** The operation's id as issued by the ordering authority. Required by the SDK (MM does not enforce it). */ authorityOperationId: string, /** The queue the ordering is valid within: an ERP resource id (machine or group). */ scopeResourceId: string, workOrderId: string, /** Routing step (MM stores it numerically). Not the sort key. */ sequenceNumber: string | number, lot: string, split: string, sub: string, /** Ordinal sort key within the scope; no contiguity or integrality promise. */ priority: number, /** The authority's pin to one machine within a group scope; null when ranked at large or the scope is a machine. */ preallocatedMachineResourceId?: string | null, customFieldsSchemaRef?: number | null | undefined, customFields?: (Record | null) | undefined); /** * Hasura `erpWorkOrderOperationDispatchPriorities_insert_input` object. * * Built from this row **as `dispatchPriorityInputSchema` parses it**, not from the raw * fields, so a row constructed directly with a numeric `lot` or `authorityOperationId` * is canonicalized exactly as one from `fromPlainObject` would be. Validation and the * wire payload therefore agree by construction: nothing can pass * `assertValidDispatchPriorityRows` and then fail here. `companyId` is a session preset * and must not be sent. * * @throws {ZodError} if the row is not usable — the same rule validation applies */ toGraphqlInsertInput(): Record; /** * From a cache/JSON-style row, validated by `dispatchPriorityInputSchema`. Text fields * accept strings and numbers, numeric fields accept numbers and numeric text, and * anything else throws naming the field. * * Unlike the older send models, which coerce a missing field to `""` and carry on, this * refuses to build a row it cannot vouch for: a `0` silently becoming `""` is an identity * nobody wrote, and a `false` becoming rank 0 is an ordering nobody wrote. * * @throws {ZodError} naming the field when the row is not usable */ static fromPlainObject(data: Record): MMSendDispatchPriority; } //# sourceMappingURL=send-types.d.ts.map