import { i18n } from '@plugins/i18n';

export function snilsFormatRule(val: string): string | boolean {
  const pattern = /^[0-9]{11}$/;
  return val
    ? pattern.test(val) ||
        String(i18n.t('validation.employees.invalidSnilsFormat'))
    : !val;
}

export function snilsFormatRuleBoolean(val: string): boolean {
  const pattern = /^[0-9]{11}$/;
  return pattern.test(val);
}
