import{validateString as e}from"./validateString.mjs";import{getOrganizationById as t}from"../../services/organization.service.mjs";const n=[`name`],r=4,i=20,a=4,o=50,s=async(r,i=n)=>{let a={},o=new Set(i);for(let n of o){let i=r[n];if(a[n]=[],n===`key`){let t=e(i,`Key`,4,20);t.length>0&&(a[n]=t)}if(n===`name`){let t=e(i,`Name`,4,50);t.length>0&&(a[n]=t)}if(n===`organizationId`){let e=[];typeof i!=`string`&&e.push(`Organization id must be a string`),i||e.push(`Organization id is required`),await t(n)||e.push(`Organization not found`),e.length>0&&(a[n]=e)}a[n].length===0&&delete a[n]}return a};export{i as KEY_MAX_LENGTH,r as KEY_MIN_LENGTH,o as NAME_MAX_LENGTH,a as NAME_MIN_LENGTH,s as validateTag};
//# sourceMappingURL=validateTag.mjs.map