Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added eduroam opportunity list
ij committed Jul 20, 2017
1 parent 6038f09 commit e1a81d4
Showing 3 changed files with 24 additions and 5 deletions.
15 changes: 11 additions & 4 deletions lib/sf/contact.rb
@@ -37,6 +37,10 @@ def update(args={})
Sf.client.update!("Contact", params)
end

def update_biography(biography)
Sf.client.update!("Contact", {'Id' => self.Id, 'Biography__c' => biography})
end

def set_person_by_email(email)
self.person = Sf::Contact.find_by(Email: email)
end
@@ -98,16 +102,19 @@ def sf_person_mapping
'zip' => 'MailingPostalCode',
'country' => 'MailingCountry',
'exclude_directory' => 'Meeting_Reg_Pre_Population_Opt_Out__c',
'biography' => 'Biography__c',
'sf_id' => 'Id',
'sf_account_id' => 'AccountId'
}
end

def compare_attr(sf_attrs, person_attr, sf_attr)
person_value = person.send(person_attr)
sf_value = self.send(sf_attr)
if person_value.present? and !person_value.eql?(sf_value)
sf_attrs[sf_attr] = person_value
if person.respond_to?(person_attr)
person_value = person.send(person_attr)
sf_value = self.send(sf_attr)
if person_value.present? and !person_value.eql?(sf_value)
sf_attrs[sf_attr] = person_value
end
end
end
def self.find(id)
12 changes: 12 additions & 0 deletions lib/sf/opportunity.rb
@@ -38,4 +38,16 @@ def self.cert_subscribers(since_date=nil)
sobjects = Sf.client.query("select #{FIELDS_SELECT_STR} from Opportunity where Name like '%Certificate Service%' and IsWon = true and CloseDate >= #{since}")
build_collection sobjects unless sobjects.blank?
end

def self.eduroam_opportunities
stages = "('Closed Won', 'Negotiation/Review', 'Transferred Internally', 'Proposal/Price Quote', 'Prospecting')"
sobjects = Sf.client.query("select #{FIELDS_SELECT_STR}, Account.Name from Opportunity where Name like '%Trust and Identity - eduroam%' and StageName in #{stages}")
build_collection sobjects unless sobjects.blank?
end

# stages
# "Prospecting", "Closed Won", "Proposal/Price Quote", "Closed Lost",
# "Negotiation/Review", "INACTIVE", "Value Proposition",
# "Transferred Internally", "Referred", "Id. Decision Makers",
# "Needs Analysis", "Qualification", "Perception Analysis"
end
2 changes: 1 addition & 1 deletion lib/sf/version.rb
@@ -1,3 +1,3 @@
module Sf
VERSION = "0.1.50"
VERSION = "0.1.51"
end

0 comments on commit e1a81d4

Please sign in to comment.