Class: MemberLifecycle::Triggers

Inherits:
Object
  • Object
show all
Defined in:
app/lifecycle/member_lifecycle.rb

Class Method Summary collapse

Class Method Details

.construct_member(member) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/lifecycle/member_lifecycle.rb', line 16

def self.construct_member(member)
  investor = member.create_investor_account!
   = investor.bank_accounts.create!
  investor.wallets.create! bank_account: ,
                           currency: Currency.idr
  investor.wallets.create! bank_account: ,
                           currency: Currency.sgd
  investor.wallets.create! bank_account: ,
                           currency: Currency.myr
  member.create_member_profile!
  member.create_preference!
end

.record_country_for_reporting(member) ⇒ Object



29
30
31
32
33
34
35
# File 'app/lifecycle/member_lifecycle.rb', line 29

def self.record_country_for_reporting(member)
  country = NexusCore::ReportUtils.decode_ip member.
  if Country[country].present?
    country = Country[country].name
  end
  member.update_column :session_country, country
end

.send_welcome_email(member) ⇒ Object



12
13
14
# File 'app/lifecycle/member_lifecycle.rb', line 12

def self.send_welcome_email(member)

end