updox 0.7.0 → 0.8.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
2
  SHA256:
3
- metadata.gz: 330210debd9f3caa13bc37acbdafadd76cee2a2cde2f1d89e8be424948d6fc42
4
- data.tar.gz: f078682f62f95674ca95ea0f91d0303600b0715618a73454c1b47c3e9f922909
3
+ metadata.gz: fca147e076b5e76f0b8d8f27ddcb6e60549759eff142a04a87bccf7062a415f5
4
+ data.tar.gz: 0cc871b61d72c3c957b6b8a80deb12498df8825dbc06fafa4eeee516e948a384
5
5
  SHA512:
6
- metadata.gz: a38e7a6a09796e65a6c3abde8f0fadd7188cb3cd6295782f413ef34959c7ae6177ff29df8e91aff555f2a8dcab6220e0855f25354bd8f5ba95e30e7a1b216bda
7
- data.tar.gz: daa1c9efc99c7b196fc25dc4ee6591ff9bb8a17724e9bd05b0cb741f6fa95cb1db7da8e1defe580e609ee75f566d6c47aa9f7f2428cd6212007392e531adbb9e
6
+ metadata.gz: a521d5ca966afff2f700e6a69f42af44568afb3313f1894113bdfcc04f08eb7518481213cb9913dc9fb92d4a65bdb576d99bbefeee161d4b27b02809c558c2a8
7
+ data.tar.gz: 75f0714582c950c2e4c0ef9d601c024ea0a4812c32bb23d385b7f36090d5bb1de4936ac96de590e9804854c943b63f04e0eb154a7d7f3c63b24fa9a61ccf296f
data/CHANGELOG.md CHANGED
@@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [0.7.0] - [UNRELEASED]
7
+ ## [0.8.0] - [UNRELEASED]
8
+ ### Added
9
+ - Model#exists? for all models to share if `find` is implemented
10
+
11
+ ### Fixed
12
+ - Rails uses `as_json` to serialize so date in appointment was incorrect string
13
+
14
+ ## [0.7.0] - [2020-02-14]
8
15
  ### Added
9
16
  - AppointmentStatus
10
17
  - Reminder
@@ -1,8 +1,11 @@
1
1
  module Updox
2
2
  class Connection
3
+ TEST_HOST = 'updoxqa.com'
4
+ PROD_HOST = 'xxxxxxx.com'
5
+
3
6
  include HTTParty
4
7
 
5
- base_uri 'http://updoxqa.com/api/io/'.freeze
8
+ base_uri "https://#{TEST_HOST}/api/io/".freeze
6
9
 
7
10
  headers 'Content-Type' => 'application/json'
8
11
 
@@ -33,6 +33,7 @@ module Updox
33
33
 
34
34
  result
35
35
  end
36
+ alias_method :as_json, :to_h
36
37
 
37
38
  def save(account_id: )
38
39
  self.class.sync([self], account_id: account_id)
@@ -15,10 +15,6 @@ module Updox
15
15
  alias_method :external_appointment_id, :externalAppointmentId
16
16
  alias_method :appointment_status, :appointmentStatus
17
17
 
18
- def self.exists?(appointment_id, account_id: , cached_query: nil)
19
- false == self.find(appointment_id, account_id: account_id, cached_query: cached_query).nil?
20
- end
21
-
22
18
  def self.find(appointment_id, account_id: , cached_query: nil)
23
19
  obj = cached_query || self.query([appointment_id], account_id: account_id)
24
20
 
@@ -26,10 +26,6 @@ module Updox
26
26
  self.class.request(endpoint: SYNC_ENDPOINT, body: self.to_h, auth: {accountId: account_id}, required_auths: Updox::Models::Auth::AUTH_ACCT)
27
27
  end
28
28
 
29
- def self.exists?(calendar_id, account_id: , cached_query: nil)
30
- false == self.find(calendar_id, account_id: account_id, cached_query: cached_query).nil?
31
- end
32
-
33
29
  def self.find(calendar_id, account_id: , cached_query: nil)
34
30
  obj = cached_query || self.query(account_id: account_id)
35
31
 
@@ -38,10 +38,6 @@ module Updox
38
38
  self.class.sync([self], account_id: account_id)
39
39
  end
40
40
 
41
- def self.exists?(location_id, account_id: , cached_query: nil)
42
- false == self.find(location_id, account_id: account_id, cached_query: cached_query).nil?
43
- end
44
-
45
41
  def self.find(location_id, account_id: , cached_query: nil)
46
42
  obj = cached_query || self.query(account_id: account_id)
47
43
 
@@ -33,6 +33,11 @@ module Updox
33
33
  "#{response_code}: #{response_message}"
34
34
  end
35
35
 
36
+ def self.exists?(item_id, account_id: , cached_query: nil)
37
+ raise UpdoxException.new('Not implemented on this model.') unless self.respond_to?(:find)
38
+ false == self.find(item_id, account_id: account_id, cached_query: cached_query).nil?
39
+ end
40
+
36
41
  def self.sync(items, account_id: , batch_size: RECOMMENDED_BATCH_SIZE, endpoint: self.const_get(:SYNC_ENDPOINT))
37
42
  response = nil
38
43
  list_type = self.const_get(:SYNC_LIST_TYPE)
data/lib/updox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Updox
2
- VERSION = '0.7.0'.freeze
2
+ VERSION = '0.8.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: updox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Crockett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-14 00:00:00.000000000 Z
11
+ date: 2020-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty