booker_ruby 3.3.14 → 3.4.1

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: a59c9a5ac124cb43252ca885779b58d0e87e0ad755822480edd8f8a3b4ca6723
4
- data.tar.gz: 5a4dc508435b84255c95f4e6c57c3e8732806262dabc683a057516627614cec0
3
+ metadata.gz: 3441fb81382a7ae0e7d453b61d65315c104d7971059938f80d6e7d54f65c6e07
4
+ data.tar.gz: 7ab3b0b833fee67a6d599974f9d0a8a93d3096ec1f43ac02288ed22363925115
5
5
  SHA512:
6
- metadata.gz: eaed9aca5f53e5fcf891ec5a1af9c4555885fd99164e78d9234542b1ddf747a611bdeb2d4912de295e87870b6369119358353d186e2eb399048fd990e877293e
7
- data.tar.gz: 38d3b6d2aa26ef2eece7395d0f84507835b8201b95a6f117b332302f67ff4ba915971683835d4e8da51cec6d48924e99ee5055f7e79e1f90d2484201bdb293e6
6
+ metadata.gz: 349f135db41f2f982f3e83e5f3542e05d824cdd1b1722cbe6a797963ac3c8fd763bccb224daa009cdf92616ab749e5dc5ff689e2e3a224f25b385da5dc187d65
7
+ data.tar.gz: e8aeca619b3e57fa630867ed5c1575a24f2be91edf4911b6b23cc55004fc5e9b97065f6e8f464aedc5dfa55ea7bf70ea8947ac237cf3c4c34bf8ed35f3f079ae
@@ -96,7 +96,11 @@ module Booker
96
96
 
97
97
  puts "fetching #{path} with #{params.except(:access_token)}. #{fetched.length} results so far."
98
98
 
99
- results = self.send(method, path, params, model)
99
+ begin
100
+ results = self.send(method, path, params, model)
101
+ rescue Net::ReadTimeout
102
+ results = nil
103
+ end
100
104
 
101
105
  unless results.is_a?(Array)
102
106
  error_msg = "Result from paginated request to #{path} with params: #{params} is not a collection"
@@ -16,7 +16,8 @@ module Booker
16
16
  treatments_verified_bookable_online: "#{V41_PREFIX}/treatments/online".freeze,
17
17
  location: "#{V41_PREFIX}/location".freeze,
18
18
  locations: "#{V41_PREFIX}/locations".freeze,
19
- class_availability: "#{V41_PREFIX}/availability/class".freeze
19
+ class_availability: "#{V41_PREFIX}/availability/class".freeze,
20
+ specials: "#{V41_PREFIX}/specials".freeze
20
21
  }.freeze
21
22
 
22
23
  def appointment(id:)
@@ -81,6 +82,16 @@ module Booker
81
82
  )
82
83
  end
83
84
 
85
+ def specials(location_id:, fetch_all: true, params: {})
86
+ paginated_request(
87
+ method: :post,
88
+ path: API_METHODS[:specials],
89
+ params: build_params({ LocationID: location_id }, params, true),
90
+ model: Booker::V4::Models::Special,
91
+ fetch_all: fetch_all
92
+ )
93
+ end
94
+
84
95
  def location(id:)
85
96
  response = get("#{API_METHODS[:location]}/#{id}", build_params)
86
97
  Booker::V4::Models::Location.from_hash(response)
@@ -62,6 +62,10 @@ module Booker
62
62
  )
63
63
  end
64
64
 
65
+ def employee(id:, params: {}, model: Booker::V4::Models::Employee)
66
+ get("#{V41_PREFIX}/employee/#{id}", build_params({}, params), model)
67
+ end
68
+
65
69
  def employees(location_id:, fetch_all: true, params: {})
