daisybill_api 0.1.5 → 0.1.7

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
- SHA1:
3
- metadata.gz: 1f4e06ac630954fbf2b73acf8cbcdb70701a4023
4
- data.tar.gz: 5c2279c1252d5b4c10a12ed8cf9bc540824f12c2
2
+ SHA256:
3
+ metadata.gz: 68f13995a338c7e6134fce1f0ff5cd3066588dc038b0b6702aebd64cc50105e9
4
+ data.tar.gz: cede9671b6669d12037ab95a7c64c7bdacd6ec3d0b29523b8a4cf4a4ec9a0609
5
5
  SHA512:
6
- metadata.gz: cc8a3e51e32e99b04b0c711ad18f3322733d8b6ac6ebcf7161a02de71e6a93ccba160eefcec399477d064a8976e483c99eef5d30c0f809efccda5ea2e85e9d33
7
- data.tar.gz: e72d81a145c9e7b296b32b1f59516f55fa8df339b132c6e442572d1ff0fec73eac8daa585999d358ffb68865d865f0e681c9c6afb40432ad43ee7efd4299cf27
6
+ metadata.gz: b893b82610e301856f2bdfde112e49573cdf4d56779be096ec1458de8af589302b99080b946fff23bf0775e505d5261f75141720465605d714506f0689cbfb5d
7
+ data.tar.gz: 51d4039273ea91137348d6a6f07fc1ffc8b7f9a77a9fbf15e06e2e42a36935187356065fe44f6d5aba9bfb37862c57f391f011ad682ccdd6935c6cbfd1b721ed
@@ -1,5 +1,5 @@
1
1
  require "rest-client"
2
- require "daisybill_api/data/rest_client/payload"
2
+ require "json"
3
3
 
4
4
  module DaisybillApi
5
5
  # @private
@@ -30,7 +30,10 @@ module DaisybillApi
30
30
  method: method,
31
31
  url: url,
32
32
  payload: params,
33
- headers: { "Content-Type" => "application/json" }
33
+ headers: {
34
+ "Authorization" => "Bearer #{DaisybillApi.configuration.api_token}",
35
+ "User-Agent" => "DaisyBill_API/#{DaisybillApi::VERSION}",
36
+ }
34
37
  }
35
38
  RestClient::Request.execute(data) { |response, request, status|
36
39
  @headers = response.headers
@@ -13,7 +13,7 @@ module DaisybillApi
13
13
  host: DaisybillApi.configuration.host,
14
14
  port: port,
15
15
  path: "#{DEFAULT_PATH}#{path}",
16
- query: to_query(params.merge api_token: DaisybillApi.configuration.api_token)
16
+ query: to_query(params)
17
17
  })
18
18
  end
19
19
 
@@ -26,6 +26,7 @@ module DaisybillApi
26
26
  has_many :bills, class: "Bill", set_path: true
27
27
  has_many :pharmacy_bills, class: "PharmacyBill", set_path: true
28
28
  has_many :injuries, class: "Injury", set_path: true
29
+ has_many :tasks, set_path: true, class: "Task"
29
30
  end
30
31
  end
31
32
  end
@@ -1,3 +1,3 @@
1
1
  module DaisybillApi
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/daisybill_api.rb CHANGED
@@ -2,6 +2,7 @@ require "daisybill_api/data"
2
2
  require "daisybill_api/configuration"
3
3
  require "daisybill_api/ext"
4
4
  require "daisybill_api/models"
5
+ require "daisybill_api/version"
5
6
 
6
7
  module DaisybillApi
7
8
  # @private
@@ -9,5 +9,4 @@ describe DaisybillApi::Data::Url do
9
9
 
10
10
  it { is_expected.to include "page=1" }
11
11
  it { is_expected.to include "per_page=20" }
12
- it { is_expected.to include "api_token=token" }
13
12
  end
@@ -13,6 +13,7 @@ describe DaisybillApi::Models::BillingProvider do
13
13
  it_behaves_like DaisybillApi::Ext::Associations, :attachments
14
14
  it_behaves_like DaisybillApi::Ext::Associations, :remittances
15
15
  it_behaves_like DaisybillApi::Ext::Associations, :bills
