import { markInvariantsSatisfied as markInboundShipmentInvariantsSatisfied, type InboundShipment as InboundShipmentAggregate, } from "../domain/inboundShipment"; import type { InventoryLedgerEntry, Item, PurchaseOrderLineForMatching, StorageLocation, } from "./moduleMocks"; // Item fixtures (from item-management query contract) export const baseActiveItem = { id: "item-1", sku: "SKU-001", name: "Active Widget", barcode: "BAR-001", unitId: "unit-ea", status: "ACTIVE", createdAt: new Date("2024-01-01T00:00:00.000Z"), updatedAt: new Date("2024-01-01T00:00:00.000Z"), } as const satisfies Item; export const baseInactiveItem = { ...baseActiveItem, id: "item-3", sku: "SKU-003", name: "Inactive Widget", barcode: "BAR-003", status: "INACTIVE", } as const satisfies Item; // StorageLocation fixtures (from inventory query contract) export const baseStorageLocation = { id: "location-1", name: "Main Shelf", code: "MAIN", siteId: "site-1", storageCondition: null, capacity: null, status: "ACTIVE", createdAt: new Date("2024-01-01T00:00:00.000Z"), updatedAt: new Date("2024-01-01T00:00:00.000Z"), } as const satisfies StorageLocation; export const baseInactiveLocation = { ...baseStorageLocation, id: "location-3", name: "Inactive Area", code: "OLD", status: "INACTIVE", } as const satisfies StorageLocation; // InboundShipment aggregate fixtures export const baseInboundShipment: InboundShipmentAggregate = markInboundShipmentInvariantsSatisfied( { id: "shipment-1", header: { status: "DRAFT", effectiveDate: new Date("2024-01-10T00:00:00.000Z"), postedAt: null, customFields: {}, }, lines: [ { id: "shipment-line-1", itemId: "item-1", quantity: "5", unitId: "unit-box", primaryQuantity: "10", primaryUnitId: "unit-ea", unitConversionRate: "2", unitCost: null, storageLocationId: "location-1", stockType: "AVAILABLE", sourceDocumentType: "PURCHASE_ORDER", sourceDocumentId: "po-1", sourceLineId: "po-line-1", customFields: {}, }, ], }, ); // Purchase-order fixtures (from purchase's matching query contract) export const basePurchaseOrderLine = { id: "po-line-1", purchaseOrderId: "po-1", companyId: "company-1", supplierAccountId: "supplier-account-1", itemId: "item-1", quantity: "5", unitPrice: "24", unitId: "unit-box", requiresPhysicalReceipt: true, receivedQuantity: "5", } as const satisfies PurchaseOrderLineForMatching; // InventoryLedger fixtures (from inventory posting contract) export const baseInventoryLedgerEntry = { id: "ledger-1", sourceType: "INBOUND_SHIPMENT", sourceId: "shipment-1", sourceLineId: "shipment-line-1", orderDocumentType: "PURCHASE_ORDER", orderDocumentId: "po-1", orderDocumentLineId: "po-line-1", direction: "IN", action: "QUANTITY_CHANGE", itemId: "item-1", storageLocationId: "location-1", stockType: "AVAILABLE", quantity: "10", executedAt: new Date("2024-01-10T00:00:00.000Z"), effectiveDate: new Date("2024-01-10T00:00:00.000Z"), createdAt: new Date("2024-01-10T00:00:00.000Z"), } as const satisfies InventoryLedgerEntry;