seatsio 49.0.0 → 50.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6175463282510d75486458379a84007b4c26ed1ef43f2dfb8c551d4d6d9d98e8
4
- data.tar.gz: 6dae48abb18631f7a1b4b96043f94607319bf00c59d51959e7abe12de45febeb
3
+ metadata.gz: cb98e04f5ec812080be376cae93cbd6e275905388c5be08d3c92d88d5b3f1fdf
4
+ data.tar.gz: d00c604de049309cd933a761a78d20f32fde81f6a957408a5ea26a9932046e5e
5
5
  SHA512:
6
- metadata.gz: b219657e0671ed52b0b5b1b74b0bd4c3c2e11dd812cc5add61adffccbee38f9e696badd1eed59ec979b9e2f4d9802c634544121386d49b23dcd92329e64da62e
7
- data.tar.gz: 9d16071d76d05e3557369086b1ba5c1cacabc49b1170f867facc2f5e5bd184ae9be7bd11a831d6f62f4a950b1b0d8764ad9a8e9a069c328668c5938a51c10c97
6
+ metadata.gz: 9c1ad1ebcef0017cfe7044554d130b2267a3b3da39ae34e5df9a1abc3cefdc95e0b79fa8b53258e9f637d3af332a0d1f01a0f5054831532afee05159f0368d0d
7
+ data.tar.gz: 758cefdf77de6d2b5940d28aa50cc03f6b5c822fba3db4eb50aa38300ed4f0a5ffee2f29878e02d16b4f8100c9695e947381c2ae4fb01dbfc7c57e4bf7ef477b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seatsio (49.0.0)
4
+ seatsio (50.0.0)
5
5
  rest-client (~> 2.0, >= 2.0.2)
6
6
 
7
7
  GEM
@@ -415,10 +415,16 @@ module Seatsio
415
415
  end
416
416
  end
417
417
 
418
+ class StatusChangeType
419
+ CHANGE_STATUS_TO = 'CHANGE_STATUS_TO'
420
+ RELEASE = 'RELEASE'
421
+ end
422
+
418
423
  class EventObjectInfo
419
424
  FREE = 'free'
420
425
  BOOKED = 'booked'
421
426
  HELD = 'reservedByToken'
427
+ RESALE = 'resale'
422
428
 
423
429
  attr_reader :labels, :ids, :label, :order_id, :extra_data, :capacity, :status,
424
430
  :category_key, :entrance, :object_type, :hold_token, :category_label,
@@ -1,8 +1,9 @@
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)
1
+ def create_change_object_status_request(type, 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
+ result[:type] = type
3
4
  result[:objects] = normalize(object_or_objects)
4
- result[:type] = 'CHANGE_STATUS_TO'
5
- result[:status] = status
5
+ result[:type] = type
6
+ result[:status] = status if type != Seatsio::StatusChangeType::RELEASE
6
7
  result[:holdToken] = hold_token if hold_token != nil
7
8
  result[:orderId] = order_id if order_id != nil
8
9
  if event_key_or_keys.is_a? Array
@@ -18,24 +19,6 @@ def create_change_object_status_request(object_or_objects, status, hold_token, o
18
19
  result
19
20
  end
20
21
 
21
- def create_release_objects_request(object_or_objects, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys)
22
- result = {}
23
- result[:objects] = normalize(object_or_objects)
24
- result[:type] = "RELEASE"
25
- result[:holdToken] = hold_token if hold_token != nil
26
- result[:orderId] = order_id if order_id != nil
27
- if event_key_or_keys.is_a? Array
28
- result[:events] = event_key_or_keys
29
- else
30
- result[:events] = [event_key_or_keys]
31
- end
32
- result[:keepExtraData] = keep_extra_data if keep_extra_data != nil
33
- result[:ignoreChannels] = ignore_channels if ignore_channels != nil
34
- result[:channelKeys] = channel_keys if channel_keys != nil
35
- result
36
- end
37
-
38
-
39
22
  def normalize(object_or_objects)
40
23
  if object_or_objects.is_a? Array
41
24
  if object_or_objects.length == 0
@@ -76,8 +76,12 @@ module Seatsio
76
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)
77
77
  end
78
78
 
79
+ def put_up_for_resale(event_key_or_keys, object_or_objects)
80
+ self.change_object_status(event_key_or_keys, object_or_objects, Seatsio::EventObjectInfo::RESALE)
81
+ end
82
+
79
83
  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)
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, allowed_previous_statuses, rejected_previous_statuses)
84
+ request = create_change_object_status_request(Seatsio::StatusChangeType::CHANGE_STATUS_TO, 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
85
  request[:params] = {
82
86
  :expand => 'objects'
83
87
  }
@@ -113,7 +117,7 @@ module Seatsio
113
117
  end
114
118
 
115
119
  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)
116
- request = create_release_objects_request(object_or_objects, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys)
120
+ request = create_change_object_status_request(Seatsio::StatusChangeType::RELEASE, object_or_objects, nil, hold_token, order_id, event_key_or_keys, keep_extra_data, ignore_channels, channel_keys, nil, nil)
117
121
  request[:params] = {
118
122
  :expand => 'objects'
119
123
  }
@@ -1,3 +1,3 @@
1
1
  module Seatsio
2
- VERSION = "49.0.0"
2
+ VERSION = "50.0.0"
3
3
  end
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: 49.0.0
4
+ version: 50.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: 2024-10-04 00:00:00.000000000 Z
11
+ date: 2024-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -135,7 +135,6 @@ files:
135
135
  - lib/seatsio/event_reports.rb
136
136
  - lib/seatsio/events.rb
137
137
  - lib/seatsio/events/change_best_available_object_status_request.rb
138
- - lib/seatsio/events/change_object_status_in_batch_request.rb
139
138
  - lib/seatsio/events/change_object_status_request.rb
140
139
  - lib/seatsio/exception.rb
141
140
  - lib/seatsio/hold_tokens.rb
@@ -1,6 +0,0 @@
1
- def create_change_object_status_in_batch_request(event_key, object_or_objects, status, hold_token = nil , order_id = nil, keep_extra_data = nil, ignore_channels = nil, channel_keys = nil)
2
- result = create_change_object_status_request(object_or_objects, status, hold_token, order_id, '', keep_extra_data, ignore_channels, channel_keys)
3
- result.delete(:events)
4
- result[:event] = event_key
5
- result
6
- end