booker_ruby 3.3.13 → 3.4.0
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 +5 -1
- 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/version.rb +1 -1
- data/lib/booker_ruby.rb +3 -0
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7937c06c7715dd99a4ffef1d690b077caacfa602707acac9a0130f9efd41b4c
|
4
|
+
data.tar.gz: cb6415126f8245095aa198ebe7369e438e0016d1a3da8aca130407e306080dcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47631077ee4304b02f6004ce9b9c70f067ee12df6bb88f905c96717751c9c63b85a35f7ddb3fc8777508dd6dbef8233dae67cb1640b5995c2d3228e439095b8f
|
7
|
+
data.tar.gz: db8020522d8f62462f25f1868cab34088b8bdf83159e18637ba495bf71fd274b3c8d71cc49c4bcc0db016ee5698c2d2054b5a91cf91686bf5efe229e1a524bc2
|
data/lib/booker/client.rb
CHANGED
@@ -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
|
-
|
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"
|
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
|
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.
|
4
|
+
version: 3.4.0
|
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-07-14 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
|
@@ -243,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
243
246
|
version: '0'
|
244
247
|
requirements: []
|
245
248
|
rubygems_version: 3.0.6
|
246
|
-
signing_key:
|
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: []
|