seatsio 44.2.0 → 45.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/seatsio/charts.rb +0 -5
- data/lib/seatsio/domain.rb +4 -84
- data/lib/seatsio/events/change_object_status_request.rb +1 -2
- data/lib/seatsio/events.rb +9 -13
- data/lib/seatsio/seasons.rb +3 -4
- 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: bdd4179789ae397639cc2adeb699ef08bba663c37fad94fd5f7b548288a903f0
|
4
|
+
data.tar.gz: 2bb0b732ffc21d52031c58888433f5378c97c9c86b70753c66b9edc88a0255e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d15e85bef5d066ed46bc0b78e89eea0111ad1d2a9f8b07db6c294b3cd6a4c78cf0423b47e70b780319499d99d027052408a82f4d2586c44decb1ddd53c8462a5
|
7
|
+
data.tar.gz: 65c45a2ffd2260d5ddc72152c43e97acfc1c62fa927d96d66aed92a98072318d7df8ba9d33ad559af5f334e8856c2c0db46b7e4036e3299dc13eb37cdef77ee3
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
seatsio (
|
4
|
+
seatsio (45.0.0)
|
5
5
|
rest-client (~> 2.0, >= 2.0.2)
|
6
6
|
|
7
7
|
GEM
|
@@ -20,7 +20,7 @@ GEM
|
|
20
20
|
mime-types (3.3.1)
|
21
21
|
mime-types-data (~> 3.2015)
|
22
22
|
mime-types-data (3.2021.0225)
|
23
|
-
minitest (5.18.
|
23
|
+
minitest (5.18.1)
|
24
24
|
minitest-parallel_fork (1.3.0)
|
25
25
|
minitest (>= 5.15.0)
|
26
26
|
netrc (0.11.0)
|
data/lib/seatsio/charts.rb
CHANGED
@@ -105,11 +105,6 @@ module Seatsio
|
|
105
105
|
@http_client.post("charts/#{chart_key}/version/draft/actions/publish")
|
106
106
|
end
|
107
107
|
|
108
|
-
def save_social_distancing_rulesets(chart_key, rulesets)
|
109
|
-
payload = {"socialDistancingRulesets": rulesets}
|
110
|
-
@http_client.post("charts/#{chart_key}/social-distancing-rulesets", payload)
|
111
|
-
end
|
112
|
-
|
113
108
|
def list(chart_filter: nil, tag: nil, expand_events: nil, with_validation: false)
|
114
109
|
cursor = Pagination::Cursor.new(Chart, 'charts', @http_client)
|
115
110
|
cursor.set_query_param('filter', chart_filter)
|
data/lib/seatsio/domain.rb
CHANGED
@@ -8,7 +8,7 @@ module Seatsio
|
|
8
8
|
|
9
9
|
attr_reader :id, :key, :status, :name, :published_version_thumbnail_url,
|
10
10
|
:draft_version_thumbnail_url, :events, :tags, :archived,
|
11
|
-
:categories, :validation
|
11
|
+
:categories, :validation
|
12
12
|
|
13
13
|
def initialize(data)
|
14
14
|
@id = data['id']
|
@@ -21,21 +21,6 @@ module Seatsio
|
|
21
21
|
@tags = data['tags']
|
22
22
|
@archived = data['archived']
|
23
23
|
@validation = data['validation']
|
24
|
-
@social_distancing_rulesets = data['socialDistancingRulesets'].map {
|
25
|
-
|key, r| [key, SocialDistancingRuleset.new(r['name'],
|
26
|
-
number_of_disabled_seats_to_the_sides: r['numberOfDisabledSeatsToTheSides'],
|
27
|
-
disable_seats_in_front_and_behind: r['disableSeatsInFrontAndBehind'],
|
28
|
-
disable_diagonal_seats_in_front_and_behind: r['disableDiagonalSeatsInFrontAndBehind'],
|
29
|
-
number_of_disabled_aisle_seats: r['numberOfDisabledAisleSeats'],
|
30
|
-
max_group_size: r['maxGroupSize'],
|
31
|
-
max_occupancy_absolute: r['maxOccupancyAbsolute'],
|
32
|
-
max_occupancy_percentage: r['maxOccupancyPercentage'],
|
33
|
-
one_group_per_table: r['oneGroupPerTable'],
|
34
|
-
fixed_group_layout: r['fixedGroupLayout'],
|
35
|
-
disabled_seats: r['disabledSeats'],
|
36
|
-
enabled_seats: r['enabledSeats'],
|
37
|
-
index: r['index'])]
|
38
|
-
}.to_h
|
39
24
|
end
|
40
25
|
end
|
41
26
|
|
@@ -163,9 +148,9 @@ module Seatsio
|
|
163
148
|
|
164
149
|
attr_accessor :id, :key, :chart_key, :name, :date, :supports_best_available,
|
165
150
|
:table_booking_config, :for_sale_config, :created_on, :updated_on, :channels,
|
166
|
-
:
|
151
|
+
:is_top_level_season, :is_partial_season,
|
167
152
|
:is_event_in_season, :top_level_season_key,
|
168
|
-
:
|
153
|
+
:object_categories, :categories
|
169
154
|
|
170
155
|
def initialize(data)
|
171
156
|
@id = data['id']
|
@@ -181,7 +166,6 @@ module Seatsio
|
|
181
166
|
@channels = data['channels'].map {
|
182
167
|
|d| Channel.new(d['key'], d['name'], d['color'], d['index'], d['objects'])
|
183
168
|
} if data['channels']
|
184
|
-
@social_distancing_ruleset_key = data['socialDistancingRulesetKey']
|
185
169
|
@is_top_level_season = data['isTopLevelSeason']
|
186
170
|
@is_partial_season = data['isPartialSeason']
|
187
171
|
@is_event_in_season = data['isEventInSeason']
|
@@ -393,7 +377,7 @@ module Seatsio
|
|
393
377
|
:category_key, :entrance, :object_type, :hold_token, :category_label,
|
394
378
|
:ticket_type, :num_booked, :num_free, :num_held, :for_sale, :section,
|
395
379
|
:is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
|
396
|
-
:left_neighbour, :right_neighbour, :is_available, :
|
380
|
+
:left_neighbour, :right_neighbour, :is_available, :channel,
|
397
381
|
:book_as_a_whole, :distance_to_focal_point, :holds, :num_seats
|
398
382
|
|
399
383
|
def initialize(data)
|
@@ -422,7 +406,6 @@ module Seatsio
|
|
422
406
|
@left_neighbour = data['leftNeighbour']
|
423
407
|
@right_neighbour = data['rightNeighbour']
|
424
408
|
@is_available = data['isAvailable']
|
425
|
-
@is_disabled_by_social_distancing = data['isDisabledBySocialDistancing']
|
426
409
|
@channel = data['channel']
|
427
410
|
@book_as_a_whole = data['bookAsAWhole']
|
428
411
|
@distance_to_focal_point = data['distanceToFocalPoint']
|
@@ -580,67 +563,4 @@ module Seatsio
|
|
580
563
|
end
|
581
564
|
object_details
|
582
565
|
end
|
583
|
-
|
584
|
-
class SocialDistancingRuleset
|
585
|
-
attr_reader :name, :number_of_disabled_seats_to_the_sides, :disable_seats_in_front_and_behind,
|
586
|
-
:disable_diagonal_seats_in_front_and_behind, :number_of_disabled_aisle_seats, :max_group_size, :max_occupancy_absolute,
|
587
|
-
:max_occupancy_percentage, :one_group_per_table, :fixed_group_layout, :disabled_seats, :enabled_seats, :index
|
588
|
-
|
589
|
-
def initialize(name, number_of_disabled_seats_to_the_sides: 0, disable_seats_in_front_and_behind: false, disable_diagonal_seats_in_front_and_behind: false,
|
590
|
-
number_of_disabled_aisle_seats: 0, max_group_size: 0, max_occupancy_absolute: 0, max_occupancy_percentage: 0, one_group_per_table: false,
|
591
|
-
fixed_group_layout: false, disabled_seats: [], enabled_seats: [], index: 0)
|
592
|
-
@name = name
|
593
|
-
@number_of_disabled_seats_to_the_sides = number_of_disabled_seats_to_the_sides
|
594
|
-
@disable_seats_in_front_and_behind = disable_seats_in_front_and_behind
|
595
|
-
@disable_diagonal_seats_in_front_and_behind = disable_diagonal_seats_in_front_and_behind
|
596
|
-
@number_of_disabled_aisle_seats = number_of_disabled_aisle_seats
|
597
|
-
@max_group_size = max_group_size
|
598
|
-
@max_occupancy_absolute = max_occupancy_absolute
|
599
|
-
@max_occupancy_percentage = max_occupancy_percentage
|
600
|
-
@one_group_per_table = one_group_per_table
|
601
|
-
@fixed_group_layout = fixed_group_layout
|
602
|
-
@disabled_seats = disabled_seats
|
603
|
-
@enabled_seats = enabled_seats
|
604
|
-
@index = index
|
605
|
-
end
|
606
|
-
|
607
|
-
def self.fixed(name, disabled_seats: [], index: 0)
|
608
|
-
SocialDistancingRuleset.new(name, index: index, disabled_seats: disabled_seats, fixed_group_layout: true)
|
609
|
-
end
|
610
|
-
|
611
|
-
def self.rule_based(name, number_of_disabled_seats_to_the_sides: 0, disable_seats_in_front_and_behind: false, disable_diagonal_seats_in_front_and_behind: false,
|
612
|
-
number_of_disabled_aisle_seats: 0, max_group_size: 0, max_occupancy_absolute: 0, max_occupancy_percentage: 0, one_group_per_table: false,
|
613
|
-
disabled_seats: [], enabled_seats: [], index: 0)
|
614
|
-
SocialDistancingRuleset.new(name,
|
615
|
-
number_of_disabled_seats_to_the_sides: number_of_disabled_seats_to_the_sides,
|
616
|
-
disable_seats_in_front_and_behind: disable_seats_in_front_and_behind,
|
617
|
-
disable_diagonal_seats_in_front_and_behind: disable_diagonal_seats_in_front_and_behind,
|
618
|
-
number_of_disabled_aisle_seats: number_of_disabled_aisle_seats,
|
619
|
-
max_group_size: max_group_size,
|
620
|
-
max_occupancy_absolute: max_occupancy_absolute,
|
621
|
-
max_occupancy_percentage: max_occupancy_percentage,
|
622
|
-
one_group_per_table: one_group_per_table,
|
623
|
-
fixed_group_layout: false,
|
624
|
-
disabled_seats: disabled_seats,
|
625
|
-
enabled_seats: enabled_seats,
|
626
|
-
index: index)
|
627
|
-
end
|
628
|
-
|
629
|
-
def == (other)
|
630
|
-
name == other.name &&
|
631
|
-
number_of_disabled_seats_to_the_sides == other.number_of_disabled_seats_to_the_sides &&
|
632
|
-
disable_seats_in_front_and_behind == other.disable_seats_in_front_and_behind &&
|
633
|
-
disable_diagonal_seats_in_front_and_behind == other.disable_diagonal_seats_in_front_and_behind &&
|
634
|
-
number_of_disabled_aisle_seats == other.number_of_disabled_aisle_seats &&
|
635
|
-
max_group_size == other.max_group_size &&
|
636
|
-
max_occupancy_absolute == other.max_occupancy_absolute &&
|
637
|
-
max_occupancy_percentage == other.max_occupancy_percentage &&
|
638
|
-
one_group_per_table == other.one_group_per_table &&
|
639
|
-
fixed_group_layout == other.fixed_group_layout &&
|
640
|
-
disabled_seats == other.disabled_seats &&
|
641
|
-
enabled_seats == other.enabled_seats &&
|
642
|
-
index == other.index
|
643
|
-
end
|
644
|
-
end
|
645
|
-
|
646
566
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
def create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys,
|
1
|
+
def create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, allowed_previous_statuses, rejected_previous_statuses)
|
2
2
|
result = {}
|
3
3
|
result[:objects] = normalize(object_or_objects)
|
4
4
|
result[:status] = status
|
@@ -12,7 +12,6 @@ def create_change_object_status_request(object_or_objects, status, hold_token, o
|
|
12
12
|
result[:keepExtraData] = keep_extra_data if keep_extra_data != nil
|
13
13
|
result[:ignoreChannels] = ignore_channels if ignore_channels != nil
|
14
14
|
result[:channelKeys] = channel_keys if channel_keys != nil
|
15
|
-
result[:ignoreSocialDistancing] = ignore_social_distancing if ignore_social_distancing != nil
|
16
15
|
result[:allowedPreviousStatuses] = allowed_previous_statuses if allowed_previous_statuses != nil
|
17
16
|
result[:rejectedPreviousStatuses] = rejected_previous_statuses if rejected_previous_statuses != nil
|
18
17
|
result
|
data/lib/seatsio/events.rb
CHANGED
@@ -18,11 +18,10 @@ 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,
|
21
|
+
def create(chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil, object_categories: nil, categories: nil)
|
22
22
|
payload = build_event_request(chart_key: chart_key, event_key: event_key,
|
23
23
|
name: name, date: date,
|
24
24
|
table_booking_config: table_booking_config,
|
25
|
-
social_distancing_ruleset_key: social_distancing_ruleset_key,
|
26
25
|
object_categories: object_categories, categories: categories)
|
27
26
|
response = @http_client.post("events", payload)
|
28
27
|
Event.new(response)
|
@@ -34,14 +33,13 @@ module Seatsio
|
|
34
33
|
Events.new(response).events
|
35
34
|
end
|
36
35
|
|
37
|
-
def update(key:, chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil,
|
36
|
+
def update(key:, chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil, object_categories: nil, categories: nil)
|
38
37
|
payload = build_event_request(
|
39
38
|
chart_key: chart_key,
|
40
39
|
event_key: event_key,
|
41
40
|
name: name,
|
42
41
|
date: date,
|
43
42
|
table_booking_config: table_booking_config,
|
44
|
-
social_distancing_ruleset_key: social_distancing_ruleset_key,
|
45
43
|
object_categories: object_categories,
|
46
44
|
categories: categories)
|
47
45
|
@http_client.post("/events/#{key}", payload)
|
@@ -72,12 +70,12 @@ module Seatsio
|
|
72
70
|
response
|
73
71
|
end
|
74
72
|
|
75
|
-
def book(event_key_or_keys, object_or_objects, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil
|
76
|
-
self.change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::BOOKED, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys
|
73
|
+
def book(event_key_or_keys, object_or_objects, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil)
|
74
|
+
self.change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::BOOKED, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
77
75
|
end
|
78
76
|
|
79
|
-
def change_object_status(event_key_or_keys, object_or_objects, status, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil,
|
80
|
-
request = create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys,
|
77
|
+
def change_object_status(event_key_or_keys, object_or_objects, status, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, allowed_previous_statuses: nil, rejected_previous_statuses: nil)
|
78
|
+
request = create_change_object_status_request(object_or_objects, status, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, allowed_previous_statuses, rejected_previous_statuses)
|
81
79
|
request[:params] = {
|
82
80
|
:expand => 'objects'
|
83
81
|
}
|
@@ -94,8 +92,8 @@ module Seatsio
|
|
94
92
|
ChangeObjectStatusInBatchResult.new(response).results
|
95
93
|
end
|
96
94
|
|
97
|
-
def hold(event_key_or_keys, object_or_objects, hold_token, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil
|
98
|
-
change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::HELD, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys
|
95
|
+
def hold(event_key_or_keys, object_or_objects, hold_token, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil)
|
96
|
+
change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::HELD, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
99
97
|
end
|
100
98
|
|
101
99
|
def change_best_available_object_status(key, number, status, categories: nil, hold_token: nil, extra_data: nil, ticket_types: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil, try_to_prevent_orphan_seats: nil)
|
@@ -171,14 +169,13 @@ module Seatsio
|
|
171
169
|
payload
|
172
170
|
end
|
173
171
|
|
174
|
-
def build_event_request(chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil,
|
172
|
+
def build_event_request(chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil, object_categories: nil, categories: nil)
|
175
173
|
result = {}
|
176
174
|
result["chartKey"] = chart_key if chart_key
|
177
175
|
result["eventKey"] = event_key if event_key
|
178
176
|
result["name"] = name if name
|
179
177
|
result["date"] = date.iso8601 if date
|
180
178
|
result["tableBookingConfig"] = table_booking_config_to_request(table_booking_config) if table_booking_config != nil
|
181
|
-
result["socialDistancingRulesetKey"] = social_distancing_ruleset_key if social_distancing_ruleset_key != nil
|
182
179
|
result["objectCategories"] = object_categories if object_categories != nil
|
183
180
|
result["categories"] = categories_to_request(categories) if categories != nil
|
184
181
|
result
|
@@ -199,7 +196,6 @@ module Seatsio
|
|
199
196
|
r["name"] = param[:name] if param[:name]
|
200
197
|
r["date"] = param[:date].iso8601 if param[:date]
|
201
198
|
r["tableBookingConfig"] = table_booking_config_to_request(param[:table_booking_config]) if param[:table_booking_config] != nil
|
202
|
-
r["socialDistancingRulesetKey"] = param[:social_distancing_ruleset_key] if param[:social_distancing_ruleset_key] != nil
|
203
199
|
r["objectCategories"] = param[:object_categories] if param[:object_categories] != nil
|
204
200
|
r["categories"] = categories_to_request(param[:categories]) if param[:categories] != nil
|
205
201
|
result.push(r)
|
data/lib/seatsio/seasons.rb
CHANGED
@@ -14,9 +14,9 @@ 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
|
17
|
+
table_booking_config: nil)
|
18
18
|
request = build_create_season_request(chart_key: chart_key, key: key, number_of_events: number_of_events, event_keys: event_keys,
|
19
|
-
table_booking_config: table_booking_config
|
19
|
+
table_booking_config: table_booking_config)
|
20
20
|
response = @http_client.post('seasons', request)
|
21
21
|
Season.new(response)
|
22
22
|
end
|
@@ -55,14 +55,13 @@ module Seatsio
|
|
55
55
|
|
56
56
|
private
|
57
57
|
|
58
|
-
def build_create_season_request(chart_key: nil, key: nil, number_of_events: nil, event_keys: nil, table_booking_config: nil
|
58
|
+
def build_create_season_request(chart_key: nil, key: nil, number_of_events: nil, event_keys: nil, table_booking_config: nil)
|
59
59
|
request = {}
|
60
60
|
request['chartKey'] = chart_key if chart_key
|
61
61
|
request['key'] = key if key
|
62
62
|
request['numberOfEvents'] = number_of_events if number_of_events
|
63
63
|
request['eventKeys'] = event_keys if event_keys
|
64
64
|
request['tableBookingConfig'] = table_booking_config_to_request(table_booking_config) if table_booking_config != nil
|
65
|
-
request['socialDistancingRulesetKey'] = social_distancing_ruleset_key if social_distancing_ruleset_key != nil
|
66
65
|
request
|
67
66
|
end
|
68
67
|
|
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:
|
4
|
+
version: 45.0.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-
|
11
|
+
date: 2023-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|