import { asFunction } from "awilix";
import { createGenericOptimisticLockReader } from "@open-mercato/shared/lib/crud/optimistic-lock";
import { registerOptimisticLockReaders } from "@open-mercato/shared/lib/crud/optimistic-lock-store";
import { WorkflowDefinition } from "./data/entities.js";
import * as workflowExecutor from "./lib/workflow-executor.js";
import * as stepHandler from "./lib/step-handler.js";
import * as transitionHandler from "./lib/transition-handler.js";
import * as activityExecutor from "./lib/activity-executor.js";
import * as eventLogger from "./lib/event-logger.js";
import * as signalHandler from "./lib/signal-handler.js";
import * as timerHandler from "./lib/timer-handler.js";
registerOptimisticLockReaders({
  "workflows.definition": createGenericOptimisticLockReader({
    entity: WorkflowDefinition,
    idField: "id",
    tenantField: "tenantId",
    orgField: "organizationId",
    softDeleteField: "deletedAt"
  })
});
function register(container) {
  container.register({
    workflowExecutor: asFunction(() => workflowExecutor).scoped(),
    stepHandler: asFunction(() => stepHandler).scoped(),
    transitionHandler: asFunction(() => transitionHandler).scoped(),
    activityExecutor: asFunction(() => activityExecutor).scoped(),
    eventLogger: asFunction(() => eventLogger).scoped(),
    signalHandler: asFunction(() => signalHandler).scoped(),
    timerHandler: asFunction(() => timerHandler).scoped()
  });
}
export {
  register
};
//# sourceMappingURL=di.js.map
