seatsio 25.1.0 → 26.2.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/chart_reports.rb +9 -8
- data/lib/seatsio/domain.rb +27 -4
- data/lib/seatsio/event_reports.rb +8 -0
- data/lib/seatsio/events.rb +6 -6
- data/lib/seatsio/events/change_best_available_object_status_request.rb +2 -1
- 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: a271b58be4efc9c27a4604733e1a7951b0f72b65d206c980c36f2d932be2baea
|
4
|
+
data.tar.gz: 9b3decce98eb7a0459063592a5428e9395296c3fad72e5e7e625bd97498b0886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e09498be7a8d43d228f3d7fbc5c7d77bc06a84510f29b9bc86f1c354132d2400772d3993e76c29ecec87ad2b72006f5274d0f2cfc3f0f75e740b8a2297441f76
|
7
|
+
data.tar.gz: c8c0cc4143ab7311932a5b5d8990285bbc33c552e05e928d6bb3cee2852764299c16348fae068817988ce07c9f7595ca559e784820a33bebdbbf388e30ee115a
|
data/Gemfile.lock
CHANGED
@@ -10,23 +10,24 @@ module Seatsio
|
|
10
10
|
@http_client = ::Seatsio::HttpClient.new(secret_key, workspace_key, base_url)
|
11
11
|
end
|
12
12
|
|
13
|
-
def by_label(chart_key)
|
14
|
-
get_chart_report('byLabel', chart_key)
|
13
|
+
def by_label(chart_key, book_whole_tables = nil)
|
14
|
+
get_chart_report('byLabel', chart_key, book_whole_tables)
|
15
15
|
end
|
16
16
|
|
17
|
-
def by_category_key(chart_key)
|
18
|
-
get_chart_report('byCategoryKey', chart_key)
|
17
|
+
def by_category_key(chart_key, book_whole_tables = nil)
|
18
|
+
get_chart_report('byCategoryKey', chart_key, book_whole_tables)
|
19
19
|
end
|
20
20
|
|
21
|
-
def by_category_label(chart_key)
|
22
|
-
get_chart_report('byCategoryLabel', chart_key)
|
21
|
+
def by_category_label(chart_key, book_whole_tables = nil)
|
22
|
+
get_chart_report('byCategoryLabel', chart_key, book_whole_tables)
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
26
26
|
|
27
|
-
def get_chart_report(report_type, chart_key)
|
27
|
+
def get_chart_report(report_type, chart_key, book_whole_tables)
|
28
|
+
params = book_whole_tables.nil? ? {} : { bookWholeTables: book_whole_tables }
|
28
29
|
url = "reports/charts/#{chart_key}/#{report_type}"
|
29
|
-
body = @http_client.get(url)
|
30
|
+
body = @http_client.get(url, params)
|
30
31
|
Domain::ChartReport.new(body)
|
31
32
|
end
|
32
33
|
end
|
data/lib/seatsio/domain.rb
CHANGED
@@ -24,6 +24,7 @@ module Seatsio::Domain
|
|
24
24
|
@social_distancing_rulesets = data['socialDistancingRulesets'].map {
|
25
25
|
|key, r| [key, SocialDistancingRuleset.new(r['name'], r['numberOfDisabledSeatsToTheSides'], r['disableSeatsInFrontAndBehind'],
|
26
26
|
r['numberOfDisabledAisleSeats'], r['maxGroupSize'],
|
27
|
+
r['maxOccupancyAbsolute'], r['maxOccupancyPercentage'], r['oneGroupPerTable'], r['fixedGroupLayout'],
|
27
28
|
r['disabledSeats'], r['enabledSeats'], r['index'])]
|
28
29
|
}.to_h
|
29
30
|
end
|
@@ -286,7 +287,7 @@ module Seatsio::Domain
|
|
286
287
|
:category_key, :entrance, :object_type, :hold_token, :category_label,
|
287
288
|
:ticket_type, :num_booked, :num_free, :num_held, :for_sale, :section,
|
288
289
|
:is_accessible, :is_companion_seat, :has_restricted_view, :displayed_object_type,
|
289
|
-
:left_neighbour, :right_neighbour, :is_selectable, :is_disabled_by_social_distancing
|
290
|
+
:left_neighbour, :right_neighbour, :is_selectable, :is_disabled_by_social_distancing, :channel
|
290
291
|
|
291
292
|
def initialize(data)
|
292
293
|
@status = data['status']
|
@@ -314,6 +315,7 @@ module Seatsio::Domain
|
|
314
315
|
@right_neighbour = data['rightNeighbour']
|
315
316
|
@is_selectable = data['isSelectable']
|
316
317
|
@is_disabled_by_social_distancing = data['isDisabledBySocialDistancing']
|
318
|
+
@channel = data['channel']
|
317
319
|
end
|
318
320
|
end
|
319
321
|
|
@@ -473,31 +475,52 @@ module Seatsio::Domain
|
|
473
475
|
|
474
476
|
class SocialDistancingRuleset
|
475
477
|
attr_reader :name, :number_of_disabled_seats_to_the_sides, :disable_seats_in_front_and_behind,
|
476
|
-
:number_of_disabled_aisle_seats, :max_group_size, :
|
478
|
+
:number_of_disabled_aisle_seats, :max_group_size, :max_occupancy_absolute,
|
479
|
+
:max_occupancy_percentage, :one_group_per_table, :fixed_group_layout, :disabled_seats, :enabled_seats, :index
|
477
480
|
|
478
481
|
def initialize(name, number_of_disabled_seats_to_the_sides = 0, disable_seats_in_front_and_behind = false, number_of_disabled_aisle_seats = 0,
|
479
|
-
max_group_size = 0,
|
482
|
+
max_group_size = 0, max_occupancy_absolute = 0, max_occupancy_percentage = 0, one_group_per_table = false,
|
483
|
+
fixed_group_layout = false, disabled_seats = [], enabled_seats = [], index = 0)
|
480
484
|
@name = name
|
481
485
|
@number_of_disabled_seats_to_the_sides = number_of_disabled_seats_to_the_sides
|
482
486
|
@disable_seats_in_front_and_behind = disable_seats_in_front_and_behind
|
483
487
|
@number_of_disabled_aisle_seats = number_of_disabled_aisle_seats
|
484
488
|
@max_group_size = max_group_size
|
489
|
+
@max_occupancy_absolute = max_occupancy_absolute
|
490
|
+
@max_occupancy_percentage = max_occupancy_percentage
|
491
|
+
@one_group_per_table = one_group_per_table
|
492
|
+
@fixed_group_layout = fixed_group_layout
|
485
493
|
@disabled_seats = disabled_seats
|
486
494
|
@enabled_seats = enabled_seats
|
487
495
|
@index = index
|
488
496
|
end
|
489
497
|
|
498
|
+
def self.fixed(name, disabled_seats = [], index = 0)
|
499
|
+
SocialDistancingRuleset.new(name, 0, false, 0, 0, 0, 0, false, true, disabled_seats, [], index)
|
500
|
+
end
|
501
|
+
|
502
|
+
def self.rule_based(name, number_of_disabled_seats_to_the_sides = 0, disable_seats_in_front_and_behind = false, number_of_disabled_aisle_seats = 0,
|
503
|
+
max_group_size = 0, max_occupancy_absolute = 0, max_occupancy_percentage = 0, one_group_per_table = false,
|
504
|
+
disabled_seats = [], enabled_seats = [], index = 0)
|
505
|
+
SocialDistancingRuleset.new(name, number_of_disabled_seats_to_the_sides, disable_seats_in_front_and_behind, number_of_disabled_aisle_seats,
|
506
|
+
max_group_size, max_occupancy_absolute, max_occupancy_percentage,
|
507
|
+
one_group_per_table, false, disabled_seats, enabled_seats, index)
|
508
|
+
end
|
509
|
+
|
490
510
|
def == (other)
|
491
511
|
self.name == other.name &&
|
492
512
|
self.number_of_disabled_seats_to_the_sides == other.number_of_disabled_seats_to_the_sides &&
|
493
513
|
self.disable_seats_in_front_and_behind == other.disable_seats_in_front_and_behind &&
|
494
514
|
self.number_of_disabled_aisle_seats == other.number_of_disabled_aisle_seats &&
|
495
515
|
self.max_group_size == other.max_group_size &&
|
516
|
+
self.max_occupancy_absolute == other.max_occupancy_absolute &&
|
517
|
+
self.max_occupancy_percentage == other.max_occupancy_percentage &&
|
518
|
+
self.one_group_per_table == other.one_group_per_table &&
|
519
|
+
self.fixed_group_layout == other.fixed_group_layout &&
|
496
520
|
self.disabled_seats == other.disabled_seats &&
|
497
521
|
self.enabled_seats == other.enabled_seats &&
|
498
522
|
self.index == other.index
|
499
523
|
end
|
500
|
-
|
501
524
|
end
|
502
525
|
|
503
526
|
end
|
@@ -31,6 +31,10 @@ module Seatsio
|
|
31
31
|
fetch_summary_report('bySelectability', event_key)
|
32
32
|
end
|
33
33
|
|
34
|
+
def summary_by_channel(event_key)
|
35
|
+
fetch_summary_report('byChannel', event_key)
|
36
|
+
end
|
37
|
+
|
34
38
|
def by_label(event_key, label = nil)
|
35
39
|
fetch_report('byLabel', event_key, label)
|
36
40
|
end
|
@@ -59,6 +63,10 @@ module Seatsio
|
|
59
63
|
fetch_report('bySelectability', event_key, selectability)
|
60
64
|
end
|
61
65
|
|
66
|
+
def by_channel(event_key, channelKey = nil)
|
67
|
+
fetch_report('byChannel', event_key, channelKey)
|
68
|
+
end
|
69
|
+
|
62
70
|
private
|
63
71
|
|
64
72
|
def fetch_summary_report(report_type, event_key)
|
data/lib/seatsio/events.rb
CHANGED
@@ -76,18 +76,18 @@ module Seatsio
|
|
76
76
|
change_object_status(event_key_or_keys, object_or_objects, Domain::ObjectStatus::HELD, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
77
77
|
end
|
78
78
|
|
79
|
-
def change_best_available_object_status(key, number, status, categories: nil, hold_token: nil, extra_data: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil)
|
80
|
-
request = create_change_best_available_object_status_request(number, status, categories, extra_data, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys)
|
79
|
+
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)
|
80
|
+
request = create_change_best_available_object_status_request(number, status, categories, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys)
|
81
81
|
response = @http_client.post("events/#{key}/actions/change-object-status", request)
|
82
82
|
Domain::BestAvailableObjects.new(response)
|
83
83
|
end
|
84
84
|
|
85
|
-
def book_best_available(key, number, categories: nil, hold_token: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ignore_channels: nil, channel_keys: nil)
|
86
|
-
change_best_available_object_status(key, number, Domain::ObjectStatus::BOOKED, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
85
|
+
def book_best_available(key, number, categories: nil, hold_token: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil)
|
86
|
+
change_best_available_object_status(key, number, Domain::ObjectStatus::BOOKED, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
87
87
|
end
|
88
88
|
|
89
|
-
def hold_best_available(key, number, hold_token, categories: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ignore_channels: nil, channel_keys: nil)
|
90
|
-
change_best_available_object_status(key, number, Domain::ObjectStatus::HELD, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
89
|
+
def hold_best_available(key, number, hold_token, categories: nil, order_id: nil, keep_extra_data: nil, extra_data: nil, ticket_types: nil, ignore_channels: nil, channel_keys: nil)
|
90
|
+
change_best_available_object_status(key, number, Domain::ObjectStatus::HELD, categories: categories, hold_token: hold_token, order_id: order_id, keep_extra_data: keep_extra_data, extra_data: extra_data, ticket_types: ticket_types, ignore_channels: ignore_channels, channel_keys: channel_keys)
|
91
91
|
end
|
92
92
|
|
93
93
|
def release(event_key_or_keys, object_or_objects, hold_token: nil, order_id: nil, keep_extra_data: nil, ignore_channels: nil, channel_keys: nil)
|
@@ -1,8 +1,9 @@
|
|
1
|
-
def create_change_best_available_object_status_request(number, status, categories, extra_data, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys)
|
1
|
+
def create_change_best_available_object_status_request(number, status, categories, extra_data, ticket_types, hold_token, order_id, keep_extra_data, ignore_channels, channel_keys)
|
2
2
|
result = {}
|
3
3
|
best_available = {'number': number}
|
4
4
|
best_available[:categories] = categories if categories != nil
|
5
5
|
best_available[:extraData] = extra_data if extra_data != nil
|
6
|
+
best_available[:ticketTypes] = ticket_types if ticket_types != nil
|
6
7
|
result[:status] = status
|
7
8
|
result[:bestAvailable] = best_available
|
8
9
|
result[:holdToken] = hold_token if hold_token != nil
|
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: 26.2.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-
|
11
|
+
date: 2020-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|