/** * `validatePlateDtoColumns` — 0.19.5-α (sc#151 #4). * * Pure helper that flags every DTO field which has NO backing column * in the consumer's TypeORM migrations AND no explicit * `// computed: ` comment justifying its existence. * * Concrete recurrence (delgoosh story-006): the spec declared * `lastMessagePreview` on `PeerChatThreadListItemDto` but no * `last_message_body` column was added to `peer_chat_threads`. Brew * was forced into a join-the-latest-message-per-row query OR returning * null. Plate is the right point to surface this — the data layer * (DTOs + migrations) is what plate reconciles when amending the * mockup, so column-vs-DTO drift is in plate's wheelhouse. * * Action is "flagged" — the resolution is upstream: drop the field * from the DTO OR add the backing column to the migration OR add a * `// computed: ` comment explaining the JOIN/aggregate. * * Designed pure (no fs / no LLM): caller passes file contents already * read. Same shape as `validateRouteCollisions` (sc#152) and * `validateEntityFieldReferences` (sc#132). */ import type { SpecValidationFinding } from "../refine/spec-validate.js"; export interface PlateDtoFinding extends SpecValidationFinding { /** The DTO field name (camelCase, as it appears in TypeScript). */ fieldName: string; /** Repo-relative path to the DTO file that declares the field. */ dtoFile: string; /** Line number of the field declaration in the DTO file (1-based). */ dtoLine: number; } export interface DtoFile { /** Repo-relative path, e.g. `packages/dtos/src/back/peer-chat/list-threads.response.dto.ts`. */ path: string; /** Full file contents (UTF-8). */ contents: string; } export interface MigrationFile { /** Repo-relative path, e.g. `packages/postgres/src/migrations/1772100000000-create-peer-chat-tables.ts`. */ path: string; /** Full file contents (UTF-8). */ contents: string; } /** * Run the check. * * @param dtos - all DTO files (typically the union of * `packages/dtos/src/**\/*.ts` AND the consumer's * `apps//src/modules//dtos/*.ts`). * @param migrations - all migration files * (`packages/postgres/src/migrations/*.ts` etc.). */ export declare function validatePlateDtoColumns(dtos: DtoFile[], migrations: MigrationFile[]): PlateDtoFinding[]; //# sourceMappingURL=dto-columns.d.ts.map