16
+ it_behaves_like DaisybillApi::Ext::Associations, :tasks
16
17
  it_behaves_like DaisybillApi::Ext::Associations, :pharmacy_bills
17
18
  it_behaves_like DaisybillApi::Ext::Associations, :injuries
18
19
  it_behaves_like DaisybillApi::Ext::Links
@@ -17,18 +17,18 @@ describe DaisybillApi do
17
17
 
18
18
  subject { DaisybillApi::Data::Url.build("/billing_providers").to_s }
19
19
 
20
- it { is_expected.to eq "https://go.daisybill.com/api/v1/billing_providers?api_token=api+token" }
20
+ it { is_expected.to eq "https://go.daisybill.com/api/v1/billing_providers?" }
21
21
 
22
22
  context "when host and port changed" do
23
23
  let(:host) { "localhost" }
24
24
  let(:port) { 3000 }
25
25
 
26
- it { is_expected.to eq("http://localhost:3000/api/v1/billing_providers?api_token=api+token") }
26
+ it { is_expected.to eq("http://localhost:3000/api/v1/billing_providers?") }
27
27
 
28
28
  context "after reset" do
29
29
  before { DaisybillApi.reset_configuration }
30
30
 
31
- it { is_expected.to eq("https://go.daisybill.com/api/v1/billing_providers?api_token") }
31
+ it { is_expected.to eq("https://go.daisybill.com/api/v1/billing_providers?") }
32
32
  end
33
33
  end
34
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daisybill_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Liscio
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-06-12 00:00:00.000000000 Z
13
+ date: 2023-09-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '1.8'
35
+ version: '2.0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '1.8'
42
+ version: '2.0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: bundler
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -158,14 +158,14 @@ dependencies:
158
158
  requirements:
159
159
  - - "~>"
160
160
  - !ruby/object:Gem::Version
161
- version: 0.8.7
161
+ version: 0.9.0
162
162
  type: :development
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
166
  - - "~>"
167
167
  - !ruby/object:Gem::Version
168
- version: 0.8.7
168
+ version: 0.9.0
169
169
  description: ActiveRecord style wrapper for DaisyBill's API
170
170
  email:
171
171
  - bliscio@daisybill.com
@@ -179,7 +179,6 @@ files:
179
179
  - lib/daisybill_api/configuration.rb
180
180
  - lib/daisybill_api/data.rb
181
181
  - lib/daisybill_api/data/client.rb
182
- - lib/daisybill_api/data/rest_client/payload.rb
183
182
  - lib/daisybill_api/data/url.rb
184
183
  - lib/daisybill_api/ext.rb
185
184
  - lib/daisybill_api/ext/associations.rb
@@ -285,47 +284,45 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
284
  - !ruby/object:Gem::Version
286
285
  version: '0'
287
286
  requirements: []
288
- rubyforge_project:
289
- rubygems_version: 2.4.5.1
287
+ rubygems_version: 3.1.4
290
288
  signing_key:
291
289
  specification_version: 4
292
290
  summary: ActiveRecord style wrapper for DaisyBill's API
293
291
  test_files:
294
292
  - spec/daisybill_api/configuration_spec.rb
295
- - spec/daisybill_api/data/client_spec.rb
296
- - spec/daisybill_api/data/rest_client/payload_spec.rb
297
- - spec/daisybill_api/data/url_spec.rb
298
- - spec/daisybill_api/ext/attributes/attribute_spec.rb
299
293
  - spec/daisybill_api/ext/attributes/type_castings_spec.rb
294
+ - spec/daisybill_api/ext/attributes/attribute_spec.rb
300
295
  - spec/daisybill_api/ext/links/link_spec.rb
301
296
  - spec/daisybill_api/ext/pageable_collection_spec.rb
302
- - spec/daisybill_api/models/address_spec.rb
303
- - spec/daisybill_api/models/attachment_spec.rb
304
- - spec/daisybill_api/models/bill_mailing_address_spec.rb
305
- - spec/daisybill_api/models/bill_payment_spec.rb
306
- - spec/daisybill_api/models/bill_spec.rb
307
- - spec/daisybill_api/models/bill_submission_spec.rb
308
- - spec/daisybill_api/models/billing_provider_spec.rb
309
- - spec/daisybill_api/models/claim_number_verification_spec.rb
310
- - spec/daisybill_api/models/claims_administrator_spec.rb
311
297
  - spec/daisybill_api/models/contact_spec.rb