66
70
  paginated_request(
67
71
  method: :post,
@@ -5,7 +5,9 @@ module Booker
5
5
  attr_accessor 'ID',
6
6
  'FirstName',
7
7
  'LastName',
8
- 'Gender'
8
+ 'Gender',
9
+ 'MobilePhone',
10
+ 'Address'
9
11
  end
10
12
  end
11
13
  end
@@ -0,0 +1,12 @@
1
+ module Booker
2
+ module V4
3
+ module Models
4
+ class PriceRange < Model
5
+ attr_accessor 'From',
6
+ 'To',
7
+ 'DiscountType',
8
+ 'DiscountAmount'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ module Booker
2
+ module V4
3
+ module Models
4
+ class PriceRangeScope < Model
5
+ attr_accessor 'ID',
6
+ 'Name'
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,46 @@
1
+ module Booker
2
+ module V4
3
+ module Models
4
+ class Special < Model
5
+ attr_accessor 'ID',
6
+ 'LocationID',
7
+ 'Name',
8
+ 'Description',
9
+ 'CouponCode',
10
+ 'Type',
11
+ 'ShortUrl',
12
+ 'ApplicableStartDate',
13
+ 'ApplicableEndDate',
14
+ 'BookingStartDate',
15
+ 'BookingEndDate',
16
+ 'MaxRedemptions',
17
+ 'TimeOfDayStart',
18
+ 'TimeOfDayEnd',
19
+ 'HasTreatment',
20
+ 'WeekDays',
21
+ 'UsePriceRanges',
22
+ 'PriceRanges',
23
+ 'DiscountType',
24
+ 'AdjustmentType',
25
+ 'DiscountAmount',
26
+ 'CanCustomerDirectBook',
27
+ 'HideOnInvoicesAndReceipts',
28
+ 'PhotoUrl',
29
+ 'UsedRedemptions',
30
+ 'AvailableRedemptions',
31
+ 'HasFreeItems',
32
+ 'PriceRangeScope',
33
+ 'ApplicationItemIDs',
34
+ 'IsExclusiveWithAll',
35
+ 'IsExclusiveWithAny',
36
+ 'CombinationRules',
37
+ 'ApplicableStartDateOffset',
38
+ 'ApplicableEndDateOffset',
39
+ 'BookingStartDateOffset',
40
+ 'BookingEndDateOffset',
41
+ 'TimeOfDayStartOffset',
42
+ 'TimeOfDayEndOffset'
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,3 +1,3 @@
1
1
  module Booker
2
- VERSION = '3.3.14'
2
+ VERSION = '3.4.1'
3
3
  end
@@ -92,6 +92,9 @@ require 'booker/v4/models/treatment'
92
92
  require 'booker/v4/models/treatment_time_slot'
93
93
  require 'booker/v4/models/treatment_verified_bookable_online'
94
94
  require 'booker/v4/models/user'
95
+ require 'booker/v4/models/special'
96
+ require 'booker/v4/models/price_range'
97
+ require 'booker/v4/models/price_range_scope'
95
98
 
96
99
  # V5 Models
97
100
  require 'booker/v5/models/model'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: booker_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.14
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederick
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-18 00:00:00.000000000 Z
11
+ date: 2020-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 1.0.2
139
- description:
139
+ description:
140
140
  email:
141
141
  - tech@hirefrederick.com
142
142
  executables: []
@@ -196,12 +196,15 @@ files:
196
196
  - lib/booker/v4/models/payment_method.rb
197
197
  - lib/booker/v4/models/preferred_staff_gender.rb
198
198
  - lib/booker/v4/models/price.rb
199
+ - lib/booker/v4/models/price_range.rb
200
+ - lib/booker/v4/models/price_range_scope.rb
199
201
  - lib/booker/v4/models/receipt_display_price.rb
200
202
  - lib/booker/v4/models/room.rb
201
203
  - lib/booker/v4/models/shipping_address.rb
202
204
  - lib/booker/v4/models/source.rb
203
205
  - lib/booker/v4/models/spa.rb
204
206
  - lib/booker/v4/models/spa_employee_availability_search_item.rb
207
+ - lib/booker/v4/models/special.rb
205
208
  - lib/booker/v4/models/status.rb
206
209
  - lib/booker/v4/models/sub_category.rb
207
210
  - lib/booker/v4/models/tag_price.rb
@@ -227,7 +230,7 @@ homepage: https://github.com/hirefrederick/booker_ruby
227
230
  licenses:
228
231
  - MIT
229
232
  metadata: {}
230
- post_install_message:
233
+ post_install_message:
231
234
  rdoc_options: []
232
235
  require_paths:
233
236
  - lib
@@ -242,8 +245,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
245
  - !ruby/object:Gem::Version
243
246
  version: '0'
244
247
  requirements: []
245
- rubygems_version: 3.0.6
246
- signing_key:
248
+ rubygems_version: 3.1.2
249
+ signing_key:
247
250
  specification_version: 4
248
251
  summary: Ruby client for the Booker API - https://developers.booker.com
249
252
  test_files: []