import{findProjects as e}from"../../services/project.service.mjs";import{z as t}from"zod";const n=[`projectIds`],r=t.object({projectIds:t.array(t.string({message:`Project id must be a string`})).min(1,`Project id is required`)}),i=async(t,i=n)=>{let a=i.reduce((e,t)=>(e[t]=!0,e),{}),o=r.pick(a).safeParse(t),s=o.success?{}:o.error.flatten().fieldErrors;if(i.includes(`projectIds`)&&t.projectIds&&!s.projectIds)try{let n=await e({_id:t.projectIds});(!n||n.length!==t.projectIds.length)&&(s.projectIds=s.projectIds||[],s.projectIds.push(`Project not found`))}catch{s.projectIds=s.projectIds||[],s.projectIds.push(`Project not found`)}return s};export{i as validateDictionary};
//# sourceMappingURL=validateDictionary.mjs.map