seatsio 46.0.0 → 46.2.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 +3 -3
- data/lib/seatsio/chart_reports.rb +29 -21
- data/lib/seatsio/domain.rb +2 -1
- data/lib/seatsio/events.rb +5 -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: ea140138380fddec62446cd0d4acb5b00280989d842960218e6431e08d8f94e4
|
4
|
+
data.tar.gz: e939d665188ff00e46e2916185a4b92d6735b5afa5d9b3026716f5180f903490
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84b277d911fd0103184538b61cf6e3f67c8b1b31425a0ab0ddde812c387706ebdec98408dede52f3c5f2f2018199ebbabeb6e744a8084bb9a2466e01bdbc05c6
|
7
|
+
data.tar.gz: c4e63427269b2f81402a3a7929659eba7c34ea779e6adc710abace361c7d139c564aca4c2e2054c40da6f4017c070eff82b241da79fe8dc643a1bf6b1516654b
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
seatsio (46.
|
4
|
+
seatsio (46.2.0)
|
5
5
|
rest-client (~> 2.0, >= 2.0.2)
|
6
6
|
|
7
7
|
GEM
|
@@ -20,8 +20,8 @@ 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.
|
24
|
-
minitest-parallel_fork (1.3.
|
23
|
+
minitest (5.20.0)
|
24
|
+
minitest-parallel_fork (1.3.1)
|
25
25
|
minitest (>= 5.15.0)
|
26
26
|
netrc (0.11.0)
|
27
27
|
public_suffix (5.0.3)
|
@@ -6,59 +6,67 @@ require 'cgi'
|
|
6
6
|
|
7
7
|
module Seatsio
|
8
8
|
class ChartReportsClient
|
9
|
+
|
9
10
|
def initialize(http_client)
|
10
11
|
@http_client = http_client
|
11
12
|
end
|
12
13
|
|
13
|
-
def by_label(chart_key, book_whole_tables = nil)
|
14
|
-
fetch_chart_report('byLabel', chart_key, book_whole_tables)
|
14
|
+
def by_label(chart_key, book_whole_tables = nil, version = nil)
|
15
|
+
fetch_chart_report('byLabel', chart_key, book_whole_tables, version)
|
15
16
|
end
|
16
17
|
|
17
|
-
def by_object_type(chart_key, book_whole_tables = nil)
|
18
|
-
fetch_chart_report('byObjectType', chart_key, book_whole_tables)
|
18
|
+
def by_object_type(chart_key, book_whole_tables = nil, version = nil)
|
19
|
+
fetch_chart_report('byObjectType', chart_key, book_whole_tables, version)
|
19
20
|
end
|
20
21
|
|
21
|
-
def summary_by_object_type(chart_key, book_whole_tables = nil)
|
22
|
-
fetch_summary_report('byObjectType', chart_key, book_whole_tables)
|
22
|
+
def summary_by_object_type(chart_key, book_whole_tables = nil, version = nil)
|
23
|
+
fetch_summary_report('byObjectType', chart_key, book_whole_tables, version)
|
23
24
|
end
|
24
25
|
|
25
|
-
def by_category_key(chart_key, book_whole_tables = nil)
|
26
|
-
fetch_chart_report('byCategoryKey', chart_key, book_whole_tables)
|
26
|
+
def by_category_key(chart_key, book_whole_tables = nil, version = nil)
|
27
|
+
fetch_chart_report('byCategoryKey', chart_key, book_whole_tables, version)
|
27
28
|
end
|
28
29
|
|
29
|
-
def summary_by_category_key(chart_key, book_whole_tables = nil)
|
30
|
-
fetch_summary_report('byCategoryKey', chart_key, book_whole_tables)
|
30
|
+
def summary_by_category_key(chart_key, book_whole_tables = nil, version = nil)
|
31
|
+
fetch_summary_report('byCategoryKey', chart_key, book_whole_tables, version)
|
31
32
|
end
|
32
33
|
|
33
|
-
def by_category_label(chart_key, book_whole_tables = nil)
|
34
|
-
fetch_chart_report('byCategoryLabel', chart_key, book_whole_tables)
|
34
|
+
def by_category_label(chart_key, book_whole_tables = nil, version = nil)
|
35
|
+
fetch_chart_report('byCategoryLabel', chart_key, book_whole_tables, version)
|
35
36
|
end
|
36
37
|
|
37
|
-
def summary_by_category_label(chart_key, book_whole_tables = nil)
|
38
|
-
fetch_summary_report('byCategoryLabel', chart_key, book_whole_tables)
|
38
|
+
def summary_by_category_label(chart_key, book_whole_tables = nil, version = nil)
|
39
|
+
fetch_summary_report('byCategoryLabel', chart_key, book_whole_tables, version)
|
39
40
|
end
|
40
41
|
|
41
|
-
def by_section(chart_key, book_whole_tables = nil)
|
42
|
-
fetch_chart_report('bySection', chart_key, book_whole_tables)
|
42
|
+
def by_section(chart_key, book_whole_tables = nil, version = nil)
|
43
|
+
fetch_chart_report('bySection', chart_key, book_whole_tables, version)
|
43
44
|
end
|
44
45
|
|
45
|
-
def summary_by_section(event_key, book_whole_tables = nil)
|
46
|
-
fetch_summary_report('bySection', event_key, book_whole_tables)
|
46
|
+
def summary_by_section(event_key, book_whole_tables = nil, version = nil)
|
47
|
+
fetch_summary_report('bySection', event_key, book_whole_tables, version)
|
47
48
|
end
|
48
49
|
|
49
50
|
private
|
50
51
|
|
51
|
-
def fetch_chart_report(report_type, chart_key, book_whole_tables)
|
52
|
+
def fetch_chart_report(report_type, chart_key, book_whole_tables, version)
|
52
53
|
params = book_whole_tables.nil? ? {} : { bookWholeTables: book_whole_tables }
|
54
|
+
unless version.nil?
|
55
|
+
params[:version] = version
|
56
|
+
end
|
53
57
|
url = "reports/charts/#{chart_key}/#{report_type}"
|
54
58
|
body = @http_client.get(url, params)
|
55
59
|
ChartReport.new(body)
|
56
60
|
end
|
57
61
|
|
58
|
-
def fetch_summary_report(report_type,
|
62
|
+
def fetch_summary_report(report_type, chart_key, book_whole_tables, version)
|
59
63
|
params = book_whole_tables.nil? ? {} : { bookWholeTables: book_whole_tables }
|
60
|
-
|
64
|
+
unless version.nil?
|
65
|
+
params[:version] = version
|
66
|
+
end
|
67
|
+
url = "reports/charts/#{chart_key}/#{report_type}/summary"
|
61
68
|
@http_client.get(url, params)
|
62
69
|
end
|
63
70
|
end
|
71
|
+
|
64
72
|
end
|
data/lib/seatsio/domain.rb
CHANGED
@@ -150,7 +150,7 @@ module Seatsio
|
|
150
150
|
:table_booking_config, :for_sale_config, :created_on, :updated_on, :channels,
|
151
151
|
:is_top_level_season, :is_partial_season,
|
152
152
|
:is_event_in_season, :top_level_season_key,
|
153
|
-
:object_categories, :categories
|
153
|
+
:object_categories, :categories, :is_in_the_past
|
154
154
|
|
155
155
|
def initialize(data)
|
156
156
|
@id = data['id']
|
@@ -172,6 +172,7 @@ module Seatsio
|
|
172
172
|
@top_level_season_key = data['topLevelSeasonKey']
|
173
173
|
@object_categories = data['objectCategories']
|
174
174
|
@categories = Category.create_list(data['categories']) if data['categories']
|
175
|
+
@is_in_the_past = data['isInThePast']
|
175
176
|
end
|
176
177
|
|
177
178
|
def is_season
|
data/lib/seatsio/events.rb
CHANGED
@@ -19,7 +19,7 @@ module Seatsio
|
|
19
19
|
end
|
20
20
|
|
21
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)
|
22
|
+
payload = build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: channels, is_in_the_past: nil)
|
23
23
|
response = @http_client.post("events", payload)
|
24
24
|
Event.new(response)
|
25
25
|
end
|
@@ -30,8 +30,8 @@ module Seatsio
|
|
30
30
|
Events.new(response).events
|
31
31
|
end
|
32
32
|
|
33
|
-
def update(key:, chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil, object_categories: nil, categories: nil)
|
34
|
-
payload = build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories)
|
33
|
+
def update(key:, chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil, object_categories: nil, categories: nil, is_in_the_past: nil)
|
34
|
+
payload = build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: nil, is_in_the_past: is_in_the_past)
|
35
35
|
@http_client.post("/events/#{key}", payload)
|
36
36
|
end
|
37
37
|
|
@@ -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)
|
162
|
+
def build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: nil, is_in_the_past: nil)
|
163
163
|
result = {}
|
164
164
|
result["chartKey"] = chart_key if chart_key
|
165
165
|
result["eventKey"] = event_key if event_key
|
@@ -169,6 +169,7 @@ module Seatsio
|
|
169
169
|
result["objectCategories"] = object_categories if object_categories != nil
|
170
170
|
result["categories"] = categories_to_request(categories) if categories != nil
|
171
171
|
result["channels"] = ChannelsClient::channels_to_request(channels) if channels != nil
|
172
|
+
result["isInThePast"] = is_in_the_past if is_in_the_past != nil
|
172
173
|
result
|
173
174
|
end
|
174
175
|
|
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.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: 2023-
|
11
|
+
date: 2023-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|