seatsio 46.2.0 → 46.3.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/seatsio/domain.rb +18 -6
- data/lib/seatsio/events.rb +14 -3
- data/lib/seatsio/seasons.rb +13 -3
- data/lib/seatsio/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f6fa92abd664442b48a8e1285facba65545f36ef713e2b41882e24bd5abfbe7
|
4
|
+
data.tar.gz: 3c22e0d584aea9f01382a0c453e84a988c7739057c8c6ecaa731f6b00ec30490
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 262525f75f50deab1e8d170734dd2232b82a3399637cf2db93b576c62a8b67755828f2998defc40c9b678e3399ffca9f979cf571cc1c209118f2036735fe6f4b
|
7
|
+
data.tar.gz: 4d1e8e4ec37ec95741deed0855625d7833df394315e2896dc592ec54e4af4a19674273e7dbaabea5b1dd035c1561182fed1b3a8b12812574558aca815df679ae
|
data/Gemfile.lock
CHANGED
data/lib/seatsio/domain.rb
CHANGED
@@ -46,14 +46,26 @@ module Seatsio
|
|
46
46
|
|
47
47
|
attr_reader :for_sale, :objects, :area_places, :categories
|
48
48
|
|
49
|
-
def initialize(
|
49
|
+
def initialize(for_sale, objects = nil, area_places = nil, categories = nil)
|
50
|
+
@for_sale = for_sale
|
51
|
+
@objects = objects
|
52
|
+
@area_places = area_places
|
53
|
+
@categories = categories
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.from_json(data)
|
50
57
|
if data
|
51
|
-
|
52
|
-
@objects = data['objects']
|
53
|
-
@area_places = data['areaPlaces']
|
54
|
-
@categories = data['categories']
|
58
|
+
ForSaleConfig.new(data['forSale'], data['objects'], data['areaPlaces'], data['categories'])
|
55
59
|
end
|
56
60
|
end
|
61
|
+
|
62
|
+
def == (other)
|
63
|
+
other != nil &&
|
64
|
+
for_sale == other.for_sale &&
|
65
|
+
objects == other.objects &&
|
66
|
+
area_places == other.area_places &&
|
67
|
+
categories == other.categories
|
68
|
+
end
|
57
69
|
end
|
58
70
|
|
59
71
|
class Category
|
@@ -160,7 +172,7 @@ module Seatsio
|
|
160
172
|
@date = Date.iso8601(data['date']) if data['date']
|
161
173
|
@supports_best_available = data['supportsBestAvailable']
|
162
174
|
@table_booking_config = TableBookingConfig::from_json(data['tableBookingConfig'])
|
163
|
-
@for_sale_config = ForSaleConfig
|
175
|
+
@for_sale_config = ForSaleConfig::from_json(data['forSaleConfig']) if data['forSaleConfig']
|
164
176
|
@created_on = parse_date(data['createdOn'])
|
165
177
|
@updated_on = parse_date(data['updatedOn'])
|
166
178
|
@channels = data['channels'].map {
|
data/lib/seatsio/events.rb
CHANGED
@@ -18,8 +18,8 @@ module Seatsio
|
|
18
18
|
@channels = ChannelsClient.new(@http_client)
|
19
19
|
end
|
20
20
|
|
21
|
-
def create(chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil, object_categories: nil, categories: nil, channels: nil)
|
22
|
-
payload = build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: channels, is_in_the_past: nil)
|
21
|
+
def create(chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil, object_categories: nil, categories: nil, channels: nil, for_sale_config: nil)
|
22
|
+
payload = build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: channels, is_in_the_past: nil, for_sale_config: for_sale_config)
|
23
23
|
response = @http_client.post("events", payload)
|
24
24
|
Event.new(response)
|
25
25
|
end
|
@@ -159,7 +159,7 @@ module Seatsio
|
|
159
159
|
payload
|
160
160
|
end
|
161
161
|
|
162
|
-
def build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: nil, is_in_the_past: nil)
|
162
|
+
def build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: nil, is_in_the_past: nil, for_sale_config: nil)
|
163
163
|
result = {}
|
164
164
|
result["chartKey"] = chart_key if chart_key
|
165
165
|
result["eventKey"] = event_key if event_key
|
@@ -170,6 +170,7 @@ module Seatsio
|
|
170
170
|
result["categories"] = categories_to_request(categories) if categories != nil
|
171
171
|
result["channels"] = ChannelsClient::channels_to_request(channels) if channels != nil
|
172
172
|
result["isInThePast"] = is_in_the_past if is_in_the_past != nil
|
173
|
+
result["forSaleConfig"] = for_sale_config_to_request(for_sale_config) if for_sale_config != nil
|
173
174
|
result
|
174
175
|
end
|
175
176
|
|
@@ -191,6 +192,7 @@ module Seatsio
|
|
191
192
|
r["objectCategories"] = param[:object_categories] if param[:object_categories] != nil
|
192
193
|
r["categories"] = categories_to_request(param[:categories]) if param[:categories] != nil
|
193
194
|
r["channels"] = ChannelsClient::channels_to_request(param[:channels]) if param[:channels] != nil
|
195
|
+
r["forSaleConfig"] = for_sale_config_to_request(param[:for_sale_config]) if param[:for_sale_config] != nil
|
194
196
|
result.push(r)
|
195
197
|
end
|
196
198
|
result
|
@@ -216,5 +218,14 @@ module Seatsio
|
|
216
218
|
result
|
217
219
|
end
|
218
220
|
|
221
|
+
def for_sale_config_to_request(for_sale_config)
|
222
|
+
result = {}
|
223
|
+
result["forSale"] = for_sale_config.for_sale
|
224
|
+
result["objects"] = for_sale_config.objects if for_sale_config.objects != nil
|
225
|
+
result["areaPlaces"] = for_sale_config.area_places if for_sale_config.area_places != nil
|
226
|
+
result["categories"] = for_sale_config.categories if for_sale_config.categories != nil
|
227
|
+
result
|
228
|
+
end
|
229
|
+
|
219
230
|
end
|
220
231
|
end
|
data/lib/seatsio/seasons.rb
CHANGED
@@ -14,8 +14,8 @@ module Seatsio
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def create(chart_key:, key: nil, number_of_events: nil, event_keys: nil,
|
17
|
-
table_booking_config: nil, channels: nil)
|
18
|
-
request = build_create_season_request(chart_key, key, number_of_events, event_keys, table_booking_config, channels)
|
17
|
+
table_booking_config: nil, channels: nil, for_sale_config: nil)
|
18
|
+
request = build_create_season_request(chart_key, key, number_of_events, event_keys, table_booking_config, channels, for_sale_config)
|
19
19
|
response = @http_client.post('seasons', request)
|
20
20
|
Season.new(response)
|
21
21
|
end
|
@@ -54,7 +54,7 @@ module Seatsio
|
|
54
54
|
|
55
55
|
private
|
56
56
|
|
57
|
-
def build_create_season_request(chart_key, key, number_of_events, event_keys, table_booking_config, channels)
|
57
|
+
def build_create_season_request(chart_key, key, number_of_events, event_keys, table_booking_config, channels, for_sale_config)
|
58
58
|
request = {}
|
59
59
|
request['chartKey'] = chart_key if chart_key
|
60
60
|
request['key'] = key if key
|
@@ -62,6 +62,7 @@ module Seatsio
|
|
62
62
|
request['eventKeys'] = event_keys if event_keys
|
63
63
|
request['tableBookingConfig'] = table_booking_config_to_request(table_booking_config) if table_booking_config != nil
|
64
64
|
request['channels'] = ChannelsClient::channels_to_request(channels) if channels != nil
|
65
|
+
request['forSaleConfig'] = for_sale_config_to_request(for_sale_config) if for_sale_config != nil
|
65
66
|
request
|
66
67
|
end
|
67
68
|
|
@@ -72,5 +73,14 @@ module Seatsio
|
|
72
73
|
request
|
73
74
|
end
|
74
75
|
|
76
|
+
def for_sale_config_to_request(for_sale_config)
|
77
|
+
result = {}
|
78
|
+
result["forSale"] = for_sale_config.for_sale
|
79
|
+
result["objects"] = for_sale_config.objects if for_sale_config.objects != nil
|
80
|
+
result["areaPlaces"] = for_sale_config.area_places if for_sale_config.area_places != nil
|
81
|
+
result["categories"] = for_sale_config.categories if for_sale_config.categories != nil
|
82
|
+
result
|
83
|
+
end
|
84
|
+
|
75
85
|
end
|
76
86
|
end
|
data/lib/seatsio/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seatsio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 46.
|
4
|
+
version: 46.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seats.io
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|