booker_ruby 3.3.12 → 3.3.17

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: 42ae305776aa66af588956675870c4ff366633bfc1ecd86fe89fc6f11022c4ff
4
- data.tar.gz: a3e3ee7f7d976bc9ddaddf1523e4f728cd3454a762eab886df1de12ce3e0c0ec
3
+ metadata.gz: dcadf1cadd1bdcb83293225449d10532537319dc7d68ef188ab6f3622aa774ab
4
+ data.tar.gz: 5337416c560efb53b659d02ec9171b5da99895df6cd0cc73a7236b639753637a
5
5
  SHA512:
6
- metadata.gz: f69ac754ed864e78110a4ad10c4dbcc1d1f5adbe50f2e382f9f0d61f47967fbbb85e0caf71263a3a8ed148582d39b2b58faedc07ef788c689e8c96348e7b62ec
7
- data.tar.gz: 80db458499485c3a25c9be4efaace854c8f2a966360a8634af1fa54df37ebe9552ffb989c82bb91adb2011116395dbedf842f02f64fd740d214110be26bf4a5d
6
+ metadata.gz: 90690641ab08679a5e71216a6408e1ca3fd8a0a559a8836c42b14f417fa42713735c282e644c9cd06f257dd53b834bee003ac9affc29f16d25a1f7ae526fb073
7
+ data.tar.gz: 6a0cb0af203e894a5239452205286fff0805326d45fd5b70651be1731656410687d67db3d578aac69613ad2ae2837afc056ecdee190409d07119ec78be12467e
@@ -313,10 +313,10 @@ module Booker
313
313
  return parsed_response['Results'] unless parsed_response['Results'].nil?
314
314
 
315
315
  if booker_model
316
- model_name = booker_model.to_s.demodulize
317
- return parsed_response[model_name] unless parsed_response[model_name].nil?
316
+ response_results_key = booker_model.response_results_key
317
+ return parsed_response[response_results_key] unless parsed_response[response_results_key].nil?
318
318
 
319
- pluralized = model_name.pluralize
319
+ pluralized = response_results_key.pluralize
320
320
  return parsed_response[pluralized] unless parsed_response[pluralized].nil?
321
321
  end
322
322
 
@@ -67,6 +67,12 @@ module Booker
67
67
  end
68
68
  end
69
69
 
70
+ protected
71
+
72
+ def self.response_results_key
73
+ self.to_s.demodulize
74
+ end
75
+
70
76
  private
71
77
 
72
78
  def hash_list(array)
@@ -11,11 +11,13 @@ module Booker
11
11
  create_appointment: "#{V41_APPOINTMENTS_PREFIX}/create".freeze,
12
12
  create_class_appointment: "#{V41_PREFIX}/class_appointment/create".freeze,
13
13
  employees: "#{V41_PREFIX}/employees".freeze,
14
+ treatment: "#{V41_PREFIX}/treatment".freeze,
14
15
  treatments: "#{V41_PREFIX}/treatments".freeze,
15
16
  treatments_verified_bookable_online: "#{V41_PREFIX}/treatments/online".freeze,
16
17
  location: "#{V41_PREFIX}/location".freeze,
17
18
  locations: "#{V41_PREFIX}/locations".freeze,
18
- class_availability: "#{V41_PREFIX}/availability/class".freeze
19
+ class_availability: "#{V41_PREFIX}/availability/class".freeze,
20
+ specials: "#{V41_PREFIX}/specials".freeze
19
21
  }.freeze
20
22
 
21
23
  def appointment(id:)
@@ -54,6 +56,12 @@ module Booker
54
56
  )
55
57
  end
56
58
 
59
+ def treatment(id:, includeEmployeeTreatment: false)
60
+ get "#{API_METHODS[:treatment]}/#{id}", build_params({
61
+ includeEmployeeTreatment: includeEmployeeTreatment
62
+ }), Booker::V4::Models::TreatmentVerifiedBookableOnline
63
+ end
64
+
57
65
  def treatments(location_id:, fetch_all: true, params: {})
58
66
  paginated_request(
59
67
  method: :post,
@@ -74,6 +82,16 @@ module Booker
74
82
  )
75
83
  end
76
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
+
77
95
  def location(id:)
78
96
  response = get("#{API_METHODS[:location]}/#{id}", build_params)
79
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,8 @@ module Booker
5
5
  attr_accessor 'ID',
6
6
  'FirstName',
7
7
  'LastName',
8
- 'Gender'
8
+ 'Gender',
9
+ 'MobilePhone'
9
10
  end
10
11
  end
11
12
  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
@@ -8,9 +8,6 @@ module Booker
8
8
  'AvailableInAdvanceDateUnitType',
9
9
  'Category',
10
10
  'ColorCode',
11
- 'CustomerRecordType',
12
- 'CustomerTypeID',
13
- 'CustomerTypeName',
14
11
  'DateCreatedOffset',
15
12
  'DateLastModifiedOffset',
16
13
  'DepositOptions',
@@ -19,24 +16,23 @@ module Booker
19
16
  'DoesNotRequireStaff',
20
17
  'DurationType',
21
18
  'EmployeeTreatments',
22
- 'FlexiblePriceIncrementType',
23
19
  'ImageURL',
24
20
  'IsActive',
25
- 'IsBoundingService',
26
21
  'IsClass',
27
22
  'IsDeleted',
28
- 'IsFlexiblePrice',
29
23
  'IsForCouples',
30
- 'IsSharedService',
31
24
  'MaxTreatmentDuration',
32
25
  'MinTreatmentDuration',
33
26
  'Name',
34
27
  'Price',
35
28
  'RequiresTwoTechnicians',
36
- 'SharedRoomGuestCount',
37
29
  'SubCategory',
38
30
  'TotalDuration',
39
31
  'TreatmentDuration'
32
+
33
+ def self.response_results_key
34
+ 'Treatment'
35
+ end
40
36
  end
41
37
  end
42
38
  end
@@ -1,3 +1,3 @@
1
1
  module Booker
2
- VERSION = '3.3.12'
2
+ VERSION = '3.3.17'
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.12
4
+ version: 3.3.17
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-04-01 00:00:00.000000000 Z
11
+ date: 2020-06-25 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: []