import { IsIn, IsNumber, IsObject, IsOptional, IsString, Max, Min } from 'class-validator'; export const SEMANTIC_LINK_STATUSES = ['suggested', 'approved', 'rejected', 'dismissed'] as const; export const SEMANTIC_LINK_ORIGINS = ['manual', 'semantic', 'llm', 'hybrid', 'rule_based'] as const; export class ReviewSemanticLinkDto { @IsString() @IsIn(SEMANTIC_LINK_STATUSES) status: (typeof SEMANTIC_LINK_STATUSES)[number]; } export class UpsertSemanticLinkDto { @IsString() sourceEntityType: string; @IsString() sourceEntityId: string; @IsString() targetEntityType: string; @IsString() targetEntityId: string; @IsOptional() @IsString() linkType?: string; @IsOptional() @IsString() @IsIn(SEMANTIC_LINK_STATUSES) status?: (typeof SEMANTIC_LINK_STATUSES)[number]; @IsOptional() @IsString() @IsIn(SEMANTIC_LINK_ORIGINS) origin?: (typeof SEMANTIC_LINK_ORIGINS)[number]; @IsOptional() @IsNumber() @Min(0) @Max(1) confidence?: number; @IsOptional() @IsString() reason?: string; @IsOptional() @IsObject() evidence?: Record; }