class EventLogging
  include Mongoid::Document
  field :mac_id, type: String
  field :client_mac, type: String
  field :category_id, type: Integer
  field :location_network_id, type: Integer
  field :type_id, type: Integer
  field :description, type: String
  field :timestamp, type: DateTime
  field :extra_data, type: String

  index({"timestamp" => 1, "type_id" => 1, "mac_id" => 1, "location_network_id" => 1}, { background: true })

  EVENT_CATEGORY = {"1" => "DEVICE" ,"2" => "CLIENT","3" => "NETWORK", "4" => 'ROUGHAP'}
  EVENT_TYPE = {"66" => "RADAR","67" => "DFS","68" => "SCAN_DONE","33" => "AUTHENTICATION","34" => "DEAUTHENTICATION","35" => "ASSOCIATION","36" => "DISASSOCIATION","37" => "SESSION_TIMEOUT"}
end
