seatsio 23.7.0 → 24.0.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/charts.rb +7 -4
- data/lib/seatsio/domain.rb +43 -23
- data/lib/seatsio/events.rb +8 -5
- 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: 4930b1db1d27358e928cc9505ce23c7087cf17f7dcfde447410d95adbd9d8ec7
|
4
|
+
data.tar.gz: 6697bab9ba71f211e932dac4c52e606cedd5c72ea32475d253bdc9658645dcd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70f297b8674903e48a297cadeb036aff12a8ceb2c473d390f2cf22f11de93c0893e6c28051c60cb3f695b150fe7b50d9c59773a9bcbf9f559196e071e4d26b5d
|
7
|
+
data.tar.gz: c89361a4618d02e15f7e6edf3eb5edca592a65bc3bc1c62c255b06a4eb1f4f313e79c1967f0bcdda6f5d2dba962958ad4b4a6e7479915a6874602782b79c55b0
|
data/Gemfile.lock
CHANGED
data/lib/seatsio/charts.rb
CHANGED
@@ -69,13 +69,11 @@ module Seatsio
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def retrieve_published_version(key)
|
72
|
-
|
73
|
-
Domain::Chart.new(response)
|
72
|
+
@http_client.get("charts/#{key}/version/published")
|
74
73
|
end
|
75
74
|
|
76
75
|
def retrieve_draft_version(key)
|
77
|
-
|
78
|
-
Domain::ChartDraft.new(response)
|
76
|
+
@http_client.get("charts/#{key}/version/draft")
|
79
77
|
end
|
80
78
|
|
81
79
|
def retrieve_draft_version_thumbnail(key)
|
@@ -94,6 +92,11 @@ module Seatsio
|
|
94
92
|
@http_client.post("charts/#{chart_key}/version/draft/actions/publish")
|
95
93
|
end
|
96
94
|
|
95
|
+
def save_social_distancing_rulesets(chart_key, rulesets)
|
96
|
+
payload = {"socialDistancingRulesets": rulesets}
|
97
|
+
@http_client.post("charts/#{chart_key}/social-distancing-rulesets", payload)
|
98
|
+
end
|
99
|
+
|
97
100
|
def list(chart_filter: nil, tag: nil, expand_events: nil, with_validation: false)
|
98
101
|
cursor = Pagination::Cursor.new(Domain::Chart, 'charts', @http_client)
|
99
102
|
cursor.set_query_param('filter', chart_filter)
|
data/lib/seatsio/domain.rb
CHANGED
@@ -4,25 +4,11 @@ module Seatsio::Domain
|
|
4
4
|
|
5
5
|
module_function
|
6
6
|
|
7
|
-
class ChartCategories
|
8
|
-
attr_accessor :list, :max_category_key
|
9
|
-
|
10
|
-
def initialize(data)
|
11
|
-
if data
|
12
|
-
@list = data['list']
|
13
|
-
@max_category_key = data['maxCategoryKey']
|
14
|
-
else
|
15
|
-
@list = []
|
16
|
-
@max_category_key = ''
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
7
|
class Chart
|
22
8
|
|
23
9
|
attr_reader :id, :key, :status, :name, :published_version_thumbnail_url,
|
24
|
-
:draft_version_thumbnail_url, :events, :tags, :archived,
|
25
|
-
:categories, :validation
|
10
|
+
:draft_version_thumbnail_url, :events, :tags, :archived,
|
11
|
+
:categories, :validation, :social_distancing_rulesets
|
26
12
|
|
27
13
|
def initialize(data)
|
28
14
|
@id = data['id']
|
@@ -34,9 +20,12 @@ module Seatsio::Domain
|
|
34
20
|
@events = Event.create_list(data['events']) if data['events']
|
35
21
|
@tags = data['tags']
|
36
22
|
@archived = data['archived']
|
37
|
-
@venue_type = data['venueType']
|
38
|
-
@categories = ChartCategories.new(data['categories'])
|
39
23
|
@validation = data['validation']
|
24
|
+
@social_distancing_rulesets = data['socialDistancingRulesets'].map {
|
25
|
+
|key, r| [key, SocialDistancingRuleset.new(r['name'], r['numberOfDisabledSeatsToTheSides'], r['disableSeatsInFrontAndBehind'],
|
26
|
+
r['numberOfDisabledAisleSeats'], r['maxGroupSize'],
|
27
|
+
r['disabledSeats'], r['enabledSeats'], r['index'])]
|
28
|
+
}.to_h
|
40
29
|
end
|
41
30
|
end
|
42
31
|
|
@@ -84,10 +73,10 @@ module Seatsio::Domain
|
|
84
73
|
|
85
74
|
def == (other)
|
86
75
|
self.key == other.key &&
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
76
|
+
self.name == other.name &&
|
77
|
+
self.color == other.color &&
|
78
|
+
self.index == other.index &&
|
79
|
+
self.objects == other.objects
|
91
80
|
end
|
92
81
|
|
93
82
|
end
|
@@ -95,7 +84,8 @@ module Seatsio::Domain
|
|
95
84
|
class Event
|
96
85
|
|
97
86
|
attr_accessor :id, :key, :chart_key, :book_whole_tables, :supports_best_available,
|
98
|
-
:table_booking_modes, :for_sale_config, :created_on, :updated_on, :channels
|
87
|
+
:table_booking_modes, :for_sale_config, :created_on, :updated_on, :channels,
|
88
|
+
:social_distancing_ruleset_key
|
99
89
|
|
100
90
|
def initialize(data)
|
101
91
|
@id = data['id']
|
@@ -110,6 +100,7 @@ module Seatsio::Domain
|
|
110
100
|
@channels = data['channels'].map {
|
111
101
|
|d| Channel.new(d['key'], d['name'], d['color'], d['index'], d['objects'])
|
112
102
|
} if data['channels']
|
103
|
+
@social_distancing_ruleset_key = data['socialDistancingRulesetKey']
|
113
104
|
end
|
114
105
|
|
115
106
|
def self.create_list(list = [])
|
@@ -476,4 +467,33 @@ module Seatsio::Domain
|
|
476
467
|
object_details
|
477
468
|
end
|
478
469
|
|
470
|
+
class SocialDistancingRuleset
|
471
|
+
attr_reader :name, :number_of_disabled_seats_to_the_sides, :disable_seats_in_front_and_behind,
|
472
|
+
:number_of_disabled_aisle_seats, :max_group_size, :disabled_seats, :enabled_seats, :index
|
473
|
+
|
474
|
+
def initialize(name, number_of_disabled_seats_to_the_sides = 0, disable_seats_in_front_and_behind = false, number_of_disabled_aisle_seats = 0,
|
475
|
+
max_group_size = 0, disabled_seats = [], enabled_seats = [], index = 0)
|
476
|
+
@name = name
|
477
|
+
@number_of_disabled_seats_to_the_sides = number_of_disabled_seats_to_the_sides
|
478
|
+
@disable_seats_in_front_and_behind = disable_seats_in_front_and_behind
|
479
|
+
@number_of_disabled_aisle_seats = number_of_disabled_aisle_seats
|
480
|
+
@max_group_size = max_group_size
|
481
|
+
@disabled_seats = disabled_seats
|
482
|
+
@enabled_seats = enabled_seats
|
483
|
+
@index = index
|
484
|
+
end
|
485
|
+
|
486
|
+
def == (other)
|
487
|
+
self.name == other.name &&
|
488
|
+
self.number_of_disabled_seats_to_the_sides == other.number_of_disabled_seats_to_the_sides &&
|
489
|
+
self.disable_seats_in_front_and_behind == other.disable_seats_in_front_and_behind &&
|
490
|
+
self.number_of_disabled_aisle_seats == other.number_of_disabled_aisle_seats &&
|
491
|
+
self.max_group_size == other.max_group_size &&
|
492
|
+
self.disabled_seats == other.disabled_seats &&
|
493
|
+
self.enabled_seats == other.enabled_seats &&
|
494
|
+
self.index == other.index
|
495
|
+
end
|
496
|
+
|
497
|
+
end
|
498
|
+
|
479
499
|
end
|
data/lib/seatsio/events.rb
CHANGED
@@ -15,8 +15,9 @@ module Seatsio
|
|
15
15
|
@http_client = ::Seatsio::HttpClient.new(secret_key, workspace_key, base_url)
|
16
16
|
end
|
17
17
|
|
18
|
-
def create(chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil)
|
19
|
-
payload = build_event_request(chart_key: chart_key, event_key: event_key, book_whole_tables: book_whole_tables,
|
18
|
+
def create(chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil, social_distancing_ruleset_key: nil)
|
19
|
+
payload = build_event_request(chart_key: chart_key, event_key: event_key, book_whole_tables: book_whole_tables,
|
20
|
+
table_booking_modes: table_booking_modes, social_distancing_ruleset_key: social_distancing_ruleset_key)
|
20
21
|
response = @http_client.post("events", payload)
|
21
22
|
Domain::Event.new(response)
|
22
23
|
end
|
@@ -27,8 +28,9 @@ module Seatsio
|
|
27
28
|
Domain::Events.new(response).events
|
28
29
|
end
|
29
30
|
|
30
|
-
def update(key:, chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil)
|
31
|
-
payload = build_event_request(chart_key: chart_key, event_key: event_key, book_whole_tables: book_whole_tables,
|
31
|
+
def update(key:, chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil, social_distancing_ruleset_key: nil)
|
32
|
+
payload = build_event_request(chart_key: chart_key, event_key: event_key, book_whole_tables: book_whole_tables,
|
33
|
+
table_booking_modes: table_booking_modes, social_distancing_ruleset_key: social_distancing_ruleset_key)
|
32
34
|
@http_client.post("/events/#{key}", payload)
|
33
35
|
end
|
34
36
|
|
@@ -159,12 +161,13 @@ module Seatsio
|
|
159
161
|
payload
|
160
162
|
end
|
161
163
|
|
162
|
-
def build_event_request(chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil)
|
164
|
+
def build_event_request(chart_key: nil, event_key: nil, book_whole_tables: nil, table_booking_modes: nil, social_distancing_ruleset_key: nil)
|
163
165
|
result = {}
|
164
166
|
result["chartKey"] = chart_key if chart_key
|
165
167
|
result["eventKey"] = event_key if event_key
|
166
168
|
result["bookWholeTables"] = book_whole_tables if book_whole_tables != nil
|
167
169
|
result["tableBookingModes"] = table_booking_modes if table_booking_modes != nil
|
170
|
+
result["socialDistancingRulesetKey"] = social_distancing_ruleset_key if social_distancing_ruleset_key != nil
|
168
171
|
result
|
169
172
|
end
|
170
173
|
|
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: 24.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: 2020-06-
|
11
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|