booker_ruby 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/booker/v4.1/{booking.rb → customer.rb} +23 -30
- data/lib/booker/v5/availability.rb +0 -9
- data/lib/booker/version.rb +1 -1
- data/lib/booker_ruby.rb +1 -2
- metadata +12 -13
- data/lib/booker/v4.1/availability.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 606a8b3ce501c73683e7bf8d3cbb4e7dee12a4f3
|
4
|
+
data.tar.gz: 7abfe1460fb079a936a454f9ba9c38ee3b2e4219
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3a7347dc4c1c6ab7f1d44fdb4a03a3c8e1c5ca8bea73ebc64598da0c1f28917d98785564e4d70cddb2e4ec9585582435c1f5749e19538a8dca7ca82f7a024ef
|
7
|
+
data.tar.gz: 7420d7d4240a0e8ef0d3d9078846a64f867c0d3b78617275d4506c68be4f4f21f0384a33d61c03f386117a90fd44b4dc1fafc94be91203358856d6083b471bb8
|
@@ -1,20 +1,20 @@
|
|
1
1
|
module Booker
|
2
2
|
module V41
|
3
|
-
class
|
3
|
+
class Customer < Booker::Client
|
4
4
|
include Booker::V4::RequestHelper
|
5
5
|
|
6
|
-
V41_PREFIX = '/v4.1/
|
6
|
+
V41_PREFIX = '/v4.1/customer'
|
7
7
|
V41_APPOINTMENTS_PREFIX = "#{V41_PREFIX}/appointment"
|
8
8
|
API_METHODS = {
|
9
9
|
appointment: "#{V41_APPOINTMENTS_PREFIX}".freeze,
|
10
10
|
cancel_appointment: "#{V41_APPOINTMENTS_PREFIX}/cancel".freeze,
|
11
11
|
create_appointment: "#{V41_APPOINTMENTS_PREFIX}/create".freeze,
|
12
12
|
create_class_appointment: "#{V41_PREFIX}/class_appointment/create".freeze,
|
13
|
-
appointment_hold: "#{V41_APPOINTMENTS_PREFIX}/hold".freeze,
|
14
13
|
employees: "#{V41_PREFIX}/employees".freeze,
|
15
|
-
|
14
|
+
treatments: "#{V41_PREFIX}/treatments".freeze,
|
16
15
|
location: "#{V41_PREFIX}/location".freeze,
|
17
|
-
locations: "#{V41_PREFIX}/locations".freeze
|
16
|
+
locations: "#{V41_PREFIX}/locations".freeze,
|
17
|
+
class_availability: "#{V41_PREFIX}/availability/class".freeze
|
18
18
|
}.freeze
|
19
19
|
|
20
20
|
def appointment(id:)
|
@@ -43,23 +43,6 @@ module Booker
|
|
43
43
|
}, params), Booker::V4::Models::Appointment
|
44
44
|
end
|
45
45
|
|
46
|
-
def create_appointment_hold(location_id:, available_time:, customer:, params: {})
|
47
|
-
post API_METHODS[:appointment_hold], build_params({
|
48
|
-
LocationID: location_id,
|
49
|
-
ItineraryTimeSlot: {
|
50
|
-
TreatmentTimeSlots: [available_time]
|
51
|
-
},
|
52
|
-
Customer: customer
|
53
|
-
}, params)
|
54
|
-
end
|
55
|
-
|
56
|
-
def delete_appointment_hold(location_id:, incomplete_appointment_id:)
|
57
|
-
delete API_METHODS[:appointment_hold], nil, build_params({
|
58
|
-
LocationID: location_id,
|
59
|
-
IncompleteAppointmentID: incomplete_appointment_id
|
60
|
-
})
|
61
|
-
end
|
62
|
-
|
63
46
|
def employees(location_id:, fetch_all: true, params: {})
|
64
47
|
paginated_request(
|
65
48
|
method: :post,
|
@@ -70,6 +53,16 @@ module Booker
|
|
70
53
|
)
|
71
54
|
end
|
72
55
|
|
56
|
+
def treatments(location_id:, fetch_all: true, params: {})
|
57
|
+
paginated_request(
|
58
|
+
method: :post,
|
59
|
+
path: API_METHODS[:treatments],
|
60
|
+
params: build_params({LocationID: location_id}, params, true),
|
61
|
+
model: Booker::V4::Models::Treatment,
|
62
|
+
fetch_all: fetch_all
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
73
66
|
def location(id:)
|
74
67
|
response = get("#{API_METHODS[:location]}/#{id}", build_params)
|
75
68
|
Booker::V4::Models::Location.from_hash(response)
|
@@ -84,14 +77,14 @@ module Booker
|
|
84
77
|
)
|
85
78
|
end
|
86
79
|
|
87
|
-
def
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
)
|
80
|
+
def class_availability(location_id:, from_start_date_time:, to_start_date_time:, params: {})
|
81
|
+
post API_METHODS[:class_availability], build_params({
|
82
|
+
FromStartDateTime: from_start_date_time,
|
83
|
+
LocationID: location_id,
|
84
|
+
OnlyIfAvailable: true,
|
85
|
+
ToStartDateTime: to_start_date_time,
|
86
|
+
ExcludeClosedDates: true
|
87
|
+
}, params), Booker::V4::Models::ClassInstance
|
95
88
|
end
|
96
89
|
end
|
97
90
|
end
|
@@ -3,7 +3,6 @@ module Booker
|
|
3
3
|
class Availability < Booker::Client
|
4
4
|
API_METHODS = {
|
5
5
|
availability: '/v5/availability/availability'.freeze,
|
6
|
-
one_day_availability: '/v5/availability/1day',
|
7
6
|
two_day_availability: '/v5/availability/2day'.freeze,
|
8
7
|
thirty_day_availability: '/v5/availability/30day'.freeze
|
9
8
|
}.freeze
|
@@ -17,14 +16,6 @@ module Booker
|
|
17
16
|
}, Booker::V5::Models::AvailabilityResult
|
18
17
|
end
|
19
18
|
|
20
|
-
def one_day(location_id:, from_date_time:, include_employees: true)
|
21
|
-
get API_METHODS[:one_day_availability], {
|
22
|
-
locationId: location_id,
|
23
|
-
fromDateTime: from_date_time,
|
24
|
-
includeEmployees: include_employees
|
25
|
-
}, Booker::V5::Models::AvailabilityResult
|
26
|
-
end
|
27
|
-
|
28
19
|
def two_day(location_id:, from_date_time:, include_employees: true)
|
29
20
|
get API_METHODS[:two_day_availability], {
|
30
21
|
locationId: location_id,
|
data/lib/booker/version.rb
CHANGED
data/lib/booker_ruby.rb
CHANGED
@@ -105,8 +105,7 @@ require 'booker/generic_token_store'
|
|
105
105
|
# Client Subclasses
|
106
106
|
require 'booker/v4/business_client'
|
107
107
|
require 'booker/v4/customer_client'
|
108
|
-
require 'booker/v4.1/
|
109
|
-
require 'booker/v4.1/booking'
|
108
|
+
require 'booker/v4.1/customer'
|
110
109
|
require 'booker/v4.1/merchant'
|
111
110
|
require 'booker/v5/availability'
|
112
111
|
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: booker_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frederick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.14'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.14'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: oj
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: jwt
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,14 +70,14 @@ dependencies:
|
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.10'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.10'
|
83
83
|
- !ruby/object:Gem::Dependency
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
version: 1.0.2
|
139
139
|
description:
|
140
140
|
email:
|
141
|
-
-
|
141
|
+
- tech@hirefrederick.com
|
142
142
|
executables: []
|
143
143
|
extensions: []
|
144
144
|
extra_rdoc_files: []
|
@@ -151,8 +151,7 @@ files:
|
|
151
151
|
- lib/booker/helpers/active_support_helper.rb
|
152
152
|
- lib/booker/helpers/logging_helper.rb
|
153
153
|
- lib/booker/model.rb
|
154
|
-
- lib/booker/v4.1/
|
155
|
-
- lib/booker/v4.1/booking.rb
|
154
|
+
- lib/booker/v4.1/customer.rb
|
156
155
|
- lib/booker/v4.1/merchant.rb
|
157
156
|
- lib/booker/v4/business_client.rb
|
158
157
|
- lib/booker/v4/business_rest.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Booker
|
2
|
-
module V41
|
3
|
-
class Availability < Booker::Client
|
4
|
-
include Booker::V4::RequestHelper
|
5
|
-
|
6
|
-
API_METHODS = {
|
7
|
-
class_availability: '/v4.1/availability/availability/class'.freeze
|
8
|
-
}.freeze
|
9
|
-
|
10
|
-
def class_availability(location_id:, from_start_date_time:, to_start_date_time:, params: {})
|
11
|
-
post API_METHODS[:class_availability], build_params({
|
12
|
-
FromStartDateTime: from_start_date_time,
|
13
|
-
LocationID: location_id,
|
14
|
-
OnlyIfAvailable: true,
|
15
|
-
ToStartDateTime: to_start_date_time,
|
16
|
-
ExcludeClosedDates: true
|
17
|
-
}, params), Booker::V4::Models::ClassInstance
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|