import{logger as r}from"../../../../tools/notifiers/logger.js";import{relatedEntityDatabaseSchema as l}from"../../schemas/database-schemas.js";import{validateWithResult as o}from"../../utils/ajv-validator.js";function u(a){const t=o(l,a);if(!t.success)return r.warn(`Invalid database bff catalog related entity, error: ${t.error}`),null;const e=t.data||{};return{id:e.id,type:e.type,key:e.key,title:e.title,summary:e.summary,source:e.source,sourceFile:e.source_file,relationRole:e.relation_role,relationType:e.relation_type,createdAt:e.created_at||null,updatedAt:e.updated_at||null,metadata:e.metadata?JSON.parse(e.metadata):null}}export{u as createBffRelatedEntity};
