tessitura_rest 0.7.8 → 0.8.3

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: 8663f1d3470c294f0b842dd667e0af9821cd944ede9b5eb4121edd3a880670b7
4
- data.tar.gz: 56036d380aa39ebaa5ecb0af8409974814feea5ac1de1e0423305282d7c6392b
3
+ metadata.gz: f7180fa16baa7e12443722d75a26127004f30df244579a60d688f73ceb5465ac
4
+ data.tar.gz: 5df18feb43210fba6e53b72172df7e1ffad63eae18e62928073d24de3e154284
5
5
  SHA512:
6
- metadata.gz: dce3d83bbc1680b45f7b542f95d0c7e53688c1a129a4f257b3c1090e9e2d28811349253ae1646fb32530b946199be664ce80e8bdb090f1b85343de680e8212b9
7
- data.tar.gz: 726d05a1dea81ed5f82c35458be14b062f062c3ecf0ac97f67bf94c08a45aa7250f2266272d5bea7f7f7e6ac2a1d7cf303136ff627faa303589e625bf2987baf
6
+ metadata.gz: 393cfdb9c868f4c2df8bb4d27164303e5238e99e7610ed02c9949a744abd996c3d15463b7ec92562dcb43dd3e4ea595a3ab762231c7d735985375f8d38bf7a80
7
+ data.tar.gz: 2ccc82a0f23fcefb3ba9c978a991a2ffcaa3f2b124176cac09888d6a51ec2c394ddce4fb2833d18f604ff1decf8f214f040db881d2f4367ccb613553841aff35
@@ -31,6 +31,7 @@ class TessituraRest
31
31
  include ProductionExtension
32
32
  include ProductKeywords
33
33
  include ProductionSeason
34
+ include Registration
34
35
  include Sections
35
36
  include Session
36
37
  include SecurityUserGroups
@@ -12,6 +12,49 @@ module Constituencies
12
12
  JSON.parse(response.body)
13
13
  end
14
14
 
15
+ def create_constituent_by_snapshot(first_name, last_name, email, constituent_type, source, city, zip, state, street1, country, options={})
16
+ parameters = {
17
+ "ConstituentType": {
18
+ "Id": constituent_type,
19
+ "Inactive": false,
20
+ },
21
+ "DisplayName": "#{first_name} #{last_name}",
22
+ "FirstName": first_name,
23
+ "LastName": last_name,
24
+ "ElectronicAddress": {
25
+ "Address": email,
26
+ "ElectronicAddressType": {
27
+ "Id": 1,
28
+ },
29
+ "AllowHtmlFormat": true,
30
+ "Inactive": false,
31
+ "AllowMarketing": false,
32
+ "Months": 'YYYYYYYYYYYY',
33
+ "PrimaryIndicator": true,
34
+ },
35
+ "OriginalSource": {
36
+ "Id": source,
37
+ },
38
+ "Address": {
39
+ "AddressType": {
40
+ "Id": 3,
41
+ },
42
+ "City": city,
43
+ "PostalCode": zip,
44
+ "State": {
45
+ "Id": state,
46
+ },
47
+ "Street1": street1,
48
+ "Country": {
49
+ "Id": country,
50
+ },
51
+ }
52
+ }
53
+ options.merge!(basic_auth: @auth, headers: @headers)
54
+ options.merge!(:body => parameters)
55
+ response = self.class.post(base_api_endpoint('CRM/Constituents/Snapshot'), options)
56
+ end
57
+
15
58
  def create_constituencies(constituency, id, options={})
16
59
  parameters =
17
60
  {
@@ -26,4 +69,4 @@ module Constituencies
26
69
  options.merge!(:body => parameters)
27
70
  response = self.class.post(base_api_endpoint('CRM/Constituencies'), options)
28
71
  end
29
- end
72
+ end
@@ -5,4 +5,27 @@ module WebLogins
5
5
  response = self.class.get(base_api_endpoint("CRM/WebLogins/Search?emailAddress=#{email}&loginTypeId=#{login_type}"), options)
6
6
  JSON.parse(response.body)
7
7
  end
8
+
9
+ def create_web_login(constituent, email_id, email, login_type, primary, temporary, options={})
10
+ parameters = {
11
+ 'Constituent': {
12
+ 'Id': constituent,
13
+ },
14
+ 'Email': {
15
+ 'Id': email_id,
16
+ },
17
+ 'FailedAttempts': 3,
18
+ 'Inactive': false,
19
+ 'Login': email,
20
+ 'LoginType': {
21
+ 'Id': login_type,
22
+ },
23
+ 'PrimaryIndicator': primary,
24
+ 'TemporaryIndicator': temporary,
25
+ }
26
+ options.merge!(basic_auth: @auth, headers: @headers)
27
+ options.merge!(:body => parameters)
28
+ self.class.post(base_api_endpoint('CRM/WebLogins'), options)
29
+ end
30
+
8
31
  end
@@ -3,7 +3,8 @@ module PerformanceExtension
3
3
  def get_performances_by_production(ids, mode_of_sale=nil, options={})
4
4
  parameters =
5
5
  {
6
- 'ProductionSeasonIds': ids,
6
+ 'ProductionSeasonIds': ids,
7
+ 'BusinessUnitId': 1,
7
8
  'ModeOfSaleId': mode_of_sale
8
9
  }
9
10
  options.merge!(basic_auth: @auth, headers: @headers)
@@ -1,3 +1,3 @@
1
1
  class TessituraRest
2
- VERSION = '0.7.8'
2
+ VERSION = '0.8.3'
3
3
  end
@@ -0,0 +1,41 @@
1
+ module Registration
2
+
3
+ def register_user(session_key, address, first_name, last_name, email, password, special_offer, phone, options={})
4
+ parameters =
5
+ {
6
+ 'FirstName': first_name,
7
+ 'LastName': last_name,
8
+ 'ElectronicAddress': {
9
+ 'Address': email,
10
+ 'AllowMarketing': special_offer || 0,
11
+ },
12
+ 'WebLogin': {
13
+ 'Login': email,
14
+ 'LoginTypeId': 1,
15
+ 'Password': password
16
+ },
17
+ 'Address': {
18
+ 'AddressTypeId': 3,
19
+ 'City': address.city,
20
+ 'PostalCode': address.postal_code,
21
+ 'StateId': address.state,
22
+ 'Street1': address.street1,
23
+ 'Street2': address.street2,
24
+ 'CountryId': address.country
25
+ },
26
+ 'ConstituentTypeId': 1,
27
+ 'OriginalSourceId': 3,
28
+ 'Phones':
29
+ [
30
+ {
31
+ 'PhoneNumber': phone,
32
+ 'PhoneTypeId': 1
33
+ },
34
+ ],
35
+ }
36
+ options.merge!(basic_auth: @auth, headers: @headers)
37
+ options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
38
+ self.class.post(base_api_endpoint("Web/Registration/#{session_key}/Register"), options)
39
+ end
40
+
41
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tessitura_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.8
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brittany Martin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-01 00:00:00.000000000 Z
11
+ date: 2020-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -161,6 +161,7 @@ files:
161
161
  - lib/tessitura_rest/web/cart.rb
162
162
  - lib/tessitura_rest/web/login.rb
163
163
  - lib/tessitura_rest/web/payment_plan_extension.rb
164
+ - lib/tessitura_rest/web/registration.rb
164
165
  - lib/tessitura_rest/web/session.rb
165
166
  - tessitura_rest.gemspec
166
167
  homepage: https://github.com/pgharts/tessitura