lib/email/hook_processor/client_mile_stone.rb
def update_mile_stone_attributes_for_admins

        puts " in update_mile_stone_attributes_for_admins"
        if !@first_stake_and_mint && mile_stone == GlobalConstant::PepoCampaigns.stake_and_mint
          return success
        end

        puts " in update_mile_stone_attributes_for_admins after"

        manager_ids = []
        super_admins = {}

        ClientManager.admins(@client_id).all.each do |client_manager|
          formatted_cm = client_manager.formatted_cache_data
          manager_ids << client_manager[:manager_id]
          super_admins[client_manager[:manager_id]] = 1 if formatted_cm[:privileges].include?(GlobalConstant::ClientManager.is_super_admin_privilege)
        end

        managers = CacheManagement::Manager.new(manager_ids).fetch

        # Only active managers should have the mile stones updated in pepo campaigns
        managers.each do |manager_id, manager|
          next if manager[:status] != GlobalConstant::Manager.active_status

          r = Email::HookCreator::UpdateContact.new(
              receiver_entity_id: manager_id,
              receiver_entity_kind: GlobalConstant::EmailServiceApiCallHook.manager_receiver_entity_kind,
              custom_attributes: {},
              user_settings: {},
              client_id: @client_id,
              manager_id: manager_id
          ).perform

          @failed_logs[manager_id] = r.to_hash unless r.success?
        end

        success
      end
# Update client mile stone attributes for all admins in pepo campaigns
#
# * Author: Santhosh
# * Date: 30/07/2019
# * Reviewed By:
#
# @return [Result::Base]
#
Update client mile stone attributes for all admins in pepo campaigns
Author: Santhosh
Date: 30/07/2019
Reviewed By.
Update client mile stone attributes for all admins in pepo campaigns Author : Santhosh Date : 30 / 07 / 2019 Reviewed By .
def update_mile_stone_attributes_for_admins
        puts " in update_mile_stone_attributes_for_admins"
        if !@first_stake_and_mint && mile_stone == GlobalConstant::PepoCampaigns.stake_and_mint
          return success
        end
        puts " in update_mile_stone_attributes_for_admins after"
        manager_ids = []
        super_admins = {}
        ClientManager.admins(@client_id).all.each do |client_manager|
          formatted_cm = client_manager.formatted_cache_data
          manager_ids << client_manager[:manager_id]
          super_admins[client_manager[:manager_id]] = 1 if formatted_cm[:privileges].include?(GlobalConstant::ClientManager.is_super_admin_privilege)
        end
        managers = CacheManagement::Manager.new(manager_ids).fetch
        managers.each do |manager_id, manager|
          next if manager[:status] != GlobalConstant::Manager.active_status
          r = Email::HookCreator::UpdateContact.new(
              receiver_entity_id: manager_id,
              receiver_entity_kind: GlobalConstant::EmailServiceApiCallHook.manager_receiver_entity_kind,
              custom_attributes: {},
              user_settings: {},
              client_id: @client_id,
              manager_id: manager_id
          ).perform
          @failed_logs[manager_id] = r.to_hash unless r.success?
        end
        success
      end
def update_mile_stone_attributes_for_admins puts " in update_mile_stone_attributes_for_admins" if ! @first_stake_and_mint && mile_stone == GlobalConstant :: PepoCampaigns . stake_and_mint return success end puts " in update_mile_stone_attributes_for_admins after" manager_ids = [ ] super_admins = { } ClientManager . admins ( @client_id ) . all . each do | client_manager | formatted_cm = client_manager . formatted_cache_data manager_ids << client_manager [ :manager_id ] super_admins [ client_manager [ :manager_id ] ] = 1 if formatted_cm [ :privileges ] . include? ( GlobalConstant :: ClientManager . is_super_admin_privilege ) end managers = CacheManagement :: Manager . new ( manager_ids ) . fetch managers . each do | manager_id , manager | next if manager [ :status ] != GlobalConstant :: Manager . active_status r = Email :: HookCreator :: UpdateContact . new ( receiver_entity_id : manager_id , receiver_entity_kind : GlobalConstant :: EmailServiceApiCallHook . manager_receiver_entity_kind , custom_attributes : { } , user_settings : { } , client_id : @client_id , manager_id : manager_id ) . perform @failed_logs [ manager_id ] = r . to_hash unless r . success? end success end
Update client mile stone attributes for all admins in pepo campaigns
 Author: Santhosh
 Date: 30/07/2019
 Reviewed By:
Update client mile stone attributes for all admins in pepo campaigns Author : Santhosh Date : 30 / 07 / 2019 Reviewed By :
# Only active managers should have the mile stones updated in pepo campaigns
None
Result::Base