booker_ruby 3.0.5 → 3.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf1b0e4f9b1d7f0b3250be40be58769ff0685c71
4
- data.tar.gz: 5b993b3c662c18cab4c534ceb7cc7f11f280e07f
3
+ metadata.gz: a41904660d50498b1a4eba410f842522180933db
4
+ data.tar.gz: ea7db0185a466abb73a20d6f74164fb266d8c31c
5
5
  SHA512:
6
- metadata.gz: bbf218ae097fa2111f0cfc16dc80e1dd2f5216a3d26a961979b99a1ef135bc9c689998cbef62301e2b90d00fa337035e5673c1e9ff940acbd03a3f8c288de812
7
- data.tar.gz: b6085d119216ab6991140d3b98130b203f7e463b4a4ab4924540efab6846125aef2256b1dec7cb4aa86c88c2e1951bd45573268e570e0d92f83c81e05e84f086
6
+ metadata.gz: 78062d0567ad6c64e59f40512c8f20166c48696c9d2f699287136c84df82ab769b9c88b7e01044c7fc78a4f65c34fe35f33cfd9a7f21f38573bb842d66992276
7
+ data.tar.gz: 39368562f861510e8a9a9a453a9baf097306b66f6e2f366ebc757df30e23560cdabfc53eb3ec609fab5e4b7be8039f81dad1bd987ca8606a9b6e4d74be96eb9a
@@ -119,8 +119,12 @@ module Booker
119
119
  )
120
120
  end
121
121
 
122
- def customer(id:)
123
- response = get("#{V41_PREFIX}/customer/#{id}", build_params)
122
+ def customer(id:, params: {})
123
+ additional_params = {
124
+ LoadUnpaidAppointments: false,
125
+ includeFieldValues: false
126
+ }
127
+ response = get("#{V41_PREFIX}/customer/#{id}", build_params(additional_params, params))
124
128
  Booker::V4::Models::Customer.from_hash(response)
125
129
  end
126
130
 
@@ -1,3 +1,3 @@
1
1
  module Booker
2
- VERSION = '3.0.5'
2
+ VERSION = '3.0.6'
3
3
  end
data/lib/booker_ruby.rb CHANGED
@@ -95,16 +95,11 @@ require 'booker/client'
95
95
 
96
96
  # V4 Rest
97
97
  require 'booker/v4/request_helper'
98
- require 'booker/v4/common_rest'
99
- require 'booker/v4/business_rest'
100
- require 'booker/v4/customer_rest'
101
98
 
102
99
  # Token Store
103
100
  require 'booker/generic_token_store'
104
101
 
105
102
  # Client Subclasses
106
- require 'booker/v4/business_client'
107
- require 'booker/v4/customer_client'
108
103
  require 'booker/v4.1/customer'
109
104
  require 'booker/v4.1/merchant'
110
105
  require 'booker/v5/availability'
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.0.5
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-18 00:00:00.000000000 Z
11
+ date: 2017-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -153,11 +153,6 @@ files:
153
153
  - lib/booker/model.rb
154
154
  - lib/booker/v4.1/customer.rb
155
155
  - lib/booker/v4.1/merchant.rb
156
- - lib/booker/v4/business_client.rb
157
- - lib/booker/v4/business_rest.rb
158
- - lib/booker/v4/common_rest.rb
159
- - lib/booker/v4/customer_client.rb
160
- - lib/booker/v4/customer_rest.rb
161
156
  - lib/booker/v4/models/address.rb
162
157
  - lib/booker/v4/models/appointment.rb
163
158
  - lib/booker/v4/models/appointment_treatment.rb
