<commit_before>import thinky from './thinky';
import validator from 'validator';
let type = thinky.type;

export const Person = thinky.createModel('person', {
  id: type.string().options({enforce_missing: false}),
  BSDId: type.string().allowNull(true)
});

export const Group = thinky.createModel('group', {
  id: type.string().options({enforce_missing: false}),
  personIdList: [type.string()],
})

export const CallAssignment = thinky.createModel('call_assignment', {
  id: type.string().options({enforce_missing: false}),
  name: type.string(),
  callerGroupId: type.string(),
  targetGroupId : type.string(),
  surveyId: type.string(),
//  startDate: type.date(),
//  endDate: type.date().allowNull(true)
})

export const Call = thinky.createModel('call', {
  id: type.string().options({enforce_missing: false}),
  callAssignmentId: type.string(),
  callerId: type.string(),
  intervieweeId: type.string(),
  callAssignedAt: type.date()
})

export const Survey = thinky.createModel('survey', {
  id: type.string().options({enforce_missing: false}),
  slug: type.string(),
  BSDId: type.string().allowNull(true)
})

export const GroupCall = thinky.createModel('group_call', {
  id: type.string().options({enforce_missing: false}),
  name: type.string(),
  scheduledTime: type.date(),
  maxSignups: type.number(),
  duration: type.number(),
  maestroConferenceUID: type.string(),
  signups: [{
    personId: type.string(),
    attended: type.boolean(),
    role: type.string().enum(['HOST', 'NOTETAKER', 'PARTICIPANT'])
  }]
})

export const Field = thinky.createModel('field', {
  id: type.string().options({enforce_missing: false}),
  label: type.string(),
  type: type.string().enum(['Number', 'String', 'Boolean', 'Date', 'Point']),
  validators: {
    function: type.string().enum([
      'enum', 'min', 'max', 'email', 'regex', 'lowercase', 'uppercase', 'integer'
    ]),
    args: []
  }
})

export const Note = thinky.createModel('note', {
  id: type.string().options({enforce_missing: false}),
  personId: type.string(),
  fieldId: type.string(),
  value: type.any().validator((field) => {
    // TODO
    return true;
  },
  entryTime: type.date(),
  source: {
    type: type.string().enum(['survey', 'group_call', 'BSD']),
    id: type.string()
  }
})<commit_msg>Add placeholder for validator on models<commit_after>import thinky from './thinky';
import validator from 'validator';
let type = thinky.type;

export const Person = thinky.createModel('person', {
  id: type.string().options({enforce_missing: false}),
  BSDId: type.string().allowNull(true)
});

export const Group = thinky.createModel('group', {
  id: type.string().options({enforce_missing: false}),
  personIdList: [type.string()],
})

export const CallAssignment = thinky.createModel('call_assignment', {
  id: type.string().options({enforce_missing: false}),
  name: type.string(),
  callerGroupId: type.string(),
  targetGroupId : type.string(),
  surveyId: type.string(),
//  startDate: type.date(),
//  endDate: type.date().allowNull(true)
})

export const Call = thinky.createModel('call', {
  id: type.string().options({enforce_missing: false}),
  callAssignmentId: type.string(),
  callerId: type.string(),
  intervieweeId: type.string(),
  callAssignedAt: type.date()
})

export const Survey = thinky.createModel('survey', {
  id: type.string().options({enforce_missing: false}),
  slug: type.string(),
  BSDId: type.string().allowNull(true)
})

export const GroupCall = thinky.createModel('group_call', {
  id: type.string().options({enforce_missing: false}),
  name: type.string(),
  scheduledTime: type.date(),
  maxSignups: type.number(),
  duration: type.number(),
  maestroConferenceUID: type.string(),
  signups: [{
    personId: type.string(),
    attended: type.boolean(),
    role: type.string().enum(['HOST', 'NOTETAKER', 'PARTICIPANT'])
  }]
})

export const Field = thinky.createModel('field', {
  id: type.string().options({enforce_missing: false}),
  label: type.string(),
  type: type.string().enum(['Number', 'String', 'Boolean', 'Date', 'Point']),
  validators: {
    function: type.string().enum([
      'enum', 'min', 'max', 'email', 'regex', 'lowercase', 'uppercase', 'integer'
    ]),
    args: []
  }
})

export const Note = thinky.createModel('note', {
  id: type.string().options({enforce_missing: false}),
  personId: type.string(),
  fieldId: type.string(),
  value: type.any(),
  entryTime: type.date(),
  source: {
    type: type.string().enum(['survey', 'group_call', 'BSD']),
    id: type.string()
  }
}, {
  validator: (data) => {
    return true;
  }
})
{'fraction_non_alphanumeric': 0.1910382513661202, 'fraction_numerical': 0.0, 'mean_word_length': 4.770491803278689, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6582449', 'n_tokens_mistral': 1502, 'n_tokens_neox': 1512, 'n_words': 310}