import{ulid as e}from"ulid";function o({entity:l,organizationId:r,projectId:s,source:c,sourceFile:t,fileHash:u}){const a=new Date().toISOString();return{id:l.id||`ce_${e()}`,organizationId:r,projectId:s,key:l.key,type:l.type,title:l.title,summary:l.summary||null,tags:l.tags?JSON.stringify(l.tags):null,metadata:l.metadata?JSON.stringify(l.metadata):null,git:l.git?JSON.stringify(l.git):null,contact:l.contact?JSON.stringify(l.contact):null,links:l.links?JSON.stringify(l.links):null,createdAt:l.createdAt||a,updatedAt:a,source:c||"file",sourceFile:t||null,fileHash:u||null,schemaVersion:1}}export{o as createEntityDbRecord};