@@ -1,9 +0,0 @@
1
- module Booker
2
- module V4
3
- class BusinessClient < Booker::Client
4
- include Booker::V4::BusinessREST
5
- ENV_BASE_URL_KEY = 'BOOKER_BUSINESS_SERVICE_URL'.freeze
6
- DEFAULT_BASE_URL = 'https://apicurrent-app.booker.ninja/webservice4/json/BusinessService.svc'.freeze
7
- end
8
- end
9
- end
@@ -1,88 +0,0 @@
1
- module Booker
2
- module V4
3
- module BusinessREST
4
- include Booker::V4::CommonREST
5
-
6
- def get_logged_in_user
7
- response = get('/user', build_params)
8
- result = Booker::V4::Models::User.from_hash(response['User'])
9
- result.LocationID = response['LocationID']
10
- result.BrandID = response['BrandID']
11
- result
12
- end
13
-
14
- def get_location_day_schedules(booker_location_id:, params: {})
15
- # Booker requires fromDate and toDate for JSON API, but does not use them when getDefaultDaySchedule is true
16
- # So datetime used for these fields does not matter
17
- random_datetime = Booker::V4::Models::Model.time_to_booker_datetime(Time.now)
18
-
19
- additional_params = {getDefaultDaySchedule: true, fromDate: random_datetime, toDate: random_datetime}
20
- response = get("/location/#{booker_location_id}/schedule", build_params(additional_params, params))
21
- response['LocationDaySchedules'].map { |sched| Booker::V4::Models::LocationDaySchedule.from_hash(sched) }
22
- end
23
-
24
- def find_locations(options: {})
25
- paginated_request(
26
- method: :post,
27
- path: '/locations',
28
- params: build_params({}, options, true),
29
- model: Booker::V4::Models::Location
30
- )
31
- end
32
-
33
- def find_employees(booker_location_id:, fetch_all: true, options: {})
34
- paginated_request(
35
- method: :post,
36
- path: '/employees',
37
- params: build_params({LocationID: booker_location_id}, options, true),
38
- model: Booker::V4::Models::Employee,
39
- fetch_all: fetch_all
40
- )
41
- end
42
-
43
- def find_treatments(booker_location_id:, fetch_all: true, options: {})
44
- paginated_request(
45
- method: :post,
46
- path: '/treatments',
47
- params: build_params({LocationID: booker_location_id}, options, true),
48
- model: Booker::V4::Models::Treatment,
49
- fetch_all: fetch_all
50
- )
51
- end
52
-
53
- def find_appointments_partial(booker_location_id:, start_date:, end_date:, fetch_all: true, options: {})
54
- additional_params = {
55
- LocationID: booker_location_id,
56
- FromStartDate: start_date.to_date,
57
- ToStartDate: end_date.to_date
58
- }
59
-
60
- paginated_request(
61
- method: :post,
62
- path: '/appointments/partial',
63
- params: build_params(additional_params, options, true),
64
- model: Booker::V4::Models::Appointment,
65
- fetch_all: fetch_all
66
- )
67
- end
68
-
69
- def get_location_notification_settings(booker_location_id:)
70
- response = get "/location/#{booker_location_id}/notification_settings", build_params
71
- Booker::V4::Models::NotificationSettings.from_hash response['NotificationSettings']
72
- end
73
-
74
- def update_location_notification_settings(booker_location_id:, send_appointment_reminders:)
75
- put "/location/#{booker_location_id}/notification_settings", build_params({
76
- NotificationSettings: {
77
- SendAppointmentReminders: send_appointment_reminders
78
- }
79
- })
80
- end
81
-
82
- def get_location_feature_settings(booker_location_id:)
83
- response = get "/location/#{booker_location_id}/feature_settings", build_params
84
- Booker::V4::Models::FeatureSettings.from_hash response['FeatureSettings']
85
- end
86
- end
87
- end
88
- end
@@ -1,21 +0,0 @@
1
- module Booker
2
- module V4
3
- module CommonREST
4
- include Booker::V4::RequestHelper
5
-
6
- def get_online_booking_settings(booker_location_id:)
7
- response = get("/location/#{booker_location_id}/online_booking_settings", build_params)
8
- Booker::V4::Models::OnlineBookingSettings.from_hash(response['OnlineBookingSettings'])
9
- end
10
-
11
- def confirm_appointment(appointment_id:)
12
- put '/appointment/confirm', build_params(ID: appointment_id), Booker::V4::Models::Appointment
13
- end
14
-
15
- def get_location(booker_location_id:)
16
- response = get("/location/#{booker_location_id}", build_params)
17
- Booker::V4::Models::Location.from_hash(response)
18
- end
19
- end
20
- end
21
- end
@@ -1,15 +0,0 @@
1
- module Booker
2
- module V4
3
- class CustomerClient < Client
4
- include Booker::V4::CustomerREST
5
- ENV_BASE_URL_KEY = 'BOOKER_CUSTOMER_SERVICE_URL'.freeze
6
- DEFAULT_BASE_URL = 'https://apicurrent-app.booker.ninja/webservice4/json/CustomerService.svc'.freeze
7
-
8
- def initialize(options={})
9
- super
10
- self.token_store ||= GenericTokenStore
11
- self.token_store_callback_method ||= :update_booker_access_token!
12
- end
13
- end
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- module Booker
2
- module V4
3
- module CustomerREST
4
- include Booker::V4::CommonREST
5
-
6
- def create_class_appointment(booker_location_id:, class_instance_id:, customer:, options: {})
7
- post '/class_appointment/create', build_params({
8
- LocationID: booker_location_id,
9
- ClassInstanceID: class_instance_id,
10
- Customer: customer
11
- }, options), Booker::V4::Models::Appointment
12
- end
13
- end
14
- end
15
- end