export const UserSchema = {
  name: 'User',
  primaryKey: 'key',
  properties: {
    key: 'int',
    email: 'string',
    password: 'string',
    firstName: 'string',
    lastName: 'string',
    tagferId: 'string?',
    twitterUsername: 'bool?',
    phoneNumber: 'string?',
    cca2: 'string?',
    callingCode: 'string?',
    formattedPhoneNumber: 'string?'
  }
};

export const ProfileSchema = {
  name: 'Profile',
  primaryKey: 'key',
  properties: {
    key: 'int',
    jobTitle: 'string',
    companyName: 'string',
    companyEmail: 'string',
    companyPhoneNumber: 'string',
    photoBytes: 'string?'
  }
};

export const InvitesSchema = {
  name: 'Invites',
  primaryKey: 'key',
  properties: {
    key: 'int',
    tagferIds: 'string[]',
    phoneNumbers: 'string[]'
  }
};

export const ContactsSchema = {
  name: 'Contacts',
  primaryKey: 'recordID',
  properties: {
    recordID: 'string'
  }
};

export const SessionSchema = {
  name: 'Session',
  primaryKey: 'key',
  properties: {
    key: 'int',
    sessionId: 'string'
  }
};

export const SignupConfig = {
  path: 'Signup.realm',
  schema: [UserSchema, ProfileSchema, InvitesSchema, ContactsSchema]
};

export const AuthConfig = {
  path: 'Auth.realm',
  schema: [SessionSchema]
};
