openstax_salesforce 4.0.1 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2665308e1bce27de1a593985b20e5be9b417ce167f84c3ffb90c168de9a3ac04
4
- data.tar.gz: 74b24e8befe93000a02c04ba865cfb1d450219eca3f7ea9cd2926d6f45b5af7a
3
+ metadata.gz: 6ba4e35d61a819c20259b20c4bd44e8c42119829b4a135fa224845f245e5ca78
4
+ data.tar.gz: 0e9c7c564ad757de906c155edf2d6d1bd7ae1556ca4d51af57290a0c882d43d8
5
5
  SHA512:
6
- metadata.gz: 103644330f45ab5cf55372e10a9e44709a2c190e8c124cceefff0573491aafe3c25785a7d37ebda5a939ced4bcb9d15d3f3d1cefd75034c07f930eb446a34627
7
- data.tar.gz: 87c623d6b32dc1fd15010b6dbe71d08b405e861f1909373b11bfebf40f67e2aa6a75275023691ab54b7ff5fb3bc823d5ccd2f19f1b45ce58d91865ec92b64936
6
+ metadata.gz: 364073054ce088aed49d68977e87e2ff8d4ac472fd40aec7e3e6f461787d6c0e71833f563f70922c16ec4e2996c7910552e4990be2b0da1f8115bfa20cbeaf8e
7
+ data.tar.gz: 13a48b27994287246b87c0099e3cfb404b1c4b7e7fed803d79484e349d3470ce6bf01c15af7578100717135b8f3707714195fd93eb2b2e9301b5dcd98800be1b
@@ -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,19 @@
1
1
  module OpenStax::Salesforce::Remote
2
2
  class Lead < ActiveForce::SObject
3
+
4
+ VALID_VERIFICATION_STATUSES = %w[pending_faculty confirmed_faculty rejected_faculty].freeze
5
+ VALID_ROLES = %w[
6
+ student
7
+ faculty
8
+ other
9
+ administrator
10
+ librarian
11
+ adjunct\ faculty
12
+ instructional\ designer
13
+ home\ school\ teacher
14
+ ].freeze
15
+ VALID_WHO_CHOOSES_BOOKS = %w[instructor committee coordinator].freeze
16
+
3
17
  field :name, from: "Name"
4
18
  field :first_name, from: "FirstName"
5
19
  field :last_name, from: "LastName"
@@ -19,7 +33,38 @@ module OpenStax::Salesforce::Remote
19
33
  field :accounts_uuid, from: "accounts_uuid_c__c"
20
34
  field :application_source, from: "Application_Source__c"
21
35
  field :role, from: "Role__c"
36
+ field :who_chooses_books, from: "who_chooses_books__c"
37
+ field :verification_status, from: "FV_Status__c"
38
+ field :finalize_educator_signup, from: "FV_Final__c", as: :boolean
39
+
40
+ validates(
41
+ :role,
42
+ allow_blank: true,
43
+ inclusion: {
44
+ in: VALID_ROLES,
45
+ message: "must be either #{VALID_ROLES.join(' or ')}"
46
+ }
47
+ )
48
+
49
+ validates(
50
+ :verification_status,
51
+ allow_blank: true,
52
+ inclusion: {
53
+ in: VALID_VERIFICATION_STATUSES,
54
+ message: "must be either #{VALID_VERIFICATION_STATUSES.join(' or ')}"
55
+ }
56
+ )
57
+
58
+ validates(
59
+ :who_chooses_books,
60
+ allow_blank: true,
61
+ inclusion: {
62
+ in: VALID_WHO_CHOOSES_BOOKS,
63
+ message: "must be either #{VALID_WHO_CHOOSES_BOOKS.join(' or ')}"
64
+ }
65
+ )
22
66
 
23
67
  self.table_name = 'Lead'
68
+
24
69
  end
25
70
  end
@@ -1,6 +1,10 @@
1
1
  module OpenStax::Salesforce::Remote
2
2
  class School < ActiveForce::SObject
3
- field :name, from: "Name"
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
4
8
 
5
9
  self.table_name = 'Account'
6
10
  end
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Salesforce
3
- VERSION = '4.0.1'
3
+ VERSION = '4.5.0'
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.0.1
4
+ version: 4.5.0
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: 2019-12-04 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
@@ -143,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
149
  - !ruby/object:Gem::Version
144
150
  version: '0'
145
151
  requirements: []
146
- rubygems_version: 3.0.4
152
+ rubygems_version: 3.0.3
147
153
  signing_key:
148
154
  specification_version: 4
149
155
  summary: Interface gem for accessing OpenStax's Salesforce instance