import { JobRunRow, JobStepRow, JobDefinitionRow } from './job-orchestration.schema.js';
import 'drizzle-orm/pg-core';
import 'drizzle-orm';

/**
 * MemoryJobStore — the shared in-memory backing for the three memory-backend
 * services (ADR-022, JOB-4).
 *
 * Plain class, not `@Injectable()`. Wired as a `useValue` provider in
 * JOB-5's `JobsDomainModule.forRoot({ backend: 'memory' })` so unit tests
 * can keep a direct reference for `beforeEach` resets.
 *
 * All three memory services receive the same `MemoryJobStore` instance via
 * constructor injection; the store owns mutable state, the services are
 * stateless mutators.
 */

declare class MemoryJobStore {
    /** Runs keyed by `id` (single source of truth for status/scope/lineage). */
    readonly runs: Map<string, JobRunRow>;
    /** Steps keyed by `job_run_id`; array order matches insertion order. */
    readonly steps: Map<string, JobStepRow[]>;
    /** Job definitions keyed by `type` — memory mirror of the `job` table. */
    readonly jobs: Map<string, JobDefinitionRow>;
    /** Reset everything. Tests call this in `beforeEach`. */
    clear(): void;
}

export { MemoryJobStore };
