export {
  postReceipt,
} from './post-receipt.js'
export {
  postIssue,
} from './post-issue.js'
export {
  postAdjustment,
} from './post-adjustment.js'
export {
  transferStock,
} from './transfer-stock.js'
export {
  reverseMovement,
} from './reverse-movement.js'
export {
  recordCount,
} from './record-count.js'
export {
  getOnHand,
  getValuation,
} from './reads/on-hand-valuation.js'
export {
  getCogs,
  getMovements,
} from './reads/cogs-movements.js'
export {
  stockLocation,
  stockItem,
  stockMovement,
  stockCostLayer,
  stockPosition,
  inventorySchema,
} from './schema.js'
export type { InventorySchema } from './schema.js'

export { pushSchema, InventoryMigrateError, isInventoryMigrateError } from './migrate.js'

export {
  OversoldError,
  InventoryValidationError,
  InventoryTransactionRequiredError,
  ItemNotFoundError,
  LocationNotFoundError,
  MovementNotFoundError,
  isOversoldError,
  isInventoryValidationError,
  isInventoryTransactionRequiredError,
  isItemNotFoundError,
  isLocationNotFoundError,
  isMovementNotFoundError,
} from './errors.js'

export type {
  Movement,
  MovementResult,
  TransferResult,
  OnHand,
  Valuation,
  CogsResult,
  CountResult,
} from './types.js'

export { consumeFifo } from './valuation/fifo.js'
export { blendReceipt, consumeAvg } from './valuation/weighted-average.js'
