openstax_salesforce 4.1.0 → 4.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef6d6f822b87cbbb085e45f075805a9e523a81d1fca4cfced326a0517aa3ebba
4
- data.tar.gz: 5cd751b8a32190e98e3dca54ed7bf22d7de023a1b78201b12e154523c71e4cd6
3
+ metadata.gz: 64d48f723102c0add3f71e787080ab5b192082d26bbcfddd30f713fbc0861125
4
+ data.tar.gz: 4486d18406b9837f529ac5f8ca7228c0755cad45aef9a8336de9e1d22d2c0d8c
5
5
  SHA512:
6
- metadata.gz: 3f8abee26ae79a8ff3bc154d159b3c210ee57f5e9d71060bcac1ba29560111a272751249383e4c0df67a6b03773f6d3ca022a7af9e373e0012320f3bbfe4b8e1
7
- data.tar.gz: 37b2a27d49806153779d0ed0d1090ac0b41f98f1c0c00e496611c5d9103cc178c6ee905c1bb43919feac4fe03547a2f68d57b7d9f85808d537be7f6b46b49c4f
6
+ metadata.gz: 930e6f24d237f436d390ca0600a6e67ad02effeb3860e571a87d280015c576a1a5ffd232bf91b60acc1a3347db1b4c976e1910d2b5e78fd198c780011c32c3a0
7
+ data.tar.gz: 7cf56d45a59457198d40432efe0b5c421a61eb45765b2104e2d9dd63fc63eeaddb0c34c4c4beb0d31c053cc4b031f16664e2da20e809700c741ed21836d3075c
@@ -5,6 +5,10 @@
5
5
  OpenStax::Salesforce.configure do |config|
6
6
  salesforce_secrets = Rails.application.secrets.salesforce
7
7
 
8
+ if salesforce_secrets.nil?
9
+ raise "Add a `salesforce` section to your Rails secrets!"
10
+ end
11
+
8
12
  # Username, client id, instance url and private key for connecting to the Salesforce app
9
13
  config.username = salesforce_secrets[:username]
10
14
  config.password = salesforce_secrets[:password]
@@ -2,8 +2,10 @@ ActiveSupport::Inflector.inflections do |inflect|
2
2
  inflect.acronym 'OpenStax'
3
3
  end
4
4
 
5
- module OpenStax::Salesforce
6
- class Engine < ::Rails::Engine
7
- isolate_namespace OpenStax::Salesforce
5
+ module OpenStax
6
+ module Salesforce
7
+ class Engine < ::Rails::Engine
8
+ isolate_namespace OpenStax::Salesforce
9
+ end
8
10
  end
9
11
  end
@@ -17,6 +17,7 @@ module OpenStax::Salesforce::Remote
17
17
  field :all_emails, from: "All_Emails__c"
18
18
  field :confirmed_emails, from: "Confirmed_Emails__c"
19
19
  field :adoption_status, from: "Adoption_Status__c"
20
+ field :grant_tutor_access, from: "Grant_Tutor_Access__c", as: :boolean
20
21
 
21
22
  self.table_name = 'Contact'
22
23
  end
@@ -1,5 +1,27 @@
1
1
  module OpenStax::Salesforce::Remote
2
2
  class Lead < ActiveForce::SObject
3
+
4
+ VALID_VERIFICATION_STATUSES = %w[
5
+ pending_faculty
6
+ confirmed_faculty
7
+ rejected_faculty
8
+ no_faculty_info
9
+ ].freeze
10
+
11
+ VALID_ROLES = %w[
12
+ student
13
+ instructor
14
+ faculty
15
+ other
16
+ administrator
17
+ librarian
18
+ adjunct\ faculty
19
+ instructional\ designer
20
+ home\ school\ teacher
21
+ ].freeze
22
+
23
+ VALID_WHO_CHOOSES_BOOKS = %w[instructor committee coordinator].freeze
24
+
3
25
  field :name, from: "Name"
4
26
  field :first_name, from: "FirstName"
5
27
  field :last_name, from: "LastName"
@@ -19,7 +41,40 @@ module OpenStax::Salesforce::Remote
19
41
  field :accounts_uuid, from: "accounts_uuid_c__c"
20
42
  field :application_source, from: "Application_Source__c"
21
43
  field :role, from: "Role__c"
44
+ field :who_chooses_books, from: "who_chooses_books__c"
45
+ field :verification_status, from: "FV_Status__c"
46
+ field :finalize_educator_signup, from: "FV_Final__c", as: :boolean
47
+
48
+ validates(
49
+ :role,
50
+ allow_blank: true,
51
+ inclusion: {
52
+ in: VALID_ROLES,
53
+ message: "must be either #{VALID_ROLES.join(' or ')}"
54
+ }
55
+ )
56
+
57
+ validates(:last_name, presence: true)
58
+ validates(:school, presence: true)
59
+ validates(
60
+ :verification_status,
61
+ allow_blank: true,
62
+ inclusion: {
63
+ in: VALID_VERIFICATION_STATUSES,
64
+ message: "must be either #{VALID_VERIFICATION_STATUSES.join(' or ')}"
65
+ }
66
+ )
67
+
68
+ validates(
69
+ :who_chooses_books,
70
+ allow_blank: true,
71
+ inclusion: {
72
+ in: VALID_WHO_CHOOSES_BOOKS,
73
+ message: "must be either #{VALID_WHO_CHOOSES_BOOKS.join(' or ')}"
74
+ }
75
+ )
22
76
 
23
77
  self.table_name = 'Lead'
78
+
24
79
  end
25
80
  end
@@ -1,7 +1,10 @@
1
1
  module OpenStax::Salesforce::Remote
2
2
  class School < ActiveForce::SObject
3
- field :name, from: 'Name'
4
- field :is_kip, from: 'K_I_P__c', as: :boolean
3
+ field :name, from: 'Name'
4
+ field :type, from: 'Type'
5
+ field :school_location, from: 'School_Location__c'
6
+ field :is_kip, from: 'K_I_P__c', as: :boolean
7
+ field :is_child_of_kip, from: 'child_of_kip__c', as: :boolean
5
8
 
6
9
  self.table_name = 'Account'
7
10
  end
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Salesforce
3
- VERSION = '4.1.0'
3
+ VERSION = '4.5.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_salesforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Slavinsky
@@ -9,22 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-22 00:00:00.000000000 Z
12
+ date: 2020-07-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '5.0'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '7.0'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">="
26
29
  - !ruby/object:Gem::Version
27
30
  version: '5.0'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '7.0'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: restforce
30
36
  requirement: !ruby/object:Gem::Requirement
@@ -85,16 +91,16 @@ dependencies:
85
91
  name: sprockets
86
92
  requirement: !ruby/object:Gem::Requirement
87
93
  requirements:
88
- - - "<"
94
+ - - ">="
89
95
  - !ruby/object:Gem::Version
90
- version: '4.0'
96
+ version: '0'
91
97
  type: :development
92
98
  prerelease: false
93
99
  version_requirements: !ruby/object:Gem::Requirement
94
100
  requirements:
95
- - - "<"
101
+ - - ">="
96
102
  - !ruby/object:Gem::Version
97
- version: '4.0'
103
+ version: '0'
98
104
  description: Interface gem for accessing OpenStax's Salesforce instance
99
105
  email:
100
106
  - jps@kindlinglabs.com