import { SchemaBase } from './dsl.js'; import type { DomainAggregate } from './aggregate.js'; /** * Aggregate-grained storage entry. The repository binds one aggregate and * exposes the three fixed operation skeletons (load / save / delete) that the * generator expands from the aggregate structure: * * save(order) = tx { rootDao.upsert + memberDao cascade by FK / extends } * load(id) = rootDao.get + memberDao by FK / extends * delete(id) = tx { memberDao delete + rootDao delete } * * Callers face the domain concept (Order), never the tables. DAO stays * single-table; Repository is the multi-table (aggregate) unit; Service is the * use-case unit. Inter-aggregate joins are prohibited — repositories only * reference each other by root ID. */ export interface RepositorySchema extends SchemaBase { type: 'repository'; /** The aggregate this repository persists (shared instance). */ aggregate: DomainAggregate; } export declare function defineRepository(options: { name: string; aggregate: DomainAggregate; description?: string; }): RepositorySchema;