312
- - spec/daisybill_api/models/disputed_service_spec.rb
313
- - spec/daisybill_api/models/employer_spec.rb
314
- - spec/daisybill_api/models/error_report_spec.rb
315
- - spec/daisybill_api/models/injury_spec.rb
316
- - spec/daisybill_api/models/paper_eor_spec.rb
317
- - spec/daisybill_api/models/patient_spec.rb
318
- - spec/daisybill_api/models/payer_spec.rb
319
- - spec/daisybill_api/models/pharmacy_bill_spec.rb
320
- - spec/daisybill_api/models/place_of_service_spec.rb
321
298
  - spec/daisybill_api/models/prescribing_provider_spec.rb
299
+ - spec/daisybill_api/models/claims_administrator_spec.rb
322
300
  - spec/daisybill_api/models/referring_provider_spec.rb
323
- - spec/daisybill_api/models/remittance_spec.rb
301
+ - spec/daisybill_api/models/disputed_service_spec.rb
302
+ - spec/daisybill_api/models/bill_spec.rb
324
303
  - spec/daisybill_api/models/rendering_provider_spec.rb
325
304
  - spec/daisybill_api/models/request_for_second_review_spec.rb
326
- - spec/daisybill_api/models/service_line_item_payment_spec.rb
327
- - spec/daisybill_api/models/service_line_item_spec.rb
305
+ - spec/daisybill_api/models/claim_number_verification_spec.rb
306
+ - spec/daisybill_api/models/payer_spec.rb
328
307
  - spec/daisybill_api/models/task_spec.rb
308
+ - spec/daisybill_api/models/billing_provider_spec.rb
309
+ - spec/daisybill_api/models/bill_payment_spec.rb
310
+ - spec/daisybill_api/models/attachment_spec.rb
311
+ - spec/daisybill_api/models/error_report_spec.rb
312
+ - spec/daisybill_api/models/pharmacy_bill_spec.rb
313
+ - spec/daisybill_api/models/employer_spec.rb
314
+ - spec/daisybill_api/models/patient_spec.rb
315
+ - spec/daisybill_api/models/bill_submission_spec.rb
316
+ - spec/daisybill_api/models/service_line_item_spec.rb
317
+ - spec/daisybill_api/models/service_line_item_payment_spec.rb
318
+ - spec/daisybill_api/models/place_of_service_spec.rb
319
+ - spec/daisybill_api/models/paper_eor_spec.rb
329
320
  - spec/daisybill_api/models/user_spec.rb
321
+ - spec/daisybill_api/models/remittance_spec.rb
322
+ - spec/daisybill_api/models/injury_spec.rb
323
+ - spec/daisybill_api/models/address_spec.rb
324
+ - spec/daisybill_api/models/bill_mailing_address_spec.rb
325
+ - spec/daisybill_api/data/client_spec.rb
326
+ - spec/daisybill_api/data/url_spec.rb
327
+ - spec/daisybill_api/data/rest_client/payload_spec.rb
330
328
  - spec/daisybill_api_spec.rb
331
- has_rdoc:
@@ -1,30 +0,0 @@
1
- # @private
2
- module RestClient
3
- module Payload
4
- class Base
5
- def flatten_params_array(value, calculated_key)
6
- result = []
7
- key = "#{calculated_key}[]"
8
- value.each do |elem|
9
- if elem.is_a? Hash
10
- result += flatten_params(elem, key)
11
- elsif elem.is_a? Array
12
- result += flatten_params_array(elem, key)
13
- else
14
- result << [key, elem]
15
- end
16
- end
17
- result
18
- end
19
- end
20
-
21
- class UrlEncoded
22
- def build_stream(params = nil)
23
- @stream = StringIO.new(flatten_params(params).collect do |entry|
24
- entry[1].nil? ? entry[0] : "#{entry[0]}=#{handle_key(entry[1])}"
25
- end.join("&"))
26
- @stream.seek(0)
27
- end
28
- end
29
- end
30
- end