module MemberAutomation extend ActiveSupport::Concern # included do # # Code in this block becomes instance methods or class macros (like scopes, validations, associations) in the including class. # scope :visible, -> { where(visible: true) } # scope :invisible, -> { where(visible: false) } # validates :status, inclusion: { in: %w(visible invisible), message: "%{value} is not a valid status" } # end # class_methods do # # Methods in this block become class methods of the including class. # def count_all_visible # visible.count # end # end # Any other methods defined here become instance methods automatically. # def up_to_date? # self.pl_plan_key.present? && # self.company_pb_entity_key.present? && # self.plan_id.present? && # self.group_number.present? && # self.effective_date.present? # end def sync_with_vhcs AutomationService::MemberUpdate.new(self.employer.pl_plan_key, self.pb_entity_key).call end end