booker_ruby 3.3.12 → 3.3.17
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/lib/booker/client.rb +3 -3
- data/lib/booker/model.rb +6 -0
- data/lib/booker/v4.1/customer.rb +19 -1
- data/lib/booker/v4.1/merchant.rb +4 -0
- data/lib/booker/v4/models/employee.rb +2 -1
- data/lib/booker/v4/models/price_range.rb +12 -0
- data/lib/booker/v4/models/price_range_scope.rb +10 -0
- data/lib/booker/v4/models/special.rb +46 -0
- data/lib/booker/v4/models/treatment_verified_bookable_online.rb +4 -8
- data/lib/booker/version.rb +1 -1
- data/lib/booker_ruby.rb +3 -0
- metadata +10 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcadf1cadd1bdcb83293225449d10532537319dc7d68ef188ab6f3622aa774ab
|
|
4
|
+
data.tar.gz: 5337416c560efb53b659d02ec9171b5da99895df6cd0cc73a7236b639753637a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90690641ab08679a5e71216a6408e1ca3fd8a0a559a8836c42b14f417fa42713735c282e644c9cd06f257dd53b834bee003ac9affc29f16d25a1f7ae526fb073
|
|
7
|
+
data.tar.gz: 6a0cb0af203e894a5239452205286fff0805326d45fd5b70651be1731656410687d67db3d578aac69613ad2ae2837afc056ecdee190409d07119ec78be12467e
|
data/lib/booker/client.rb
CHANGED
|
@@ -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
|
-
|
|
317
|
-
return parsed_response[
|
|
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 =
|
|
319
|
+
pluralized = response_results_key.pluralize
|
|
320
320
|
return parsed_response[pluralized] unless parsed_response[pluralized].nil?
|
|
321
321
|
end
|
|
322
322
|
|
data/lib/booker/model.rb
CHANGED
data/lib/booker/v4.1/customer.rb
CHANGED
|
@@ -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)
|
data/lib/booker/v4.1/merchant.rb
CHANGED
|
@@ -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,
|
|
@@ -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
|
data/lib/booker/version.rb
CHANGED
data/lib/booker_ruby.rb
CHANGED
|
@@ -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.
|
|
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-
|
|
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.
|
|
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: []
|