class Admission::ContactRevisionField < ApplicationRecord
  include Fieldable

  enum field: {
    relationship: 0,
    first_name: 1,
    last_name: 2,
    title_id: 3,
    country_id: 14,
    address: 4,
    address_ext: 5,
    city: 6,
    state: 7,
    zip_code: 8,
    home_phone: 9,
    cell_phone: 10,
    work_phone: 11,
    email: 12,
    emergency_contact: 13
  }

  REQUIRED_FIELDS = [
    'relationship',
    'first_name',
    'last_name',
    'primary',
    'emergency',
    'pickup'
  ]

  DISPLAY_FIELDS = [
    'title_id',
    'country_id',
    'address',
    'address_ext',
    'city',
    'state',
    'zip_code',
    'country_id',
    'home_phone',
    'cell_phone',
    'work_phone',
    'email',
    'emergency_contact'
  ]

  belongs_to :school

  scope :with_display, -> { where(display: true) }
  scope :with_required, -> { where(required: true) }
end
