import { TAB_GENERAL } from '../constants';

export const validationScheme = [
  {
    fieldName: 'name',
    tabId: TAB_GENERAL,
    validation: (value) => {
      if (!value) {
        return 'Field cannot be empty';
      }

      if (value.length < 2) {
        return 'Minimum 2 letters';
      }

      return '';
    },
  },
  {
    fieldName: 'salesforceId',
    tabId: TAB_GENERAL,
    validation: (value) => {
      if (!value) {
        return 'Field cannot be empty';
      }

      if (value.length !== 15) {
        return 'Must be 15 alphanumeric characters';
      }

      return '';
    },
  },
  {
    fieldName: 'account',
    tabId: TAB_GENERAL,
    validation: (value) => {
      if (!value) {
        return 'Field cannot be empty';
      }

      return '';
    },
  },
];
