booker_ruby 3.2.4 → 3.3.0

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
- SHA1:
3
- metadata.gz: c79d28f4a9da5e2fd860931d8b25a90ae9c7eaf7
4
- data.tar.gz: 27b9569803109ad7073dc76a3200161d9158924a
2
+ SHA256:
3
+ metadata.gz: baa1179ff8f6f934316e1849d5ec77cbe91c0ef354bdf9fd09462b3bc56a3ac0
4
+ data.tar.gz: d13597a26e4ad8326deb2f232ee25e41d64f70cadfe04da21c26d7f0788c71d7
5
5
  SHA512:
6
- metadata.gz: 74b6ca0a769f86bcc4defa48a78e21aba497adbdd64b64e64f07f02b5977420c2709171e0d5cece3e0cf27149e6925600592280730ff04a57469c1d17e1d8132
7
- data.tar.gz: de2f0778e36cf840ae54ddb761a97f5cbfb9398752ffbdc24d758cc22b559a18842d5251c304c850106926726be6b362060ec9f06a1988072fd06d2d6086b735
6
+ metadata.gz: 607ec644480ca71e6410be7a753905b8a143422f70387ffe9875266008d1a2370615de8d66091acf9c287526d35b4006fbe39a180a9fcc61f3743169ab874ca7
7
+ data.tar.gz: f13133e4057d454af4785e65fc1c2c0f62c9ba51d80f8026d362ae74016a0df2c9e7744cea72cbb9e4b4da5c4a451e299ec1f5fb4626e50a993690ef6285ad19
@@ -119,12 +119,24 @@ module Booker
119
119
  )
120
120
  end
121
121
 
122
- def customer(id:, params: {})
122
+ def customer(id:, params: {}, model: Booker::V4::Models::Customer)
123
123
  additional_params = {
124
124
  LoadUnpaidAppointments: false,
125
125
  includeFieldValues: false
126
126
  }
127
- get("#{V41_PREFIX}/customer/#{id}", build_params(additional_params, params), Booker::V4::Models::Customer)
127
+ get("#{V41_PREFIX}/customer/#{id}", build_params(additional_params, params), model)
128
+ end
129
+
130
+ def update_customer(id:, update_params: {})
131
+ # get a raw json response because we need to send all fields back with modifications
132
+ customer_response = customer(id: id, model: nil)
133
+
134
+ if customer_response.present? && customer = customer_response["Customer"]
135
+ customer["Customer"].merge!(update_params)
136
+ customer["LocationID"] = self.location_id
137
+ put("#{V41_PREFIX}/customer/#{id}", build_params(customer))
138
+ end
139
+
128
140
  end
129
141
 
130
142
  def create_special(location_id:, start_date:, end_date:, coupon_code:, name:, params: {})
@@ -1,3 +1,3 @@
1
1
  module Booker
2
- VERSION = '3.2.4'
2
+ VERSION = '3.3.0'
3
3
  end
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.2.4
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-25 00:00:00.000000000 Z
11
+ date: 2018-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  requirements: []
236
236
  rubyforge_project:
237
- rubygems_version: 2.5.1
237
+ rubygems_version: 2.7.6
238
238
  signing_key:
239
239
  specification_version: 4
240
240
  summary: Ruby client for the Booker API - https://developers.booker.com