import { IsObject, IsOptional, IsUUID } from "class-validator"; /** * POST /v1/documents/generations body (eden.md §1.3, simplified for this * leva). Exactly one of clientRegistrationId/resellerId is required — * enforced in DocumentsService (mirrors the DB CHECK * chk_document_generations_one_source), not here, since class-validator * doesn't cleanly express an XOR across two optional fields. */ export class CreateGenerationDto { @IsUUID() templateId!: string; @IsOptional() @IsUUID() clientRegistrationId?: string; @IsOptional() @IsUUID() resellerId?: string; /** {chave: valor} usado pelo merge engine (merge-engine.ts) para resolver `{{variavel}}`. */ @IsObject() context!: Record; }