/**
 * Validate TOS against rules
 * @param tos
 * @param rules
 * @returns {boolean}
 */
export const validateTOS = (tos, rules) => {
  let errors = [];
  // debugger;

  return errors;
};

@@ -153,21 +153,402 @@
 ;%0A  
-// debugger;%0A
+for (const key in rules) %7B%0A    if (rules%5Bkey%5D.required && rules%5Bkey%5D.requiredIn.includes('function')) %7B%0A      if (!tos.attributes%5Bkey%5D) %7B%0A        errors.push(key);%0A      %7D%0A    %7D%0A    if (rules%5Bkey%5D.requiredIf.length) %7B%0A      for (const item in key.requiredIf) %7B%0A        if (item.key === key && !item.values.includes(tos.attributes%5Bkey%5D)) %7B%0A          errors.push(key);%0A        %7D%0A      %7D%0A    %7D%0A  %7D
 %0A  r

Implement function for validating TOS attributes