module Base::Discipline::Config
  extend ActiveSupport::Concern
  include Castable

  included do
    cast_as_boolean :ViewLogs, true
    cast_as_boolean :PendingDetentions, true
    cast_as_boolean :NotifyManager, true
    cast_as_boolean :NotifyHRTeacher, true

    self.table_name = 'DisciplineConfig'
    self.primary_key = 'DCID'

    alias_attribute :id, :DCID
    alias_attribute :school_id, :SchoolID
    alias_attribute :view_logs, :ViewLogs
    alias_attribute :pending_detentions, :PendingDetentions
    alias_attribute :points_to_trigger, :PointsToTrigger
    alias_attribute :reset_points_new_term, :ResetPointsNewTerm
    alias_attribute :notify_manager, :NotifyManager
    alias_attribute :notify_hr_teacher, :NotifyHRTeacher
  end
end
